Fixed BackgroundSubstractorMOG2 ocl implementation.

This commit is contained in:
Gilles Rochefort 2016-06-03 11:00:31 +02:00
parent 78de75397e
commit 2717ba735a

View File

@ -369,7 +369,6 @@ __kernel void mog2_kernel(__global T_FRAME * frame, __global int* fgmask, __glob
bool fitsPDF = false; //if it remains zero a new GMM mode will be added
int nmodes = modesUsed[y * modesUsed_step + x];
int nNewModes = nmodes; //current number of modes in GMM
float totalWeight = 0.0f;
@ -430,8 +429,6 @@ __kernel void mog2_kernel(__global T_FRAME * frame, __global int* fgmask, __glob
for (int mode = 0; mode < nmodes; ++mode)
weight[(mode * frame_row + y) * weight_step + x] *= totalWeight;
nmodes = nNewModes;
if (!fitsPDF)
{
int mode = nmodes == (NMIXTURES) ? (NMIXTURES) - 1 : nmodes++;