我使用BackgroundsubtractorMOG()
來基本上提取一個蒙版以分離出前景。然後我使用掩模上的convexHull()
來定位移動物體的位置。由BackgroundSubtractorMOG輸出的蒙版上的凸殼
但我得到以下錯誤:
openCV Error: Assertion failed (nelems >= 0 && (depth == CV_32F || depth == CV_32S)) in convexHull, file /home/ameya/OpenCV2.4.2/modules/imgproc/src/contours.cpp, line 1947
terminate called after throwing an instance of 'cv::Exception'
what(): /home/ameya/OpenCV2.4.2/modules/imgproc/src/contours.cpp:1947: error: (-215) nelems >= 0 && (depth == CV_32F || depth == CV_32S) in function convexHull
我已經檢查了沒有。元素以及類型鑄造掩模矩陣。但錯誤仍然存在。 有沒有人遇到過類似的問題。我正在使用OpenCV 2.4.2
這要麼是錯誤的號碼傳遞給函數或錯誤的類型(不32F浮動或32S元素signed int),因爲錯誤會顯示它 – Georges 2016-11-26 10:18:55