资源简介

基于matlab仿真联合变换相关器的一个基本程序,适用于初学者,还有滤波等重要编程

资源截图

代码片段和文件信息

%JTC
%% 读入图像
clc;clear;close all;
N=1024;
ob_1=imread(‘F:\Matlab\lena.bmp‘);
ob_2=imread(‘F:\Matlab\templatexiao.bmp‘);
ob_1=double(ob_1);
ob_2=double(ob_2);
 figuresubplot(321)imshow(ob_1[]);
% subplot(322)imshow(ob_2[]);
%% 把输入图像置于同一平面;
[m10n10]=size(ob_1);
[m20n20]=size(ob_2);
m1=floor(m10/2);
m2=floor(m20/2);
n1=floor(n10/2);
n2=floor(n20/2);
input=zeros(N);
input(N/2-m1+1:N/2+m10-m1N/4-n1+1:N/4+n10-n1)=ob_1;
input(N/2-m2+1:N/2+m20-m23*N/4-n2+1:3*N/4+n20-n2)=ob_2;
subplot(323)figureimshow(input[]);
%%
input_edge=edge(input‘canny‘);%滤波
subplot(324)figureimshow(input_edge[]);
%% %相关计算
input_fft=fft2(input_edge);
input_fftshift=fftshift(input_fft);
subplot(325) figureimshow(log(1+abs(input_fftshift))[]);
input_abs=input_fftshift.*conj(input_fftshift);
output_ifft=ifft2(input_abs);
output=fftshift(output_ifft);
figure;
mesh(abs(output));
subplot(326)figureimshow(output[]);
%%
%高通滤波
r=N/4;
for i=1:N;
    for j=1:N;
       if((i-N/2).^2+(j-N/2).^2<=r)
           h(ij)=0;
       else
           h(ij)=1;
       end
    end
end
output_filt=output.*h;
subplot(322)figuremesh(output_filt);

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1197  2009-09-14 08:21  JTC.m

----------- ---------  ---------- -----  ----

                 1197                    1


评论

共有 条评论