Download presentation
Presentation is loading. Please wait.
Published byDominick Ray Modified over 9 years ago
1
Filtering the Images
2
Filtering images using low-pass filters Filtering images using a median filter Applying directional filters to detect edges Computing the Laplacian of an image
3
Definition:- A Filter. =>is an operation that amplifis certain bands of frequencies of an image while blocking (or reducing) other image frequency bands
4
==> is one of the fundamental tasks in signal and image processing Signals : stationary &non stationary
5
Why using filter? It is a process aimed 1- extracting certain aspects of an image that are considered to convey important information in the context of a given application. 2- Filtering removes noise in images, 3- extracts interesting visual features 4- allows image resampling, and so on
8
When we look at an image, we observe how the different gray-level (or colors) are distributed over the image. Images differ from each others because they have a different gray- level distribution
9
One simple way to achieve this goal is to replace each pixel by the average value of the pixels around. The objective of the cv::blur function is to smooth an image by replacing each pixel by the average pixel value computed over a rectangular neighborhood. This low-pass filter is appliedas follows: cv::blur(image,result,cv::Size(5,5)); This kind of fiter is also called a box fiter low pass filter= box fiter
11
problem :-In some cases, it might be desirable to give more importance to the closer pixels in the neighborhood of a pixel. This can be achieved by using a weighted scheme that follows a Gaussian function (a "bell-shaped" function). The cv::GaussianBlur function applies such a fiter and it is called as follows: cv::GaussianBlur(image,result,cv::Size(5,5),1.5);
13
This is like multiplying each neighboring pixel by 1 over the total number of pixels and summing all of these values.
15
Non-linear filters median filters are particularly useful to combat salt-and-pepper noise
16
The call to the median filtering function is done in a way similar to the other filters: cv::medianBlur(image,result,5);
17
The Laplacian is another high pass(high frequancy) it show the edges of image. linear filter that is based on the computation of the image derivatives. As it will be explained, it computes second-order derivatives to measure the curvature of the image function.
18
One derivatives Second derivatives
19
The Open CV function cv :: Laplacian computes the Laplacian of an image. It is very similar to the cv::Sobel function. In fact, it uses the same basic function cv :: getDerivKernels in order to obtain its kernel matrix. The only difference is that there is no derivative order parameters since these ones are by defination second order derivatives. For this operator, we will create a simple class that will encapsulate some useful operations related to the Laplacian.
20
class LaplacianZC { private: // original image cv::Mat img; // 32-bit float image containing the Laplacian cv::Mat laplace; // Aperture size of the laplacian kernel int aperture; public: LaplacianZC() : aperture(3) {} // Set the aperture size of the kernel void setAperture(int a) { aperture= a; } // Compute the floating point Laplacian cv::Mat computeLaplacian(const cv::Mat& image) { // Compute Laplacian cv::Laplacian(image,laplace,CV_32F,aperture); // Keep local copy of the image (used for zero-crossings) img= image.clone(); return laplace; }
22
The function of The Sobel and Laplacian Edge Detectors is do edge detection. But Laplacian Edge Detectors is more showing edge detection than Sobel. It is similar in mask to Sobel that in Sobel the kernel (mask) is 3x3 but compute the Laplacian using larger kernels such as 7x7 kernel. The disadvanteges is more sensitive to image noise because it show clearly the edges. You need specific filter according to need of application
24
In its simplest form, it can be approximated by the following 3x3 kernel: As for the Sobel operator, it is also possible to compute the Laplacian using larger kernels, and since this operator is even more sensitive to image noise.
26
The zero crossing detector looks for places in the Laplacian of an image where the value of the Laplacian passes through zero.Laplacian zero crossings also occur at any place where the image intensity gradient starts increasing or starts decreasing, and this may happen at places that are not obviously edges
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.