数字图像处理实验(6):PROJECT 04-02,Fourier Spectrum and Average Value 标签: 图像处理MATLABfft 2017-05-07 23:1
实验要求:
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的更多相关文章
- 数字图像处理实验(总计23个)汇总 标签: 图像处理MATLAB 2017-05-31 10:30 175人阅读 评论(0)
以下这些实验中的代码全部是我自己编写调试通过的,到此,最后进行一下汇总. 数字图像处理实验(1):PROJECT 02-01, Image Printing Program Based on Half ...
- 080 01 Android 零基础入门 02 Java面向对象 01 Java面向对象基础 01 初识面向对象 05 单一职责原则
080 01 Android 零基础入门 02 Java面向对象 01 Java面向对象基础 01 初识面向对象 05 单一职责原则 本文知识点:单一职责原则 说明:因为时间紧张,本人写博客过程中只是 ...
- 数字图像处理实验(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 ...
- 数字图像处理实验(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 ...
- 数字图像处理实验(15):PROJECT 06-02,Pseudo-Color Image Processing 标签: 图像处理MATLAB 2017-05-27 20:53
实验要求: 上面的实验要求中Objective(实验目的)部分是错误的. 然而在我拿到的大纲中就是这么写的,所以请忽视那部分,其余部分是没有问题的. 本实验是使用伪彩色强调突出我们感兴趣的灰度范围,在 ...
- 数字图像处理实验(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 ...
- 数字图像处理实验(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 ...
- 数字图像处理实验(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 ...
- 数字图像处理实验(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 ( ...
随机推荐
- UnityGUI扩展实例:图片挖洞效果 Mask的反向实现
转载自 https://www.taidous.com/forum.php?mod=viewthread&fid=211&tid=55259 我想大家在用uGUI做界面时,可能经常会碰 ...
- stl_relops.h
stl_relops.h // Filename: stl_relops.h // Comment By: 凝霜 // E-mail: mdl2009@vip.qq.com // Blog: http ...
- [Unity3D]EZGUI 操作简单介绍
官方的GUI根本无法跟EZGUI比,无论是资源还是易用性还是速度.EZGUI基于Mesh不占DrawCall.EZGUI是自动合并Mesh成为一个物体,并且贴图自动制作Atlas.所以效率高,CPU消 ...
- BZOJ - 2588 Spoj 10628. Count on a tree (可持久化线段树+LCA/树链剖分)
题目链接 第一种方法,dfs序上建可持久化线段树,然后询问的时候把两点之间的所有树链扒出来做差. #include<bits/stdc++.h> using namespace std; ...
- CodeForces - 633H :Fibonacci-ish II(正解:莫对+线段树)
Yash is finally tired of computing the length of the longest Fibonacci-ish sequence. He now plays ar ...
- unitychan-crs 头发随动脚本
// //SpringCollider for unity-chan! // //Original Script is here: //ricopin / SpringCollider.cs //Ro ...
- python basestring()
作用: basestring是str和unicode的超类(父类),也是抽象类,因此不能被调用和实例化,但可以被用来判断一个对象是否为str或者unicode的实例,isinstance(obj, b ...
- Mesos-slave启动处理记录
1. work_dir错误导致启动异常 /etc/mesos-slave/work_dir设置的目录不存在或者权限不够将会导致启动异常. 2. 根据日志信息以及status信息来判断问题 通过serv ...
- MD5加密 及获得密码盐
MD5加密 及获得密码盐 using System; using System.Collections.Generic; using System.Configuration; using Syste ...
- IIS调用批处理权限的处理[转]
最近公司希望将Windows 2003升级为Windows 2008,做完安全设置后发现.net调用批处理拒绝访问的情况.网上很多说更改应用程序池的权限,建议不需要修改该权限,我这里强烈建议使用默认的 ...