图像处理傅里叶变换图像变化_傅里叶变换和图像床单视图。

图像处理傅里叶变换图像变化

What do Fourier Transforms do? What do the Fourier modes represent? Why are Fourier Transforms notoriously popular for data compression? These are the questions this article aims to address using an interesting analogy to represent images.

傅立叶变换有什么作用? 傅立叶模式代表什么? 为什么众所周知,傅立叶变换在数据压缩方面很受欢迎? 这些是本文旨在使用有趣的类比表示图像来解决的问题。

Images are digital paintings. They are made up of different features. Some features require really precise control of the brush like drawing whiskers on a dog. Others can be quickly filled in with a thick brush, like a clear blue sky. All images are a combination of fine and dull features to varying degrees, i.e. high-frequency and low-frequency features.

图像是数字绘画。 它们由不同的功能组成。 一些功能需要真正精确地控制画笔,例如在狗上绘制胡须。 其他人可以用浓密的刷子快速填充,例如湛蓝的天空。 所有图像在不同程度上都是精细特征和暗淡特征的组合,即高频和低频特征。

let’s take a moment to understand how frequencies crept up into our analysis. Imagine the sine wave over half a period. It slowly goes up reaches a maximum and then slowly diminishes. The higher the frequency of the sine, the narrower the wave.

让我们花一点时间来了解频率是如何爬升到我们的分析中的。 想象一下半个周期的正弦波。 它缓慢上升达到最大值,然后缓慢减小。 正弦频率越高,波形越窄。

Image for post
Photo by William Felker on Unsplash
威廉·费尔克在Unsplash上的照片

Imagine a cursed painter, who can only paint with brushes whose tips are half-wave sines. If he were to draw a delicately fine feature like the whiskers on a dog, he would choose a brush with a sine which has high frequency i.e. a narrowly pointed brush. Similarly, if he were to paint a clear sky that is devoid of any finer details, he would choose a brush with low frequency i.e. a fat thicker one.

想象一个被诅咒的画家,他只能用笔尖是半波正弦的画笔进行绘画。 如果要在狗身上画出细微的特征(如胡须),他会选择频率较高的正弦画笔,即窄尖的画笔。 同样,如果他要绘制没有任何精细细节的晴朗天空,则他会选择频率较低的画笔,即较厚的脂肪。

Image for post
Higher the frequency, narrower the peaks.
频率越高,峰越窄。

Surprisingly, all the images to ever exist are just like the artwork of the cursed painter. Notably, Fourier showed that every image (signal) can be decomposed into a range of sinuous terms where each term has a magnitude. The magnitudes are called Fourier coefficients. The whole process of decomposing an image into various sine terms and concomitantly their magnitudes is called Fourier decomposition. Fourier series is a much more general scenario, where the signals to be decomposed are periodic. Fourier Transforms are special cases where signals have an infinite time-period, i.e. non-periodic.

令人惊讶的是,所有存在的图像都像被诅咒的画家的作品一样。 值得注意的是,傅立叶(Fourier)表明,每个图像(信号)都可以分解为一系列正弦项,其中每个项都有一个大小。 幅度称为傅里叶系数。 将图像分解为各种正弦项及其幅度的整个过程称为傅里叶分解。 傅立叶级数是一种更为通用的方案,其中要分解的信号是周期性的。 傅立叶变换是信号具有无限时间周期(即非周期性)的特殊情况。

One elegant and fast algorithm to do the above decomposition is the Fast Fourier Transform, which is arguably the most important algorithm to be developed in the 21st century. It has far-reaching applications in cellular communications, satellites, films, televisions, and much more.

快速傅立叶变换是完成上述分解的一种优雅而快速的算法,它可以说是21世纪最重要的算法。 它在蜂窝通信,卫星,电影,电视等领域具有广泛的应用。

To visualize the sinuous nature of images, it would be interesting to plot the magnitude of an image as if it were a surface plot and observe the top view of the contours. This idea was developed by Dr. Steven Brunton at the University of Washington.

为了可视化图像的弯曲性质,将图像的大小绘制为表面图并观察轮廓的俯视图将很有趣。 这个想法是华盛顿大学的史蒂文·布伦顿博士提出的。

