圖像處理傅里葉變換圖像變化_傅里葉變換和圖像床單視圖。

圖像處理傅里葉變換圖像變化

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.pswp.cn/news/388587.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/388587.shtml
英文地址,請注明出處:http://en.pswp.cn/news/388587.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

HDUOJ 1062 TEXT REVERSE

#include<iostream> #include<stdlib.h> #include <iomanip> #include<stack> using namespace std;int main(){//次數int n 0;while (cin >> n) {//這里需要讀一個字符&#xff0c;需要消除換行符的影響getchar();while (n--) {char c;stack&l…

VC++的windows服務

項目建立&#xff1a; VS2008->ATL項目->服務exe 服務部署&#xff1a; 在VS2008中新建的ATL項目&#xff0c;在網上看到的流程中都會有注冊服務這一項。 但是對服務的注冊都是只給了一個指令&#xff0c;一句話帶過&#xff0c;沒有給出具體的操作步驟 經過多次試驗…

linux中gradle編譯慢,【Linux】解決linux下android studio用gradle構建從jcenter或maven下載依賴太慢...

一個簡單的辦法&#xff0c;修改項目根目錄下的build.gradle&#xff0c;將jcenter()或者mavenCentral()替換掉即可&#xff1a;allprojects {repositories {maven{ url http://maven.oschina.net/content/groups/public/}}}但如果你有很多個項目的話&#xff0c;一個一個的改估…

MFC程序需要的函數庫及頭文件--《深入淺出MFC》

Windows程序調用的函數可分為2部分&#xff1a;C Runtimes Windows API。 C Runtimes&#xff1a; LIBC.LIB -- C Runtime函數庫的靜態鏈接版本 MSVSRT.LIB--C Runtime庫的動態鏈接版本&#xff08;如果要鏈接這一函數&#xff0c;你的程序執行時必須有MSVCRT40.DLL在場&#…

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

C#DNS域名解析工具(DnsLookup) DNS域名解析工具&#xff1a;DnsLookup 輸入域名后點擊Resolve按鈕即可。 主要實現代碼如下&#xff1a; private void btnResolve_Click ( object sender, EventArgs e ) {lstIPs.Items.Clear ( ); //首先把結果里的ListBox清空 try {IPHostE…

python.day05

一 字典 定義:dict, 以{},表示.每一項用逗號隔開,內部元素用key:value的形式來保存數據.例如 {"jj":"林俊杰","jay:周杰倫"} 特點:查詢效率非常高,通過key來查找元素 內部使用key來計算一個內存地址(暫時),hash算法,key必須不可變的數據類型(ke…

滯后分析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.本文的目的是提供一些指南&#xff0c;說明如何使用R對…

Linux程序實現彈框,jQuery實現彈出框 效果絕對美觀

使用到JQeury寫的幾個比較好的Popup DialogBox,覺得不錯。和大家分享下。使用它們結合.net可以實現很好的效果。1.jqpopup:是個可以拖拽,縮放并可以在它上面顯示html頁面上任何一個控件組合的控件。可以和后面的主頁面通信。使用方法:先調用這幾個js文件,可以自提供的下載地址下…

Interesting visualization tools for profiling.

Interesting visualization tools for profiling. http://dtrace.org/blogs/brendan/2012/03/17/linux-kernel-performance-flame-graphs/ http://dtrace.org/blogs/brendan/2013/07/01/detecting-outliers/

MySQL的事務-原子性

MySQL的事務處理具有ACID的特性&#xff0c;即原子性&#xff08;Atomicity)、一致性&#xff08;Consistency&#xff09;、隔離性&#xff08;Isolation&#xff09;和持久性&#xff08;Durability&#xff09;。 1. 原子性指的是事務中所有操作都是原子性的&#xff0c;要…

codeforces CF438D The Child and Sequence 線段樹

$ \Rightarrow $ 戳我進CF原題 D. The Child and Sequencetime limit per test: 4 secondsmemory limit per test: 256 megabytesinput: standard inputoutput: standard outputAt the childrens day, the child came to Pickss house, and messed his house up. Picks was ang…

大型網站架構演變

今天我們來談談一個網站一般是如何一步步來構建起系統架構的&#xff0c;雖然我們希望網站一開始就能有一個很好的架構&#xff0c;但馬克思告訴我們事物是在發展中不斷前進的&#xff0c;網站架構也是隨著業務的擴大、用戶的需求不斷完善的&#xff0c;下面是一個網站架構逐步…

linux的磁盤磁頭瓷片作用,Linux 磁盤管理

硬盤物理結構以下三張圖片都是磁盤的實物圖&#xff0c;一個磁盤是由多塊堆放的瓷片組成的&#xff0c;所以磁頭的結構也是堆疊的&#xff0c;他要對每一塊瓷片進行讀取&#xff0c;磁頭是可以在不同磁道(在瓷片的表現為不同直徑的同心圓&#xff0c;磁道間是有間隔的)之間移動…

多層插件開發框架

先來幾張效果圖&#xff1a; 1.基于DATASNAP構建的中間件&#xff0c;中間件已經經過實際項目的檢驗&#xff0c;單臺中間件可支持幾千客戶端&#xff0c;中間件可集群 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.在上一個博客中&#xff0c;我們學習了如何…

linux無法設置變量,linux – crontab在作業之前無法設置變量

我的crontab看起來像&#xff1a;rootslack13x64:~# crontab -l -u dnd# some variablesSHELL/bin/bashPATH/bin:/usr/bin:/usr/local/bin:/home/dnd/binMAILTOroot# Actual jobs40 20 * * * /home/dnd/cron_jobs/some_job.sh55 23 * * Fri /home/dnd/cron_jobs/other_job.py作…

詳談P(查準率),R(查全率),F1值

怎么來的&#xff1f; 我們平時用的精度accuracy&#xff0c;也就是整體的正確率 acc predict_right_num / predict_num 這個雖然常用&#xff0c;但不能滿足所有任務的需求。比如&#xff0c;因為香蕉太多了&#xff0c;也不能撥開人工的一個一個的看它的好壞(我愛吃啊&#…

網站系統分布式架構

寫這篇文章之前&#xff0c;需要有些論點和論據&#xff0c;以表明網絡系統在極端情況下的情況&#xff0c;先來看看世界上排名靠前的網站。 1、 FaceBook 2、 Google 從這兩個站可以看出&#xff0c;當下比較極限的日均訪問量在2~3億&#xff0c;PV值…

linux文件系統學習,linux文件系統之tmpfs學習

關于文件系統&#xff0c;我們在下面的博文中已有做簡單的介紹&#xff0c;外鏈網址已屏蔽本篇博文我們學習的是文件系統中的tmpfs。tmpfs是一種偽文件系統&#xff0c;它是從DRAM中創建出來的&#xff0c;相比于磁盤而言&#xff0c;其具有更高的訪問效率。如何創建一個tmpfs&…

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是數據科學中最流行的語言。 不幸的是&#xff0c;要知道何時使用許多數據科學庫中的哪…