Skip to Content
Python图像处理实战
book

Python图像处理实战

by Posts & Telecom Press, Sandipan Dey
February 2024
Intermediate to advanced
387 pages
7h 20m
Chinese
Packt Publishing
Content preview from Python图像处理实战

第2章 采样、傅里叶变换与卷积

本章将阐述如何实现二维信号在时域和频域之间的相互转换。首先,我们将提出“采样”这样一个用于调整图像大小的重要概念,列举采样中所遇到的挑战,并试着用Python库中的函数来解决这些问题。其次,介绍图像的量化。量化是指在图像中每个像素所使用的比特数,以及它对图像质量的影响。本章还将介绍离散傅里叶变换(Discrete Fourier Transform,DFT)。学完本章,读者可以用numpyscipy函数库中的快速傅里叶变换(Fast Fourier Transform,FFT)算法实现DFT,并将其应用于图像的实现。

本章还将介绍二维卷积的相关内容,它能显著加快卷积的速度。首先,我们将给出卷积定理的基本概念,并通过一个实例来澄清 “相关”和“卷积”这两个概念之间由来已久的混淆。其次,通过一个SciPy的示例,展示如何通过应用互关联的模板来查找图像中特定模式的位置。

本章还将介绍一些滤波技术,以及如何用Python库实现它们。读者应该会对用这些滤波器进行图像去噪后所得到的结果感兴趣。

本章主要包括以下内容:

  • 图像形成——采样和量化;
  • 离散傅里叶变换;
  • 理解卷积。

本节将描述图像形成的两个重要概念——采样和量化,并介绍如何使用PILscikit-image库通过采样和颜色量化来调整图像的大小。我们将使用一种实战的方法,并在实践中定义这两个概念。

从导入如下所需要的包开始,如下面的代码所示:

% matplotlib inline # for inline image display inside notebook from PIL import Image from skimage.io import imread, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

深度学习实战手册(R语言版)

深度学习实战手册(R语言版)

Posts & Telecom Press, PKS Prakash, Achyutuni Sri Krishna Rao
Spark机器学习实战

Spark机器学习实战

Posts & Telecom Press, Siamak Amirghodsi, Meenakshi Rajendran, Broderick Hall, Shuen Mei
Python实用技能学习指南

Python实用技能学习指南

Posts & Telecom Press, Robert Smallshire, Austin Bingham
人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar

Publisher Resources

ISBN: 9781835465615