How to get real-time image processing using a limited high-speed capture session in Android?

I am working on a project that requires real-time image processing using an Android smartphone (in fact, the Samsung Galaxy S7).

In short, the main requirements / conditions are:

  • I need to capture and process images in real time with a high frame rate (ideally 120 frames per second or 240 frames per second, but 60 frames per second would be a good start);
  • No need to view images on the display;
  • I just need grayscale images (working with nv21 format, this is the first part of the image data). Therefore, for efficiency, I would prefer not to convert images from my own format to jpg, and then decode and calculate data in grayscale,
  • I don’t need high-resolution images (640x480 will be good), and the frame processing itself is relatively simple and can be done very quickly (I just need to scan the data in grayscale and extract some basic information);

I tried using normal capture using Camera2 Api with a surface ImageReader, but the best I could get was 37 frames per second (just capture, not processing), even when turning off automatic control, setting large ranges to request capture, changing exposure time, frame duration, etc.

, CameraConstrainedHighSpeedCaptureSession Camera2 Api. , Android , VIDEO RECORDING. , , createConstrainedHighSpeedCaptureSession , ( MediaRecorder), ( SurfaceView, SurfaceTexture). , / (, ).

(SurfaceView, SurfaceTexture), , 60 ( ). , BufferQueue MediaRecorder, , NDK/JNI. , , , MediaRecorder, .

, ? ? ?

litte FileDescriptor , MediaRecorder , , .

+4

Source: https://habr.com/ru/post/1656274/


All Articles