Correlation and Convolution

Research/Robot Vision 2015. 5. 22. 18:17


Convolution.pdf









사실 associativity를 생각해보면 가우시안의 convolution은 결국 작은 값의 convolution을 여러번 반복한 것과 같다. 그런데 그것보다는 큰 convolution을 한 번에 수행하는 것이 훨씬 computationally 효율적이겠지!

(마치 1+1+1+1... 하는 것보다 큰 수를 한 번에 더하는 것과 같은 느낌이랄까..)




https://www.youtube.com/watch?v=Ma0YONjMZLI


correlation과 convolution의 가장 큰 차이점은 convolution이 associative하다는 것이다!!

The key difference between the two is that convolution is associative. 

(In general, people use convolution for image processing operations such as smoothing, and they use correlation to match a template to an image. Then, we don’t mind that correlation isn’t associative, because it doesn’t really make sense to combine two templates into one with correlation, whereas we might often want to combine two filter together for convolution. When discussing the Fourier series as a way of understanding filtering, we will use convolution, so that we can introduce the famous convolution theorem.)




Correlation은 아래와 같이 Image similarity를 보는 데 쓰인다. 

(만약 Image가 같은 이미지인데 일정한 상수값이 곱해진 이미지라면, ZNCC 값이 1 인 것으로 같은 이미지라는 것을 알 수 있음)






- 아래는 image에서의 FFT


The "mathematical equations" are important, so don't skip them entirely. But the 2d FFT has an intuitive interpretation, too. For illustration, I've calculated the inverse FFT of a few sample images:

enter image description here

As you can see, only one pixel is set in the frequency domain. The result in the image domain (I've only displayed the real part) is a "rotated cosine pattern" (the imaginary part would be the corresponding sine).

If I set a different pixel in the frequency domain (at the left border):

enter image description here

I get a different 2d frequency pattern.

If I set more than one pixel in the frequency domain:

enter image description here

you get the sum of two cosines.

So like a 1d wave, that can be represented as a sum of sines and cosines, any 2d image can be represented (loosely speaking) as a sum of "rotated sines and cosines", as shown above.

when we take fft of a image in opencv, we get weird picture. What does this image denote?

It denotes the amplitudes and frequencies of the sines/cosines that, when added up, will give you the original image.

And what is its application?

There are really too many to name them all. Correlation and convolution can be calculated very efficiently using an FFT, but that's more of an optimization, you don't "look" at the FFT result for that. It's used for image compression, because the high frequency components are usually just noise.




* ref

[1] https://moocs.qut.edu.au/courses/791/learn

[2] https://www.youtube.com/watch?v=Ma0YONjMZLI

[3] http://dsp.stackexchange.com/questions/1637/what-does-frequency-domain-denote-in-case-of-images

[4] Correlation and Convolution, Class Notes for CMSC 426, Fall 2005 David Jacobs

     (Important!)


설정

트랙백

댓글