From 49e921ba25e8bca1d4d4d3fa882307c72c1d6e50 Mon Sep 17 00:00:00 2001 From: Scott Klum Date: Mon, 20 Oct 2014 15:59:09 -0400 Subject: [PATCH] Added ScaleTransform --- openbr/plugins/cvt.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+), 0 deletions(-) diff --git a/openbr/plugins/cvt.cpp b/openbr/plugins/cvt.cpp index 2dedfcd..362ca0c 100644 --- a/openbr/plugins/cvt.cpp +++ b/openbr/plugins/cvt.cpp @@ -103,6 +103,26 @@ BR_REGISTER(Transform, CvtUCharTransform) /*! * \ingroup transforms + * \brief Scales using the given factor + * \author Scott Klum \cite sklum + */ +class ScaleTransform : public UntrainableTransform +{ + Q_OBJECT + + Q_PROPERTY(float scaleFactor READ get_scaleFactor WRITE set_scaleFactor RESET reset_scaleFactor STORED false) + BR_PROPERTY(float, scaleFactor, 1.) + + void project(const Template &src, Template &dst) const + { + resize(src, dst, Size(src.m().cols*scaleFactor,src.m().rows*scaleFactor)); + } +}; + +BR_REGISTER(Transform, ScaleTransform) + +/*! + * \ingroup transforms * \brief Split a multi-channel matrix into several single-channel matrices. * \author Josh Klontz \cite jklontz */ -- libgit2 0.21.4