How to make Rect transparent in opencv

Home / opencv / How to make Rect transparent in opencv

I looked at the OpenCV Java doc for help with loading in images onto a frame. I did this by using frame however as my picture is transparent, the image has a black background inside its rectangular container. This is my Rect function :
Mat submat = src.submat(new(Rect((int) facesArray[i].tl().x, (int) facesArray[i].tl().y, (int)(facesArray[i].br().x- facesArray[i].tl().x), (int)(facesArray[i].br().y- facesArray[i].tl().y));

Is there a way to set the background of the image to be transparent (I want to remove the black background and make it transparent). Please see the link for more info.

enter image description here


Read more

Leave a Reply

Your email address will not be published. Required fields are marked *