I'm working on detecting balls on images with Objective-C++ and OpenCV. I tried to use HoughCircle transformation, but I am not detecting the balls properly. For me it seems like the parameters do not fit to the description of the function. Is it different in Objective-C++ than in C++?
This is my code and the description of the OpenCV function:
cv::medianBlur(grayMat, grayMat, 17);
std::vector<cv::Vec3f> circles;
cv::HoughCircles(grayMat, circles, CV_HOUGH_GRADIENT,
1, //dp resolution
1, //minDist
140.0, //higher threshold
120.0, //lower threshold
15, //min radius
50); //max radius
If the parameters are correct as I implemented them, the idea was to use seed growing to get better results. I have no idea how to implement this in Objective-C++ and OpenCV. I already saw some examples in C++ but I do not know how to "translate" that into Objective-C++.
Could you please have a look at my HoughCircle parameters or give me an Objective-C++ example for seed growing?
Thanks a lot!
Edit: Here are two example images - I need universal parameters to detect the balls on both pictures: