Package adams.data.opencv
Class OpenCVHelper
- java.lang.Object
-
- adams.data.opencv.OpenCVHelper
-
public class OpenCVHelper extends Object
Helper methods for OpenCV.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected static Boolean
m_Available
whether OpenCV is available.
-
Constructor Summary
Constructors Constructor Description OpenCVHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
isAvailable()
Checks whether OpenCV is available.static BufferedImage
toBufferedImage(org.bytedeco.opencv.opencv_core.Mat mat)
Converts the Mat object into a BufferedImage one.static org.bytedeco.opencv.opencv_core.Mat
toMat(BufferedImage image)
Converts the BufferedImage into a Mat object.static OpenCVImageContainer
toOpenCVImageContainer(AbstractImageContainer cont)
Creates anOpenCVImageContainer
container if necessary, otherwise it just casts the object.
-
-
-
Field Detail
-
m_Available
protected static Boolean m_Available
whether OpenCV is available.
-
-
Method Detail
-
isAvailable
public static boolean isAvailable()
Checks whether OpenCV is available.- Returns:
- true if available
-
toBufferedImage
public static BufferedImage toBufferedImage(org.bytedeco.opencv.opencv_core.Mat mat)
Converts the Mat object into a BufferedImage one.- Parameters:
mat
- the matrix to convert- Returns:
- the generated image
-
toMat
public static org.bytedeco.opencv.opencv_core.Mat toMat(BufferedImage image)
Converts the BufferedImage into a Mat object.- Parameters:
image
- the image to convert- Returns:
- the generated object
-
toOpenCVImageContainer
public static OpenCVImageContainer toOpenCVImageContainer(AbstractImageContainer cont)
Creates anOpenCVImageContainer
container if necessary, otherwise it just casts the object.- Parameters:
cont
- the cont to cast/convert- Returns:
- the casted/converted container
-
-