Camera frames in a service / background process

后端 未结 2 1621
囚心锁ツ
囚心锁ツ 2020-12-04 02:40

For scientific measurements, I would like to access the camera frames from a service. The idea is to analyze the images coming from the camera in real-time under some condit

2条回答
  •  悲哀的现实
    2020-12-04 03:25

    You can send the preview to a SurfaceTexture instead (setPreviewTexture()). This won't disappear when the app is paused. Requires API 11+.

    You can see various applications of this technique in Grafika, which is generally doing video or GLES manipulation rather than stills, but the idea is similar.

提交回复
热议问题