After I rewrote the code over the ‘LiveCamTest’ example, the blurring successfully covered directly over the face as opposed to the previous sketch, where it was askew. For this blog, I am going to talk about the code that I wrote and how it creates the facial blur successfully over the face.
The reason the blur works over the face is due to these lines of code:
The way the code works is to use a ‘get’ type function to grab the square area of the face, then put that square (or ‘rect’) over the detected face at a lower resolution, this is all in real time. The ‘faceGrab’ function ‘grabs’ the detected face and then resizes it, at a lower resolution (“int(faceGrab.width*0.1) , int(faceGrab.width*0.1″), the square over the detection is outputting the resolution of 0.1, creating this pixelated, blur like image (shown above).
Overall I am extremely happy with the outcome of the image because the final design was exactly the same as how I imagined it and there was not much issue when it came to designing the piece.
Here is the whole code that I used to create the sketch: