您好,通过此代码,我能够找到图像的质心,即每当瞳孔位于中心时。但是当瞳孔在角落时,它会在巩膜部分给出质心。那么我怎样才能根据瞳孔移动质心。以及如何创建一个滑动窗口以在图像上移动它以找到最大的暗区即瞳孔。 清除所有; 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并在那里问。 但要注意:你得到你付出的代价。支付花生,买猴子。 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 and ask there. But be aware: you get what you pay for. Pay peanuts, get monkeys.
更多推荐
使用霍夫变换检测瞳孔的代码。即圆圈发现和瞳孔中心。
发布评论