Commit a80bf1d217a904f8ff7ad68a4c5a39bda4b98790
1 parent
f46fec38
Added 0 span option for rndrotate
Showing
1 changed file
with
1 additions
and
1 deletions
openbr/plugins/imgproc/rndrotate.cpp
| ... | ... | @@ -39,7 +39,7 @@ class RndRotateTransform : public UntrainableTransform |
| 39 | 39 | |
| 40 | 40 | void project(const Template &src, Template &dst) const { |
| 41 | 41 | int span = range.first() - range.last(); |
| 42 | - int angle = (rand() % span) + range.first(); | |
| 42 | + int angle = span == 0 ? range.first() : (rand() % span) + range.first(); | |
| 43 | 43 | Mat rotMatrix = getRotationMatrix2D(center == -1 ? Point2f(src.m().rows/2,src.m().cols/2) : OpenCVUtils::toPoint(src.file.points()[center]),angle,1.0); |
| 44 | 44 | warpAffine(src,dst,rotMatrix,Size(src.m().cols,src.m().rows),INTER_LINEAR,BORDER_REFLECT_101); |
| 45 | 45 | ... | ... |