| 295 | return mask; |
| 296 | } |
| 297 | |
| 298 | void Extractor::assignRegion() |
| 299 | { |
| 300 | m_facePolygon.reserve(20); |
| 301 | for(int i = 0; i < 20; ++i) |
| 302 | m_facePolygon.push_back(Point(cvRound(points[i].x), cvRound(points[i].y))); |
| 303 | |
| 304 | const int eye_brow_point_count = 6; |
| 305 | m_rightEyeBrowPolygon.reserve(eye_brow_point_count); |
| 306 | m_leftEyeBrowPolygon.reserve(eye_brow_point_count); |
| 307 | for(int i = 20; i < (20 + eye_brow_point_count); ++i) |
| 308 | m_rightEyeBrowPolygon.push_back(Point(cvRound(points[i].x), cvRound(points[i].y))); |
| 309 | for(int i = 26; i < (26 + eye_brow_point_count); ++i) |
| 310 | m_leftEyeBrowPolygon.push_back(Point(cvRound(points[i].x), cvRound(points[i].y))); |
| 311 | |
| 312 | const int eye_point_count = 8; |
| 313 | m_rightEyePolygon.reserve(eye_point_count); |
| 314 | m_leftEyePolygon.reserve(eye_point_count); |
| 315 | for(int i = 34; i < (34 + eye_point_count); ++i) |
| 316 | m_rightEyePolygon.push_back(Point(cvRound(points[i].x), cvRound(points[i].y))); |
| 317 | for(int i = 44; i < (34 + eye_point_count); ++i) |
| 318 | m_leftEyePolygon.push_back(Point(cvRound(points[i].x), cvRound(points[i].y))); |
| 319 | |
| 320 | m_upperLipPolygon.reserve(10); |
| 321 | for(int i = 63; i < 73; ++i) |
| 322 | m_upperLipPolygon.push_back(Point(cvRound(points[i].x), cvRound(points[i].y))); |
| 323 | |
| 324 | m_lowerLipPolygon.reserve(9); |
| 325 | m_lowerLipPolygon.push_back(Point(cvRound(points[63].x), cvRound(points[63].y))); |
| 326 | for(int i = 73; i < 81; ++i) |
| 327 | m_lowerLipPolygon.push_back(Point(cvRound(points[i].x), cvRound(points[i].y))); |
| 328 | |
| 329 | m_mouthPolygon.reserve(12); |
| 330 | for(int i = 63; i < 70; ++i) |
| 331 | m_mouthPolygon.push_back(Point(cvRound(points[i].x), cvRound(points[i].y))); |
| 332 | for(int i = 76; i < 81; ++i) |
| 333 | m_mouthPolygon.push_back(Point(cvRound(points[i].x), cvRound(points[i].y))); |
| 334 | |
| 335 | const int nose_point_count = 10; |
| 336 | m_nosePolygon.reserve(nose_point_count); |
| 337 | int nose_indices[nose_point_count] = {52, 53, 54, 62, 61, 55, 60, 57, 59, 58}; |
| 338 | for(int i = 0; i < nose_point_count; ++i) |
| 339 | { |
| 340 | int j = nose_indices[i]; |
| 341 | m_nosePolygon.push_back(Point(cvRound(points[j].x), cvRound(points[j].y))); |
| 342 | } |
| 343 | |
| 344 | m_rightBlusherPolygon.push_back(Point(cvRound(points[1].x), cvRound(points[1].y))); |
| 345 | m_rightBlusherPolygon.push_back(Point(cvRound(points[2].x), cvRound(points[2].y))); |
| 346 | m_rightBlusherPolygon.push_back(Point(cvRound(points[3].x), cvRound(points[3].y))); |
| 347 | m_rightBlusherPolygon.push_back(Point(cvRound((points[3].x + points[64].x)/2), cvRound((points[3].y + points[64].y)/2))); |
| 348 | m_rightBlusherPolygon.push_back(Point(cvRound(points[62].x), cvRound(points[62].y))); |
| 349 | m_rightBlusherPolygon.push_back(Point(cvRound((points[62].x + points[41].x)/2), cvRound((points[62].y + points[41].y)/2))); |
| 350 | |
| 351 | m_leftBlusherPolygon.push_back(Point(cvRound(points[11].x), cvRound(points[11].y))); |
| 352 | m_leftBlusherPolygon.push_back(Point(cvRound(points[10].x), cvRound(points[10].y))); |
| 353 | m_leftBlusherPolygon.push_back(Point(cvRound(points[9].x), cvRound(points[9].y))); |
| 354 | m_leftBlusherPolygon.push_back(Point(cvRound((points[9].x) + points[68].x)/2, cvRound((points[9].y + points[68].y)/2))); |
nothing calls this directly
no outgoing calls
no test coverage detected