I have a camera preview working and I want to extract the Y value from specific coordinates of my camera preview to determine the luma.
However, I do not know how to create the 'byte[] yuv' parameter for when I pass in values. From the API docs ( http://developer.android.com/reference/android/graphics/YuvImage.html ) it tells me it is the yuv data. So how do I obtain this byte array from my camera preview to create my YuvImage?
Or am I tackling this problem completely wrong?
Thanks in advance.
Normally, the data byte[] that arrives from onPreviewFrame() has luma data packed in a width*height array.
To extract luma(x, y) you can use the following snippet:
You don't need YuvImage for that.