<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                   "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
<!-- lifted from troff+man by doclifter -->
<refentry id='cwsq1'>
<!--  @(#)cwsq.1 2001/04/02 NIST -->
<!--  I Image Group -->
<!--  Craig Watson and Michael D. Garris -->

<refmeta>
<refentrytitle>CWSQ</refentrytitle>
<manvolnum>1D</manvolnum>
<refmiscinfo class='date'>02 April 2001</refmiscinfo>
<refmiscinfo class='source'>NIST</refmiscinfo>
<refmiscinfo class='manual'>NFIS Reference Manual</refmiscinfo>
</refmeta>
<refnamediv id='name'>
<refname>cwsq</refname>
<refpurpose>WSQ compresses grayscale fingerprint images.</refpurpose>
</refnamediv>
<!-- body begins here -->
<refsynopsisdiv id='synopsis'>
<cmdsynopsis>
  <command>cwsq</command>    
    <arg choice='plain'><replaceable>&lt;rbitrate&gt;&lt;outext&gt;&lt;imagefile&gt;</replaceable></arg>
    <sbr/>
    <arg choice='opt'><arg choice='plain'>-raw_in <replaceable>w,h,d,</replaceable></arg><arg choice='opt'><replaceable>ppi</replaceable></arg></arg>
    <arg choice='opt'><replaceable>commentfile</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>


<refsect1 id='description'><title>DESCRIPTION</title>
<para><emphasis remap='B'>Cwsq</emphasis>
takes as input a file containing an uncompressed grayscale fingerprint
image.  Two possible input file formats are accepted, NIST IHead files
and raw pixmap files.  If a raw pixmap file is to be compressed, then
its image attributes must be provided on the command line as well.
Once read into memory, the pixmap is <emphasis remap='I'>lossy</emphasis> compressed
using Wavelet Scalar Quantization as described in the FBI's Criminal
Justice Information Services (CJIS) document, "WSQ Gray-scale Fingerprint
Compressions Specification," Dec. 1997.  The results are then written
to an output file in a format dictated by this document.  This is
the only fingerprint compression format accepted by the FBI IAFIS system.</para>

</refsect1>

<refsect1 id='options'><title>OPTIONS</title>
<para>All switch names may be abbreviated; for example,
<option>-raw_in</option> may be written <option>-r</option>.</para>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>&lt;r bitrate&gt;</emphasis></term>
  <listitem>
<para>determines the amount of lossy compression.</para>
<!-- .br -->
  <!-- .RS -->
<para>Suggested settings:</para>
    <!-- .RS 3 -->
<!-- .br -->
<para><emphasis remap='I'>r bitrate</emphasis> = 2.25 yields around 5:1 compression
<!-- .br -->
<emphasis remap='I'>r bitrate</emphasis> = 0.75 yields around 15:1 compression</para>
    <!-- .RE -->
  <!-- .RE -->
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&lt;outext&gt;</emphasis></term>
  <listitem>
<para>the extension of the compressed output file.
To construct the output filename, <command>cwsq</command> takes the
input filename and replaces its extension with the one
specified here.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>&lt;image file&gt;</emphasis></term>
  <listitem>
<para>the input file, either an IHead file or raw pixmap file,
containing the fingerprint image to be compressed.</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><option>-raw_in </option><emphasis remap='I'>w</emphasis>,<emphasis remap='I'>h</emphasis>,<emphasis remap='I'>d</emphasis>,[<emphasis remap='I'>ppi</emphasis>]</term>
  <listitem>
<para>the attributes of the input image.  This option must
be included on the command line if the input is a
raw pixmap file.</para>
<!-- .br -->
  <!-- .RS -->
  </listitem>
  </varlistentry>
</variablelist>
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>w</emphasis></term>
  <listitem>
<para>the pixel width of the pixmap</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>h</emphasis></term>
  <listitem>
<para>the pixel height of the pixmap</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>d</emphasis></term>
  <listitem>
<para>the pixel depth of the pixmap</para>
  </listitem>
  </varlistentry>
  <varlistentry>
  <term><emphasis remap='I'>ppi</emphasis></term>
  <listitem>
<para>the optional scan resolution of the image in integer units of
pixels per inch.</para>
  </listitem>
  </varlistentry>
</variablelist>
<!-- .RE -->
<variablelist remap='TP'>
  <varlistentry>
  <term><emphasis remap='I'>comment file</emphasis></term>
  <listitem>
<para>an optional user-supplied ASCII comment file.  (See COMMENT
OPTIONS below.)</para>

  </listitem>
  </varlistentry>
</variablelist>
</refsect1>

<refsect1 id='comment_options'><title>COMMENT OPTIONS</title>
<para>Upon successful compression, this utility generates and inserts
in the compressed output file a specially formatted comment block,
called a NISTCOM.  A NISTCOM is a text-based attribute list comprised
of (name, value) pairs, one pair per text line.
The first line of a NISTCOM always has name = "NIST_COM" 
and its value is always the total number of attributes included in
the list.  The utility <emphasis remap='B'>rdwsqcom</emphasis> scans a WSQ compressed file for
any and all comment blocks.  Once found, the contents of each comment
block is printed to standard output.  Using this utility, the NISTCOM
provides easy access to relevant image attributes.  The following is
an example NISTCOM generated by <command>cwsq</command>:</para>

<!-- .RS -->
<para>NIST_COM 9
<!-- .br -->
PIX_WIDTH 500
<!-- .br -->
PIX_HEIGHT 500
<!-- .br -->
PIX_DEPTH 8
<!-- .br -->
PPI 500
<!-- .br -->
LOSSY 1
<!-- .br -->
COLORSPACE GRAY
<!-- .br -->
COMPRESSION WSQ
<!-- .br -->
WSQ_BITRATE 0.750000</para>

<!-- .RE -->
<para><emphasis remap='B'>Cwsq</emphasis> also accepts an optional comment file on the command
line.  If provided, the contents of this file are also inserted
into the compressed output file.  If the comment file is a
NISTCOM attribute list, then its contents are merged with the
NISTCOM internally generated by <command>cwsq</command> and a single NISTCOM
is written to the compressed output file.  Note that <command>cwsq</command>
gives precedence to internally generated attribute values.
If the user provides a non-NISTCOM comment file,
then the contents of file are stored to a separate comment block in
the output file.  Using these comment options enables the user
to store application-specific information in a WSQ file.</para>

</refsect1>

<refsect1 id='examples'><title>EXAMPLES</title>
<para>From <emphasis remap='I'>test/imgtools/execs/cwsq/cwsq.src</emphasis>:</para>

<!-- .RS -->
<para><emphasis remap='B'>% cwsq .75 wsq finger.raw -r 500,500,8,500</emphasis>
<!-- .br -->
compresses a raw fingerprint pixmap.</para>

</refsect1>

<refsect1 id='see_also'><title>SEE ALSO</title>
<para><emphasis remap='B'>dpyimage</emphasis>(1D),
<emphasis remap='B'>dwsq</emphasis>(1D),
<emphasis remap='B'>rdwsqcom</emphasis>(1D),
<emphasis remap='B'>wrwsqcom</emphasis>(1D)</para>

</refsect1>

<refsect1 id='author'><title>AUTHOR</title>
<para>NIST/ITL/DIV894/Image Group</para>
</refsect1>
</refentry>

