scanin/scanin

Summary

Convert an 8 or 16 bit per component TIFF image of a test chart into .ti3 device values using automatic pattern recognition.
Performs other tasks associated with turning a TIFF raster of test patches into numeric values.

Usage Summary

usage: scanin [options] input.tif recogin.cht valin.cie [diag.tif]
   :- inputs 'input.tif',  and outputs scanner 'input.ti3', or

usage: scanin -g [options] input.tif recogout.cht [diag.tif]
   :- outputs file 'recogout.cht', or

usage: scanin -o [options] input.tif recogin.cht [diag.tif]
   :- outputs file 'input.val', or

usage: scanin -c [options] input.tif recogin.cht scanprofile.icc pbase [diag.tif]
   :- inputs pbase.ti2 and outputs printer pbase.ti3, or

usage: scanin -r [options] input.tif recogin.cht pbase [diag.tif]
   :- inputs pbase.ti2+.ti3 and outputs pbase.ti3

 -g                  Generate a chart reference (.cht) file
 -o                  Output patch values in .val file
 -c                  Use scanner as colorimeter to
                     convert printer .ti2 to .ti3
 -ca                Same as -c, but accumulates more values to .ti3
                     from subsequent pages
 -r                  Replace device values in .ti3
                     Default is to create a scanner .ti3 file
 -a                  Recognize chart in normal orientation only
                      Default is to recognize all possible chart angles
 -v [n]             Verbosity level 0-9
 -d [ihvglLrsonap]   Generate diagnostic output (try -dipn)
     i                diag - B&W of input image
     h               diag - Horizontal edge detection
     v               diag - Vertical edge detection
     g               diag - Groups detected
     l                diag - Lines detected
     L               diag - All lines detected
     r                diag - lines rotated
     s                diag - sample boxes rotated
     o               diag - sample box outlines
     n               diag - sample box names
     a               diag - sample box areas
     p               diag - pixel areas sampled

Usage Details and Discussion

scanin is setup to deal with a raster file that has been roughly cropped to a size that contains the test chart. It's exact orientation is not important [ie. there is usually no need to rotate or crop the image any more finely.] The reference files are normally set up with the assumption that the edges of the chart are visible within the image, and if the image is cropped to exclude the chart edges, it may well not recognize the chart properly.

There are 5 basic modes that scanin operates in.
A number of flags and options are available, that are independent of the mode that scanin is in.

Normally scanin will try and recognize a chart, irrespective of its orientation. For charts that have some asymmetric patch size or arrangement (such as an IT8.7/2, or a chart generated by printtarg with the -s option), this is both flexible and reliable. Other charts may be symmetrical, and therefore having scanin figure out the orientation automatically is a problem if the recognition template does not contain expected patch values, since it will have an equal chance of orienting it incorrectly as correctly. To solve this, the -a flag can be used, and care taken to provide a raster file that is within 45 degrees of "no rotation".

The -v flag enables extra verbosity in processing. This can aid debugging, if a chart fails to be recognized.

The -d flag enables the generation of an image recognition diagnostic raster. The name of diagnostic raster can be specified as the last in the command line, or if not, will default to diag.tif. Various flags control what is written to the diagnostic raster. Note that no diagnostic raster will be produced if at least one flag isn't specified.
i    creates a black and white version of the input raster in the diagnostic output, to be able to compare with the feature extraction.
h    will show pixels in the input image classified as being on horizontal edges, in red.
v    will show pixels in the input image classified as being vertical edges, in green.
g    will show groups of pixels that will be used to estimate edge lines, each group in a different color.
l    will show valid lines estimated from the vertical and horizontal pixel groups, in white.
L    will show all lines (valid and invalid) estimated from the vertical and horizontal pixel groups, in white.
r    will show the lines rotated to the reference chart orientation, in yellow.
s    will show the diagnostic sampling box edge outlines, rotated to the reference chart orientation, in orange.
o    will show all the sampling box edge outlines, in orange.
n    will show the ID names of the sampling boxes, plus the diagnostic sample boxes, using a simple stroke font, in orange.
a    will show the sampling areas as crossed boxes, plus the diagnostic sample boxes, in orange.
p    will show the sampling areas as colored pixels.

The combination of -dipn is usually a good place to start.

The TIFF file can be either 8 or 16 bits per color component, with 16 bit files being slower to process, but yielding more accurate results.

If at all in doubt that the file has been recognized correctly, use the -dipn diagnostic flag combination, and check the resulting diagnostic raster file.