使用霍夫变换检测瞳孔的代码。即圆圈发现和瞳孔中心。 [英] code for pupil detection using hough transform. i.e. circle finding and center of pupil.

查看:458
本文介绍了使用霍夫变换检测瞳孔的代码。即圆圈发现和瞳孔中心。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,通过此代码,我能够找到图像的质心,即每当瞳孔位于中心时。但是当瞳孔在角落时,它会在巩膜部分给出质心。那么我怎样才能根据瞳孔移动质心。以及如何创建一个滑动窗口以在图像上移动它以找到最大的暗区即瞳孔。



清除所有; clc;

Ia = imread('eye.jpg');



subplot(121); imshow(Ia);



bw = im2bw(Ia,graythresh(getimage));

figure,imshow(bw);



%Thresholding

Ia_black = uint8(Ia(:,:,1)< 20&Ia(:,:,2)> 200&Ia(:,:,3)< 20);



%Centroid

[y1,x1] = find(Ia_black == 0);



x1 = round(mean(x1));

y1 = round(mean(y1));

figure;

imshow式(Ia);坚持;



alpha(.5);

plot(x1,y1,'r *');

Hello, with this code I am able to find the centroid of the image i.e. whenever the pupil is at the center. But when pupil is at the corner it is giving centroid on sclera part. so how can i move the centroid according to the pupil. And how to create a sliding window to move it on image to find the max dark area i.e. pupil.

clear all;clc;
Ia = imread('eye.jpg');

subplot(121);imshow(Ia);

bw = im2bw(Ia, graythresh(getimage));
figure, imshow(bw);

% Thresholding
Ia_black = uint8(Ia(:,:,1)<20 & Ia(:,:,2)>200 & Ia(:,:,3)<20);

% Centroid
[y1,x1] = find(Ia_black==0);

x1 = round(mean(x1));
y1 = round(mean(y1));
figure;
imshow(Ia); hold on;

alpha(.5);
plot(x1,y1,'r*');

推荐答案

它不是那样的工作。

我们不为你工作。

如果你想要某人要写你的代码,你必须付钱 - 我建议你去Freelancer.com并在那里问。



但要注意:你得到你付出的代价。支付花生,买猴子。
It doesn't quite work like that.
We do not do your work for you.
If you want someone to write your code, you have to pay - I suggest you go to Freelancer.com and ask there.

But be aware: you get what you pay for. Pay peanuts, get monkeys.


这篇关于使用霍夫变换检测瞳孔的代码。即圆圈发现和瞳孔中心。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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