I am trying to first use a facial detection function to detect faces, then create a face colour mask that can be applied to the whole face and neck region using CIELAB colour space. I’m going to run an experiment where participants can flick through images with the same person but different colour masks.
I’ve used the OpenCV package in R to use facial detection in the images. This is the code I got for OpenCV:
image <- load.image("male1.jpg")
temp_file <- tempfile(fileext = ".jpg")
save.image(image, temp_file)
**# Read the image using OpenCV**
img_cv <- ocv_read(temp_file)
#edge detection
ocv_edges(img_cv)
ocv_markers(img_cv)
##find face
faces <- ocv_face(img_cv)
#show locations of faces
facemask <- ocv_facemask(img_cv)
attr(facemask, 'faces')
New contributor
user26387575 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.