Image for post
The plot uses a photo by Jakob Kac on Unsplash.
剧情使用雅各布• 凯克 ( Jakob Kac)在“ Unsplash”上的照片 。

The sinuous nature of the image is clearly visible. the high-frequency features are sharply visible as narrow peaks. These include the eyes, the outlines of the facial structure, and the outline of the human hand. The low-frequency features, which are usually huge stretches of uniform color, are observed in the background. These include large regions of black colored fur and the background.

图像的弯曲性质清晰可见。 高频特征清晰可见为窄峰。 这些包括眼睛,面部结构轮廓和人手轮廓。 通常在背景中观察到低频特征,通常是巨大的均匀颜色延伸。 其中包括黑色毛皮和背景的大区域。

Here, is the simple code to replicate the prior results.

这是复制先前结果的简单代码。

The source code to animate the surface plot is included in my Github, here!

我的Github中包含了动画曲面图的源代码, 在这里 !

This is called as the bed sheet view of the image. The idea behind the name is that if four people were holding each side of a bedsheet and begin oscillating it at one of the Fourier frequency with the corresponding magnitude and a similar setup with four people exists for each of the infinite Fourier modes, then the superposition of all the bedsheets would result physically in creases which look like the above image. Hence, the name, bed sheet view!

这称为图像的床单视图。 该名称背后的想法是,如果四个人拿着床单的每一侧,并开始以相应的幅度以傅立叶频率之一进行振荡,并且对于每个无限傅立叶模式都存在四个人的相似设置,则该叠加所有的床单都会在物理上导致皱纹,看起来像上面的图像。 因此,名称,床单视图!

Okay, now that a good intuition is developed to understand what Fourier transforms can do, its a good exercise to go over these ideas formally. The Fourier decomposition equation for a discrete signal looks like:

好的,现在已经发展出一种很好的直觉来理解傅立叶变换可以做什么,这是一个很好的练习,可以正式地研究这些想法。 离散信号的傅立叶分解方程如下:

Image for post

Here, xn is the value of the signal at time n. Xk is the Fourier coefficient for each frequency k. N is the total number of samples of the signal (i.e. the number of discrete time steps over which the signal was recorded). The FFT algorithm returns the Xk values for each frequency. The complex exponential can be decomposed into sines and cosines using the Euler’s formula. This provides a sanity check to the intuitions developed so far.

在此,xn是时间n处的信号值。 Xk是每个频率k的傅立叶系数。 N是信号采样的总数(即记录信号的离散时间步长)。 FFT算法返回每个频率的Xk值。 可以使用欧拉公式将复指数分解为正弦和余弦。 这为到目前为止开发的直觉提供了健全的检查。

Image for post

For example, let’s build a sinuous signal out of multiple frequencies. Say a combination of sines with 50, 100, and 200 hertz as frequencies and at different proportions. The periodic nature is still visible, but it is really hard to understand the original frequency components by visualizing the signal in the time domain.

例如,让我们从多个频率构建一个正弦信号。 说出频率分别为50、100和200赫兹的正弦组合。 周期性仍然是可见的,但是通过在时域中可视化信号很难理解原始频率分量。

Image for post

The Fourier Transform helps to intuitively visualize the signals in the frequency domain. So, applying the Fourier decomposition on the above signal gives us the following plot.

傅立叶变换有助于直观地可视化频域中的信号。 因此,对上述信号进行傅立叶分解可得出以下曲线。

Image for post

The true frequencies of the mixture at 50, 100, and 200 Hz show peaks in the frequency domain as expected. Notably, the FFT algorithm can also give the weightage of each frequency component, without having any prior knowledge of the signal.

混合物在50、100和200 Hz的真实频率如预期的那样在频域中显示出峰值。 值得注意的是,FFT算法还可以给出每个频率分量的权重,而无需事先了解信号。

Ah, yes! the notorious one line FFT command. In MATLAB, it’s even simpler, just fft() without any imports.
是的! 臭名昭著的单行FFT命令。 在MATLAB中,它甚至更简单,只是没有任何导入的fft()。

Now going back to the bedsheet view of images, every picture is a 2-dimensional signal on which the Fourier decomposition can be applied. If a slice of the image is taken, it would resemble the time domain signal from our example, however with its own frequency components. The bedsheet views are powerful to develop intuition behind how an image can be a simple signal in the time domain, with multiple dimensions.

