问题
Since the Raw callback from takePhoto is not reliable I have to use the JPEG callback... What I'm basicly getting is a byte array which holds all the information in JPEG data-form. I now need to somehow get this to be only grayscale information with each pixel having a value of 0-255...
At the moment I'm converting the jpeg data array to Bitmap using BitmapFactory.decodeByteArray and then converting the bitmap to grayscale by using getPixel(), which is pretty bad performance wise...
Does anyone have any experience with this?
回答1:
Theoretically, the fastest way would be to just decode the Y component and ignore Cb and Cr in the stream.
来源:https://stackoverflow.com/questions/47139477/what-is-the-fastest-way-to-convert-jpeg-byte-data-to-raw-greyscale-byte-informat