// shrink the input image
int nTargetWidth = (int) (imGray.getWidth() / fScale);
int nTargetHeight = (int) (imGray.getHeight() / fScale);
int nStepHoriz = Math.max(1, nTargetWidth / this.nStep);
int nStepVert = Math.max(1, nTargetHeight / this.nStep);
Gray8Shrink gs = new Gray8Shrink(nTargetWidth, nTargetHeight);
gs.push(imGray);
Gray8Image imShrunk = (Gray8Image) gs.getFront();
for (int i=0; i<imShrunk.getWidth()-this.hcc.getWidth(); i+=nStepHoriz) {
// compute left coordinate in original image
int nXPos = (i * imGray.getWidth()) / imShrunk.getWidth();
for (int j=0; j<imShrunk.getHeight()-this.hcc.getHeight(); j+=nStepVert) {
// compute top coordinate of in original image