现在回到图像的床单视图,每张图片都是一个二维信号,可以对其进行傅立叶分解。 如果拍摄图像的一部分,它将类似于我们示例中的时域信号,但是具有自己的频率分量。 床单视图功能强大,可以直观地理解图像在时域中如何成为具有多个维度的简单信号。

In general, the information-dense regions are made up of high-frequency terms and plain stretches of uniformity are made up of lower frequency terms. The genius of Fourier is deriving the weighted modes (or frequency — magnitude pair). This gives an idea to understand the most important modes which make up the image. Turns out the Pareto rule holds true here and a really small number of modes contain most of the information about the image. This principle is crucial to data compression. By ignoring the majority of modes, we could reduce the size of the image. However, the quality of the image is only slightly compromised.

通常,信息密集区域由高频项组成,均匀性的平坦范围由低频项组成。 傅立叶的天才在于推导加权模式(或频率-幅度对)。 这给出了一个了解构成图像的最重要模式的想法。 事实证明,帕累托规则在这里成立,很少有模式包含有关图像的大多数信息。 该原理对于数据压缩至关重要。 通过忽略大多数模式,我们可以减小图像的大小。 但是,图像的质量只会略有下降。

If you are interested in going more in-depth on how Fourier Transforms are used for data compression, or to understand why data is compressible, to begin with, check out my previous article. As always, reach out to me to continue the conversation or provide me with some feedback on the content.

如果您想更深入地了解如何使用傅里叶变换进行数据压缩,或者想了解为什么数据是可压缩的,那么请阅读我的上一篇文章 。 与往常一样,请与我联系以继续对话或向我提供有关内容的反馈。

翻译自: https://towardsdatascience.com/fourier-transforms-and-bed-sheet-view-of-images-58ba34e6808a

图像处理傅里叶变换图像变化

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/388587.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

C#DNS域名解析工具(DnsLookup)

C#DNS域名解析工具(DnsLookup) DNS域名解析工具:DnsLookup 输入域名后点击Resolve按钮即可。 主要实现代码如下: private void btnResolve_Click ( object sender, EventArgs e ) {lstIPs.Items.Clear ( ); //首先把结果里的ListBox清空 try {IPHostE…

滞后分析rstudio_使用RStudio进行A / B测试分析

滞后分析rstudioThe purpose of this article is to provide some guide on how to conduct analysis of a sample scenario A/B test results using R, evaluate the results and draw conclusions based on the analysis.本文的目的是提供一些指南,说明如何使用R对…

Linux程序实现弹框,jQuery实现弹出框 效果绝对美观

使用到JQeury写的几个比较好的Popup DialogBox,觉得不错。和大家分享下。使用它们结合.net可以实现很好的效果。1.jqpopup:是个可以拖拽,缩放并可以在它上面显示html页面上任何一个控件组合的控件。可以和后面的主页面通信。使用方法:先调用这几个js文件,可以自提供的下载地址下…

MySQL的事务-原子性

MySQL的事务处理具有ACID的特性,即原子性(Atomicity)、一致性(Consistency)、隔离性(Isolation)和持久性(Durability)。 1. 原子性指的是事务中所有操作都是原子性的,要…

大型网站架构演变

今天我们来谈谈一个网站一般是如何一步步来构建起系统架构的,虽然我们希望网站一开始就能有一个很好的架构,但马克思告诉我们事物是在发展中不断前进的,网站架构也是随着业务的扩大、用户的需求不断完善的,下面是一个网站架构逐步…

linux的磁盘磁头瓷片作用,Linux 磁盘管理

硬盘物理结构以下三张图片都是磁盘的实物图,一个磁盘是由多块堆放的瓷片组成的,所以磁头的结构也是堆叠的,他要对每一块瓷片进行读取,磁头是可以在不同磁道(在瓷片的表现为不同直径的同心圆,磁道间是有间隔的)之间移动…

多层插件开发框架

先来几张效果图: 1.基于DATASNAP构建的中间件,中间件已经经过实际项目的检验,单台中间件可支持几千客户端,中间件可集群 2.中间件支持同时连接ACCESS\SQL SERVER\MYSQL\ORACLE。。。多种数据库系统 3.中间件同时支持TCP/IP,HTTP&a…

