数字图像处理实验(6):PROJECT 04-02,Fourier Spectrum and Average Value
来源:互联网 发布:淘宝q币充值改金额 编辑:程序博客网 时间:2024/06/08 11:52
实验要求:
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维幅度谱。
均值。
0 0
- 数字图像处理实验(6):PROJECT 04-02,Fourier Spectrum and Average Value
- 数字图像处理实验(5):PROJECT 04-01 [Multiple Uses],Two-Dimensional Fast Fourier Transform
- 数字图像处理实验(4):PROJECT 02-04 [Multiple Uses],Zooming and Shrinking Images by Bilinear Interpolation
- 数字图像处理实验(3):PROJECT 02-03, Zooming and Shrinking Images by Pixel Replication
- 数字图像处理实验(7):PROJECT 04-03 , Lowpass Filtering
- 数字图像处理实验(8):PROJECT 04-04,Highpass Filtering Using a Lowpass Image
- 数字图像处理实验(1):PROJECT 02-01, Image Printing Program Based on Halftoning
- 数字图像处理实验(11):PROJECT 05-02,Noise Reduction Using a Median Filter
- 数字图像处理实验(15):PROJECT 06-02,Pseudo-Color Image Processing
- 数字图像处理实验(9):PROJECT 04-05,Correlation in the Frequency Domain
- 数字图像处理实验(13):PROJECT 05-04,Parametric Wiener Filter
- 数字图像处理实验(17):PROJECT 06-04,Color Image Segmentation
- 数字图像处理实验(2):PROJECT 02-02, Reducing the Number of Gray Levels in an Image
- 数字图像处理实验(10):PROJECT 05-01 [Multiple Uses],Noise Generators
- 数字图像处理实验(12):PROJECT 05-03,Periodic Noise Reduction Using a Notch Filter
- 数字图像处理实验(14):PROJECT 06-01,Web-Safe Colors
- 数字图像处理实验(16):PROJECT 06-03,Color Image Enhancement by Histogram Processing
- bmp数字图像处理实验
- 使用wait和notifyAll实现生产者消费者模型
- leetcode解题报告11. Container With Most Water
- 基于proteus的51单片机仿真实例五十、51单片机的P1、P2、P3口的工作原理
- 上传本地代码到GitHub
- 统计学习方法 第三章 kdTree
- 数字图像处理实验(6):PROJECT 04-02,Fourier Spectrum and Average Value
- JSON-json-lib-工具类
- [POJ1741]Tree-点分治
- 万众期待的PowerBI Report Server与PowerBI Premium
- 今天,2017第十届省赛结束了
- XDOJ省赛选拔赛第二场H题
- 女生赛hdu6025
- 二分贪心练习题-Y25
- Elasticsearch(十二)【NEST高级客户端--规范】