I have done some google-ing around and couldn't find enough information about this format. It is the default format for camera preview. Can anyone suggest good sources of information about it and how to extract data from a photo/preview image with that format? To be more specific, I need the black and white image extracted.

Starting with Android API level 17, the best solution is to use an intrinsic RenderScript - ScriptIntrinsicYuvToRGB. This RenderScript is built-in, so you do not have to write a line of C-like code. See this question for details: How to use ScriptIntrinsicYuvToRGB converting yuv to rgba
– rwongJun 9 '14 at 22:06

The data is in YUV420 format.
If you are only interested in the monochrome channel, i.e. "black and white", then this the first width x height bytes of the data buffer you already have.
The Y channel is the first image plane. It is exactly the grey/intensity/luminosity etc. channel.

Sam how could I remove red and blue color from the nv21. I want to make my image to Greenish( night Vision Effect).
– Xar E AhmerApr 17 '15 at 14:00

@Nepster, I'm not sure off the top of my head. You could use the luminance as the green value by making this change in the above code: out[i] = Color.argb(0xFF, 0, luminance, 0);. Or maybe you could alter the code of a full-colour implementation to discard the blue and red information. I think you should make a new StackOverflow question for that.
– SamApr 20 '15 at 12:02

It works Sam. Thanks a lot. But when i open Front Camera. It rotate the image vertically.(up side down)
– Xar E AhmerApr 20 '15 at 12:45