Accessing raw image data?

12 posts / 0 new
Last post
meadowood
meadowood's picture
Offline
Joined: 22 Nov 2011
Posts:
Accessing raw image data?

From CameraDemo example, you can get an image handle by calling maCameraSnapshot and then maCreateImageFromData. I am wondering if there is an API or a member variable which exposes raw image data?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
meadowood
meadowood's picture
Offline
Joined: 22 Nov 2011
Posts:

If anybody could confirm whether this is doable or not, that will be very helpful. I need to access raw image data to do some image processing.

Sam Pickard
rival's picture
Online
Mobile Archmage
Joined: 19 Mar 2009
Posts:

I'll experiment. I'm pretty sure that maCameraSnapshot data won't be raw - I'll be jpeg encoded most likely, but maCreateImageFromData may produce the bitmap.

Diego Velazquez
diegolv's picture
Offline
Mobile Wizard
Joined: 4 Oct 2010
Posts:

Hi,

maCameraSnapshot can return both RAW and JPEG in Android.

Regards,

Diego

meadowood
meadowood's picture
Offline
Joined: 22 Nov 2011
Posts:

Thanks! Getting a raw bitmap pointer from maCreateImageFromData is totally fine.

meadowood
meadowood's picture
Offline
Joined: 22 Nov 2011
Posts:

I see. How can I access the raw data from maCameraSnapshot?

Sam Pickard
rival's picture
Online
Mobile Archmage
Joined: 19 Mar 2009
Posts:

maCameraSnapshop() populates a MoSync handle (MAHandle). You can copy the contents of the handle into a byte array.

MAHandle imageData = maCreatePlaceholder();
maCameraSnapshot(<format>, imageData);
byte rawData[maGetDataSize(imageData);
maReadData(imageData, rawData, 0, maGetDataSize(imageData));

meadowood
meadowood's picture
Offline
Joined: 22 Nov 2011
Posts:

Thanks! I will try this!

vijay_yande
vijay_yande's picture
Offline
Joined: 3 Feb 2011
Posts:

Any idea how to access Actual Files like we do in C/C++. e.g. using File IO (fopen)

vijay_yande
vijay_yande's picture
Offline
Joined: 3 Feb 2011
Posts:

Any idea how to access Actual Files like we do in C/C++. e.g. using File IO (fopen)

vijay_yande
vijay_yande's picture
Offline
Joined: 3 Feb 2011
Posts:

Any idea how to access Actual Files like we do in C/C++. e.g. using File IO (fopen)

Sam Pickard
rival's picture
Online
Mobile Archmage
Joined: 19 Mar 2009
Posts:

Yep - look at the 'FileSystem' section here http://www.mosync.com/files/imports/doxygen/latest/html/index.html

In particular, look at maFileOpen http://www.mosync.com/files/imports/doxygen/latest/html/maapi_8h.html#a6007ebe538825f7d8c1954a441a943e5