Author: saqibkhan
-
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…
-
Image Compression Technique
An image can easily be compressed and stored through Java. Compression of image involves converting an image into jpg and storing it. In order to compress an image, we read the image and convert into BufferedImage object. Further, we get an ImageWriter from getImageWritersByFormatName() method found in the ImageIO class. From this ImageWriter, create an ImageWriteParam object. Its syntax…