Closed GoogleCodeExporter closed 9 years ago
This can be done in the usual Java way, by first copying the Image object into a
BufferedImage, and then copying that into an IplImage. Although copying is
efficient,
it still involves two copies, but that's the best that can done. For example,
given
an Image object "image", this should work:
BufferedImage bufferedImage = new BufferedImage(image.getWidth(null),
image.getHeight(null), BufferedImage.TYPE_3BYTE_BGR /* or whatever type you
like */);
Graphics g = bufferedImage.getGraphics();
g.drawImage(image, 0, 0, null);
g.dispose();
IplImage iplImage = IplImage.createFrom(bufferedImage);
Original comment by samuel.a...@gmail.com
on 21 Apr 2010 at 4:41
Original issue reported on code.google.com by
markus.l...@gmail.com
on 20 Apr 2010 at 3:58