Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/307.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
基于Java和OpenCV的虹膜和瞳孔图像检测_Java_Opencv_Hough Transform - Fatal编程技术网

基于Java和OpenCV的虹膜和瞳孔图像检测

基于Java和OpenCV的虹膜和瞳孔图像检测,java,opencv,hough-transform,Java,Opencv,Hough Transform,我有一个已知的问题,虹膜和瞳孔检测的图像。我已经阅读了一些主题(例如: 关于这个问题,但仍然找不到解决我问题的办法 我有一个眼睛图像,我想做的是检测虹膜和瞳孔。我的问题是,我不能选择好的参数值 这是我的输入示例图片: 这是我的输出: 我的代码贴在下面 Mat src = Highgui.imread("in.jpg", Highgui.CV_LOAD_IMAGE_GRAYSCALE); Mat des = new Mat(src.rows(), src.cols(), s

我有一个已知的问题,虹膜和瞳孔检测的图像。我已经阅读了一些主题(例如:

关于这个问题,但仍然找不到解决我问题的办法

我有一个眼睛图像,我想做的是检测虹膜和瞳孔。我的问题是,我不能选择好的参数值

这是我的输入示例图片: 这是我的输出:

我的代码贴在下面

 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)


Hough圆不是一种很好的虹膜/瞳孔检测方法。它不是很可靠,而且最终会调整过多的参数

在一些基本阈值或canny边缘检测之后,特征检测方法如MSER在这些情况下工作得更好。这是一个具有解决方案的类似问题


既然你有一个好的分辨率图像,如果你想测量它们或者想要一些非常精确的东西,我建议你写博客。它详细解释了所涉及的步骤。

您的精明门槛太低了。试着显示中间图像,你会看到一些非常“嘈杂”的东西你的概念上的问题可能是,虹膜边界和瞳孔边界的边缘强度非常不同,因此你很容易检测到瞳孔,但虹膜可能更难。@Mika根据我在stacoverflow上发现的一些主题,我添加了阈值的自动计算,比如:maxThreshold=Imgproc.threshold(来源,tmp,0,255,Imgproc.THRESH_BINARY | Imgproc.THRESH_OTSU);minThreshold对我来说是5.0*maxThres。它可以正确地检测瞳孔,但我仍然有很多圆。而且,它不能检测虹膜。我还能做什么呢?如果你也有彩色图像,试着在HSV H频道检测圆。不知道还能做什么,我自己没有找到虹膜的简单阈值…我会试着找到源代码de是这个应用程序的一部分,但老实说,我担心找不到它。
* @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,