OpenCV 中虹膜检测的霍夫变换

发布于 2024-09-02 15:55:40 字数 206 浏览 3 评论 0原文

我写了霍夫变换的代码,效果很好。我还可以裁剪脸部的眼睛位置。现在我想通过应用霍夫变换(cvHoughCircle)来检测裁剪图像的虹膜。但是,当我尝试此过程时,系统无法在图像上找到任何圆圈。

也许,原因是图像中有噪点,但我不认为这是原因。 那么,如何检测虹膜呢?我有二进制阈值的代码也许我可以使用它,但是 我不知道该怎么办?

如果有人帮助我真的很感激。谢谢 :)

I wrote the code for hough transformation and it works well. Also I can crop the eye location of a face. Now I want to detect the iris of the crop image with applying the Hough transformation(cvHoughCircle). However when I try this procedure, the system is not able to find any circle on the image.

Maybe, the reason is, there are noises in the image but I don't think it's the reason.
So, how can I detect the iris? I have the code of binary thresholding maybe I can use it, but
I don't know how to do?

If anyone helps I really appreciate it. thx :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

一人独醉 2024-09-09 15:55:40

您说,通过二进制阈值,您会得到纯白色的虹膜:这不是您想要的。使用 cvCanny 之类的工具来仅获取虹膜的边缘。

You say that with binary thresold you get an iris that is pure white : that is not what you want to have. Use something like cvCanny in order to get only the edge of the iris.

吐个泡泡 2024-09-09 15:55:40

您是否正确检测边缘?
你能显示二值图像并清楚地看到虹膜吗?

圆形霍夫变换通常有一个半径窗口(否则您正在搜索 3d 解空间)您是否将窗口设置为合理的值?

Are you detecting the edges correctly?
Can you display the binary image and see the iris clearly?

circular hough transforms normally have a radius window (otherwise you are searching a 3d solution space) are you setting the window to a reasonable value?

绿萝 2024-09-09 15:55:40
void houghcircle()
{
    //cvSmooth( graybin,graybin, CV_GAUSSIAN, 5,5 );
    CvMemStorage* storage = cvCreateMemStorage(0);

    // smooth it, otherwise a lot of false circles may be detected
    CvSeq* circles = cvHoughCircles( edge, storage, CV_HOUGH_GRADIENT, 5, edge->height/4,1,1,2,50, 70 );
    int i;
    for( i = 0; i < circles->total; i++ )
    {
        float* p = (float*)cvGetSeqElem( circles, i);
        cvCircle( img, cvPoint(cvRound(p[0]),cvRound(p[1])), 2, CV_RGB(0,255,0), -1, 2, 0 );
        cvCircle( img, cvPoint(cvRound(p[0]),cvRound(p[1])), cvRound(p[2]), CV_RGB(255,0,0), 1, 2, 0 );
        cvNamedWindow( "circles", 1 );
        cvShowImage( "circles", img );
        cvWaitKey();
    }
}
void houghcircle()
{
    //cvSmooth( graybin,graybin, CV_GAUSSIAN, 5,5 );
    CvMemStorage* storage = cvCreateMemStorage(0);

    // smooth it, otherwise a lot of false circles may be detected
    CvSeq* circles = cvHoughCircles( edge, storage, CV_HOUGH_GRADIENT, 5, edge->height/4,1,1,2,50, 70 );
    int i;
    for( i = 0; i < circles->total; i++ )
    {
        float* p = (float*)cvGetSeqElem( circles, i);
        cvCircle( img, cvPoint(cvRound(p[0]),cvRound(p[1])), 2, CV_RGB(0,255,0), -1, 2, 0 );
        cvCircle( img, cvPoint(cvRound(p[0]),cvRound(p[1])), cvRound(p[2]), CV_RGB(255,0,0), 1, 2, 0 );
        cvNamedWindow( "circles", 1 );
        cvShowImage( "circles", img );
        cvWaitKey();
    }
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文