资源简介

MATLAB 实现 人脸识别 光照归一化 算法 MATLAB 实现 人脸识别 光照归一化 算法

资源截图

代码片段和文件信息

% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This code has been written in 2008 by me Gholamreza Anbarjafari        %
% (Shahab). You can use this code for any research and academic purposes  %
% as far as you refer to the following work:                              %
% Hasan Demirel and Gholamreza Anbarjafari “HSI based Colour Image       %
% Equalization using Iterative nth Root and nth Power“ 5th International %
% Conference on Electrical and Computer Systems (EECS?8) Nov 27-28      %
% 2008 Lefke North Cyprus.                                              %
%                                                                         %
% Feel free to contact us for any furthur information:                    %
%  {hasan.demirel shahab.jafari}@emu.edu.tr                              %
%   http://faraday.ee.emu.edu.tr/shahab                                   %
%   http://faraday.ee.emu.edu.tr/hdemirel                                 %
%   (c) Demirel and Anbarjafari -2008                                     %
%                                                                         %
% The iterative proposed method for equalization is based on achieving a  %
% normalized image with mean of 0.5 in R G and B channels.               %
% one can easily calculate the PSNR using the calcpsnr commend avaiable in%
% this address: http://www.mathworks.com/matlabcentral/fileexchange/22241 %
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clc
clear all
i=imread(‘illu3_1.jpg‘);
id=i;
id=im2double(id);
[hsv]=rgb2hsv(id);
v=im2double(v);
m=mean(mean(v));
while (abs(m-0.5)>0.1)
    if m<0.5
        v=(v).^(1-m);
    else
        v=v.^(1/(1-m));
    end
    m=mean(mean(v));
end
ID(::1)=h;ID(::2)=s;ID(::3)=v;
idhsv=hsv2rgb(ID);

id1=im2double(imread(‘illu3.jpg‘));

clear i;
i=uint8(idhsv*255);
id_cool=idhsv;
idr=idhsv(::1);idg=idhsv(::2);idb=idhsv(::3);
m=mean(mean(idr));
while (abs(m-0.5)>0.1)
    if m<0.5
        idr=(idr).^(1-m);
    else
        idr=idr.^(1/(1-m));
    end
    m=mean(mean(idr));
end
m=mean(mean(idg));
while (abs(m-0.5)>0.1)
    if m<0.5
        idg=(idg).^(1-m);
    else
        idg=idg.^(1/(1-m));
    end
    m=mean(mean(idg));
end
m=mean(mean(idb));
while (abs(m-0.5)>0.1)
    if m<0.5
        idb=(idb).^(1-m);
    else
        idb=idb.^(1/(1-m));
    end
    m=mean(mean(idb));
end


idr_cool=id_cool(::1);idg_cool=id_cool(::2);idb_cool=id_cool(::3);
cnt1=1;mm=mean(mean(idr_cool));
while (abs(mm-0.5)>0.00009)
    idr_cool=idr_cool.^(log(0.5)/log(mm));
    mm=mean(mean(idr_cool));
end
mm=mean(mean(idg_cool));
while (abs(mm-0.5)>0.00009)
    idg_cool=idg_cool.^(log(0.5)/log(mm));
    mm=mean(mean(idg_cool));
end
mm=mean(mean(idb_cool));
while (abs(mm-0.5)>0.00009)
    idb_cool=idb_cool.^(log(0.5)/log(mm));
    mm=mean(mean(idb_cool));
end

ieqr=im2double(histeq(i(::

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件       69571  2008-01-12 03:18  illu3.jpg
     文件      367564  2008-01-12 17:45  illu3_1.jpg
     文件        3512  2008-12-21 14:27  Some_Equalization.m

评论

共有 条评论