razibmimran / javacv

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

Buffer nor large enough for pixels.. #285

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When I tried to convert Bitmap to IplImage in Javacv Android app, I got an 
error: "Buffered not large enough for pixels"..

My code is this:

String imageInSD = "/mnt/sdcard/DCIM/100MEDIA/pixx.jpg";

Bitmap bitmap = Bitmap.createBitmap(660, 660, Bitmap.Config.ARGB_8888);

bitmap = BitmapFactory.decodeFile(imageInSD);

IplImage image = IplImage.create(bitmap.getWidth(),bitmap.getHeight() , 
IPL_DEPTH_8U, 4);

bitmap.copyPixelsToBuffer(image.getByteBuffer());// Got error here

Original issue reported on code.google.com by hnfarid...@gmail.com on 27 Feb 2013 at 11:25

GoogleCodeExporter commented 9 years ago
Could you find what buffer size it expects?

Original comment by samuel.a...@gmail.com on 27 Feb 2013 at 11:29

GoogleCodeExporter commented 9 years ago
No, I can't find out that..

Original comment by hnfarid...@gmail.com on 27 Feb 2013 at 4:12

GoogleCodeExporter commented 9 years ago
No, I can't find out that..

Original comment by hnfarid...@gmail.com on 27 Feb 2013 at 4:17

GoogleCodeExporter commented 9 years ago
Can you call "bitmap.getByteCount()" and let me know what that returns?

Can you also do the same with "image.getByteBuffer().capacity()"?

Original comment by samuel.a...@gmail.com on 28 Feb 2013 at 2:52

GoogleCodeExporter commented 9 years ago
Application crashed when I used bitmap.getByteCount() or 
image.getByteBuffer().capacity()...

Really stuck just because of this... :(

Original comment by hnfarid...@gmail.com on 28 Feb 2013 at 7:54

GoogleCodeExporter commented 9 years ago
If android.graphics.Bitmap doesn't work -- which has nothing to do with JavaCV 
-- I'm afraid that the problem is unrelated to JavaCV. When you fix whatever 
isn't working with your Android installation, JavaCV should work, then.

Original comment by samuel.a...@gmail.com on 28 Feb 2013 at 8:17

GoogleCodeExporter commented 9 years ago
yeah this is the problem with android..

Is there any other way to get image in IplImage in android..??

Original comment by hnfarid...@gmail.com on 28 Feb 2013 at 8:19

GoogleCodeExporter commented 9 years ago
Do you mean something like cvLoadImage("/mnt/sdcard/DCIM/100MEDIA/pixx.jpg") ?

Original comment by samuel.a...@gmail.com on 28 Feb 2013 at 8:21

GoogleCodeExporter commented 9 years ago
does cvloadimage works on android..??

Original comment by hnfarid...@gmail.com on 28 Feb 2013 at 8:28

GoogleCodeExporter commented 9 years ago
Let me know if it doesn't

Original comment by samuel.a...@gmail.com on 28 Feb 2013 at 9:39

GoogleCodeExporter commented 9 years ago
Its not working...

Basically i want to create an app on which i have to open a image from sdcard 
and then detect faces..

But I am stuck on IplImage on android..

Face detection using javacv on desktop was quite easy...

Original comment by hnfarid...@gmail.com on 28 Feb 2013 at 10:28

GoogleCodeExporter commented 9 years ago
That's OK, but first please make sure you followed the instructions in the 
README.txt file, and like I said please ask your questions on the mailing list 
if possible

Original comment by samuel.a...@gmail.com on 2 Mar 2013 at 1:19

GoogleCodeExporter commented 9 years ago
I read all the instruction in Readme.txt file..
other things of javacv works fine for me except this..

I don't know how to post in mailing list, I will ask question there if u just 
give me a path to that..

Original comment by hnfarid...@gmail.com on 2 Mar 2013 at 7:25

GoogleCodeExporter commented 9 years ago
It's all in the README.txt file

Original comment by samuel.a...@gmail.com on 10 Mar 2013 at 2:06