Category: 01. Java Digital Image Processing
-
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…
-
Applying Box Filter
We apply Box filter that blurs an image. A Box filter could be of dimensions 3×3, 5×5, 9×9 etc. We use OpenCV function filter2D to apply Box filter 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. 2 dstIt…
-
Applying Gaussian Filter
In this chapter, we apply Gaussian filter to an image that blurs an image. We are going to use OpenCV function GaussianBlur to apply Gaussian filter 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 sourceIt is…
-
Image Shape Conversion
The shape of the image can easily be changed by using OpenCV. Image can either be flipped, scaled, or rotated in any of the four directions. In order to change the shape of the image, we read the image and convert into Mat object. Its syntax is given below − Flipping an Image OpenCV allows…
-
Basic Thresholding
Thresholding enables to achieve image segmentation in the easiest way. Image segmentation means dividing the complete image into a set of pixels in such a way that the pixels in each set have some common characteristics. Image segmentation is highly useful in defining objects and their boundaries. In this chapter we perform some basic thresholding…
-
Image Pyramids
Image pyramid is nothing but a method to display a multi-resolution image. The lowermost layer is a highest-resolution version of image and the topmost layer is a lowest-resolution version of the image. Image pyramids are used to handle image at different scales. In this chapter we perform some down sampling and up sampling on images.…
-
Adding Border
In this chapter we learn to add different types of borders to an image. We use OpenCV function copyMakeBorder. It 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 topIt is the length in pixels of…