@@ -15,9 +15,11 @@ namespace op
1515 {
1616 }
1717
18- inline Rectangle<float > getFaceFromPoseKeypoints (const Array<float >& poseKeypoints, const unsigned int personIndex, const unsigned int neck,
19- const unsigned int headNose, const unsigned int lEar, const unsigned int rEar,
20- const unsigned int lEye, const unsigned int rEye, const float threshold)
18+ inline Rectangle<float > getFaceFromPoseKeypoints (const Array<float >& poseKeypoints, const unsigned int personIndex,
19+ const unsigned int neck, const unsigned int headNose,
20+ const unsigned int lEar, const unsigned int rEar,
21+ const unsigned int lEye, const unsigned int rEye,
22+ const float threshold)
2123 {
2224 try
2325 {
@@ -58,13 +60,17 @@ namespace op
5860 {
5961 pointTopLeft.x += (posePtr[lEye*3 ] + posePtr[lEar*3 ] + posePtr[headNose*3 ]) / 3 .f ;
6062 pointTopLeft.y += (posePtr[lEye*3 +1 ] + posePtr[lEar*3 +1 ] + posePtr[headNose*3 +1 ]) / 3 .f ;
61- faceSize += 0 .85f * (getDistance (poseKeypoints, personIndex, headNose, lEye) + getDistance (poseKeypoints, personIndex, headNose, lEar) + getDistance (poseKeypoints, personIndex, neck, headNose));
63+ faceSize += 0 .85f * (getDistance (poseKeypoints, personIndex, headNose, lEye)
64+ + getDistance (poseKeypoints, personIndex, headNose, lEar)
65+ + getDistance (poseKeypoints, personIndex, neck, headNose));
6266 }
6367 else // if(lEyeScoreAbove)
6468 {
6569 pointTopLeft.x += (posePtr[rEye*3 ] + posePtr[rEar*3 ] + posePtr[headNose*3 ]) / 3 .f ;
6670 pointTopLeft.y += (posePtr[rEye*3 +1 ] + posePtr[rEar*3 +1 ] + posePtr[headNose*3 +1 ]) / 3 .f ;
67- faceSize += 0 .85f * (getDistance (poseKeypoints, personIndex, headNose, rEye) + getDistance (poseKeypoints, personIndex, headNose, rEar) + getDistance (poseKeypoints, personIndex, neck, headNose));
71+ faceSize += 0 .85f * (getDistance (poseKeypoints, personIndex, headNose, rEye)
72+ + getDistance (poseKeypoints, personIndex, headNose, rEar)
73+ + getDistance (poseKeypoints, personIndex, neck, headNose));
6874 }
6975 }
7076 // else --> 2 * dist(neck, headNose)
@@ -108,7 +114,7 @@ namespace op
108114 }
109115 }
110116
111- std::vector<Rectangle<float >> FaceDetector::detectFaces (const Array<float >& poseKeypoints, const double scaleInputToOutput ) const
117+ std::vector<Rectangle<float >> FaceDetector::detectFaces (const Array<float >& poseKeypoints) const
112118 {
113119 try
114120 {
@@ -119,7 +125,8 @@ namespace op
119125 // Otherwise, get face position(s)
120126 if (!poseKeypoints.empty ())
121127 for (auto person = 0 ; person < numberPeople ; person++)
122- faceRectangles.at (person) = getFaceFromPoseKeypoints (poseKeypoints, person, mNeck , mNose , mLEar , mREar , mLEye , mREye , threshold) / (float )scaleInputToOutput;
128+ faceRectangles.at (person) = getFaceFromPoseKeypoints (
129+ poseKeypoints, person, mNeck , mNose , mLEar , mREar , mLEye , mREye , threshold);
123130 return faceRectangles;
124131 }
125132 catch (const std::exception& e)
0 commit comments