实验要求:

Objective:

To observe the Fourier spectrum by FFT and the average value of an image.

Main requirements:

Ability of programming with C, C++, or Matlab.

Instruction manual:

(a) Download Fig. 4.18(a) and compute its (centered) Fourier spectrum.

(b) Display the spectrum.

(c) Use your result in (a) to compute the average value of the image.

实验中我们要观察图像进行FFT后的傅里叶频谱图,并且输出其均值。

代码:

%%
close all;
clc;
clear all; %%
img = imread('gray_image.jpg');
imshow(img);
title('original image'); % 计算傅里叶变换
img_F = fft2(img); [M, N] = size(img);
s = sum(abs(img_F(1:M, 1:N))); % 行求和
s = sum(s); % 列求和
ave = s / (M * N);
disp(['average value of image is: ',num2str(ave)]); S = log(1 + abs(img_F));
% figure;
% plot(S);
% title('二维图像显示幅度谱'); x = 0:1:255;
y = 0:1:255;
[x, y] = meshgrid(x, y);
figure;
mesh(S);
title('三维图像显示幅度谱'); img_Q = angle(img_F);
% figure;
% plot(img_Q);
% title('二维图像显示相位谱'); x = 0:1:255;
y = 0:1:255;
[x, y] = meshgrid(x, y);
figure;
mesh(img_Q);
title('三维图像显示相位谱');

实验结果:



上图是原始图像。



上图是FFT之后3维幅度谱。



上图是FFT之后3维幅度谱。



均值。

数字图像处理实验(6):PROJECT 04-02,Fourier Spectrum and Average Value 标签: 图像处理MATLABfft 2017-05-07 23:1的更多相关文章

  1. 数字图像处理实验(总计23个)汇总 标签: 图像处理MATLAB 2017-05-31 10:30 175人阅读 评论(0)

    以下这些实验中的代码全部是我自己编写调试通过的,到此,最后进行一下汇总. 数字图像处理实验(1):PROJECT 02-01, Image Printing Program Based on Half ...

  2. 080 01 Android 零基础入门 02 Java面向对象 01 Java面向对象基础 01 初识面向对象 05 单一职责原则

    080 01 Android 零基础入门 02 Java面向对象 01 Java面向对象基础 01 初识面向对象 05 单一职责原则 本文知识点:单一职责原则 说明:因为时间紧张,本人写博客过程中只是 ...

  3. 数字图像处理实验(5):PROJECT 04-01 [Multiple Uses],Two-Dimensional Fast Fourier Transform 标签: 图像处理MATLAB数字图像处理

    实验要求: Objective: To further understand the well-known algorithm Fast Fourier Transform (FFT) and ver ...

  4. 数字图像处理实验(16):PROJECT 06-03,Color Image Enhancement by Histogram Processing 标签: 图像处理MATLAB 2017

    实验要求: Objective: To know how to implement image enhancement for color images by histogram processing ...

  5. 数字图像处理实验(15):PROJECT 06-02,Pseudo-Color Image Processing 标签: 图像处理MATLAB 2017-05-27 20:53

    实验要求: 上面的实验要求中Objective(实验目的)部分是错误的. 然而在我拿到的大纲中就是这么写的,所以请忽视那部分,其余部分是没有问题的. 本实验是使用伪彩色强调突出我们感兴趣的灰度范围,在 ...

  6. 数字图像处理实验(14):PROJECT 06-01,Web-Safe Colors 标签: 图像处理MATLAB 2017-05-27 20:45 116人阅读

    实验要求: Objective: To know what are Web-safe colors, how to generate the RGB components for a given jp ...

  7. 数字图像处理实验(12):PROJECT 05-03,Periodic Noise Reduction Using a Notch Filter 标签: 图像处理MATLAB 2017-0

    实验要求: Objective: To understand the principle of the notch filter and its periodic noise reducing abi ...

  8. 数字图像处理实验(11):PROJECT 05-02,Noise Reduction Using a Median Filter 标签: 图像处理MATLAB 2017-05-26 23:

    实验要求: Objective: To understand the non-linearity of median filtering and its noise suppressing abili ...

  9. 数字图像处理实验(10):PROJECT 05-01 [Multiple Uses],Noise Generators 标签: 图像处理MATLAB 2017-05-26 23:36

    实验要求: Objective: To know how to generate noise images with different probability density functions ( ...

随机推荐

  1. SDK中常用的工具

    Android SDK包含了各种各样的定制工具,简介如下: 一.Android模拟器(Android Emulator )它是在你的计算机上运行的一个虚拟移动设备.你可以使用模拟器来在一个实际的And ...

  2. Java_脚本引擎_00_资源帖

    一.精选资料 1.w3cschool—Java 脚本引擎 2.Riding the Nashorn 二.参考资料

  3. LeetCode OJ:Length of Last Word(最后一个词的长度)

    Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the l ...

  4. hadoop2.5.2 安装与部署

    主从机构 主:jobtracker 从:tasktracker 四个阶段 1. split 2. Mapper: key-value(对象) 3. shuffle a)  分区(partition,H ...

  5. python-Django初体验

    1.搭建Django开发环境 2.创建工程与应用 CentOS6.5环境下 Python 2.6 ipython 1.2.1 Django 1.6.5 pip install -y django == ...

  6. spring学习-5

    spring表达式SpEL 语法#{..},为bean的属性进行动态赋值 通过bean的id对bean进行引用 调用方法以及引用对象中的属性 计算表达式的值 正则表达式的匹配 修改Address.ja ...

  7. bzoj4513 储能表

    求 $\sum\limits_{i=0}^{n-1} \sum\limits_{j=0}^{m-1} max((x \space xor \space j) - k,0)$ ,膜 $p$ $n,m \ ...

  8. HDU2065"红色病毒"问题【指数型母函数】

    Problem Description 医学界发现的新病毒因其蔓延速度和Internet上传播的"红色病毒"不相上下,被称为"红色病毒",经研究发现,该病毒及其 ...

  9. asp.net core mcroservices 架构之 分布式日志(一)

    一 简介 无论是微服务还是其他任何分布式系统,都需要一个统一处理日志的系统,这个系统 必须有收集,索引,分析查询的功能.asp .net core自己的日志是同步方式的,正如文档所言: 所以必须自己提 ...

  10. Java程序员如何在竞争中保持优势

    Java程序员入门容易,进阶很难,想要在竞争中保持优势,脚踏实地的同时也要仰望星空规划自己的未来.时间在流逝,年龄在增加,你期望的薪水也在不断增多,你总得让自己能力持续增加以配得上想要的收入吧. 从初 ...