Question: Please add these code into my code. Can I get the face detection code that can join with my code. I added the picture of

Please add these code into my code. Can I get the face detection code that can join with my code. I added the picture of my code.
Please don't copy from other post.cuz this is my second time posting. The answer from first time is not working.
I want to do face detection by using keystrokes
(i.e.1,2,3,4etc.)and replace the detected face image
with:
a.A greyscale image
b.A blurred image adjust blurring so your face is not recognisable
c.A colour converted image reuse code from task 9
d.A pixelate image. To perform pixelation use the following approach
i.Run step a so that your image is greyscale
ii.Split the detected face image into 5x5pixel blocks
iii. Calculate the average pixel intensity of each block using image.get(x,
y); or use the pixel array (to access each pixels intensity)
iv.Paint the entire block using the average pixel intensity. Utilise this
command: outimage.set(x,y,avePixInt); or use the pixel array
v.Loop through all blocks repeating steps iii and iv in the lowest row again.
I can only post 5 photos that's why i add first page code in below.
let video;
let snapshot;
let sliderRed;
let sliderGreen;
let sliderBlue;
function setup(){
let canvas = createCanvas(800,500); // Create a canvas for the grid
canvas.parent('canvas-container'); // Append to the HTML container
video = createCapture(VIDEO); // Capture webcam feed
video.size(160,120); // Set the webcam feed resolution to 160x120
video.hide(); // Hide the live video feed (we'll display snapshots instead)
let snapshotButton = select('#snapshotbutton'); // Capture snapshot on button press
snapshotButton.mousePressed(takeSnapshot);
snapshotButton.position(360,30);
sliderRed = createSlider(0,255,128);
sliderRed.position(10,370); // Position of the Red slider
sliderGreen = createSlider(0,255,128);
sliderGreen.position(170,370); // Position of the Green slider
sliderBlue = createSlider(0,255,128);
sliderBlue.position(340,370); // Position of the Blue slider
}
Please add these code into my code. Can I get the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!