Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Camera2 taking multiple images in one capture session

Tags:

android

Is it possible to take multiple images in one 'cameraDevice.createCaptureSession' with different focus distances, I'm trying to do some manual autofocus.

I know that I can just use multiple capture sessions and wait for the focus move before capturing the picture but can it be done in a single capture session?

like image 779
Cjen1 Avatar asked Aug 05 '15 15:08

Cjen1


1 Answers

You definitely want to use a single CameraCaptureSession to issue multiple capture requests. Capture Sessions are not created lightly, you should only really be creating a new one when the set of possible output Surfaces has changed.

The framework is designed to get access to a CameraDevice and to open up a single CameraCaptureSession, which is your actual interface to controlling the camera. You tell the Session to initiate captures using .capture(), .captureBurst(),.setRepeatingRequest(), and .setRepeatingBurst() by passing each one appropriately designed CaptureRequests.

Each of the CaptureRequests you issue to the CameraCaptureSession can have whatever set of camera control parameters you want (as long as your device supports them), such as the different focal distances you desire. When issued through the Session, they enter a pipeline and the results should essentially emerge in the same order as you request.

like image 175
rcsumner Avatar answered Nov 01 '22 07:11

rcsumner