小弟找高手帮帮忙 下面是小波边缘检测的主程序 但是matlab仿真却只出两幅图 老是那个local_max_mode函数出问题 有人说是没有子程序 我也不知道子程序是什么 高手帮帮忙 毕业设计急啊 还有谁能教我程序流程图该怎么画 我没有学过matlba 一点概念都没有 仿真图片我也传上来了 愿帮忙的好心人可发到我邮箱 chencheng0417@163.com
%小波多尺度边缘检测主程序
close all
clc
I=imread('lena256.bmp');
[row,col]=size(I);
%使用小波函数
wname='bior4.4';
% 显示原图
subplot(2,3,1);
imshow(I);
title('原图');
%canny算法¨
bw= edge(I,'canny');
subplot(2,3,2);
imshow(bw);
title('Canny法');
I = double(I);
% 对图像进行三层小波变换
[ca1,ch1,cv1,cd1] = dwt2(I,wname);
[ca2,ch2,cv2,cd2] = dwt2(ca1,wname);
[ca3,ch3,cv3,cd3] = dwt2(ca2,wname);
% 各层小波系数求极值点及极值点的梯度值(角度)
thr=4;a0=1;n=7;
[edge_mf1,grads1] = local_max_mode(cv1,ch1,thr,a0,n);
thr=15;a0=1;n=5;
[edge_mf2,grads2] = local_max_mode(cv2,ch2,thr,a0,n);
thr=30;a0=1;n=3;
[edge_mf3,grads3] = local_max_mode(cv3,ch3,thr,a0,n);
% 对极值点矩阵归一化
edge_mf1=guiyi(edge_mf1);
edge_mf2=guiyi(edge_mf2);
edge_mf3=guiyi(edge_mf3);
% 把三层小波分解的结果合并
ca3=wthresh(ca3,'h',3000000);
ca2=wthresh(ca2,'h',3000000);
ca1=wthresh(ca1,'h',3000000);
ca2_ca3=idwt2(ca3,edge_mf3,edge_mf3,edge_mf3,wname,size(ca2));
ca2_ca3=guiyi(abs(ca2_ca3));
com_2=mul_c(ca2_ca3,edge_mf2);
ca1_ca3=idwt2(ca2,com_2,com_2,com_2,wname,size(ca1));
ca1_ca3=guiyi(abs(ca1_ca3));
com_1=mul_c(ca1_ca3,edge_mf1);
n=5;a0=0.01;
com_1=ada_thr(com_1,n,a0);
com_1=wthresh(com_1,'h',0.00001);
com_1=dayu_c(com_1,0);
subplot(2,3,3);
imshow(com_1*255);
title('多尺度');
subplot(2,3,4);
imshow(edge_mf3*255);
title('2层');
subplot(2,3,5);
imshow(edge_mf2*255);
title('1层');
subplot(2,3,6);
imshow(edge_mf1*255);
title('0层');