@@ -1188,6 +1188,7 @@ class IPPCalcHistInvoker :
1188
1188
1189
1189
virtual void operator () (const Range & range) const
1190
1190
{
1191
+ Ipp32s levelNum = histSize + 1 ;
1191
1192
Mat phist (hist->size (), hist->type (), Scalar::all (0 ));
1192
1193
#if IPP_VERSION_X100 >= 900
1193
1194
IppiSize roi = {src->cols , range.end - range.start };
@@ -1196,7 +1197,7 @@ class IPPCalcHistInvoker :
1196
1197
IppiHistogramSpec *pSpec = NULL ;
1197
1198
Ipp8u *pBuffer = NULL ;
1198
1199
1199
- if (ippiHistogramGetBufferSize (ipp8u, roi, &histSize , 1 , 1 , &specSize, &bufferSize) < 0 )
1200
+ if (ippiHistogramGetBufferSize (ipp8u, roi, &levelNum , 1 , 1 , &specSize, &bufferSize) < 0 )
1200
1201
{
1201
1202
*ok = false ;
1202
1203
return ;
@@ -1217,7 +1218,7 @@ class IPPCalcHistInvoker :
1217
1218
return ;
1218
1219
}
1219
1220
1220
- if (ippiHistogramUniformInit (ipp8u, (Ipp32f*)&low, (Ipp32f*)&high, (Ipp32s*)&histSize , 1 , pSpec) < 0 )
1221
+ if (ippiHistogramUniformInit (ipp8u, (Ipp32f*)&low, (Ipp32f*)&high, (Ipp32s*)&levelNum , 1 , pSpec) < 0 )
1221
1222
{
1222
1223
if (pSpec) ippFree (pSpec);
1223
1224
if (pBuffer) ippFree (pBuffer);
@@ -1233,7 +1234,7 @@ class IPPCalcHistInvoker :
1233
1234
#else
1234
1235
CV_SUPPRESS_DEPRECATED_START
1235
1236
IppStatus status = ippiHistogramEven_8u_C1R (src->ptr (range.start ), (int )src->step , ippiSize (src->cols , range.end - range.start ),
1236
- phist.ptr <Ipp32s>(), (Ipp32s*)(Ipp32f*)*levels, histSize , (Ipp32s)low, (Ipp32s)high);
1237
+ phist.ptr <Ipp32s>(), (Ipp32s*)(Ipp32f*)*levels, levelNum , (Ipp32s)low, (Ipp32s)high);
1237
1238
CV_SUPPRESS_DEPRECATED_END
1238
1239
#endif
1239
1240
if (status < 0 )
@@ -1282,15 +1283,15 @@ static bool ipp_calchist(const Mat* images, int nimages, const int* channels,
1282
1283
!accumulate && uniform)
1283
1284
{
1284
1285
ihist.setTo (Scalar::all (0 ));
1285
- AutoBuffer<Ipp32f> levels (histSize[0 ] + 1 );
1286
+ AutoBuffer<Ipp32f> levels (histSize[0 ]);
1286
1287
1287
1288
bool ok = true ;
1288
1289
const Mat & src = images[0 ];
1289
1290
int nstripes = std::min<int >(8 , static_cast <int >(src.total () / (1 << 16 )));
1290
1291
#ifdef HAVE_CONCURRENCY
1291
1292
nstripes = 1 ;
1292
1293
#endif
1293
- IPPCalcHistInvoker invoker (src, ihist, levels, histSize[0 ] + 1 , ranges[0 ][0 ], ranges[0 ][1 ], &ok);
1294
+ IPPCalcHistInvoker invoker (src, ihist, levels, histSize[0 ], ranges[0 ][0 ], ranges[0 ][1 ], &ok);
1294
1295
Range range (0 , src.rows );
1295
1296
parallel_for_ (range, invoker, nstripes);
1296
1297
0 commit comments