Category: 01. Java Digital Image Processing

  • OpenCV Color Space Conversion

    In order to change color space of one image to another using OpenCV, we read image into BufferedImage and convert it into Mat Object. Its syntax is given below − OpenCv allows many color conversion types, all of which can be found in the Imgproc class. Some of the types are described briefly − Sr.No. Color Conversion Type 1…

  • OpenCV GrayScale Conversion

    In order to convert a color image to Grayscale image using OpenCV, we read the image into BufferedImage and convert it into Mat Object. Its syntax is given below − Then you can transform the image from RGB to Grayscale format by using method cvtColor() in the Imgproc class. Its syntax is given below − The method cvtColor() takes three parameters which are the source…

  • Introduction to OpenCV

    OpenCV is released under a BSD license and hence it is free for both academic and commercial use. It has C++, C, Python, and Java interfaces, and it supports Windows, Linux, Mac OS, iOS, and Android. OpenCV was designed for computational efficiency and with a strong focus on real-time applications. Written in optimized C/C++, the…

  • Open Source Libraries

    In this chapter, we explore some of the free image processing libraries that are widely used and can be easily integrated in the project. These libraries include − ImageJ ImageJ is a public domain Java image processing program inspired by NIH Image for the Macintosh. It can display, edit, analyze, process, save, and print 8-bit,…

  • 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.…