I’m using JavaCV for a university project. It is essentially a motion detector.
I use the OpenCVFrameGrabber class to get the frames from a webcam and I want to display the grabbed frames on my GUI.
I’m using SWT and I thought it would be good to display the frames into a Canvas component.
I have a problem because the OpenCVFrameGrabber provides images as instances of the IplImage class and SWT uses org.eclipse.swt.graphics.Image image class.
So I should convert the image someway from IplImage to SWT Image. What is the best way to do this?
I recently converted BufferedImages (AWT) to SWT Image Objects.
I made use of the following snippet: java2s.com
Maybe the code gets you started. Or someone already converted IplImages to BufferedImages, and you could “pipe” these two conversion methods.
Cheers