KEMBAR78
Correlation & Convolution | PDF
0% found this document useful (0 votes)
20 views16 pages

Correlation & Convolution

The document discusses correlation and convolution as fundamental operations in computer vision, focusing on their mathematical definitions and applications in image processing. It outlines the steps involved in correlation, including the use of a kernel to measure similarity between images, and provides an example of applying a blur filter. Additionally, it explains convolution as a pixel-wise transformation of an image using a kernel, highlighting the differences between the two processes.

Uploaded by

takash2412
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views16 pages

Correlation & Convolution

The document discusses correlation and convolution as fundamental operations in computer vision, focusing on their mathematical definitions and applications in image processing. It outlines the steps involved in correlation, including the use of a kernel to measure similarity between images, and provides an example of applying a blur filter. Additionally, it explains convolution as a pixel-wise transformation of an image using a kernel, highlighting the differences between the two processes.

Uploaded by

takash2412
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Correlation & Convolution

Fundamental Operation in Computer Vision

• Correlation
• Convolution
Correlation
• The mathematical operation used to measure
the similarity between two images.
• In image processing, a kernel, convolution
matrix, or mask is a small matrix used for
blurring, sharpening, embossing, edge
detection, and more.
Mathematical Formula
• I – image
• F – Filter or Kernel or Mask
• (x,y) – position of an image
• (i,j) – position of a filter
• Mathematical formula for 2D images
Steps in Correlation
• 1. Slide the center of the correlation kernel on
the image
• 2. Multiply each weight in the correlation
kernel by the pixel in the image
• 3. Sum these products
Example
Linear Filter Based on Correlation
• Blur Filter
• import cv2
import matplotlib.pyplot as plt
import numpy as np# read image
src = cv2.imread('src.png', 0)# prepare the filter
kernel = [[0,0,0], [0,1,0], [0,0,0]]# apply kernel to the original image
dst = cv2.filter2D(src, -1, np.array(kernel))# concatenate images
horizontally
result = np.concatenate((src, dst), axis=1)
cv2.imwrite('result.png', result)
Convolution Filtering
• In image processing, convolution is a process
by which we transform an input image by
applying a kernel over it in a pixel-wise
fashion.
• When the convolution mask operates on a
particular pixel, then it performs the action by
considering that pixel and its neighbouring
pixels and the result is returned to that one
particular pixel.
Mathematical Formula
Steps
Comparison

You might also like