diff --git a/openbr/janus.cpp b/openbr/janus.cpp index dd6d332..6dd011b 100644 --- a/openbr/janus.cpp +++ b/openbr/janus.cpp @@ -24,7 +24,10 @@ janus_error janus_initialize(const char *sdk_path, const char *temp_path, const if (algorithm.isEmpty()) { transform.reset(Transform::make("Cvt(Gray)+Affine(88,88,0.25,0.35)+++", NULL)); distance = Distance::fromAlgorithm("FaceRecognition"); - } else { + } else if (algorithm.compare("Component") == 0) { + transform.reset(Transform::make("StasmManual+Cvt(Gray)+", NULL)); + distance = Distance::fromAlgorithm(algorithm); + } else { transform.reset(Transform::make(algorithm + "Enroll", NULL)); distance.reset(Distance::make(algorithm + "Compare", NULL)); } @@ -83,11 +86,14 @@ janus_error janus_augment(const janus_image image, const janus_attribute_list at t.file.contains("LEFT_EYE_Y")) { t.file.set("Affine_0", QPointF(t.file.get("RIGHT_EYE_X") - rect.x(), t.file.get("RIGHT_EYE_Y") - rect.y())); t.file.set("Affine_1", QPointF(t.file.get("LEFT_EYE_X") - rect.x(), t.file.get("LEFT_EYE_Y") - rect.y())); + t.file.set("First_Eye", t.file.get("Affine_0")); + t.file.set("Second_Eye", t.file.get("Affine_1")); t.file.appendPoint(t.file.get("Affine_0")); t.file.appendPoint(t.file.get("Affine_1")); } Template u; transform->project(t, u); + if (u.file.fte) u.m() = cv::Mat(); template_->append(u); return (u.isEmpty() || !u.first().data) ? JANUS_FAILURE_TO_ENROLL : JANUS_SUCCESS; }