資源簡(jiǎn)介
用matlab的guide實(shí)現(xiàn)對(duì)人像的美顏功能,數(shù)字圖像處理技術(shù)。
設(shè)計(jì)內(nèi)容及要求:
人臉皮膚的光滑程度很大程度影響人的容貌,很多時(shí)候,我們希望拍出
來的照片能更漂亮一些。請(qǐng)?jiān)O(shè)計(jì)一美顏軟件,實(shí)現(xiàn)如下功能:
1、 拍攝一幅彩色人像,對(duì)該彩色圖像設(shè)計(jì)一可變模板大小的平滑濾波
器,對(duì)人像圖像進(jìn)行濾波處理;
2、 針對(duì)面部斑點(diǎn)設(shè)計(jì)濾波器進(jìn)行消除
3、 設(shè)計(jì)亮度調(diào)整函數(shù),調(diào)整該圖像亮度;
4、 調(diào)整該圖像飽和度,使圖像色彩鮮艷程度改變
5、 設(shè)計(jì) GUI 界面
設(shè)計(jì)內(nèi)容及要求:
人臉皮膚的光滑程度很大程度影響人的容貌,很多時(shí)候,我們希望拍出
來的照片能更漂亮一些。請(qǐng)?jiān)O(shè)計(jì)一美顏軟件,實(shí)現(xiàn)如下功能:
1、 拍攝一幅彩色人像,對(duì)該彩色圖像設(shè)計(jì)一可變模板大小的平滑濾波
器,對(duì)人像圖像進(jìn)行濾波處理;
2、 針對(duì)面部斑點(diǎn)設(shè)計(jì)濾波器進(jìn)行消除
3、 設(shè)計(jì)亮度調(diào)整函數(shù),調(diào)整該圖像亮度;
4、 調(diào)整該圖像飽和度,使圖像色彩鮮艷程度改變
5、 設(shè)計(jì) GUI 界面

代碼片段和文件信息
function?R=gray2rgb(img1img2)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This?Program?converts?a?gray?image?ro?RGB?image?based?on?the?colors?of?the?destination?image.?The better?the?destination?image?match?with?the?source?gray?image?the?better?the?coloring?will?be.?The?program?takes?some?time??as?the?searching?time?is?high.?You?can?decrease?the?searching?time?by?taking only?samples?from?the?used?color?image?but?quality?may?decrease.?U?can?use?jittered?sampling?for?improving?running?speed.?%?
%??You?can?use?also?use?the?attahed?test?images?Use?the?following?combinations?for?better?result nature1.jpg(as?img1)?and?nature2.jpg(as?img2)?or?test1.jpg(as?img1)?and?test2.jpg?(as?img2) %
% Usage:?gray2rgb(‘nature1.jpg‘‘nature2.jpg‘);??%
%??Authors?:?Jeny Rajan??Chandrashekar P.S?%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%?img1?-?Source?Image??(gray?image)???
%?img2?-?Selected?color?image?for?coloring?the?gray?image.?
tic
?clc;
?warning?off;
?imt=imread(img1);
?ims=imread(img2);
?[sx?sy?sz]=size(imt);
?[tx?ty?tz]=size(ims);
?if?sz~=1
?????imt=rgb2gray(imt);
?end
?if?tz~=3
?????disp?(‘img2?must?be?a?color?image?(not?indexed)‘);
?else
?????imt(::2)=imt(::1);
?????imt(::3)=imt(::1);
?%?Converting?to?ycbcr?color?space
?????nspace1=rgb2ycbcr(ims);
?????nspace2=?rgb2ycbcr(imt);
????ms=double(nspace1(::1));
?????mt=double(nspace2(::1));
?????m1=max(max(ms));
?????m2=min(min(ms));
?????m3=max(max(mt));
?????m4=min(min(mt));
?????d1=m1-m2;
?????d2=m3-m4;
?%?Normalization
?????dx1=ms;
?????dx2=mt;
?????dx1=(dx1*255)/(255-d1);
?????dx2=(dx2*255)/(255-d2);
?????[mxmymz]=size(dx2);
?%Luminance?Comparison
?????disp(‘Please?wait..................‘);
?????for?i=1:mx
?????????for?j=1:my
??????????????iy=dx2(ij);
??????????????tmp=abs(dx1-iy);
??????????????ck=min(min(tmp));
??????????????[rc]?=?find(tmp==ck);
??????????????ck=isempty(r);
??????????????if?(ck~=1)????????????
??????????????????nimage(ij2)=nspace1(r(1)c(1)2);
??????????????????nimage(ij3)=nspace1(r(1)c(1)3);
??????????????????nimage(ij1)=nspace2(ij1);???????????
?????????????end
??????????end
??????end
?????rslt=ycbcr2rgb(nimage)
?????figureimshow(uint8(imt));
?????figureimshow(uint8(rslt));
?????R=uint8(rslt);
?????toc
?end??
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件????????2444??2019-07-09?16:41??gray2rgb.m
?????文件?????????718??2019-07-07?22:35??hsitorgb.m
?????文件???????24274??2019-07-10?00:36??meiyan.fig
?????文件???????19398??2019-07-15?14:55??meiyan.m
?????文件?????????879??2019-07-08?01:25??meiyan1.m
?????文件?????????647??2019-07-09?17:21??pinghua.m
?????文件?????????727??2019-07-10?00:31??qiuhe.m
?????文件?????????363??2019-07-05?00:39??rgbtohsi.m
?????文件??????136312??2019-07-04?10:41??標(biāo)準(zhǔn)測(cè)試圖.jpg
?????文件???????43247??2019-07-04?10:42??標(biāo)準(zhǔn)測(cè)試圖2.jpg
?????文件???????20932??2019-07-04?11:01??痣1.jpg
?????文件??????219465??2019-07-04?11:06??痣2.png
?????文件??????246932??2019-07-04?10:53??皺紋1.jpeg
?????文件???????49703??2019-07-04?10:55??皺紋2.jpg
?????文件??????217346??2019-07-04?11:07??皺紋3.jpg
?????文件???????91148??2019-07-04?10:51??粗糙1.jpeg
?????文件???????10141??2019-07-04?11:10??粗糙2.jpg
?????文件???????20760??2019-07-04?10:49??雀斑1.jpg
?????文件???????23810??2019-07-04?11:09??雀斑2.jpg
評(píng)論
共有 條評(píng)論