Commit b05ac3695f46ff3c67dd718bc67e7064172ea2e7

Authored by Scott Klum
1 parent 97156d76

Updated compareBlock to deal with empty templates

openbr/openbr_plugin.cpp
@@ -1269,5 +1269,6 @@ void Distance::compareBlock(const TemplateList &target, const TemplateList &quer @@ -1269,5 +1269,6 @@ void Distance::compareBlock(const TemplateList &target, const TemplateList &quer
1269 { 1269 {
1270 for (int i=0; i<query.size(); i++) 1270 for (int i=0; i<query.size(); i++)
1271 for (int j=0; j<target.size(); j++) 1271 for (int j=0; j<target.size(); j++)
1272 - output->setRelative(compare(target[j], query[i]), i+queryOffset, j+targetOffset); 1272 + if (target[j].isEmpty() || query[i].isEmpty()) output->setRelative(-std::numeric_limits<float>::max(),i+queryOffset, j+targetOffset);
  1273 + else output->setRelative(compare(target[j], query[i]), i+queryOffset, j+targetOffset);
1273 } 1274 }
openbr/plugins/distance.cpp
@@ -56,8 +56,6 @@ private: @@ -56,8 +56,6 @@ private:
56 56
57 float compare(const Template &a, const Template &b) const 57 float compare(const Template &a, const Template &b) const
58 { 58 {
59 - if (a.file.getBool("FTO") || b.file.getBool("FTO")) return -std::numeric_limits<float>::max();  
60 -  
61 if ((a.m().size != b.m().size) || 59 if ((a.m().size != b.m().size) ||
62 (a.m().type() != b.m().type())) 60 (a.m().type() != b.m().type()))
63 return -std::numeric_limits<float>::max(); 61 return -std::numeric_limits<float>::max();
openbr/plugins/quality.cpp
@@ -272,8 +272,6 @@ class HeatMapDistance : public Distance @@ -272,8 +272,6 @@ class HeatMapDistance : public Distance
272 return 0; 272 return 0;
273 } 273 }
274 274
275 - // Switch this to template list version, use compare(template, template) in  
276 - // heat map distance, and index into the proper match probability  
277 void compare(const TemplateList &target, const TemplateList &query, Output *output) const 275 void compare(const TemplateList &target, const TemplateList &query, Output *output) const
278 { 276 {
279 for (int i=0; i<step; i++) { 277 for (int i=0; i<step; i++) {