diff --git a/modules/gpu/src/cuda/lbp.cu b/modules/gpu/src/cuda/lbp.cu index 9b729fe63..55f5d7512 100644 --- a/modules/gpu/src/cuda/lbp.cu +++ b/modules/gpu/src/cuda/lbp.cu @@ -185,6 +185,7 @@ namespace cv { namespace gpu { namespace device void connectedConmonents(PtrStepSz candidates, int ncandidates, PtrStepSz objects, int groupThreshold, float grouping_eps, unsigned int* nclasses) { + if (!ncandidates) return; int block = ncandidates; int smem = block * ( sizeof(int) + sizeof(int4) ); disjoin<<<1, block, smem>>>(candidates, objects, ncandidates, groupThreshold, grouping_eps, nclasses);