Image Processing in Java – Contrast Enhancement
- Image Processing in Java – Read and Write
- Image Processing In Java – Get and Set Pixels
- Image Processing in Java – Colored Image to Grayscale Image Conversion
- Image Processing in Java – Colored Image to Negative Image Conversion
- Image Processing in Java – Colored to Red Green Blue Image Conversion
- Image Processing in Java – Colored Image to Sepia Image Conversion
- Image Processing in Java – Creating a Random Pixel Image
- Image Processing in Java – Creating a Mirror Image
- Image Processing in Java – Face Detection
- Image Processing in Java – Watermarking an Image
- Image Processing in Java – Changing Orientation of Image
At first, we need to set up OpenCV for Java, we recommend using eclipse for the same since it is easy to use and set up. Now let us understand some of the methods required for enhancing the color of an image. Now let us understand some of the methods required for contrast enhancement.
Method 1: equalizeHist(source, destination): This method resides in Imgproc package of opencv.source parameter is an 8-bit single-channel source image, and the destination parameter is the destination image
Method 2: Imcodecs.imread() or Imcodecs.imwrite(): These methods are used to read and write images as Mat objects which are rendered by OpenCV.
Implementation: Let us take an arbitrary input image which is as follows:
Output: On console
Image Successfully Contrasted
This article is contributed by Pratik Agarwal. If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Please Login to comment...