Commit a9687a34 authored by Andrey Pavlenko's avatar Andrey Pavlenko

adding more than 4 channels random Mats support

if `Scalar:all` is used, Mats with 5+ channels cause errors
parent ae9d24d4
......@@ -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<int>& 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]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment