Commit 68a335abe88dcf38c11f2d65e6873d48693c840c
1 parent
1a5a4da1
Only include faces with the 3 landmarks (if requireLandmarks = true)
Showing
1 changed file
with
12 additions
and
5 deletions
openbr/plugins/pp5.cpp
| ... | ... | @@ -309,14 +309,21 @@ class PP5EnrollTransform : public UntrainableMetaTransform |
| 309 | 309 | dst.file = src.file; |
| 310 | 310 | |
| 311 | 311 | dst.file.append(PP5Context::toMetadata(face)); |
| 312 | + dst += m; | |
| 312 | 313 | if (requireLandmarks) { |
| 313 | - QPointF pt = dst.file.get<QPointF>("PP5_Landmark0_Right_Eye"); | |
| 314 | - if (std::isnan(pt.x()) && std::isnan(pt.y())){ | |
| 315 | - dst.file.fte = true; | |
| 314 | + QPointF right = dst.file.get<QPointF>("PP5_Landmark0_Right_Eye"); | |
| 315 | + QPointF left = dst.file.get<QPointF>("PP5_Landmark1_Left_Eye"); | |
| 316 | + QPointF nose = dst.file.get<QPointF>("PP5_Landmark2_Nose_Base"); | |
| 317 | + if (dst.file.get<int>("PP5_Face_NumLandmarks") >= 3 && | |
| 318 | + !( std::isnan(right.x()) && std::isnan(right.y()) && | |
| 319 | + std::isnan(left.x()) && std::isnan(left.y()) && | |
| 320 | + std::isnan(nose.x()) && std::isnan(nose.y()) )) | |
| 321 | + { | |
| 322 | + dstList.append(dst); | |
| 316 | 323 | } |
| 324 | + } else { | |
| 325 | + dstList.append(dst); | |
| 317 | 326 | } |
| 318 | - dst += m; | |
| 319 | - dstList.append(dst); | |
| 320 | 327 | |
| 321 | 328 | // Found a face, nothing else to do (if we aren't trying to find multiple faces). |
| 322 | 329 | if (!Globals->enrollAll) | ... | ... |