diff --git a/openbr/frvt2012.cpp b/openbr/frvt2012.cpp index 7a95338..d574755 100644 --- a/openbr/frvt2012.cpp +++ b/openbr/frvt2012.cpp @@ -15,6 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include +#include #include "frvt2012.h" #include "core/distance_sse.h" diff --git a/openbr/openbr_plugin.cpp b/openbr/openbr_plugin.cpp index 272393d..e5d7185 100644 --- a/openbr/openbr_plugin.cpp +++ b/openbr/openbr_plugin.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #ifndef BR_EMBEDDED #include diff --git a/openbr/openbr_plugin.h b/openbr/openbr_plugin.h index 908764a..482a69b 100644 --- a/openbr/openbr_plugin.h +++ b/openbr/openbr_plugin.h @@ -1085,6 +1085,14 @@ public: return dst; } + /*! + * \brief Perform the minimum amount of work necessary to make a + * transform that can be used safely from a different thread than this + * transform. For transforms that aren't time-varying, nothing needs to be + * done, returning this is sufficient. + */ + virtual Transform * smartCopy() { return this;} + protected: Transform(bool independent = true, bool trainable = true); /*!< \brief Construct a transform. */ inline Transform *make(const QString &description) { return make(description, this); } /*!< \brief Make a subtransform. */ @@ -1125,133 +1133,6 @@ inline QDataStream &operator>>(QDataStream &stream, Transform &f) f.load(stream); return stream; } - -/*! - * \brief A br::Transform for which the results of project may change due to prior calls to project - */ -class BR_EXPORT TimeVaryingTransform : public Transform -{ - Q_OBJECT - -public: - virtual bool timeVarying() const { return true; } - - virtual void project(const Template &src, Template &dst) const - { - qFatal("No const project defined for time-varying transform"); - (void) dst; (void) src; - } - - virtual void project(const TemplateList &src, TemplateList &dst) const - { - qFatal("No const project defined for time-varying transform"); - (void) dst; (void) src; - } - - // Get a compile failure if this isn't here to go along with the other - // projectUpdate, no idea why - virtual void projectUpdate(const Template & src, Template & dst) - { - (void) src; (void) dst; - qFatal("do something useful"); - } - - virtual void projectUpdate(const TemplateList &src, TemplateList &dst) - { - foreach (const Template & src_part, src) { - Template out; - projectUpdate(src_part, out); - dst.append(out); - } - } - -protected: - TimeVaryingTransform(bool independent = true, bool trainable = true) : Transform(independent, trainable) {} -}; - -/*! - * \brief A br::Transform expecting multiple matrices per template. - */ -class BR_EXPORT MetaTransform : public Transform -{ - Q_OBJECT - -protected: - MetaTransform() : Transform(false) {} -}; - -/*! - * \brief A br::Transform that does not require training data. - */ -class BR_EXPORT UntrainableTransform : public Transform -{ - Q_OBJECT - -protected: - UntrainableTransform(bool independent = true) : Transform(independent, false) {} /*!< \brief Construct an untrainable transform. */ - -private: - Transform *clone() const { return const_cast(this); } - void train(const TemplateList &data) { (void) data; } - void store(QDataStream &stream) const { (void) stream; } - void load(QDataStream &stream) { (void) stream; } -}; - -/*! - * \brief A br::MetaTransform that does not require training data. - */ -class BR_EXPORT UntrainableMetaTransform : public UntrainableTransform -{ - Q_OBJECT - -protected: - UntrainableMetaTransform() : UntrainableTransform(false) {} -}; - -/*! - * \brief A MetaTransform that aggregates some sub-transforms - */ -class BR_EXPORT CompositeTransform : public TimeVaryingTransform -{ - Q_OBJECT - -public: - Q_PROPERTY(QList transforms READ get_transforms WRITE set_transforms RESET reset_transforms) - BR_PROPERTY(QList, transforms, QList()) - - virtual void project(const Template &src, Template &dst) const - { - if (timeVarying()) qFatal("No const project defined for time-varying transform"); - _project(src, dst); - } - - virtual void project(const TemplateList &src, TemplateList &dst) const - { - if (timeVarying()) qFatal("No const project defined for time-varying transform"); - _project(src, dst); - } - - bool timeVarying() const { return isTimeVarying; } - - void init() - { - isTimeVarying = false; - trainable = false; - foreach (const br::Transform *transform, transforms) { - isTimeVarying = isTimeVarying || transform->timeVarying(); - trainable = trainable || transform->trainable; - } - } - -protected: - bool isTimeVarying; - - virtual void _project(const Template & src, Template & dst) const = 0; - virtual void _project(const TemplateList & src, TemplateList & dst) const = 0; - - CompositeTransform() : TimeVaryingTransform(false) {} -}; - /*! @}*/ /*! diff --git a/openbr/plugins/algorithms.cpp b/openbr/plugins/algorithms.cpp index ab8bc33..9efa8e9 100644 --- a/openbr/plugins/algorithms.cpp +++ b/openbr/plugins/algorithms.cpp @@ -14,7 +14,7 @@ * limitations under the License. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include +#include "openbr_internal.h" namespace br { diff --git a/openbr/plugins/cascade.cpp b/openbr/plugins/cascade.cpp index f8373ee..0c00523 100644 --- a/openbr/plugins/cascade.cpp +++ b/openbr/plugins/cascade.cpp @@ -15,8 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include - +#include "openbr_internal.h" #include "openbr/core/opencvutils.h" #include "openbr/core/resource.h" diff --git a/openbr/plugins/cluster.cpp b/openbr/plugins/cluster.cpp index 7876d69..560709f 100644 --- a/openbr/plugins/cluster.cpp +++ b/openbr/plugins/cluster.cpp @@ -14,7 +14,7 @@ * limitations under the License. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include +#include "openbr_internal.h" #include #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/crop.cpp b/openbr/plugins/crop.cpp index e9cfff4..f0e14ea 100644 --- a/openbr/plugins/crop.cpp +++ b/openbr/plugins/crop.cpp @@ -15,7 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include +#include "openbr_internal.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/ct8.cpp b/openbr/plugins/ct8.cpp index 4fa3660..51d5598 100644 --- a/openbr/plugins/ct8.cpp +++ b/openbr/plugins/ct8.cpp @@ -11,7 +11,7 @@ #include #include #include -#include +#include "openbr_internal.h" #include "core/resource.h" diff --git a/openbr/plugins/cvt.cpp b/openbr/plugins/cvt.cpp index 3a2197a..243851e 100644 --- a/openbr/plugins/cvt.cpp +++ b/openbr/plugins/cvt.cpp @@ -15,8 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include - +#include "openbr_internal.h" #include "openbr/core/opencvutils.h" using namespace cv; diff --git a/openbr/plugins/denoising.cpp b/openbr/plugins/denoising.cpp index 9d76032..03ac646 100644 --- a/openbr/plugins/denoising.cpp +++ b/openbr/plugins/denoising.cpp @@ -15,7 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include +#include "openbr_internal.h" using namespace cv; diff --git a/openbr/plugins/distance.cpp b/openbr/plugins/distance.cpp index c3ef877..cb07e12 100644 --- a/openbr/plugins/distance.cpp +++ b/openbr/plugins/distance.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include "openbr_internal.h" #include "openbr/core/distance_sse.h" #include "openbr/core/qtutils.h" diff --git a/openbr/plugins/draw.cpp b/openbr/plugins/draw.cpp index e35a4ff..7535a6a 100644 --- a/openbr/plugins/draw.cpp +++ b/openbr/plugins/draw.cpp @@ -15,8 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include - +#include "openbr_internal.h" #include "openbr/core/opencvutils.h" using namespace cv; diff --git a/openbr/plugins/eigen3.cpp b/openbr/plugins/eigen3.cpp index c1fbe71..8ee362e 100644 --- a/openbr/plugins/eigen3.cpp +++ b/openbr/plugins/eigen3.cpp @@ -15,7 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include +#include "openbr_internal.h" #include "openbr/core/common.h" #include "openbr/core/eigenutils.h" diff --git a/openbr/plugins/eyes.cpp b/openbr/plugins/eyes.cpp index 8b7d34b..e8e2ae9 100644 --- a/openbr/plugins/eyes.cpp +++ b/openbr/plugins/eyes.cpp @@ -34,8 +34,7 @@ */ #include -#include - +#include "openbr_internal.h" #include "openbr/core/opencvutils.h" using namespace cv; diff --git a/openbr/plugins/fill.cpp b/openbr/plugins/fill.cpp index 81ac706..1614337 100644 --- a/openbr/plugins/fill.cpp +++ b/openbr/plugins/fill.cpp @@ -15,7 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include +#include "openbr_internal.h" using namespace cv; diff --git a/openbr/plugins/filter.cpp b/openbr/plugins/filter.cpp index 32e9ec5..2bc8cd3 100644 --- a/openbr/plugins/filter.cpp +++ b/openbr/plugins/filter.cpp @@ -15,8 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include - +#include "openbr_internal.h" #include "openbr/core/tanh_sse.h" using namespace cv; diff --git a/openbr/plugins/format.cpp b/openbr/plugins/format.cpp index 7fd947d..581577d 100644 --- a/openbr/plugins/format.cpp +++ b/openbr/plugins/format.cpp @@ -19,7 +19,7 @@ #include #endif // BR_EMBEDDED #include -#include +#include "openbr_internal.h" #include "openbr/core/bee.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index 4537aab..07ef58e 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -24,7 +24,7 @@ #include #endif // BR_EMBEDDED #include -#include +#include "openbr_internal.h" #include "NaturalStringCompare.h" #include "openbr/core/bee.h" diff --git a/openbr/plugins/gui.cpp b/openbr/plugins/gui.cpp index c7fdd08..650fd0a 100644 --- a/openbr/plugins/gui.cpp +++ b/openbr/plugins/gui.cpp @@ -4,7 +4,7 @@ #include #include #include -#include +#include "openbr_internal.h" using namespace cv; diff --git a/openbr/plugins/hash.cpp b/openbr/plugins/hash.cpp index 3ff12d1..e3f1a79 100644 --- a/openbr/plugins/hash.cpp +++ b/openbr/plugins/hash.cpp @@ -15,8 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include - +#include "openbr_internal.h" #include "openbr/core/qtutils.h" namespace br diff --git a/openbr/plugins/hist.cpp b/openbr/plugins/hist.cpp index ccbc654..b3efd8b 100644 --- a/openbr/plugins/hist.cpp +++ b/openbr/plugins/hist.cpp @@ -15,8 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include - +#include "openbr_internal.h" #include "openbr/core/common.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/integral.cpp b/openbr/plugins/integral.cpp index 06f53d1..20afb31 100644 --- a/openbr/plugins/integral.cpp +++ b/openbr/plugins/integral.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include "openbr_internal.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/ipc2013.cpp b/openbr/plugins/ipc2013.cpp index 585978a..4f5ce59 100644 --- a/openbr/plugins/ipc2013.cpp +++ b/openbr/plugins/ipc2013.cpp @@ -1,4 +1,4 @@ -#include +#include "openbr_internal.h" #include #include #include diff --git a/openbr/plugins/keypoint.cpp b/openbr/plugins/keypoint.cpp index a14468c..b857aa7 100644 --- a/openbr/plugins/keypoint.cpp +++ b/openbr/plugins/keypoint.cpp @@ -16,8 +16,7 @@ #include #include -#include - +#include "openbr_internal.h" #include "openbr/core/opencvutils.h" using namespace cv; diff --git a/openbr/plugins/lbp.cpp b/openbr/plugins/lbp.cpp index 6b36cca..a455021 100644 --- a/openbr/plugins/lbp.cpp +++ b/openbr/plugins/lbp.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include "openbr_internal.h" using namespace cv; diff --git a/openbr/plugins/mask.cpp b/openbr/plugins/mask.cpp index 5e779af..f9979e8 100644 --- a/openbr/plugins/mask.cpp +++ b/openbr/plugins/mask.cpp @@ -15,7 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include +#include "openbr_internal.h" using namespace cv; diff --git a/openbr/plugins/meta.cpp b/openbr/plugins/meta.cpp index 4c7eee1..7a462f6 100644 --- a/openbr/plugins/meta.cpp +++ b/openbr/plugins/meta.cpp @@ -16,11 +16,11 @@ #include #include -#include - +#include "openbr_internal.h" #include "openbr/core/common.h" #include "openbr/core/opencvutils.h" #include "openbr/core/qtutils.h" +#include "openbr/core/resource.h" using namespace cv; @@ -183,7 +183,6 @@ class PipeTransform : public CompositeTransform } } - protected: // Template list project -- process templates in parallel through Transform::project // or if parallelism is disabled, handle them sequentially @@ -590,6 +589,56 @@ static void _projectList(const Transform *transform, const TemplateList *src, Te } +class TransformCopier : public ResourceMaker +{ +public: + Transform * basis; + TransformCopier(Transform * _basis) + { + basis = _basis; + } + + virtual Transform *make() const + { + return basis->smartCopy(); + } + +}; + +class TimeInvariantWrapperTransform : public MetaTransform +{ +public: + Resource transformSource; + + TimeInvariantWrapperTransform(Transform * basis) : transformSource(new TransformCopier(basis)) + { + baseTransform = basis; + } + + virtual void project(const Template &src, Template &dst) const + { + Transform * aTransform = transformSource.acquire(); + aTransform->projectUpdate(src,dst); + transformSource.release(aTransform); + } + + + void project(const TemplateList &src, TemplateList &dst) const + { + Transform * aTransform = transformSource.acquire(); + aTransform->projectUpdate(src,dst); + transformSource.release(aTransform); + } + + void train(const TemplateList &data) + { + baseTransform->train(data); + } + +private: + Transform * baseTransform; +}; + class DistributeTemplateTransform : public MetaTransform { Q_OBJECT @@ -598,6 +647,16 @@ class DistributeTemplateTransform : public MetaTransform public: + Transform * smartCopy() + { + if (!transform->timeVarying()) + return this; + + DistributeTemplateTransform * output = new DistributeTemplateTransform; + output->transform = transform->smartCopy(); + return output; + } + void train(const TemplateList &data) { transform->train(data); @@ -620,15 +679,6 @@ public: // Process the single elemnt templates in parallel if parallelism is enabled. void project(const TemplateList &src, TemplateList &dst) const { - // Little ugly, but if we own a timeVaryingTransform and this gets called - // cast off the const modifier and use projectUpdate. This allows us to - // act as a single point of entry. - if (transform->timeVarying()) - { - DistributeTemplateTransform * non_const = (DistributeTemplateTransform *) this; - non_const->projectUpdate(src,dst); - return; - } // Pre-allocate output for each template QList output_buffer; output_buffer.reserve(src.size()); @@ -655,15 +705,16 @@ public: void projectUpdate(const TemplateList &src, TemplateList &dst) { - if (!transform->timeVarying()) { - this->project(src, dst); - return; - } - this->transform->projectUpdate(src, dst); + this->project(src, dst); + return; } + void init() + { - private: + if (transform && transform->timeVarying()) + transform = new br::TimeInvariantWrapperTransform(transform); + } }; BR_REGISTER(Transform, DistributeTemplateTransform) diff --git a/openbr/plugins/misc.cpp b/openbr/plugins/misc.cpp index fd682f7..d81c026 100644 --- a/openbr/plugins/misc.cpp +++ b/openbr/plugins/misc.cpp @@ -15,8 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include - +#include "openbr_internal.h" #include "openbr/core/opencvutils.h" using namespace cv; diff --git a/openbr/plugins/mongoose.cpp b/openbr/plugins/mongoose.cpp index bb51223..7b4cc45 100644 --- a/openbr/plugins/mongoose.cpp +++ b/openbr/plugins/mongoose.cpp @@ -1,4 +1,4 @@ -#include +#include "openbr_internal.h" #include namespace br diff --git a/openbr/plugins/nec3.cpp b/openbr/plugins/nec3.cpp index f94f6e0..099138e 100644 --- a/openbr/plugins/nec3.cpp +++ b/openbr/plugins/nec3.cpp @@ -4,7 +4,7 @@ #include -#include +#include "openbr_internal.h" #include "core/resource.h" using namespace br; diff --git a/openbr/plugins/neclatent1.cpp b/openbr/plugins/neclatent1.cpp index 60c5bf7..cf1a461 100644 --- a/openbr/plugins/neclatent1.cpp +++ b/openbr/plugins/neclatent1.cpp @@ -1,4 +1,4 @@ -#include +#include "openbr_internal.h" #include // Necessary to allocate a large memory though the actual template size may be much smaller diff --git a/openbr/plugins/normalize.cpp b/openbr/plugins/normalize.cpp index 1c42e22..a3f4942 100644 --- a/openbr/plugins/normalize.cpp +++ b/openbr/plugins/normalize.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include "openbr_internal.h" #include "openbr/core/common.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/nt4.cpp b/openbr/plugins/nt4.cpp index d6f6cd3..a3ded95 100644 --- a/openbr/plugins/nt4.cpp +++ b/openbr/plugins/nt4.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include "openbr_internal.h" //IRIS #include diff --git a/openbr/plugins/openbr_internal.h b/openbr/plugins/openbr_internal.h new file mode 100644 index 0000000..7c992b6 --- /dev/null +++ b/openbr/plugins/openbr_internal.h @@ -0,0 +1,184 @@ +#ifndef __OPENBR_INTERNAL_H +#define __OPENBR_INTERNAL_H + +#include "openbr/openbr_plugin.h" + +namespace br +{ +/*! + * \brief A br::Transform that does not require training data. + */ +class BR_EXPORT UntrainableTransform : public Transform +{ + Q_OBJECT + +protected: + UntrainableTransform(bool independent = true) : Transform(independent, false) {} /*!< \brief Construct an untrainable transform. */ + +private: + Transform *clone() const { return const_cast(this); } + void train(const TemplateList &data) { (void) data; } + void store(QDataStream &stream) const { (void) stream; } + void load(QDataStream &stream) { (void) stream; } +}; + +/*! + * \brief A br::MetaTransform that does not require training data. + */ +class BR_EXPORT UntrainableMetaTransform : public UntrainableTransform +{ + Q_OBJECT + +protected: + UntrainableMetaTransform() : UntrainableTransform(false) {} +}; + +/*! + * \brief A br::Transform for which the results of project may change due to prior calls to project + */ +class BR_EXPORT TimeVaryingTransform : public Transform +{ + Q_OBJECT + +public: + virtual bool timeVarying() const { return true; } + + virtual void project(const Template &src, Template &dst) const + { + qFatal("No const project defined for time-varying transform"); + (void) dst; (void) src; + } + + virtual void project(const TemplateList &src, TemplateList &dst) const + { + qFatal("No const project defined for time-varying transform"); + (void) dst; (void) src; + } + + // Get a compile failure if this isn't here to go along with the other + // projectUpdate, no idea why + virtual void projectUpdate(const Template & src, Template & dst) + { + (void) src; (void) dst; + qFatal("do something useful"); + } + + virtual void projectUpdate(const TemplateList &src, TemplateList &dst) + { + foreach (const Template & src_part, src) { + Template out; + projectUpdate(src_part, out); + dst.append(out); + } + } + + /*! + *\brief For transforms that don't do any training, this default implementation + * which creates a new copy of the Transform from its description string is sufficient. + */ + virtual Transform * smartCopy() + { + return this->clone(); + } + + +protected: + TimeVaryingTransform(bool independent = true, bool trainable = true) : Transform(independent, trainable) {} +}; + +/*! + * \brief A br::Transform expecting multiple matrices per template. + */ +class BR_EXPORT MetaTransform : public Transform +{ + Q_OBJECT + +protected: + MetaTransform() : Transform(false) {} +}; + +/*! + * \brief A MetaTransform that aggregates some sub-transforms + */ +class BR_EXPORT CompositeTransform : public TimeVaryingTransform +{ + Q_OBJECT + +public: + Q_PROPERTY(QList transforms READ get_transforms WRITE set_transforms RESET reset_transforms) + BR_PROPERTY(QList, transforms, QList()) + + virtual void project(const Template &src, Template &dst) const + { + if (timeVarying()) qFatal("No const project defined for time-varying transform"); + _project(src, dst); + } + + virtual void project(const TemplateList &src, TemplateList &dst) const + { + if (timeVarying()) qFatal("No const project defined for time-varying transform"); + _project(src, dst); + } + + bool timeVarying() const { return isTimeVarying; } + + void init() + { + isTimeVarying = false; + trainable = false; + foreach (const br::Transform *transform, transforms) { + isTimeVarying = isTimeVarying || transform->timeVarying(); + trainable = trainable || transform->trainable; + } + } + + /*! + * \brief Composite transforms need to create a copy of themselves if they + * have any time-varying children. If this object is flagged as time-varying, + * it creates a new copy of its own class, and gives that copy the child transforms + * returned by calling smartCopy on this transforms children + */ + Transform * smartCopy() + { + if (!timeVarying()) + return this; + + QString name = metaObject()->className(); + name.replace("Transform",""); + name += "([])"; + name.replace("br::",""); + CompositeTransform * output = dynamic_cast(Transform::make(name, NULL)); + + if (output == NULL) + qFatal("Dynamic cast failed!"); + + foreach(Transform* t, transforms ) + { + Transform * maybe_copy = t->smartCopy(); + if (maybe_copy->parent() == NULL) + maybe_copy->setParent(output); + output->transforms.append(t->smartCopy()); + } + + output->file = this->file; + output->classes = classes; + output->instances = instances; + output->fraction = fraction; + + output->init(); + + return output; + } + +protected: + bool isTimeVarying; + + virtual void _project(const Template & src, Template & dst) const = 0; + virtual void _project(const TemplateList & src, TemplateList & dst) const = 0; + + CompositeTransform() : TimeVaryingTransform(false) {} +}; + +} + +#endif diff --git a/openbr/plugins/output.cpp b/openbr/plugins/output.cpp index 75d5ad1..33c1f75 100644 --- a/openbr/plugins/output.cpp +++ b/openbr/plugins/output.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include "openbr_internal.h" #include "openbr/core/bee.h" #include "openbr/core/common.h" diff --git a/openbr/plugins/pbd.cpp b/openbr/plugins/pbd.cpp index 14ad713..f3e1089 100644 --- a/openbr/plugins/pbd.cpp +++ b/openbr/plugins/pbd.cpp @@ -2,7 +2,7 @@ #include -#include +#include "openbr_internal.h" #include "core/opencvutils.h" diff --git a/openbr/plugins/pixel.cpp b/openbr/plugins/pixel.cpp index 03f69d1..a4795f4 100644 --- a/openbr/plugins/pixel.cpp +++ b/openbr/plugins/pixel.cpp @@ -14,7 +14,7 @@ * limitations under the License. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include +#include "openbr_internal.h" using namespace cv; diff --git a/openbr/plugins/plugins.cmake b/openbr/plugins/plugins.cmake index 4672098..21af22d 100644 --- a/openbr/plugins/plugins.cmake +++ b/openbr/plugins/plugins.cmake @@ -1,7 +1,7 @@ # Add source to BR_THIRDPARTY_SRC # Add libs to BR_THIRDPARTY_LIBS -file(GLOB PLUGINS plugins/*.cpp) +file(GLOB PLUGINS plugins/*.cpp plugins/*.h) foreach(PLUGIN ${PLUGINS} ${BR_THIRDPARTY_PLUGINS}) get_filename_component(PLUGIN_BASENAME ${PLUGIN} NAME_WE) get_filename_component(PLUGIN_PATH ${PLUGIN} PATH) diff --git a/openbr/plugins/pp5.cpp b/openbr/plugins/pp5.cpp index 36309f6..c8227a0 100644 --- a/openbr/plugins/pp5.cpp +++ b/openbr/plugins/pp5.cpp @@ -11,8 +11,7 @@ #include #include #include -#include - +#include "openbr_internal.h" #include "openbr/core/resource.h" #define TRY(CC) \ diff --git a/openbr/plugins/qtnetwork.cpp b/openbr/plugins/qtnetwork.cpp index 1f717e9..cf80390 100644 --- a/openbr/plugins/qtnetwork.cpp +++ b/openbr/plugins/qtnetwork.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include "openbr_internal.h" using namespace cv; diff --git a/openbr/plugins/quality.cpp b/openbr/plugins/quality.cpp index 92eafcc..6d34ff4 100644 --- a/openbr/plugins/quality.cpp +++ b/openbr/plugins/quality.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include "openbr_internal.h" #include "openbr/core/common.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/quantize.cpp b/openbr/plugins/quantize.cpp index 45fdcbf..2a37edc 100644 --- a/openbr/plugins/quantize.cpp +++ b/openbr/plugins/quantize.cpp @@ -16,7 +16,7 @@ #include #include -#include +#include "openbr_internal.h" #include "openbr/core/common.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/quantize2.cpp b/openbr/plugins/quantize2.cpp index ea9a299..d392810 100644 --- a/openbr/plugins/quantize2.cpp +++ b/openbr/plugins/quantize2.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include "openbr_internal.h" #include "openbr/core/common.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/random.cpp b/openbr/plugins/random.cpp index 1cbeff4..0201710 100644 --- a/openbr/plugins/random.cpp +++ b/openbr/plugins/random.cpp @@ -15,7 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include +#include "openbr_internal.h" #include "openbr/core/common.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/reduce.cpp b/openbr/plugins/reduce.cpp index c17e3cd..70b968e 100644 --- a/openbr/plugins/reduce.cpp +++ b/openbr/plugins/reduce.cpp @@ -14,7 +14,7 @@ * limitations under the License. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include +#include "openbr_internal.h" using namespace cv; diff --git a/openbr/plugins/regions.cpp b/openbr/plugins/regions.cpp index 6608e4c..c3feafb 100644 --- a/openbr/plugins/regions.cpp +++ b/openbr/plugins/regions.cpp @@ -15,7 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include +#include "openbr_internal.h" using namespace cv; diff --git a/openbr/plugins/register.cpp b/openbr/plugins/register.cpp index 4af9f73..0536780 100644 --- a/openbr/plugins/register.cpp +++ b/openbr/plugins/register.cpp @@ -15,7 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include +#include "openbr_internal.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/sentence.cpp b/openbr/plugins/sentence.cpp index 9151364..8f43794 100644 --- a/openbr/plugins/sentence.cpp +++ b/openbr/plugins/sentence.cpp @@ -1,5 +1,5 @@ #include -#include +#include "openbr_internal.h" using namespace cv; diff --git a/openbr/plugins/stasm.cpp b/openbr/plugins/stasm.cpp index 6a386cc..483968d 100644 --- a/openbr/plugins/stasm.cpp +++ b/openbr/plugins/stasm.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include "openbr_internal.h" using namespace cv; diff --git a/openbr/plugins/stream.cpp b/openbr/plugins/stream.cpp index d0debbc..340712e 100644 --- a/openbr/plugins/stream.cpp +++ b/openbr/plugins/stream.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include "openbr_internal.h" #include "openbr/core/common.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/svm.cpp b/openbr/plugins/svm.cpp index aceb2a4..0fc0b0c 100644 --- a/openbr/plugins/svm.cpp +++ b/openbr/plugins/svm.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include "openbr_internal.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/synthetic.cpp b/openbr/plugins/synthetic.cpp index dd4025e..96af658 100644 --- a/openbr/plugins/synthetic.cpp +++ b/openbr/plugins/synthetic.cpp @@ -15,7 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include +#include "openbr_internal.h" #include "openbr/core/opencvutils.h" diff --git a/openbr/plugins/validate.cpp b/openbr/plugins/validate.cpp index 61193e4..ea1b6de 100644 --- a/openbr/plugins/validate.cpp +++ b/openbr/plugins/validate.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include "openbr_internal.h" #include namespace br diff --git a/openbr/plugins/wavelet.cpp b/openbr/plugins/wavelet.cpp index 7fc829d..25c6511 100644 --- a/openbr/plugins/wavelet.cpp +++ b/openbr/plugins/wavelet.cpp @@ -15,7 +15,7 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include -#include +#include "openbr_internal.h" using namespace cv; diff --git a/openbr/plugins/youtube.cpp b/openbr/plugins/youtube.cpp index 54a5d11..7ed114c 100644 --- a/openbr/plugins/youtube.cpp +++ b/openbr/plugins/youtube.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include "openbr_internal.h" #include "openbr/core/common.h"