@Override public void process(GrayU8 binary) { if(copyForPadding) { work.reshape(binary.width + 2, binary.height + 2); ImageMiscOps.copy(0, 0, 1, 1, binary.width, binary.height, binary, work); alg.process(work,1,1); } else { alg.process(binary,adjustX,adjustY); } // create the contours list contours.reset(); PackedSetsPoint2D_I32 points = alg.getExternalContours(); for( int i = 0; i < points.size(); i++ ) { ContourPacked p = contours.grow(); p.externalIndex = i; p.id = i; } }