From 2b9685aeb3dcb3ca43049ac2b0eb953b7b6b461d Mon Sep 17 00:00:00 2001 From: Scott Klum Date: Tue, 25 Oct 2016 16:24:04 -0600 Subject: [PATCH] Updated if to consider the condition false if no metadata exists --- openbr/plugins/imgproc/if.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/openbr/plugins/imgproc/if.cpp b/openbr/plugins/imgproc/if.cpp index a19852e..58ba041 100644 --- a/openbr/plugins/imgproc/if.cpp +++ b/openbr/plugins/imgproc/if.cpp @@ -51,14 +51,14 @@ public: if (transform->trainable) { TemplateList passed; for (int i=0; i(key))) + if (data[i].file.contains(key) && compare(data[i].file.get(key))) passed.append(data[i]); transform->train(passed); } } void project(const Template &src, Template &dst) const { - if (compare(src.file.get(key))) + if (src.file.contains(key) && compare(src.file.get(key))) transform->project(src,dst); else dst = src; @@ -67,7 +67,7 @@ public: void project(const TemplateList &src, TemplateList &dst) const { TemplateList ifTrue, ifFalse; foreach (const Template &t, src) { - if (compare(t.file.get(key))) + if (t.file.contains(key) && compare(t.file.get(key))) ifTrue.append(t); else ifFalse.append(t); @@ -83,4 +83,3 @@ BR_REGISTER(Transform, IfTransform) } // namespace br #include "imgproc/if.moc" - -- libgit2 0.21.4