# I want to covert matlab as follows? If eye is detected, then move to mouth detection and display eye with bounding box. There after, If mouth is detected, then display mouth with bounding box.

1 Ansicht (letzte 30 Tage)
Bushry am 25 Okt. 2013
Bearbeitet: Walter Roberson am 27 Jan. 2014
If eye is detected, then move to mouth detection and display eye with bounding box.
There after,
If mouth is detected, then display mouth with bounding box.
I found a matlab code of forming eye and mouth map from MATLAB Central as follows;
EyeMap = rgb2ycbcr(I);
temp1=0;
temp2=0;
%Q = rgb2gray(I);
%imshow(EyeMap)
[m n l]=size(EyeMap);
%Finding EyeMapC
y = double(EyeMap(:,:,1));
Cb = double(EyeMap(:,:,2));
Cr = double(EyeMap(:,:,3));
Z=Cr;
Q = Cb.^2;
R = (255-Cr).^2;
G = Cb./Cr;
CrCb = Cr./Cb;
%Eye Map for Crominance
EyeC=(Q+R+G)/3;
CRS = Cr.^2;
ssCRS = sum(sum(CRS));
ssCrCb=sum(sum(CrCb));
eta = 0.95 * ssCRS/ssCrCb;
x= CRS - eta * Cr./Cb;
MM = CRS.*x.*x;
SE=strel('disk',4) ;
UP=imdilate(y,SE);
Down=imerode(y,SE);
EyeY= UP./(Down+1);
EyeMap=EyeY.*EyeC;
figure;
subplot(1,4,1), imagesc(I);title ('Face');axis off;
subplot(1,4,2), imagesc(Q);title ('Cb^2');axis off;
subplot(1,4,3), imagesc(R);title ('(Cr-complement)^2');axis off;
subplot(1,4,4), imagesc(EyeC);title ('Eye-Map-C'); axis off;
colormap(gray);
figure;
subplot(1,4,1), imagesc(UP);title ('Dilation'); axis off;
subplot(1,4,2), imagesc(Down);title ('Erotion'); axis off;
subplot(1,4,3), imagesc(EyeY);title ('EyeY'); axis off;
subplot(1,4,4), imagesc(EyeMap);title ('EyeMap'); axis off;
%colormap(gray);
%figure
%imagesc(MM);title ('MouthMap');
colormap(gray);
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Pattern Recognition and Classification finden Sie in Help Center und File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by