@@ -127,7 +127,7 @@ namespace
127
127
void minMaxMat (const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat&, double , Stream& stream, int op)
128
128
{
129
129
typedef void (*func_t )(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, Stream& stream);
130
- static const func_t funcs_v1[2 ][7 ] =
130
+ static const func_t funcs_v1[2 ][CV_DEPTH_MAX ] =
131
131
{
132
132
{
133
133
minMaxMat_v1<minimum, uchar>,
@@ -161,8 +161,6 @@ void minMaxMat(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat
161
161
162
162
const int depth = src1.depth ();
163
163
164
- CV_DbgAssert ( depth <= CV_64F );
165
-
166
164
GpuMat src1_ = src1.reshape (1 );
167
165
GpuMat src2_ = src2.reshape (1 );
168
166
GpuMat dst_ = dst.reshape (1 );
@@ -191,6 +189,7 @@ void minMaxMat(const GpuMat& src1, const GpuMat& src2, GpuMat& dst, const GpuMat
191
189
}
192
190
193
191
const func_t func = funcs_v1[op][depth];
192
+ CV_Assert (func);
194
193
195
194
func (src1_, src2_, dst_, stream);
196
195
}
@@ -209,8 +208,10 @@ namespace
209
208
210
209
void minMaxScalar (const GpuMat& src, cv::Scalar value, bool , GpuMat& dst, const GpuMat&, double , Stream& stream, int op)
211
210
{
211
+ CV_DbgAssert ( src.channels () == 1 );
212
+
212
213
typedef void (*func_t )(const GpuMat& src, double value, GpuMat& dst, Stream& stream);
213
- static const func_t funcs[2 ][7 ] =
214
+ static const func_t funcs[2 ][CV_DEPTH_MAX ] =
214
215
{
215
216
{
216
217
minMaxScalar<minimum, uchar>,
@@ -232,12 +233,10 @@ void minMaxScalar(const GpuMat& src, cv::Scalar value, bool, GpuMat& dst, const
232
233
}
233
234
};
234
235
235
- const int depth = src.depth ();
236
-
237
- CV_DbgAssert ( depth <= CV_64F );
238
- CV_DbgAssert ( src.channels () == 1 );
236
+ auto f = funcs[op][src.depth ()];
237
+ CV_Assert (f);
239
238
240
- funcs[op][depth] (src, value[0 ], dst, stream);
239
+ f (src, value[0 ], dst, stream);
241
240
}
242
241
243
242
#endif
0 commit comments