Ask Your Question

Cropping a face out of an image and leave a black rectangle on the original image

asked 2019-03-15 14:47:13 -0500

ray4 gravatar image

I have an image with multiple faces. Each time I detect a face I want to remove the thumbnail and leave a black rectangle where the face was. How do I leave that black rectangle on the original image where the face was? I am am doing this in Java.


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-03-16 02:35:32 -0500

berak gravatar image

it's not very difficult. assuming you get Rect for each face from the detection:

Mat roi = image.submat(rect);
edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-03-15 14:47:13 -0500

Seen: 184 times

Last updated: Mar 16 '19