diff --git a/openbr/plugins/crop.cpp b/openbr/plugins/crop.cpp index 456cc50..a4df76a 100644 --- a/openbr/plugins/crop.cpp +++ b/openbr/plugins/crop.cpp @@ -90,6 +90,25 @@ BR_REGISTER(Transform, LimitSizeTransform) /*! * \ingroup transforms + * \brief Enforce a multiple of \em n columns. + * \author Josh Klontz \cite jklontz + */ +class ModTransform : public UntrainableTransform +{ + Q_OBJECT + Q_PROPERTY(int n READ get_n WRITE set_n RESET reset_n STORED false) + BR_PROPERTY(int, n, 1) + + void project(const Template &src, Template &dst) const + { + dst = Mat(src, Rect(0,0,n*(src.m().cols/n),src.m().rows)); + } +}; + +BR_REGISTER(Transform, ModTransform) + +/*! + * \ingroup transforms * \brief Crop out black borders * \author Josh Klontz \cite jklontz */