Is it possible to overlay a transparent image over a live camera view, such that it is overlayed over the captured photo as well?
The transparent image I want to overlay is just the boundary of a polygon in black color, the rest of the image is transparent. Like this:
Using OpenCV4Android, I want to overlay it over live camera preview, such that it is overlayed on the image captured as well (i.e. the polygon is blended over the image captured, I mean the polygon should become a part of the image captured.)
How can I achieve that?
ADDENDUM:
I would simply add the polygon to the live camera preview by overlaying the JavaCameraView
(which is the widget which displays live camera preview/frames) with an ImageView
(Android's image container widget) containing the transparent image to overlay. overlay; by placing them both sequentially in a FrameLayout
, which automatically Z-orders widgets added to it. Then I would separately add the image to overlay into to captured photo.
But the challenge here is:
The polygon in the live camera preview/frames is a guide. Just like the following image has a guide for positioning the face before taking the picture.
Then when the photo is captured, I want the polygon to be overlayed at EXACTLY the position on which it was when the photo was captured.
So how do I achieve this?