Hi,
I am using opencv in Visual Studio to detect faces in gray image.
But i get an issue in the attached image.
Here is the code I used.
String face_cascade_name = "[login to view URL]";
String eyes_cascade_name = "[login to view URL]";
CascadeClassifier face_cascade;
CascadeClassifier eyes_cascade;
//-- 1. Load the cascades
if (![login to view URL](face_cascade_name)){ printf("--(!)Error loading\n"); return -1; };
if (![login to view URL](eyes_cascade_name)){ printf("--(!)Error loading\n"); return -1; };
std::vector<Rect> faces;
Mat frame_gray;
if ([login to view URL]() > 1){
cvtColor(frame, frame_gray, CV_BGR2GRAY);
}
else{
frame_gray = frame;
}
equalizeHist(frame_gray, frame_gray);
//-- Detect faces
[login to view URL](frame_gray, faces, 1.1, 2, 0 | CV_HAAR_SCALE_IMAGE, Size(30, 30));
for (size_t i = 0; i < [login to view URL](); i++)
{
Point center(faces[i].x + faces[i].width*0.5, faces[i].y + faces[i].height*0.5);
ellipse(frame, center, Size(faces[i].width*0.5, faces[i].height*0.5), 0, 0, 360, Scalar(255, 0, 255), 4, 8, 0);
Mat faceROI = frame_gray(faces[i]);
std::vector<Rect> eyes;
//-- In each face, detect eyes
[login to view URL](faceROI, eyes, 1.1, 2, 0 | CV_HAAR_SCALE_IMAGE, Size(30, 30));
for (size_t j = 0; j < [login to view URL](); j++)
{
Point center(faces[i].x + eyes[j].x + eyes[j].width*0.5, faces[i].y + eyes[j].y + eyes[j].height*0.5);
int radius = cvRound((eyes[j].width + eyes[j].height)*0.25);
circle(frame, center, radius, Scalar(255, 0, 0), 4, 8, 0);
}
}
//-- Show what you got
imshow("Capture - Face detection", frame);
return [login to view URL]();
If you can fix this bid, then plz bid.
thanks.
Hello, i am good at opencv and face detection.
Relevant Skills and Experience
i have done good face detection. if you want i can provide my face detection library.
Proposed Milestones
$25 AUD - let me discuss about price
i can give you perfect result.
I am post doc researcher at robotic lab in paris. I have great experience on opencv i can fix it.
Relevant Skills and Experience
15 years experience on opencv
Proposed Milestones
$30 AUD - Project delivery
Face detection in opencv is good for some cases but not so robust when compare with others.
Relevant Skills and Experience
I can provide you other options as well if you are interested. I can give you advice which one is better for you. Need demo? Message me and I will prepare for you in no time.
Proposed Milestones
$55 AUD - face detection, computer vision
Additional Services Offered
$10 AUD - Advice for choosing the right tool for face detection
$20 AUD - Maintenance for the app.
Which case do you want to use? If you have more images, I can give you the right tool for you.