• 图像正交变换


    关键词:

    实验1 :


    >> f=imread('fouriertest.jpg');
    >> imshow(f,'notruesize')
    Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
    Use IMSHOW(...,'InitialMagnification','fit') instead.
    > In imshow>preParseInputs at 293
      In imshow at 149
    >> F=fft2(f);
    Warning: FFTN on values of class UINT8 is obsolete.
             Use FFTN(DOUBLE(X)) or FFTN(SINGLE(X)) instead.
    > In uint8.fftn at 10
      In fft2 at 19
    >> mesh(fftshift(abs(F)));

    image

    这就是fft变换后的频谱图;

    >> F2=fftshift(log(abs(F)));
    >> imshow(F2,[-1,5],'notruesize');%显示频谱图像,频谱的零频率系数被移至频率中间
    Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
    Use IMSHOW(...,'InitialMagnification','fit') instead.
    > In imshow>preParseInputs at 293
      In imshow at 149

    image

    f=zeros(1000,1000);
    f(350:649,475:524)=1;
    f=imrotate(f,45,'bilinear','crop');
    imshow(f,'notruesize');
    Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
    Use IMSHOW(...,'InitialMagnification','fit') instead.                        
    In imshow>preParseInputs at 293
      In imshow at 149

    image

    >> title('图像正向旋转45°');
    >> subplot(224)
    >> F=fftshift(abs(fft2(f)));
    >> imshow(F,[-1 5],'notruesize');
    Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
    Use IMSHOW(...,'InitialMagnification','fit') instead.
    > In imshow>preParseInputs at 293
      In imshow at 149
    >>

    image

    >> f=zeros(1000,1000);

    f(50:349,475:524)=1;

    imshow(f, 'notruesize');
    Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
    Use IMSHOW(...,'InitialMagnification','fit') instead.
    > In imshow>preParseInputs at 293
      In imshow at 149
    >>

    image

    F=fftshift(abs(fft2(f)));
    >>
    >> imshow(F,[-1 5], 'notruesize');
    Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
    Use IMSHOW(...,'InitialMagnification','fit') instead.
    > In imshow>preParseInputs at 293
      In imshow at 149
    >>

    image

    >> f=zeros(1000,1000);
    >> f(350:640,475:524)=1;
    >> subplot(221)
    >> imshow(f,'notruesize');
    Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
    Use IMSHOW(...,'InitialMagnification','fit') instead.
    > In imshow>preParseInputs at 293
      In imshow at 149
    >> subplot(221)
    >>  imshow(f,'notruesize');
    Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
    Use IMSHOW(...,'InitialMagnification','fit') instead.
    > In imshow>preParseInputs at 293
      In imshow at 149
    >> title('原始图片');
    >> subplot(222)
    >> F=fftshift(abs(fft2(f)));
    >> imshow(F,[-1 5],'notruesize');
    Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
    Use IMSHOW(...,'InitialMagnification','fit') instead.
    > In imshow>preParseInputs at 293
      In imshow at 149
    >> title('原始图像的傅里叶变换频谱');
    >> subplot(223)
    >> f=zeros(1000,1000);
    >> f(350:649,800:849)=1;
    >> imshow(f,'notruesize');
    Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
    Use IMSHOW(...,'InitialMagnification','fit') instead.
    > In imshow>preParseInputs at 293
      In imshow at 149
    >> title('向x轴方向移动后的图像');
    >> subplot(224)
    >> F=fftshift(abs(fft2(f)));
    >> imshow(F,[-1 5] ,'notruesize');
    Warning: IMSHOW(...,'notruesize') is an obsolete syntax.
    Use IMSHOW(...,'InitialMagnification','fit') instead.
    > In imshow>preParseInputs at 293
      In imshow at 149
    >> title('向x轴方向移动后的傅里叶变换频谱');
    >>

    image

  • 相关阅读:
    String常用方法
    测试
    mongo aggregate group, group使用
    jquery ajax封装添加默认错误提示
    js时间格式化
    本地项目导入远程git仓库
    java设计模式:适配器模式
    mysql if示例
    hibernate指定查询字段
    js window resize延时
  • 原文地址:https://www.cnblogs.com/fleetwgx/p/1488212.html
Copyright © 2020-2023  润新知