Solving how to get the rectangle from OpenCV face track

Hi, I am trying to resolve a puzzle and I need help for figuring out a potential logic for it.

I am detecting a face from video with OpenCV. I want to output only the moving rectangle with the face and to fix it in a superposition in the center of the image.

How can I do it?

You should have the coordinates and size of the rectangle, correct? I would start working with a Rectangle TOP and composite it over your original image.

Or if you have many things to track, you could look at OP Snippets for the Blob Track TOP called “track warping blobs” for a method to render objects over multiple things in your image.

Thank you ben,
I meant I want to transfer the texture from the moving rectangle and what is tracked there and fix it over a new static rectangle, that is in the middle.

I’m not entirely clear on what you’re trying to do but perhaps what you are looking for is the Crop TOP, cropping out just the rectangle you want, then composite this back over your new static rectangle.