有关使用霍夫圈的Java OpenCV的检测虹膜和瞳孔圆 [英] about detecting iris and pupil circles using hough circle in java opencv

查看:2577
本文介绍了有关使用霍夫圈的Java OpenCV的检测虹膜和瞳孔圆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用OpenCV的在Java中尝试检测眼睛图像的圆圈(虹膜,瞳孔和)。但我没有得到它应该是结果。

I'm using opencv in java to trying detecting the circles (iris, and pupil) in eye image. But I didn't get the result as it should be.

下面是我的code

`  // convert source image to gray
  org.opencv.imgproc.Imgproc.cvtColor(mRgba, imgCny, Imgproc.COLOR_BGR2GRAY);
  //fliter
  org.opencv.imgproc.Imgproc.blur(imgCny,imgCny,new Size(3,3));
 //apply canny 
  org.opencv.imgproc.Imgproc.Canny(imgCny, imgCny, 10, 30);
//apply Hough circle
  Mat circles = new Mat();
        Point pt;
        org.opencv.imgproc.Imgproc.HoughCircles(imgCny,circles,             Imgproc.CV_HOUGH_GRADIENT,imgCny.rows()/4,2,200,100,0,0);
                  //draw the found circles 
                 for (int i=0; i < circles.cols();i++){
                 double vCircle[] = circles.get(0,i);
                  pt = new Point((int) Math.round((vCircle[0])),(int)          `enter code here`Math.round((vCircle[1])));
                  int radius = (int) Math.round(vCircle[2] );
                   Core.circle(mRgba, pt, radius, new Scalar(0,0,255),3);

`

原始图像

精明结果

我不知道是什么,如果问题是出在霍夫圈子功能或者别的什么的参数

I don't know what if the problem is in the parameters of hough circle function or something else

有没有人遇到这样的问题或不知道如何解决它?

Is there anyone faced such problem or know how to fix it ??

推荐答案

有没有办法,Hough变换将检测到您在此谨慎的结果,要圆!有太多的边缘。您必须先清洁影像。

There is no way that the Hough transform will detect THE circle you want in this canny result! There are too many edges. You must clean the image first.

开始用黑色(瞳孔,虹膜内部)和白检测。这两个区域将圈定的投资回报率。

Start with black (the pupil, iris inner part) and white detection. These two zones will delimitate the ROI.

此外,我也想尝试执行皮肤检测(简单的阈值到HSV色彩空间,这将消除90%的研究领域。

Moreover, I would also try to perform a skin detection (simple threshold into HSV color space. It will eliminate 90% of the research area.

这篇关于有关使用霍夫圈的Java OpenCV的检测虹膜和瞳孔圆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