\ .\" This man page was generated by the Netpbm tool 'makeman' from HTML source. .\" Do not hand-hack it! If you have bug fixes or improvements, please find .\" the corresponding HTML page on the Netpbm website, generate a patch .\" against that, and send it to the Netpbm maintainer. .TH "Pamtilt User Manual" 0 "28 August 2005" "netpbm documentation" .SH NAME pamtilt - print the tilt angle of a PGM file .UN synopsis .SH SYNOPSIS \fBpamtilt\fP [\fB-angle=\fP\fImaxangle\fP] [\fB-fast\fP] [\fB-quality=\fP\fIq\fP] [\fB-hstep=\fP\fIn\fP] [\fB-vstep=\fP\fIn\fP] [\fB-dstep=\fP\fIn\fP] [\fB-astep=\fP\fIn\fP] [\fB-verbose\fP] [\fIpgmfile\fP] .UN examples .SH EXAMPLES .nf \f(CW scanimage --mode Gray --resolution 300 >crooked.pgm pnmrotate -b white `pamtilt crooked.pgm` crooked.pgm >straight.pgm \fP (then crop, threshold, etc.) .fi .UN description .SH DESCRIPTION .PP This program is part of .BR "Netpbm" (1)\c \&. .PP \fBpamtilt\fP tries to find the correct angle for untilting (de-skewing) a scanned text document. The output is a single floating-point number (the angle in degrees) for use as the argument to pnmrotate. .PP "Document skew" is the name given to what happens when you feed a page into an image scanner at an angle: the resulting image is tilted. \fBpamtilt\fP aims to help correct that. .PP \fBpamtilt\fP makes three iterations at successively finer increments, testing prospective rotation angles to find the best one. \fBpamtilt\fP works best for straightening images with strong horizontal lines and does poorly with arbitrary photos. If \fBpamtilt\fP has no confidence in its results, it prints the special value 00.00; you can check for this or just pass it as a legal argument to pnmrotate. .PP \fBpamtilt\fP operates on the first plane of the input image, which is either PNM or PAM, and ignores any other planes. Ordinarily, the input is PGM or GRAYSCALE PAM, so there is only one plane. .PP \fBpamtilt\fP works on bilevel (PBM, BLACKANDWHITE PAM) images as well as grayscale, but you will minimize artifacts if you scan and rotate in grayscale before you apply a threshold to make a bilevel image. .UN options .SH OPTIONS .PP In addition to the options common to all programs based on libnetpbm (most notably \fB-quiet\fP, see .UR index.html#commonoptions Common Options .UE \&), \fBpamtilt\fP recognizes the following command line options: .TP \fB-angle=\fP\fImaxangle\fP Assume a maximum tilt angle of \fImaxangle\fP (measured in degrees). The default value is sufficient for most images, even those scanned somewhat carelessly. .sp The default is 10.0. .TP \fB-fast\fP Skip the third iteration for speed at the expense of accuracy. .TP \fB-verbose\fP Show on Standard Error the measurements computed at each tested angle. .PP Here are some other options you can use to tune the operation of \fBpamtilt\fP but they're seldom needed. The default values accommodate a wide variety of input documents. .TP \fB-quality=\fP\fIq\fP Require a signal-to-noise ratio of a least \fIq\fP on the first iteration to report a valid result. Larger values reduce the chances of obtaining a bogus result at the risk of obtaining no result at all. .sp The default is 1.0. .TP \fB-hstep=\fP\fIn\fP Set the horizontal increment to check every \fIn\fPth column. This value affects both run time and memory requirements. .sp The default is 11. .TP \fB-vstep=\fP\fIn\fP Set the vertical increment to check every nth row. Larger values usually work, reducing run time, but they increase the risk of incorrect results. .sp The default is 5. .TP \fB-dstep=\fP\fIn\fP Set the vertical distance used when checking pixels in a column. The default is intended to minimize the effect of noise along a horizontal boundary. .sp The default is 2. .TP \fB-astep=\fP\fIn\fP Set the angle increment of the first iteration, in degrees. .sp The default is 1.0. .UN references .SH REFERENCES .PP \fBpamtilt\fP implements a somewhat simplified algorithm inspired by: "Measuring Document Image Skew and Orientation", by Bloomberg, Kopec, and Dasari. In SPIE Volume 2422, Document Recognition II, pages 302-316, February 1995. .UN seealso .SH SEE ALSO .IP \(bu .BR "\fBpnmrotate\fP" (1)\c \& .IP \(bu .BR "pgm" (1)\c \& .UN history .SH HISTORY .PP \fBpamtilt\fP was new in Netpbm 10.30 (October 2005). .PP Gregg Townsend wrote it and sent it to Bryan Henderson in August 2005. Bryan recoded it to fit Netpbm conventions. .SH DOCUMENT SOURCE This manual page was generated by the Netpbm tool 'makeman' from HTML source. The master documentation is at .IP .B http://netpbm.sourceforge.net/doc/pamtilt.html .PP