Maruthi Krishna has Published 951 Articles

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

Maruthi Krishna

Maruthi Krishna

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

253 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

713 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

177 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

504 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

124 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

How to alter the sharpness of an image using Java OpenCV library?

Maruthi Krishna

Maruthi Krishna

Updated on 09-Apr-2020 07:55:11

820 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.Exampleimport org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.Size; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; public class AlteringSharpness { ... Read More

How to alter the brightness of an image using Java OpenCV library?

Maruthi Krishna

Maruthi Krishna

Updated on 09-Apr-2020 07:53:00

680 Views

The convertTo() method of the org.opencv.core.Mat class 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 the same size and type as the source matrix.rtype − integer value ... Read More

How to alter the contrast of an image using Java OpenCV library?

Maruthi Krishna

Maruthi Krishna

Updated on 09-Apr-2020 07:47:51

847 Views

The increasing/decreasing of brightness and contrast of an image are the operations that can be achieved by transforming the pixels of the image. this can be expressed in the form of an equation as −g(i, j) = α . f(i, j)+ βWhere, (i, j) are the positions of the pixels.α ... Read More

How to compare two images using Java OpenCV library?

Maruthi Krishna

Maruthi Krishna

Updated on 09-Apr-2020 07:26:47

5K+ Views

To compare two images −Read Both of them using the Image.IO.read() method.Get the height and width of both of them to make sure they are equal.Get the pixel values and, get the RGB values of both of the images.Get the sum of the differences between the RGB values of these ... Read More

How to flip an image using Java OpenCV library?

Maruthi Krishna

Maruthi Krishna

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

712 Views

The flip() method of the Core class of OpenCV flips an image along the x/y axis. This method accepts −A source matrix congaing the data of the original image.An empty destination matrix to hold the data of the resultant image.A flip code to specify the direction of the image (0 ... Read More

Advertisements