资源简介
用matlab的guide实现对人像的美颜功能,数字图像处理技术。
设计内容及要求:
人脸皮肤的光滑程度很大程度影响人的容貌,很多时候,我们希望拍出
来的照片能更漂亮一些。请设计一美颜软件,实现如下功能:
1、 拍摄一幅彩色人像,对该彩色图像设计一可变模板大小的平滑滤波
器,对人像图像进行滤波处理;
2、 针对面部斑点设计滤波器进行消除
3、 设计亮度调整函数,调整该图像亮度;
4、 调整该图像饱和度,使图像色彩鲜艳程度改变
5、 设计 GUI 界面
设计内容及要求:
人脸皮肤的光滑程度很大程度影响人的容貌,很多时候,我们希望拍出
来的照片能更漂亮一些。请设计一美颜软件,实现如下功能:
1、 拍摄一幅彩色人像,对该彩色图像设计一可变模板大小的平滑滤波
器,对人像图像进行滤波处理;
2、 针对面部斑点设计滤波器进行消除
3、 设计亮度调整函数,调整该图像亮度;
4、 调整该图像饱和度,使图像色彩鲜艳程度改变
5、 设计 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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 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 标准测试图.jpg
文件 43247 2019-07-04 10:42 标准测试图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
相关资源
- 串行级联cpm系统MATLAB仿真
- matlab_OFDM调制解调(来自剑桥大学)
- Matlab路面裂缝识别69319
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
评论
共有 条评论