Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
调试此代码并到达 HoughCircles 行时出现内存分配错误:
#define CV_HOUGH_GRADIENT 3; Mat Valv; if( sumValv[0] > sumHol[0]){ vector<Vec3f> circles; HoughCircles( Valv, circles, 3 , 1, Valv.rows/8, 200, 100, 0, 0 ); }
有人知道是什么原因吗?
在使用 HoughCircles 之前没有初始化 Valv。您在图像中找不到不存在的圆圈...
问题是 Mat Valv 是 32 位的,而在 opencv 中它应该是 8 位。因此,我将其类型更改为 int。现在效果很好:)