public class ComputerVision
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
ComputerVision.Blur
A filter that blurs the image.
|
class |
ComputerVision.Dilate
A filter that dilates the image.
|
class |
ComputerVision.Erode
A filter that erodes the image.
|
class |
ComputerVision.FindContours
A filter that finds contours in the image.
|
class |
ComputerVision.FindEdges
A filter that finds edges in an image.
|
class |
ComputerVision.GaussianBlur
A filter that applies a gaussian blur to an image.
|
class |
ComputerVision.Histogram
A class for creating a histogram from the image.
|
class |
ComputerVision.MakeBGRA
A filter that converts the image to BGRA format (Blue Green Red Alpha).
|
class |
ComputerVision.MakeGray
A filter that converts the image to grayscale.
|
class |
ComputerVision.MakeHSV
A filter that converts the image to HSV (Hue, Saturation, and Value).
|
class |
ComputerVision.MakeYUV
A filter that converts the image to YUV.
|
class |
ComputerVision.MedianBlur
A filter that blurs the image.
|
Constructor and Description |
---|
ComputerVision()
Construct an instance of ComputerVision and load OpenCV.
|
Modifier and Type | Method and Description |
---|---|
org.opencv.core.Mat |
bufferedImage2Mat(java.awt.image.BufferedImage source)
Convert a BufferedImage object to OpenCV's Mat representation.
|
java.awt.image.BufferedImage |
filter(java.awt.image.BufferedImage source,
java.lang.String filterName)
Apply the specified filter to the source image.
|
java.awt.image.BufferedImage |
mat2BufferedImage(org.opencv.core.Mat matrix)
Convert a Mat image into a BufferedImage.
|
void |
setBlurSize(int blurSize)
Set the blur size. 1 to 25.
|
void |
setCannyThreshold(int threshold)
Set the canny edge detection threshold. 10 to 150.
|
void |
setErosionSize(int erosionSize)
Set the erosion size. 0 to 21.
|
java.lang.String |
toString()
Return a string description of the filter.
|
public ComputerVision() throws java.io.IOException
java.io.IOException
- If the shared library cannot be loaded.public java.awt.image.BufferedImage filter(java.awt.image.BufferedImage source, java.lang.String filterName) throws IllegalActionException
source
- The source image to transform.filterName
- The name of the filter.IllegalActionException
- If no filter is found or
there is a problem filtering.public org.opencv.core.Mat bufferedImage2Mat(java.awt.image.BufferedImage source)
source
- BufferedImage inputpublic java.awt.image.BufferedImage mat2BufferedImage(org.opencv.core.Mat matrix)
matrix
- Mat inputpublic void setBlurSize(int blurSize)
blurSize
- The new blur size.public void setCannyThreshold(int threshold)
threshold
- The new thresholdpublic void setErosionSize(int erosionSize)
erosionSize
- The new erosion size.public java.lang.String toString()
toString
in class java.lang.Object