different filters used in the images.pptx

SamruddhiChillure1 13 views 29 slides Sep 16, 2024
Slide 1
Slide 1 of 29
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29

About This Presentation

image filter


Slide Content

Smoothing with Gaussian

A symmestric Gaussian Kernel, This smoothing kernel forms a weighted average that weights pixel at its centere much more strongly than at its boundaries. Smoothing supresses noise by enforcing the requirement that pixels should look like neighbours. By downweighting distant neighbours in the average ,we can ensure that the requirement that a pixel looks like its neighbors is less striongly imposed on distant neighbors.

The qualitative analysis gives the following

Void cv::GaussianBlur  ( InputArray  src,  OutputArray  dst,  Size  ksize, double sigmaX, double sigmaY=0, int borderType= BORDER_DEFAULT ,  AlgorithmHint  hint= cv::ALGO_HINT_DEFAULT )   Blurs an image using a Gaussian filter.

Gaussian filter: Parameters Size of kernel or mask : Gaussian function has infinite support, but discrete filters use finite kernels. [Source: K. Grauman] Raquel Urtasun (TTI- C) Computer Vision Jan 10, 2013 24 / 82

Gaussian filter: Parameters Variance of the Gaussian : determines extent of smoothing. [Source: K. Grauman] Raquel Urtasun (TTI- C) Computer Vision Jan 10, 2013 25 / 82

Gaussian filter: Parameters [Source: K. Grauman] Raquel Urtasun (TTI- C) Computer Vision Jan 10, 2013 26 / 82

Is this the most general Gaussian? No, the most general form for x ∈ ঩ d N ( x ; µ, Σ) = 1 (2 π ) d / 2 | Σ | 1 / 2 1 2 T − 1 exp − ( x − µ ) Σ ( x − µ ) But the simplified version is typically use for filtering. Raquel Urtasun (TTI- C) Computer Vision Jan 10, 2013 27 / 82

Median Filter: Used primarily for noise reduction, especially for salt-and-pepper noise. It replaces each pixel value with the median value of the neighboring pixels, preserving edges while removing noise.

cv::medianBlur   ( InputArray   src,   OutputArray   dst, int ksize) Blurs an image using the median filter.

Min and Max filters Filters: Minimum and Maximum Morphological image processing is a technique introducing operations for transforming images in a special way which takes image content into account. The most common morphological operations are minimum (also known as erosion) and maximum (dilation) filters. The minimum filter erodes shapes on the image, whereas the maximum filter extends object boundaries. In morphological filters, each pixel is updated based on comparing it against surrounding pixels in the running window. The running window is an image area around a current pixel with a defined radius. For example, if we specify the radius = 1, the running window will be a 3x3 square around the target pixel. Transformations differ for all morphological operations.

The Minimum Filter The transformation replaces the central pixel with the darkest one in the running window. For example, if you have text that is lightly printed, the minimum filter makes letters thicker.

The following code example makes the text bold using the Minimum(Int32) method as shown in the picture below: C# bitmap.Transforms.Minimum(2);

Here is the same example using Minimum transform: C# using (var bitmap = new Bitmap(@"Images\in.png")) using (var minimum = new Minimum()) { minimum.Radius = 2; using (var newbitmap = minimum.Apply(bitmap)) newbitmap.Save(@"Images\Output\out.png"); }

The Maximum Filter The maximum and minimum filters are shift-invariant. Whereas the minimum filter replaces the central pixel with the darkest one in the running window, the maximum filter replaces it with the lightest one. For example, if you have a text string drawn with a thick pen, you can make the sign skinnier.

The following two snippets use the Maximum(Int32) method and the Maximum class, respectively, to make the text lighter: C# bitmap.Transforms.Maximum(2); C# using (var bitmap = new Bitmap(@"Images\in.png")) using (var maximum = new Maximum(2)) using (var newbitmap = maximum.Apply(bitmap)) newbitmap.Save(@"Images\Output\out.png");

The picture below shows the result of these snippets:

Image Blurring (Image Smoothing) Image blurring is achieved by convolving the image with a low-pass filter kernel. It is useful for removing noise. It actually removes high frequency content (eg: noise, edges) from the image. So edges are blurred a little bit in this operation (there are also blurring techniques which don't blur the edges). OpenCV provides four main types of blurring techniques. 1. Averaging This is done by convolving an image with a normalized box filter. It simply takes the average of all the pixels under the kernel area and replaces the central element. This is done by the function cv.blur() or cv.boxFilter(). Check the docs for more details about the kernel. We should specify the width and height of the kernel. A 3x3 normalized box filter would look like the below:

void  cv::Laplacian   ( InputArray   src,   OutputArray   dst, int ddepth, int ksize=1, double scale=1, double delta=0, int borderType= BORDER_DEFAULT )   Calculates the Laplacian of an image.   void   

5. Applications of Filtering in Computer Vision Noise Reduction: Filters like the Gaussian and median filters are used to remove noise from images, making them cleaner for further processing. Feature Extraction: Filters like Gabor and edge detection filters help in identifying important features such as edges, corners, and textures, which are crucial for tasks like object detection and image recognition. Image Enhancement: Filtering techniques enhance the quality of images, making important details more visible. This is particularly useful in medical imaging and satellite imagery. Object Detection: Filtering is a key step in detecting objects within an image by highlighting important features while suppressing irrelevant details. Image Reconstruction: In applications like MRI or CT scanning, filtering helps in reconstructing images from raw data by removing artifacts and enhancing the quality.
Tags