资源简介
极化SAR图像处理中,将三个不同极化通道的数据进行为彩色合成的程序fake_color
代码片段和文件信息
function[]=fake_color(hhhvvvnumberstr)%%% 显示伪彩色图像,hh---r红色;hv----g绿色;vv-----l蓝色
%% 后面的系数1和2,分别代表 是根据 强度(1) 还是幅度(2) 和灰度(可能有负值)(3) 做伪彩色图str为显示的图像的名称,可以省略掉
if nargin==4
str=‘伪彩图‘;
end
[size1size2]=size(hh);
fake_color=zeros(size1size23);
red=zeros(size1size2);
blue=zeros(size1size2);
green=zeros(size1size2);
max_value=zeros(13);
min_value=zeros(13);
switch(number)
case 1
red=log(1+hh);
green=log(1+2*hv);
blue=log(1+vv);
max_value(1)=max(max(red));
max_value(2)=max(max(green));
max_value(3)=max(max(blue));
min_value(1)=min(min(red));
min_value(2)=min(min(green));
min_value(3)=min(min(blue));
fake_color(::1)=(red-min_value(1))./(max_value(1)-min_value(1));
fake_color(::2)=(green-min_value(2))./(max_value(2)-min_value(2));
fake_color(::3)=(blue-min_value(3))./(max_value(3)-min_value(3));
figure;
imshow(fake_color);title(str);
case 2
hh=sqrt(hh);
hv=sqrt(hv);
vv=sqrt(vv);
red=log(1+hh);
green=log(1+hv);
blue=log(1+vv);
max_value(1)=max(max(red));
max_value(2)=max(max(green));
max_value(3)=max(max(blue));
min_value(1)=min(min(red));
min_value(2)=min(min(green));
min_value(3)=min(min(blue));
fake_color(::1)=(red-min_value(1))./(max_value(1)-min_value(1));
fake_color(::2)=(green-min_value(2))./(max_value(2)-min_value(2));
fake_color(::3)=(blue-min_value(3))./(max_value(3)-min_value(3));
figure;
imshow(fake_color);title(str);
case 3
max_hh=max(max(hh));
max_hv=max(max(hv));
max_vv=max(max(vv));
min_hh=min(min(hh));
min_hv=min(min(hv));
min_vv=min(min(vv));
hh=hh-min_hh;
hv=hv-min_hv;
vv=vv-min_vv;
red=log(1+hh);
green=log(1+hv);
blue=log(1+vv);
max_value(1)=max(max(red));
max_value(2)=max(max(green));
max_value(3)=max(max(blue));
min_value(1)=min(min(red));
min_value(2)=min(min(green));
min_value(3)=min(min(blue));
fake_color(::1)=(red-min_value(1))./(max_value(1)-min_value(1));
fake_color(::2)=(green-min_value(2))./(max_value(2)-min_value(2));
fake_color(::3)=(blue-min_value(3))./(max_value(3)-min_value(3));
figure;
% show_area_color(fake_color25130050100[0 0 0]);
imshow(fake_color);title(str);
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2447 2006-05-08 09:46 fake_color.m
----------- --------- ---------- ----- ----
2665 2
评论
共有 条评论