You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Is there a performant method to convert a java.awt.image or an array of
floats or int to an IplImage?
I tried set2D, but it's slow, like 7 seconds for 200x200 on 2GHz.
Original issue reported on code.google.com by markus.l...@gmail.com on 20 Apr 2010 at 3:58
The text was updated successfully, but these errors were encountered:
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:58The text was updated successfully, but these errors were encountered: