From 51f633f32529f38b6194a3c18579f0fd78320eb7 Mon Sep 17 00:00:00 2001 From: Austin Blanton Date: Tue, 5 Nov 2013 15:38:26 -0500 Subject: [PATCH] Decode and enroll images from strings in C API --- openbr/core/core.cpp | 15 ++++++++++++++- openbr/openbr.cpp | 42 ++++++++++++++++++++++++++++++++++++++++++ openbr/openbr.h | 17 +++++++++++++++++ openbr/openbr_plugin.h | 5 +++++ 4 files changed, 78 insertions(+), 1 deletion(-) diff --git a/openbr/core/core.cpp b/openbr/core/core.cpp index 06b7194..53b034c 100644 --- a/openbr/core/core.cpp +++ b/openbr/core/core.cpp @@ -160,7 +160,7 @@ struct AlgorithmCore data.removeAt(i); const int numFiles = data.size(); - data >> *transform; + enroll(data); g->writeBlock(data); const FileList newFiles = data.files(); @@ -184,6 +184,11 @@ struct AlgorithmCore return fileList; } + void enroll(TemplateList &data) + { + data >> *transform; + } + void retrieveOrEnroll(const File &file, QScopedPointer &gallery, FileList &galleryFiles) { if (!file.getBool("enroll") && (QStringList() << "gal" << "mem" << "template").contains(file.suffix())) { @@ -371,6 +376,14 @@ FileList br::Enroll(const File &input, const File &gallery) return AlgorithmManager::getAlgorithm(gallery.get("algorithm"))->enroll(input, gallery); } +void br::Enroll(const Template &tmpl) +{ + QList