1- Intro

All right, welcome back to Computer Vision. Last time we talked about images as functions. An image could be thought of as a function of two dimensional position like i of xy. Or a two dimensional array we'd say f of ij row column. And sometimes I'll try to distinguish between whether I've got rows and columns and x and y. And we talked about how x and y are not the same as rows and columns. In fact, a row is typically going down so if we go row, column, that's y, x. The other thing is, and we're going to talk about this in a little bit, there's going to be this question about whether y gets bigger as you go up in an image, which is like what you learned in grade school, right? Y positive goes up. Or maybe a lot of you think of rows going down, and so we'll, we'll have to wrestle with that. And, we also talked about that, even though indexing in a computer world should start at 0, in MATLAB, indexing of arrays starts at 1, and you're sure to screw that up somewhere in your code, but eventually, you'll learn to figure it out.

Computer vision, a rapidly evolving field, has revolutionized the way machines perceive and interpret visual information. At the heart of this transformative technology lies the powerful concept of filters. Filters play a pivotal role in image processing, aiding in tasks such as feature extraction, noise reduction, and image enhancement. In this blog post, we'll delve into the world of filters in computer vision, exploring their significance, types, and applications.

Sections

  • What is a filter
  • Types of Filters
  • Conclusion

Section 1- What is a filter (Mask or Kernel)?

Def: In computer vision, a filter is a mathematical operation that is applied to an image to transform it in some way. Filters are used to extract information from images, enhance features, remove noise, and prepare images for further processing [2].

Def: In the context of computer vision, a filter refers to a mathematical operation applied to an image to enhance or modify certain characteristics. These operations are typically performed using convolution, a process where a small matrix, known as a kernel or filter, is applied to the input image. The convolution operation involves sliding the kernel over the image pixel by pixel and computing a weighted sum of the values in the overlapping region.

Def:a kernel (also known as a filter or mask) is a small matrix used to perform operations on an image. The kernel is a fundamental concept that enables a wide range of image manipulations, from Filtering (i.e. blurring and sharpening to edge detection.)

Def: A kernel is a grid of numbers, usually a small square matrix (e.g., 3x3, 5x5), that slides over an image to apply a specific effect or extract features.

Kernal Function 

Convolution: The process of applying a kernel to an image is called convolution. This involves placing the kernel on a part of the image, performing element-wise multiplication between the kernel values and the corresponding image pixel values, and summing the results to produce a new pixel value in the output image.

Section 2- Types of Filters:

Filtering techniques involve modifying images to enhance or detect specific features. Common filters include blurring, sharpening, and edge detection.

There are many different types of filters used in computer vision, each with a specific purpose. Some common filters include:

Blurring filters are used to reduce noise and unwanted details in an image, creating a smoother appearance. Here are some common types of blurring:

1. Blurring Filters

Blurring filters are used to reduce noise and unwanted details in an image, creating a smoother appearance. Here are some common types of blurring:

 Averaging Blur: This is a simple and fast blurring technique that replaces each pixel with the average intensity of its neighbors within a specified kernel (usually a square).

Gaussian Blur: Similar to averaging, but uses a Gaussian kernel that assigns higher weights closer to the center, resulting in a smoother blur with less pronounced edges Gaussian filter: smooths an image by removing high-frequency noise.

Median Blur: This technique is effective for removing salt-and-pepper noise (randomly distributed black and white pixels) by replacing each pixel with the median intensity value in its neighborhood. Median filter: removes noise from an image by replacing each pixel with the median value of its neighboring pixels.

2. Sharpening Filters

Sharpening filters enhance edges and high-frequency details in an image, making them appear crisper and more defined. Here's a common approach:

Laplacian Filter: This filter highlights edges by emphasizing intensity differences between neighboring pixels Laplacian filter: detects changes in intensity in an image by computing the second derivative of the image.

3. Edge Detection Filters

Edge detection filters identify and localize boundaries between objects in an image. Here are two popular methods:

Sobel Operator: The Sobel filter calculates the gradient of the image intensity at each pixel, which indicates how abrupt the change is at that point. It uses two 3x3 convolution kernels, one for detecting changes in the horizontal direction Gx and one for detecting changes in the vertical direction Gy. Sobel filter: detects edges in an image by computing the gradient of the image in the horizontal and vertical directions.

Canny Edge Detection: This advanced algorithm performs multi-stage processing to detect strong and weak edges while suppressing noise.

Filters work by convolving an image with a small matrix, known as a kernel or a filter. The filter is centered at each pixel of the image, and the values of the neighboring pixels are multiplied by the corresponding values in the filter matrix. The resulting products are then summed, and the sum is used to replace the value of the pixel being processed.

Conclusion:

Filters in computer vision act as powerful tools, shaping the way machines perceive and understand visual information. Whether it's enhancing edges, reducing noise, or extracting meaningful features, filters play a vital role in a wide range of applications. As computer vision continues to advance, the intelligent use of filters will remain at the forefront, unlocking new possibilities for image processing and analysis.

References

1- Introduction of computer Vision (Udacity)

2-Computer Vision Tutorial Series M2C2

Last modified: Saturday, 28 September 2024, 8:56 PM