Really ! Canny is executed inside HoughCircles , and there is no way to call cv::HoughCircles() and prevent it from calling Canny.
However , if you want to stick with your current approach, one option is to copy the version of cv::HoughCircles() available in the OpenCV source code and change it to suit your needs. This will allow you to write your own version of cv::HoughCircles() .
If you are following this path, it is important to understand that the C ++ API of OpenCV is built on the C API. This means that cv::HoughCircles() is just a wrapper around cvHoughCircles() , which is implemented in opencv-2.4.7/modules/imgproc/src/hough.cpp after line 1006.
Look at this function (line 1006) and notice the call made using icvHoughCirclesGradient() on line 1064. This is the function responsible for calling cvCanny() , which is executed on line 817.
Another approach, if the ball is monochrome , can be implemented using cv::inRange() to isolate a specific color , and this will provide much faster detection. In addition, this issue has been widely discussed at this forum. Very interesting topic:
- Writing reliable (color and dimensional) circle detection using OpenCV (based on Hough Transform transform or other functions)
karlphillip
source share