- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2617 Articles for Java
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
252 Views
Thresholding is a simple technique for the segmentation of an image. it is often used to create binary images. In simple thresholding, the pixels greater than a given threshold value will be replaced with a standard value.The threshold() method performs the simple threshold operation on the given image. Following are the parameters of this method −Two Mat objects representing the source and destination images.Two integer variables representing the threshold or the standard value.An integer variable representing the type of the simple threshold.Exampleimport java.awt.Image; import java.awt.image.BufferedImage; import java.io.IOException; import javafx.application.Application; import javafx.embed.swing.SwingFXUtils; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.image.ImageView; import javafx.scene.image.WritableImage; import ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
172 Views
The Scharr operator for edge detections allows you to find the edges in a given image in both horizontal and vertical directions.The Scharr() method of the Imgproc class applies the Scharr edge detection algorithm on the given image. This method accepts −Two Mat objects representing the source and destination images.An integer variable representing the depth of an image.Two double variables to hold the x and y derivatives.Exampleimport org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.highgui.HighGui; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; public class ScharrEdgeDetection { public static void main(String args[]) { //Loading the OpenCV core library System.loadLibrary( Core.NATIVE_LIBRARY_NAME ); ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
628 Views
The Sobel operator for edge detections allows you to find the edges in a given image in both horizontal and vertical directions.The Sobel() method of the Imgproc class applies the Sobel Edge Detection algorithm on the given image. This method accepts −Two Mat objects representing the source and destination images.An integer variable representing the depth of an image.Two double variables to hold the x and y derivatives.Exampleimport org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.highgui.HighGui; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; public class SobelEdgeDetection { public static void main(String args[]) { //Loading the OpenCV core library System.loadLibrary( Core.NATIVE_LIBRARY_NAME ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
196 Views
The distance transform, in general, is a derived representation of a digital image. In this operation, the gray level intensities of the points inside the foreground regions are changed to distance their respective distances from the closest 0 value (boundary).The distanceTransform() method of the Imgproc class applies Distance Transform on the given image, this method accepts −Two Mat objects representing the source and destination images.An integer variable representing the type of the distance transformation to be applied.An integer value representing the mask size to be used.Exampleimport java.awt.Image; import java.awt.image.BufferedImage; import java.io.IOException; import javafx.application.Application; import javafx.embed.swing.SwingFXUtils; import javafx.scene.Group; import javafx.scene.Scene; import ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
223 Views
The Laplacian transform on an image highlights the regions where there is a rapid intensity change. Therefore, it is used to detect edges.The Laplacian() method of the Imgproc class applies Laplacian Transform on the given image, this method accepts −Two Mat objects representing the source and destination images.Four integer variables representing the depth, size, scale and, delta values of the transform.An integer value representing the border.Exampleimport java.awt.Image; import java.awt.image.BufferedImage; import java.io.IOException; import javafx.application.Application; import javafx.embed.swing.SwingFXUtils; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.image.ImageView; import javafx.scene.image.WritableImage; import javafx.stage.Stage; import org.opencv.core.Core; import org.opencv.core.CvType; import org.opencv.core.Mat; import org.opencv.highgui.HighGui; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; public class LaplacianTransform ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
522 Views
The histogram of an image shows the frequency of pixels’ intensity values. In an image histogram, the X-axis shows the gray level intensities and the Y-axis shows the frequency of these intensities and improves the contrast of an image.The equalizeHist() method of the Imgproc method accepts to Mat objects representing the source and destination images, equalizes the histogram of the source matrix and receives it in the destination matrix.Exampleimport java.awt.Image; import java.awt.image.BufferedImage; import java.io.IOException; import javafx.application.Application; import javafx.embed.swing.SwingFXUtils; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.image.ImageView; import javafx.scene.image.WritableImage; import javafx.stage.Stage; import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.highgui.HighGui; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; public class ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
571 Views
You can detect circles in a given image using the Hough circle transform. You can apply Hough Circle transform using the HoughCircles() method, this method accept the following parameters −A Mat object representing the input image.A Mat object to store the output vectors of the found circles.An integers variables representing the detection method.Two double variables representing an inverse ratio of the accumulator resolution to the image resolution and minimum distance between the centers of the detected circles.Exampleimport org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.Point; import org.opencv.core.Scalar; import org.opencv.highgui.HighGui; import org.opencv.imgcodecs.Imgcodecs; import org.opencv.imgproc.Imgproc; import java.awt.Image; import java.awt.image.BufferedImage; import java.io.IOException; import javafx.application.Application; import javafx.embed.swing.SwingFXUtils; ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
164 Views
You can detect straight lines in a given image using the Hough line transform. There are two kinds of Hough Line Transforms available in OpenCV namely, Standard Hough line transform and, Probabilistic Hough Line Transform.You can apply Probabilistic Hough line transform using the HoughLinesP() method of the Imgproc class, this method accepts the following parameters −Two Mat objects representing source image and the vector that stores the parameters (r, Φ) of the lines.Two double variables representing the resolution of the parameters r (pixels) and Φ (radians).An integer representing the minimum number of intersections to “detect” a line.ExampleFollowing Java example detects ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
630 Views
You can detect straight lines in a given image using the Hough line transform. There are two kinds of Hough line transforms available in OpenCV namely, Standard Hough line transform and, Probabilistic Hough Line Transform.You can apply the Standard Hough line transform using the HoughLines() method of the Imgproc class. This method accepts −Two Mat objects representing source image and the vector that stores the parameters (r, Φ) of the lines.Two double variables representing the resolution of the parameters r (pixels) and Φ (radians).An integer representing the minimum number of intersections to “detect” a line.You can apply Probabilistic Hough line ... Read More
![Maruthi Krishna](https://www.tutorialspoint.com/assets/profiles/119958/profile/60_3780337-1641548568.png)
652 Views
Morphological operations are the set of operations that process images according to the given shapes.Erosion − Erosion is a morphological operation during which pixels are removed from the image boundaries.Dilation − During is a morphological operation during which pixels are added to the image boundaries.Where the total number of pixels added/removed depends on the dimensions of the structuring element used.Morphological Opening − During this operation erosion is applied on the given input and on the result dilation is applied. This is used to remove small objects from the foreground of an image.Morphological Closing − During this operation dilation is applied ... Read More