Interpret raw image data from Android Camera onPictureTaken(byte[] data)

99封情书 提交于 2019-12-10 20:16:51

问题


I'm using the Camera class to take a picture and want to do some processing on the image inside onPictureTaken. How can I interpret the byte array? Is it in RGB format or something else? Thanks.


回答1:


references say it depends on Camera.Parameters (Camera.Parameters), and in this post (Re: FileOutPutstream code from onPictureTaken) they say that you must use the jpeg callback, so i guess it's jpeg.




回答2:


One more solution

mCamera.takePicture(null, null,mPictureCallbackRaw);

where mPictureCallbackRaw is the instance of Camera.PictureCallback

I hope this will also work for you as it worked for me :)



来源:https://stackoverflow.com/questions/4351306/interpret-raw-image-data-from-android-camera-onpicturetakenbyte-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!