资源简介
利用matlab工具,运用微分数学形态学算法提取阴影,提取结果可以较好的与原6影像进行匹配。
代码片段和文件信息
[file1 geo]=geotiffread(‘11.tif‘);
info=geotiffinfo(‘11.tif‘);
% file1 = imread(‘11.tif‘);
b1 =mat2gray( file1(::1));
b1 = im2uint8(b1);
b2 = mat2gray(file1(::2));
b2 = im2uint8(b2);
b3 =mat2gray( file1(::3));
b3 = im2uint8(b3);
b4 = mat2gray(file1(::4));
b4 = im2uint8(b4);
c1 = min(b1b2);
c2 = min(b3b4);
% % 求出各个像元最大值
% minfile = min(c1c2);
% imshow(c2);
minfile = b1;
se1 = cell(17);
% 设置循环把结构算子存到细胞元组
for i = 4:2:12
se1{1i/2} = strel(‘line‘i0)
end
se2 = cell(17);
% 设置循环把结构算子存到细胞元组
for i = 4:2:12
se2{1i/2} = strel(‘line‘i45)
end
se3 = cell(17);
% 设置循环把结构算子存到细胞元组
for i = 4:2:12
se3{1i/2} = strel(‘line‘i90)
end
se4 = cell(17);
% 设置循环把结构算子存到细胞元组
for i =4:2:12
se4{1i/2} = strel(‘line‘i135)
end
% 求照片的大小
[mn] = size(minfile);
wth1 = zeros(mn5);
wth2 = zeros(mn5);
wth3 = zeros(mn5);
wth4 = zeros(mn5);
sum1 = zeros(mn1);
sum2 = zeros(mn1);
sum3 = zeros(mn1);
sum4= zeros(mn1);
% aa = imclose(minfilese1{14})-minfile;
for i=1:1:5
wth1(::i) = double(imclose(minfilese1{1i})- minfile);
sum1 = wth1(::i) + sum1;
% i = i+1;
end
for i=1:5
wth2(::i) = double( imclose(minfilese2{1i})-minfile);
sum2 = wth2(::i) + sum2;
end
for i=1:5
wth3(::i) = double( imclose(minfilese3{1i})-minfile);
sum3 = wth3(::i) + sum3;
end
for i=1:5
wth4(::i) = double
- 上一篇:三次样条插值matlab程序 含多种边界条件
- 下一篇:位势函数 matlab程序
评论
共有 条评论