Fixed BackgroundSubstractorMOG2 ocl implementation.
authorGilles Rochefort <gilles@placemeter.com>
Fri, 3 Jun 2016 09:00:31 +0000 (11:00 +0200)
committerGilles Rochefort <gilles@placemeter.com>
Fri, 3 Jun 2016 20:17:22 +0000 (22:17 +0200)
modules/ocl/src/opencl/bgfg_mog.cl

index a3c2619..f18a115 100644 (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++;