Open CV Assertion Failed error

后端 未结 1 1921
陌清茗
陌清茗 2021-01-24 23:02

I am currently getting this error:

Error

OpenCV Error: Assertion failed (0 <= i && i < (int)vv.size()) in getMat_, file 

/tmp/binarydeb         


        
1条回答
  •  清酒与你
    2021-01-24 23:51

    The error happens because the output array for the circles doesn't have the correct format. The cv::HoughCircles function takes a cv::vector, not a vector of vectors as type for the circle array. Also the values are float, not integer.

    Compare the tutorial at http://docs.opencv.org/3.1.0/d4/d70/tutorial_hough_circle.html

    (What happens is that when cv::HoughCircles finds a circle, it attempts to access the vec3f matrix - however in your case this is an (empty) cv::vector of integers and hence the size-assertion fails.)

    0 讨论(0)
提交回复
热议问题