
vextract(1)                  Khoros                   vextract(1)

PROGRAM
     vextract - Extract a rectangular piece from an image and put
     it in a subimage

SYNTAX
     vextract

     -i             input image

     -o             resulting output image

     [-i1]          input coordinate image

     [-x]           specifies upper left x coordinate of subimage

     [-y]           specifies upper left y coordinate of subimage

     [-w]           specifies the subimage width in pixels

     [-h]           specifies the subimage height in pixels

     [-V]           Gives the version for vextract

     [-U]           Gives the usage for vextract

     [-P]           Prompts for command line options

     [-A [file1]]   Creates the answer file called vextract.ans
                    or file1

     [-a [file1]]   Uses vextract.ans or file1 as the answer file

DESCRIPTION
     vextract copies that area of the input image which is w pix-
     els wide and h pixels high with the upper left corner at
     (x,y) into a new image, called a subimage. The subimage can
     then be treated just like an normal image and can be rein-
     serted back into the original or any other image of the same
     data type.

     If the subimage specification extends beyond the image boun-
     dary, the largest possible subimage is returned. If the
     subimage is larger than the original image, the routine will
     fail.

     Vextract allows a coordinate input image to specify the
     region to extract rather than specifing the region by the
     -x, -y, -h and -w arguments. If the -i1 argument (input
     coordinate image) is specified then none of the specific
     coordinate values (-x, -y, -w -h arguments) can be speci-
     fied.  The coordinate input image must contain at least 2
     columns and 3 rows. The following explains how the coordi-
     nate input image is used to extract a sub-region. The first
     2 data points in the image are the x any y offset values.
     These specify the -x and -y arguments. To find the width of
     the subimage, the first value in the second row is sub-
     tracted from the first value of the first row. To find the
     height of the subimage, the second value in the third row is
     subtracted from the second value of the first row. Basically
     the coordinate image should be specifed as (but is not lim-
     ited to) an image with three rows and two columns where each
     row specifies the (x,y) location of a point. Then the first
     row specifies the (x,y) location of the upper left hand
     corner, the second row specifies the (x,y) location of the
     upper right hand corner and the third point specifies the
     lower left hand corner.

     The output image is the same data type as the input image.
     An image with only the color map and header data is obtained
     if none of the options are used.

     The input image may be single or multiband, and the result-
     ing output image will be of the same type and same number of
     bands.

REQUIRED ARGUMENTS
     -i     type: infile
            desc: input image

     -o     type: outfile
            desc: resulting output image

OPTIONAL ARGUMENTS
     -i1    type: infile
            desc: input coordinate image

     -x     type: integer
            desc: specifies upper left x coordinate of subimage
            default: 0
            bounds: value >= 0

     -y     type: integer
            desc: specifies upper left y coordinate of subimage
            default: 0
            bounds: value >= 0

     -w     type: integer
            desc: specifies the subimage width in pixels
            default: 128
            bounds: value > 0

     -h     type: integer
            desc: specifies the subimage height in pixels
            default: 128
            bounds: value > 0

EXAMPLES
     vextract -i ball.xv -o ball_sub.xv -x 64 -y 64 -w 128 -h 128

     This extracts a subimage from ball.xv beginning at coordi-
     nates (64, 64), and the resulting output image is of dimen-
     sion 128 by 128.

SEE ALSO
     intro(1), verror(3), vgparms(3), vutils(3), lvextract(3)

RESTRICTIONS
COPYRIGHT
     Copyright 1991, University of New Mexico.  All rights
     reserved.

Khoros                    Release: 1.0                          1

