⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 face_test_luminance.m

📁 pca matlab 人脸识别
💻 M
字号:
clear,clc
Ori_Face=imread('C:\matlab\sub6.1.jpg');
copy=Ori_Face;

Chrom=rgb2ycbcr(copy);

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 (105<Chrom(i,j,1)<117 && 110<Chrom(i,j,2)<113 && Chrom(i,j,3)>128)%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);
% imshow(filteredRGB);


imtool(copy);
imtool(Chrom);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -