www.pudn.com > Face_test_luminance.rar > Face_test_luminance.m


Ori_Face=imread('walk2.bmp'); 
copy=Ori_Face; 
figure(1); 
imshow(copy); 
Chrom=rgb2ycbcr(copy); 
figure(2); 
imshow(Chrom) 
for i=1:size(Chrom,1)%Read row pixels 
    for j=1:size(Chrom,2)%Read column pixels 
        %This conditions will determine the face based on RGB colour value 
        if (105128)%why i can't extract blue color properly? 
            copy(i,j,1)=0;                                                   %is my condition have any mistakes? 
            copy(i,j,2)=0; 
            copy(i,j,3)=255;                                                 %i get my pixel value by pixel region tool/ 
         
        %If above conditions is not meet, other colour values will be set to 255 (white)     
        else 
            copy(i,j,1)=255; 
            copy(i,j,2)=255; 
            copy(i,j,3)=255; 
             
        end 
    end 
end 
 
 h = fspecial('prewitt'); 
 filteredRGB = imfilter(copy, h); 
figure(3); 
 imshow(filteredRGB); 
 figure(4); 
 imshow(copy); 
 
 
%imtool(copy); 
%imtool(Chrom);