Question: Please use P 5 . js . I want to do face detection by using keystrokes ( i . e . 1 , 2 ,

Please use P5.js .
I want to do face detection by using keystrokes
(i.e.1,2,3,4 etc.) 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 5x5 pixel 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.
Use objectdetect.js or objectdetect.frontalface .
Please add these code into my code . I added the picture of my code.
I can only post the five photos that's why I pasted some part of my code here.
sketch.js
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 use P 5 . js . I want to do face detection

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!