Maruthi Krishna has Published 558 Articles

How to perform Bitwise XOR operation on two images using Java OpenCV?

Maruthi Krishna

Maruthi Krishna

Updated on 09-Apr-2020 08:46:00

543 Views

You can compute bitwise exclusive or between two images using the bitwise_xor() method of the org.opencv.core.Core class.This method accepts three Mat objects representing the source, destination, and result matrices, calculates the bitwise exclusive or of each element in the source matrices and stores the result in the destination matrix.ExampleIn the following ... Read More

How to draw an ellipse in OpenCV using Java?

Maruthi Krishna

Maruthi Krishna

Updated on 09-Apr-2020 08:27:05

398 Views

The org.opencv.imgproc package of Java OpenCV library contains a class named Imgproc. To draw an ellipse you need to invoke the ellipse() method of this class. This method accepts the following parameters −A Mat object representing the image on which the ellipse is to be drawn.A RotatedRect object (The ellipse ... Read More

How to convert colored image to HLS using Java OpenCV library?

Maruthi Krishna

Maruthi Krishna

Updated on 09-Apr-2020 08:22:22

260 Views

You can convert HLS image to RGB (colored) image by passing Imgproc.COLOR_RGB2HLS as the 3rd parameter to the cvtColor() method.Exampleimport org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; public class HSL2RGB {    public static void main(String args[]) throws Exception {       System.loadLibrary( Core.NATIVE_LIBRARY_NAME );       Mat ... Read More

How to convert HLS to colored image using Java OpenCV library?

Maruthi Krishna

Maruthi Krishna

Updated on 09-Apr-2020 08:20:02

281 Views

The cvtColor() method of the Imgproc class changes/converts the color of the image from one to another. This method accepts three parameters −src − A Matrix object representing source.dst − A Matrix object representing the destination.code − An integer value representing the color of the destination image.You can convert a ... Read More

How to convert HSV to BGR image using Java OpenCV library?

Maruthi Krishna

Maruthi Krishna

Updated on 09-Apr-2020 08:17:14

529 Views

The cvtColor() method of the Imgproc class changes/converts the color of the image from one to another. This method accepts three parameters −src − A Matrix object representing source.dst − A Matrix object representing the destination.code − An integer value representing the color of the destination image.To convert an HSV ... Read More

How to convert HSV to colored image using Java OpenCV library?

Maruthi Krishna

Maruthi Krishna

Updated on 09-Apr-2020 08:14:57

388 Views

The cvtColor() method of the Imgproc class changes/converts the color of the image from one to another. This method accepts three parameters −src − A Matrix object representing source.dst − A Matrix object representing the destination.code − An integer value representing the color of the destination image.To convert an HSV image ... Read More

How to convert RGB image to HSV using Java OpenCV library?

Maruthi Krishna

Maruthi Krishna

Updated on 09-Apr-2020 08:12:00

1K+ Views

The cvtColor() method of the Imgproc class changes/converts the color of the image from one to another. This method accepts three parameters −src − A Matrix object representing source.dst − A Matrix object representing the destination.code − An integer value representing the color of the destination image.To convert an RGB ... Read More

OpenCV JavaFX application to alter the sharpness of an image

Maruthi Krishna

Maruthi Krishna

Updated on 09-Apr-2020 08:09:44

311 Views

Sharpening an image is the opposite of blur. To alter the sharpness of an image using the OpenCV library, you need to smooth/blur it using the Gaussian filter and subtract the smoothed version from the original image.ExampleFollowing is a JavaFX program with two sliders representing the alpha and beta values.import ... Read More

Altering the brightness and contrast of an image using JavaFX and OpenCV

Maruthi Krishna

Maruthi Krishna

Updated on 09-Apr-2020 08:04:37

725 Views

The convertTo() method of the org.opencv.core.Mat class accepts 4 parameters namely: mat(empty matrix), rtype(integer), alpha(integer), beta(integer), in the same order.To increase the brightness − You need to reduce the beta value from 0 towards -255(keeping alpha value 1).To decrease the brightness − You need to increase the beta value from ... Read More

JavaFX example to decrease the brightness of an image using OpenCV.

Maruthi Krishna

Maruthi Krishna

Updated on 09-Apr-2020 07:59:28

260 Views

One way to alter the brightness of an image using Java is to use the convertTo() method. This method performs the required calculations on the given matrix to alter the contrast and brightness of an image. This method accepts 4 parameters −mat − Empty matrix to hold the result with ... Read More

Advertisements