Ask Your Question

Maciejp's profile - activity

2013-12-02 12:56:52 -0600 received badge  Editor (source)
2013-12-02 12:55:51 -0600 asked a question Converting from Image to Mat - JavaFX

Hi,

I have a problem converting data from Image (javafx.scene.image.Image) to Mat. Doing it the other way is quite straightforward:

public Image matToImage(Mat input) {
MatOfByte buf = new MatOfByte();    
Highgui.imencode(".png", input, buf);
return new Image(new ByteArrayInputStream(buf.toArray()));

}