RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.82k stars 408 forks source link

[Request] Add processors that can alter the image #84

Closed NitroG42 closed 7 years ago

NitroG42 commented 7 years ago

The frame processors is real nice and easy to use, but it lacks one feature, we can't modify the preview image in the renderer.

Either having two kind of processors, or just make the method processFrame return a Frame with the modifier bytearray ?

A good answer to why is : I wanted to add a barcode FrameProcessor to fotoapparat, but also wanted to replicate the behavior of https://github.com/Credntia/MVBarcodeReader that display nice colored rects on the image around the barcodes.

I might be able to do a pull request If needed but that will take time, and I want to know if you think this feature is interesting or not (I think it is).

Also, it might be nice to expose a method to know if the fotoapparat has been started or not.

dmitry-zaitsev commented 7 years ago

Thanks for the suggestion.

Libraries which are working with computer vision (such as barcode detection) are not actually modifying the frame. Instead, they are drawing the overlay on top of the camera preview which is way more efficient (aka fast, aka not-laggy).

We implemented something similar in our FaceDetector where we draw rectangles on top of the camera view. Check it out if you want to get started.