HamoudaOthman / javacv

Automatically exported from code.google.com/p/javacv
GNU General Public License v2.0
0 stars 0 forks source link

android iplimage use? #59

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,
Is there a performant method to convert bitmap or bytebuffer or byte[] (in 
Android) to an IplImage?

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?
I try to view image(iplimage) on android phone.

What version of the product are you using? On what operating system?
javacv-bin-20110219.zip
windows7
eclipse - android

Please provide any additional information below.

Original issue reported on code.google.com by charming...@naver.com on 14 Apr 2011 at 8:26

GoogleCodeExporter commented 9 years ago
Android does not seem to give access to the internal buffer of Bitmap objects. 
I am guessing that, similarly to Java's BufferedImage, some implementations may 
store data in VRAM, which may not always map nicely to a direct Buffer. It 
seems the most efficient, and safe, way requires at least one copy:
    Bitmap.copyPixelsToBuffer(IplImage.getByteBuffer())
byte[] objects also do not map nicely to direct Buffer, and you may copy their 
content this way:
    IplImage.getByteBuffer().put(byte[])

And BTW, this is not an issue with JavaCV, so please post your questions on the 
mailing list next time, thank you.

Original comment by samuel.a...@gmail.com on 15 Apr 2011 at 3:58