From 4f24dc0959f340c345aab6ae9a8846f680da0e0e Mon Sep 17 00:00:00 2001 From: Jonathan Viney Date: Thu, 5 Mar 2015 12:46:07 +1300 Subject: [PATCH] Fix KNN background subtraction not honoring width step. --- modules/video/src/bgfg_KNN.cpp | 85 +++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 42 deletions(-) diff --git a/modules/video/src/bgfg_KNN.cpp b/modules/video/src/bgfg_KNN.cpp index c551ce4..cddd62c 100755 --- a/modules/video/src/bgfg_KNN.cpp +++ b/modules/video/src/bgfg_KNN.cpp @@ -458,10 +458,8 @@ CV_INLINE void uchar nShadowDetection ) { - int size=_src.rows*_src.cols; int nchannels = CV_MAT_CN(_src.type()); - const uchar* pDataCurrent=_src.ptr(0); - uchar* pDataOutput=_dst.ptr(0); + //model uchar* m_aModel=_bgmodel.ptr(0); uchar* m_nNextLongUpdate=_nNextLongUpdate.ptr(0); @@ -509,48 +507,51 @@ CV_INLINE void if (_nLongCounter >= m_nLongUpdate) _nLongCounter = 0; //go through the image - for (long i=0;i