Skip to content

Get camera preview output #24

@borgesgabriel

Description

@borgesgabriel

Hi,

I'm having issues obtaining the CameraSource frame passed to the face detector.

I have tried getting the drawing cache from both the GraphicOverlay object on CameraSourcePreview (which contains only the drawn overlay, as expected), and its SurfaceView object (bitmap empty). The drawing cache from the CameraSourcePreview object itself doesn't help, either.

Another path tried was to create a custom detector myself and expose a getFrame() method that returned the last frame passed to the detector. This solution seemed a bit of a workaround and I believe I was getting frames somewhat out of sync, so I pursued it no further.

Finally, I resorted to the following logic: whenever I find a face I deem acceptable to my use case, I submit an async request to take a picture using CameraSource.takePicture(). With this, however, comes a bit of a lag on the preview while the picture is being taken; also, since there's a delay between finding a face I want and taking its picture, the obtained bitmap may not be "acceptable" any more. Finally, in order to track the same face I wanted in the first place (I'm using LargestFaceFocusingProcessor here), I need to pass the detector I'm using on my activity to the object that actually takes the picture and does further processing with that. Overall I'm not sure if that'd be the way to go here.

I'd appreciate any tips on how to proceed with this issue. Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions