Package algorithm
Class ImageDataProcessor
java.lang.Object
algorithm.ImageDataProcessor
ImageDataProcessor accesses AbstractImageSource to control the connection and read images.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
static BufferedImage
Mat2BufferedImage
(org.opencv.core.Mat matrix) static javafx.scene.image.Image
boolean
openConnection
(VideoSource source) boolean
openConnection
(VideoSource source, int deviceId) Sets the type of image source depending on parameters source and deviceId and prepares the connection.javafx.scene.image.Image
readImg()
Reads an image from video source and crops it.org.opencv.core.Mat
readMat()
void
setBottomCrop
(int bottomCrop) void
setFilePath
(String filePath) void
setLeftCrop
(int leftCrop) void
setRightCrop
(int rightCrop) void
setTopCrop
(int topCrop)
-
Constructor Details
-
ImageDataProcessor
public ImageDataProcessor()
-
-
Method Details
-
setTopCrop
public void setTopCrop(int topCrop) -
setBottomCrop
public void setBottomCrop(int bottomCrop) -
setLeftCrop
public void setLeftCrop(int leftCrop) -
setRightCrop
public void setRightCrop(int rightCrop) -
setFilePath
-
getFilePath
-
isConnected
public boolean isConnected() -
Mat2BufferedImage
-
Mat2Image
-
readImg
public javafx.scene.image.Image readImg()Reads an image from video source and crops it. The matrix is then converted to a JavaFx image- Returns:
- Image
-
readMat
public org.opencv.core.Mat readMat() -
openConnection
-
openConnection
Sets the type of image source depending on parameters source and deviceId and prepares the connection.- Parameters:
source
- Input devicedeviceId
- ID of the device (default: 0)
-
closeConnection
public boolean closeConnection()
-