Package algorithm
Class ImageDataProcessor
java.lang.Object
algorithm.ImageDataProcessor
ImageDataProcessor accesses AbstractImageSource to control the connection and read images.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanstatic BufferedImageMat2BufferedImage(org.opencv.core.Mat matrix) static javafx.scene.image.ImagebooleanopenConnection(VideoSource source) booleanopenConnection(VideoSource source, int deviceId) Sets the type of image source depending on parameters source and deviceId and prepares the connection.javafx.scene.image.ImagereadImg()Reads an image from video source and crops it.org.opencv.core.MatreadMat()voidsetBottomCrop(int bottomCrop) voidsetFilePath(String filePath) voidsetLeftCrop(int leftCrop) voidsetRightCrop(int rightCrop) voidsetTopCrop(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()
-