Image Processing on Android -


i'm writing application android. need make image processing on picture taken camera. use camera.picturecallback photo, , picture in byte array. problem want make operations on every pixel of photo (some filtering , other stuff) guess, have photo in byte array not bad idea. don't know how interpret information in byte array... way know make processing use bitmapfactory.decodebytearray() , use bitmap object. way handle lot of image processing? right use this:

bitmap mphotopicture mphotopicture = bitmapfactory.decodebytearray(imagedata, 0 , imagedata.length);

mphotopicture = mphotopicture.copy(bitmap.config.rgb_565, true);

i appreciate help.

i'm not sure if decoding byte array best way on android, can offer know image processing in general.

if you're using rgb_565, means each pixel 16 bits, or 2 of bytes. first 5 bits red, next 6 green, , last 5 blue. dealing hairy in java. suggest work easier format argb_8888, mean have 32 bits, or 4 bytes per pixel, , each byte own value (alpha, red, green, blue).

to test, try setting every fourth byte, [3], [7], [11], etc., 0. should take out of particular channel, in case, blue.

[2], [6], [10], etc. green values each pixel.

(note, 4 components might go in opposite order because i'm not sure endianness! might have told how take out alpha, not blue…)


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -