opencv-java / getting-started

Getting started with OpenCV and JavaFX
105 stars 176 forks source link

How to display IplImage in Imageview #11

Closed mahajandhiraj closed 7 years ago

mahajandhiraj commented 7 years ago

I am trying to display IplImage on imageview in application. But Imageview_id.setImage() allows only Image obj as parameter. Is there is another method to display iplImage in imageview ? or How to convert IplImage to Image?

luigidr commented 7 years ago

Hi,

here you can find a method for converting an OpenCV Mat into a JavaFX image: https://github.com/opencv-java/getting-started/blob/master/FXHelloCV/src/it/polito/elite/teaching/cv/utils/Utils.java

You can try if this work with IplImage, as well. Please, notice that this project uses OpenCV 3.x (for Java) and JavaFX 8.

mahajandhiraj commented 7 years ago

channels = original.channels() and
original.get(0, 0, sourcePixels); this two methods => channels() and get() are not predifined for IplImage

@luigidr Do you know any similar methods to replace this methods??

luigidr commented 7 years ago

No, unfortunately I don't know how to replace such methods. IplImage existed for OpenCV 1.x and, perhaps, in some external OpenCV wrappers (in something like JavaCV?).