diff --git a/openbr/openbr_plugin.h b/openbr/openbr_plugin.h index 3b62676..6472337 100644 --- a/openbr/openbr_plugin.h +++ b/openbr/openbr_plugin.h @@ -856,7 +856,7 @@ struct Factory else qFatal("%s registry does not contain object named: %s", qPrintable(baseClassName()), qPrintable(name)); } T *object = registry->value(name)->_make(); - object->init(file); + static_cast(object)->init(file); return object; } //! [Factory make] diff --git a/openbr/plugins/meta.cpp b/openbr/plugins/meta.cpp index fecc52b..7d61341 100644 --- a/openbr/plugins/meta.cpp +++ b/openbr/plugins/meta.cpp @@ -274,6 +274,11 @@ class ContractTransform : public UntrainableMetaTransform foreach (const Template & t, src) { out.merge(t); } + out.file.clearRects(); + foreach (const Template & t, src) { + if (!t.file.rects().empty()) + out.file.appendRects(t.file.rects()); + } dst.clear(); dst.append(out); }