null,
null);
}
this.imageCropped = (Gray8Image) imageResult;
{ Debug debug = new Debug();
Gray8Rgb g2r = new Gray8Rgb();
g2r.push(this.imageCropped);
RgbImage rgb = (RgbImage) g2r.getFront();
debug.toFile(rgb, "cropped.png"); //$NON-NLS-1$
}
/* Then do edge detection. The cWidth of the Canny operator is set
* based on the cropped cWidth, which is supposed to be the
* barcode cWidth.
*/
int cCannyWidth = cWidth / 6;
Gray8CannyHoriz canny = new Gray8CannyHoriz(cCannyWidth);
/* Now apply the edge detection to the cropped mage
*/
canny.push(imageCropped.clone());
/* And obtain the result
*/
imageResult = canny.getFront();
if (!(imageResult instanceof Gray8Image)) {
throw new jjil.core.Error(
jjil.core.Error.PACKAGE.ALGORITHM,
jjil.algorithm.ErrorCodes.IMAGE_NOT_GRAY8IMAGE,
imageResult.toString(),
null,
null);
}
this.imageEdge = (Gray8Image) imageResult;
{
Debug debug = new Debug();
Gray8Rgb g2r = new Gray8Rgb();
g2r.push(this.imageEdge);
RgbImage rgb = (RgbImage) g2r.getFront();
debug.toFile(rgb, "edges.png"); //$NON-NLS-1$
}
}