【图像增强】基于matlab频域+密度分割+灰度级-彩色变换伪彩色图像增强【含Matlab源码 1011期】
作者:互联网
一、简介
mark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L1RJUUNtYXRsYWI=,size_16,color_FFFFFF,t_70#pic_center)
HR0cHM6Ly9ibG9nLmNzZG4ubmV0L1RJUUNtYXRsYWI=,size_16,color_FFFFFF,t_70#pic_center)
二、源代码
Image = double(imread('yaogan1.bmp'));
imshow(uint8(Image))
[height,width]=size(Image);
NewImage=zeros(height,width,3);
for i=1:height
for j=1:width
if Image(i,j)<52
NewImage(i,j,1)=16; NewImage(i,j,2)=25; NewImage(i,j,3)=64;
elseif Image(i,j)<92
NewImage(i,j,1)=27; NewImage(i,j,2)=45; NewImage(i,j,3)=125;
elseif Image(i,j)<115
NewImage(i,j,1)=101; NewImage(i,j,2)=146; NewImage(i,j,3)=79;
elseif Image(i,j)<170
NewImage(i,j,1)=115; NewImage(i,j,2)=156; NewImage(i,j,3)=142;
else
NewImage(i,j,1)=213;
NewImage(i,j,2)=222;
NewImage(i,j,3)=159;
end
end
end
Image=double(imread('Brain.jpg'));
[height,width]=size(Image);
NewImage=zeros(height,width,3);
L=255;
for i=1:height
for j=1:width
if Image(i,j)<=L/4
NewImage(i,j,1)=0;
NewImage(i,j,2)=4*Image(i,j);
NewImage(i,j,3)=L;
else if Image(i,j)<=L/2
NewImage(i,j,1)=0;
NewImage(i,j,2)=L;
NewImage(i,j,3)=-4*Image(i,j)+2*L;
else if Image(i,j)<=3*L/4
NewImage(i,j,1)=4*Image(i,j)-2*L;
NewImage(i,j,2)=L;
NewImage(i,j,3)=0;
三、运行结果
四、备注
版本:2014a
完整代码或代写加1564658423
标签:灰度级,color,Image,pic,height,width,源码,图像增强,size 来源: https://www.cnblogs.com/homeofmatlab/p/14901085.html