1

BackgroundsubtractorMOG()基本的にマスクを抽出して前景を分離するためにを使用しています。次にconvexHull()、マスクを使用して移動オブジェクトの位置を特定します。

しかし、私は次のエラーが発生しています:

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 を使用しています

4

2 に答える 2

0

マスク画像で凸包を呼び出していますか?

point2d(またはインデックス)ベクトルで動作するはずです。findContours() から

于 2013-02-13T20:03:46.840 に答える