Is there no lossless camera picture format?
Camera.Parameters uses:
setPictureFormat (int pixel_format)
where pixel_format can have the following values:
ImageFormat.NV21
ImageFormat.RGB_565
ImageFormat.JPEG
All of those formats seem to interpolate a single color value across multiple pixels. That is, the color of a certain pixel can change if the color of the pixel next to it changes. I want to automatically analyze image data, so this would introduce sever complications for me! I don't care what it looks like to human eyes. I want to identify and follow certain edges in photos.
ImageFormat uses also NV16, YUY2, YV12 which also interpolate single color values over neighboring pixels.
Doesn't Android support any lossless image format for cameras??? :(-:
Re: Is there no lossless camera picture format?
Quote:
That is, the color of a certain pixel can change if the color of the pixel next to it changes.
I'm not sure I follow this. Why would a pixel change?
Related to this is what you mean by "lossless". Certainly the images will not contain all the colour information of physical reality, but the device takes a picture and then you have access to the raw image data, a scaled fully processed postview image, and a compressed jpeg image.
Whatever the processing that is done or the formatting, the values of the pixels don't change unless you change them.
Re: Is there no lossless camera picture format?
It's called "interleaved U/V plane with 2x2 subsampling"
I know about YUY2. It has three values to determine a certain color: Y, U and V.
Y can be thought of as the light strength and Y-values alone is a monochrome black-and-white image.
U and V can be thought of as 2 different colors, a bit like RGB-values represent 3 different colors. But while each pixel has its own Y-value, a U-value is always the same for two neighboring pixels. Same with V-values.
Now imagine a white edge in a picture which I want to detect and follow. Imagine it crosses a background. Imagine that with a 24 bit RGB format, on one pixel line, the white edge pixel would be neighbor with a green background pixel. On the pixel line above it, a white edge pixel would be neighbor with a red background pixel. Then with YUY2 (or NV21 or RGB565) neither of the pixels on the white edge will be white. One will have its U- and V-values mixed with green, the other with red. That makes it harder for me to know if there actually is a white pixel involved there or not.
Now, with a reasonable resolution, there will likely be plenty of white-white pixels somewhere around there for my purposes. But it still messes up the edges with randomly mixed white-green and white-red color noise which doesn't exist in the real world. Maybe I could simply double the horizontal resolution and treat every four bytes as one unique pixel, averaging the both Y-values? Hmmm...