我在图像中有虹膜和瞳孔检测的已知问题。我已经阅读了一些主题(例如:
What are the correct usage/parameter values for HoughCircles in OpenCV for Iris detection? pupil Detection and cvHoughCircles? Using HoughCircles to detect and measure pupil and iris HoughCircles Parameters to recognise balls
关于这个问题,但仍无法找到问题的解决方案。
我有一个眼睛图像,我想做的是检测虹膜和瞳孔。我的问题是,我无法选择好的参数值。
这是我输入的示例图片: 这是我的输出:
我的代码发布在下面。
Mat src = Highgui.imread("in.jpg", Highgui.CV_LOAD_IMAGE_GRAYSCALE);
Mat des = new Mat(src.rows(), src.cols(), src.type());
Imgproc.GaussianBlur(src,src, new Size(3,3),0,0);
Imgproc.Canny(src, dst, 5, 10);
Mat circles = new Mat();
Imgproc.HoughCircles(source, circles, Imgproc.CV_HOUGH_GRADIENT, 1.0, 20.0, 70.0, 30.0, 3, 100);
//draw circles code here
我想要一个带圆圈的瞳孔和虹膜。有人可以为我的圆检测发布正确的值吗? 我也有几个问题:
1)使用Canny或Sobel滤镜更好吗?
2)我可以更好,更灵活地进行检测吗?
3)你能简单解释一下,HoughCircles参数意味着什么 - (来自OpenCV javadoc)
* @param dp Inverse ratio of the accumulator resolution to the image
* resolution. For example, if <code>dp=1</code>, the accumulator has the same
* resolution as the input image. If <code>dp=2</code>, the accumulator has half
* as big width and height.
* @param param1 First method-specific parameter. In case of <code>CV_HOUGH_GRADIENT</code>,
* it is the higher threshold of the two passed to the "Canny" edge detector
* (the lower one is twice smaller).
* @param param2 Second method-specific parameter. In case of <code>CV_HOUGH_GRADIENT</code>,
* it is the accumulator threshold for the circle centers at the detection
* stage. The smaller it is, the more false circles may be detected. Circles,