OpenCV Python HoughCircles error

两盒软妹~` 提交于 2019-12-05 15:22:21

For what it's worth, I've found that cv.HoughCircles aborts if it can't detect a circular shape in the image, instead of gracefully returning an empty list.

Are the images valid?
Can you display them (the original and the grayscaled)

Otherwise are you sure the args to the function are correct? Are you passing pointers or references correctly

Julio Werner

The storage must to be bigger, I thought that cvMat isn't dinamically allocated so you have to for example change the line:

storage = cv.CreateMat(1, 2, cv.CV_32FC3)

to:

storage = cv.CreateMat(1, img.rows * img.cols, cv.CV_32FC3)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!