The second question you asked is relatively easy.  There are two
because one of them will return raw data ignoring the format
(Uncompressed data direct from the camera).  The other actually
follows the format settings.

The first question, however, is more difficult. The only specs I've
been able to find on the 422 is that it's essentially 4 bytes of data
with 2 pixels in it (equating to 6 rgb bytes.  To "decompress" the
data use the following algorithms.

U  = yuv[0]
Y1 = yuv[1]
V  = yuv[2]
Y2 = yuv[3]

Then use equation to convert YUV to RGB is (remember to apply it to
both Y1 and Y2):

R = Y + 1.140V
G = y - (0.395 * U) - (0.581 * V)
B = Y + (2.032 * U)

That, as far as I know, should get you a perfectly usable RGB picture
out of it.

Some notes about the emulator:

It seems when you take a picture, it returns a picture that actually
has many versions of the picture within it.  Not sure why this
happens, probably due to the video of the "capture" being lower res
than the preview pane, thereby making the preview larger than the
rendered video and the system seems to map it over.  Not sure on this,
but it *SHOULD* be all better when we run it on hardware.
Unfortunately, no way to be sure on this until Oct 22.

Now, I may be wrong on any of this, unfortunately I haven't completely
tested it.

On Oct 2, 8:59 am, walterc <[EMAIL PROTECTED]> wrote:
> where is the specs for YCbCr_422_SP pixel format?  i can get the
> preview data and, after some guessing and googling, can display the
> image.  but the image displayed doesnt match the preview display.  i
> am sure my effort to decode the data is at fault but how can i correct
> it?
>
> please give us the spec for the documented pixel formats or your
> effort to come up with the api doesnt do you (google) and us any good!
>
> btw, please tell me why there are 2 PictureCallback arguments in
> Camera.takePicture(Camera.ShutterCallback shutter,
> Camera.PictureCallback raw, Camera.PictureCallback jpeg) when only one
> picture format will be returned (implied by
> Camera.Parameters.setPictureFormat)?
>
> regards,
>
> walter chang
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to