Basic algorithms for image processing-convolution and correlation

Source: Internet
Author: User

When performing linear spatial filtering, two conceptual correlations and convolution are often encountered
The two are basically similar, and the image matching is a very important method.
Correlation is the filter template moves over the image and calculates the processing of the sum of the product of each position
The convolution mechanism is similar, but the filter first rotates 180 degrees
The relevant calculation steps:
(1) Move the central element of the associated nucleus so that it is directly above the input image pending pixel
(2) The pixel value of the input image as the weight, multiplied by the relevant kernel
(3) Add the results from the above steps as output
Calculation steps for convolution:
(1) convolution cores rotate 180 degrees clockwise around their core elements
(2) Move the central element of the convolution core so that it is directly above the input image pending pixel
(3) Multiply the pixel value of the input image as a weight in the rotated convolution core
(4) The result of the third step and the output pixel corresponding to the input pixel
To replenish pixels when out of bounds, typically add 0 or add values of the original boundary pixels
It can be seen that the main difference is that when calculating convolution, convolution cores are rotated first.

There is no need to rotate the relevant cores in the calculation process.

Discrete unit shock: We will contain a single 1 and the rest is all 0 of the functions become discrete unit shocks.
Important properties: A function is associated with a discrete unit shock, which produces a function in the impact position
A rollover version.
f function
W Filter Template
eg
f (x, Y)
0 0 0) 0 0
0 0 0) 0 0
0 0 1) 0 0
0 0 0) 0 0
0 0 0) 0 0
W (x, y)
1 2 3
4 5 6
7 8 9
Related f*w =
0 0 0) 0 0
0 9 8) 7 0
0 6 5) 4 0
0 3 2) 1 0
0 0 0) 0 0
Convolution f*w=
0 0 0) 0 0
0 1 2) 3 0
0 4 5) 6 0
0 7 8) 9 0
0 0 0) 0 0
Related uses: matching of images

Basic algorithms for image processing-convolution and correlation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.