Author: saqibkhan
-
Create Zooming Effect
Zooming is the process of enlarging an image so that the details in the image become more visible and prominent. We use OpenCV function resize to apply zooming to images. It can be found under Imgproc package. Its syntax is given below − In the resize function, we pass source image, destination image and its size, zooming factor, and the interpolation…
-
Weighted Average Filter
In weighted average filter, we gave more weight to the center value, due to which the contribution of center becomes more than the rest of the values. Due to weighted average filtering, we can control the blurring of image. We use OpenCV function filter2D to apply weighted average filter to images. It can be found under Imgproc package. Its syntax is…
-
Laplacian Operator
Laplacian Operator is also a derivative operator which is used to find edges in an image. The major difference between Laplacian and other operators like Prewitt, Sobel, Robinson, and Kirsch is that these all are first order derivative masks but Laplacian is a second order derivative mask. We use OpenCV function filter2D to apply Laplacian operator to images. It…
-
Robinson Operator
Robinson compass masks are yet another type of derivative masks which are used for edge detection. This operator is also known as direction mask. In this operator we take one mask and rotate it in all the eight major directions to get edges of the eight directions. We are going to use OpenCV function filter2D to apply Robinson operator…
-
Kirsch Operator
Kirsch compass masks are yet another type of derivative mask which are used for edge detection. This operator is also known as direction mask. In this operator we take one mask and rotate it in all the eight compass directions to get edges of the eight directions. We are going to use OpenCV function filter2D to apply Kirsch operator…
-
Sobel Operator
Sobel operator is very similar to Prewitt operator. It is also a derivative mask and is used for edge detection. Sobel operator is used to detect two kinds of edges in an image: Vertical direction edges and Horizontal direction edges. We are going to use OpenCV function filter2D to apply Sobel operator to images. It can be found under Imgproc package.…
-
Prewitt Operator
Prewitt operator is used for edge detection in an image. It detects two types of edges: vertical edges and horizontal edges. We use OpenCV function filter2D to apply Prewitt operator to images. It can be found under Imgproc package. Its syntax is given below − The function arguments are described below − Sr.No. Argument & Description 1 srcIt is source image.…
-
Understand Convolution
Convolution is a mathematical operation on two functions f and g. The function f and g in this case are images, since an image is also a two dimensional function. Performing Convolution In order to perform convolution on an image, following steps are taken − We use OpenCV function filter2D to apply convolution to images. It can be found…
-
Applying Watermark
In this chapter we learn two ways of applying watermark on images. These ways are − Applying Text Watermark We use OpenCV function putText to apply text watermark to image. It can be found under Core package. Its syntax is given below − The parameters of this function are described below − Sr.No. Parameter & Description 1 SourceIt is source image.…
-
Eroding and Dilating
In this chapter we learn apply two very common morphology operators:Dilation and Erosion. We use OpenCV function erode and dilate. They can be found under Imgproc package. Its syntax is given below − The parameters are described below − Sr.No. Parameter & Description 1 sourceIt is Source image. 2 destinationIt is destination image. 3 elementIt is a structuring element used for erosion…