Task: Create a photobooth programme that directs the user to the centre of the screen, and takes a photo 3 seconds after he/she is in the right position.
- Detection of the face and drawing its perimeters (sensing)
- Different audio tracks triggered based on the position of the user (effecting):
Right – play “move left!”
Left – play “move right!”
Up – play “go down!”
Down – play “go up!”
- Take photo if no audio tracks are triggered for 3 seconds (effecting)
The first part is similar to the previous assignment: using jit.grab and cv.jit.faces to display and detect the human face. Draw out the perimeters of the face.
Using jit.iter, separate the four x and y values of the detected face. Depending on the dimensions and size of your camera window, determine the x and y values for the photobooth (a box area in the middle of the screen).
If the user’s position is out of bounds, the x value will be bigger than or smaller than the designated middle box, and the audio track will be triggered. If the value = 0 or within the perimeters of the box, nothing will happen.
If the user’s position remains within the middle box for more than 3 seconds, a screenshot will be taken and saved onto the desktop!