From a80bf1d217a904f8ff7ad68a4c5a39bda4b98790 Mon Sep 17 00:00:00 2001 From: Scott Klum Date: Mon, 26 Oct 2015 16:27:12 -0400 Subject: [PATCH] Added 0 span option for rndrotate --- openbr/plugins/imgproc/rndrotate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openbr/plugins/imgproc/rndrotate.cpp b/openbr/plugins/imgproc/rndrotate.cpp index e268dee..580607c 100644 --- a/openbr/plugins/imgproc/rndrotate.cpp +++ b/openbr/plugins/imgproc/rndrotate.cpp @@ -39,7 +39,7 @@ class RndRotateTransform : public UntrainableTransform void project(const Template &src, Template &dst) const { int span = range.first() - range.last(); - int angle = (rand() % span) + range.first(); + int angle = span == 0 ? range.first() : (rand() % span) + range.first(); Mat rotMatrix = getRotationMatrix2D(center == -1 ? Point2f(src.m().rows/2,src.m().cols/2) : OpenCVUtils::toPoint(src.file.points()[center]),angle,1.0); warpAffine(src,dst,rotMatrix,Size(src.m().cols,src.m().rows),INTER_LINEAR,BORDER_REFLECT_101); -- libgit2 0.21.4