Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

meanshift strange for loop

hy, what is this doing in imgproc/src/segmentation.cpp ? 394 for( i = 1; i < size1.height-1; i++, dptr += dstep - (size1.width-2)3, mask += mstep2 ) 395 { 396 for( j = 1; j < size1.width-1; j++, dptr += cn ) 397 { 398 int c0 = dptr[0], c1 = dptr[1], c2 = dptr[2]; 399 mask[j*2 - 1] = cdiff(-3) || cdiff(3) || cdiff(-dstep-3) || cdiff(-dstep) || 400 cdiff(-dstep+3) || cdiff(dstep-3) || cdiff(dstep) || cdiff(dstep+3); 401 } 402 }

meanshift strange for loop

hy, what is this doing in imgproc/src/segmentation.cpp ? ?

Blockquote

394 for( i = 1; i < size1.height-1; i++, dptr += dstep - (size1.width-2)3, mask += mstep2 ) 395 { 396 for( j = 1; j < size1.width-1; j++, dptr += cn ) 397 { 398 int c0 = dptr[0], c1 = dptr[1], c2 = dptr[2]; 399 mask[j*2 - 1] = cdiff(-3) || cdiff(3) || cdiff(-dstep-3) || cdiff(-dstep) || 400 cdiff(-dstep+3) || cdiff(dstep-3) || cdiff(dstep) || cdiff(dstep+3); 401 } 402 }

Blockquote

meanshift strange for loop

hy, what is this doing in imgproc/src/segmentation.cpp ?

Blockquote

394

for( i = 1; i < size1.height-1; i++, dptr += dstep - (size1.width-2)3, (size1.width-2)*3, mask += mstep2 mstep*2 )
395 {
396 {  for( j = 1; j < size1.width-1; j++, dptr += cn )
397  {
398  int c0 = dptr[0], c1 = dptr[1], c2 = dptr[2];
399  mask[j*2 - 1] = cdiff(-3) || cdiff(3) || cdiff(-dstep-3) || cdiff(-dstep) ||
400  cdiff(-dstep+3) || cdiff(dstep-3) || cdiff(dstep) || cdiff(dstep+3);
401 }
402 }

Blockquote

} }