Fun with Computer Vision(with complete code) | MATLAB

preview_player
Показать описание
Prerequisite:
Code:

clc
clear all
close all;
warning off;
FDetect=vision.CascadeObjectDetector('LeftEyeCART','MergeThreshold',50);
FDetect2=vision.CascadeObjectDetector('RightEyeCART','MergeThreshold',50);
c=webcam;
t=0:0.01:2*pi;
while true
BB_L=step(FDetect,e);
BB_R=step(FDetect2,e);
if(~isempty(BB_L) && ~isempty(BB_R))
cenrL=floor((BB_L(1)+BB_L(1)+BB_L(3))/2);
cencL=floor((BB_L(2)+BB_L(2)+BB_L(4))/2);
cenrR=floor((BB_R(1)+BB_R(1)+BB_R(3))/2);
cencR=floor((BB_R(2)+BB_R(2)+BB_R(4))/2);
imshow(e);
hold on;
x=cenrL+20*cos(t);
y=cencL+20*sin(t);
fill(x,y,'k','LineStyle','none');
x=cenrR+20*cos(t);
y=cencR+20*sin(t);
fill(x,y,'k','LineStyle','none');
plot([cenrL+40 cenrR-40],[cencR cencR],'k','linewidth',3);
else
imshow(e);
end
drawnow;
end

Learn Image Processing with MATLAB:

#DigitalImageProcessing #MATLAB #ComputerVision
Рекомендации по теме
Комментарии
Автор

i am getting error using these codes...i will be thankful if i get (.m) code file from you

pratikmakwana
welcome to shbcf.ru