unity3d 可视化编程_R编程系列:R中的3D可视化

unity3d 可视化编程In the last blog, we have learned how to create “Dynamic Maps Using ggplot2“. In this article, we will explore more into the 3D visualization in R programming language by using the plot3d package.在上一个博客中,我们学习了如何…

详谈P(查准率),R(查全率),F1值

怎么来的? 我们平时用的精度accuracy,也就是整体的正确率 acc predict_right_num / predict_num 这个虽然常用,但不能满足所有任务的需求。比如,因为香蕉太多了,也不能拨开人工的一个一个的看它的好坏(我爱吃啊&#…

网站系统分布式架构

写这篇文章之前,需要有些论点和论据,以表明网络系统在极端情况下的情况,先来看看世界上排名靠前的网站。 1、 FaceBook 2、 Google 从这两个站可以看出,当下比较极限的日均访问量在2~3亿,PV值…

python 数据科学 包_什么时候应该使用哪个Python数据科学软件包?

python 数据科学 包Python is the most popular language for data science. Unfortunately, it can be tricky to know which of the many data science libraries to use when. ☹️Python是数据科学中最流行的语言。 不幸的是,要知道何时使用许多数据科学库中的哪…

Go语言开发环境配置

http://blog.csdn.net/hil2000/article/details/41261267/ 一.我为什么要学习go语言 当今已经是移动和云计算时代,Go出现在了工业向云计算转型的时刻,简单、高效、内 置并发原语和现代的标准库让Go语言尤其适合云端软件开发(毕竟它就是为此而…

熊猫tv新功能介绍_您应该知道的4种熊猫绘图功能

熊猫tv新功能介绍Pandas is a powerful package for data scientists. There are many reasons we use Pandas, e.g. Data wrangling, Data cleaning, and Data manipulation. Although, there is a method that rarely talks about regarding Pandas package and that is the …

win与linux渊源,微软与Linux从对立走向合作,WSL是如何诞生的

原标题:微软与Linux从对立走向合作,WSL是如何诞生的正文Windows Subsystem for Linux(WSL)的开发,让微软从Linux的对立面走向合作,并且不断加大对开源社区的支持力度。而作为微软历史上的重要转折点,外界对WSL技术在Pr…

MFC80.DLL复制到程序目录中,也有的说复制到安装目录中

在用VS2005学习C调试程序的时候,按F5键,总提示这个问题, 不晓得什么原因,网上有的说找到MFC80.DLL复制到程序目录中,也有的说复制到安装目录中,可结果很失望,也有的VS2005安装有问题&#xff0…

vs显示堆栈数据分析_什么是“数据分析堆栈”?

vs显示堆栈数据分析A poor craftsman blames his tools. But if all you have is a hammer, everything looks like a nail.一个可怜的工匠责怪他的工具。 但是,如果您只有一把锤子,那么一切看起来都像钉子。 It’s common for web developers or databa…

树莓派 zero linux,树莓派 zero基本调试

回家之前就从网上购买了一堆设备,回去也不能闲着,可以利用家里相对齐全的准备安装调试。结果人还没回来,东西先到了。购买的核心装备是树莓派zero w,虽然已经知道它比家族大哥树莓派小不少,但拿到手里还是惊奇它的小巧…

简单的编译流程

简易编译器流程图: 一个典型的编译器,可以包含为一个前端,一个后端。前端接收源程序产生一个中间表示,后端接收中间表示继续生成一个目标程序。所以,前端处理的是跟源语言有关的属性,后端处理跟目标机器有关的属性。 复…

广告投手_测量投手隐藏自己的音高的程度

广告投手As the baseball community has recently seen with the Astros 2017 cheating scandal, knowing what pitch is being thrown gives batters a game-breaking advantage. However, unless you have an intricate system of cameras and trash cans set up, knowing wh…

验证部分表单是否重复

1. 效果 图片中的名称、机构编码需要进行重复验证2. 思路及实现 表单验证在获取数据将需要验证的表单数据进行保存this.nameChangeTemp response.data.orgName;this.codeChangeTemp response.data.orgCode; 通过rule对表单进行验证 以名字的验证为例rules: {orgName: [// 设置…