Sequence seq = new Sequence(crop);
seq.add(new Gray8Reduce(1,cHeightReduce));
int cReducedHeight = cCroppedHeight / cHeightReduce;
// we stretch the cropped image so cInputWidth becomes cTargetWidth. This means
// cTotalWidth must become cTargetWidth * cTotalWidth / cInputWidth
Gray8RectStretch stretch = new Gray8RectStretch(
cTargetWidth * cTotalWidth / cInputWidth, cReducedHeight);
seq.add(stretch);
seq.add(new Gray8HistEq());
seq.push(imageInput);
return seq.getFront();