From a9687a341e63f969c01ee0ce74139c1a9dab2178 Mon Sep 17 00:00:00 2001 From: Andrey Pavlenko Date: Wed, 18 Dec 2013 17:27:39 +0400 Subject: [PATCH] adding more than 4 channels random Mats support if `Scalar:all` is used, Mats with 5+ channels cause errors --- modules/ts/src/ts_func.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ts/src/ts_func.cpp b/modules/ts/src/ts_func.cpp index 5900637c3..44f3e483f 100644 --- a/modules/ts/src/ts_func.cpp +++ b/modules/ts/src/ts_func.cpp @@ -116,7 +116,7 @@ Mat randomMat(RNG& rng, Size size, int type, double minVal, double maxVal, bool Mat m(size0, type); - rng.fill(m, RNG::UNIFORM, Scalar::all(minVal), Scalar::all(maxVal)); + rng.fill(m, RNG::UNIFORM, minVal, maxVal); if( size0 == size ) return m; return m(Rect((size0.width-size.width)/2, (size0.height-size.height)/2, size.width, size.height)); @@ -142,7 +142,7 @@ Mat randomMat(RNG& rng, const vector& size, int type, double minVal, double Mat m(dims, &size0[0], type); - rng.fill(m, RNG::UNIFORM, Scalar::all(minVal), Scalar::all(maxVal)); + rng.fill(m, RNG::UNIFORM, minVal, maxVal); if( eqsize ) return m; return m(&r[0]);