Ask Your Question
0

How do I blur a section of a Video Feed that I capture through my camera?

asked 2015-04-06 14:00:58 -0600

Ron gravatar image

updated 2015-04-06 15:14:50 -0600

Potato gravatar image

I need to blur out faces from the video feed. I wrote down the code to detect faces. I can also blur the faces individually but I don't know the proper commands to put the blurred face in the same resulting video.

I have one window which shows the original face and another window which shows just the blurred parts (no background), but i want a resulting window which has the background along with the blurred face

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-04-06 23:09:14 -0600

Haris gravatar image

You could use ROI(region of interest) to operate specific portion(rectangular) of Mat,

Assume you already detected face, and got face rect.

     Mat frame; // input frame
     Rect faceRect; //  face rectangle
     .....................
    //face detection
     .....................

     Now apply ROI
     Mat ROI=frame(faceRect); // here you got Mat with face portion, note that any change made on ROI will change the original Mat, that is frame, as it's not a deep copy operation and that's what you required.

    // blur ROI or any do any  other operation
    .............................................
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-04-06 14:00:58 -0600

Seen: 944 times

Last updated: Apr 06 '15