实验要求:

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. 面试题13:在O(1)时间删除链表结点

    题目:给定单向链表的头指针和一个结点指针,定义一个函数在O(1)时间删除该结点. 链表结点与函数的定义如下: struct ListNode { int val; ListNode* next; }; ...

  2. BEC listen and translation exercise 7

    Maybe I ought to subscribe to the Engineering Quarterly.也许我应该订阅<工程学季刊>. The performance is sai ...

  3. http请求 详解

  4. net Core 2.1新功能Generic Host(通用主机)

    net Core 2.1新功能Generic Host(通用主机) http://doc.okbase.net/CoderAyu/archive/301859.html 什么是Generic Host ...

  5. webpack 开发环境

    当项目逐渐变大,webpack 的编译时间会变长,可以通过参数让编译的输出内容带有进度和颜色. $ webpack --progress --colors 如果不想每次修改模块后都重新编译,那么可以启 ...

  6. Sqoop--Free-form Query Imports 自由查询模式下$CONDITIONS关键字的作用

    Scoop是用来实现HDFS文件系统和关系型数据库如MySQL之间数据传输和转换的工具. 从MySQL导出到HDFS可以通过--table, --columns and --where等设置数据抽出的 ...

  7. ConcurrentHashMap的扩容机制(jdk1.8)

    ConcurrentHashMap相关的文章网上有很多,而关于ConcurrentHashMap扩容机制是很关键的点,尤其是在并发的情况下实现数组的扩容的问题经常会碰到,看到这篇写的具有代表性,详细讲 ...

  8. Angular5学习笔记 - 服务优化(十)

    一.服务合并 二.验证效果

  9. GWT实现“跟随标题栏”

    在一些商城或者博客上,随处可见一些“跟随的标题栏”,什么是”跟随的标题栏“呢?它的效果是当浏览器窗口移到看不见某处内容的时候,这块内容的标题会紧贴在浏览器顶部,跟随浏览器滑动,当用户将浏览器内容往上拖 ...

  10. Day3-Python基础3--默认参数和参数组

    一.默认参数 先看下下面的代码: def stu_register(name,age,country,course): print("----注册学生信息------") prin ...