Change the scale of an image by replicating or deleting pixels.
Change the scale of an image by deleting or replicating pixels from the input image and producing the zoomed output image. When reducing an image, each output pixel may receive either the value of a single input pixel, or the mean of all the input pixels which are covered by the output pixel. When expanding an image, each output value may be multiplied by a pseudorandom number, subject to the constraint that the average of the multipliers for any given input pixel is always unity. The image may be scaled independently in the line and sample direction.
- IN
- Input image(s). The input image(s) may be BYTE, INTEGER*2, INTEGER*4, or REAL*4.
- OUT
- Output image. Data type will be the same as the input.
- SCALFACT
- Scale factor(s). Scaling factors in the line and sample directions. They must be nonzero integers.
- IN
- Input image(s). The input image(s) may be BYTE, INTEGER*2, INTEGER*4, or REAL*4.
- OUT
- Output image. Data type will be the same as the input.
- SCALFACT
- Scale factor(s). Scaling factors in the line and sample directions. They must be nonzero integers.
- IN
- Input image(s). The input image(s) may be BYTE, INTEGER*2, INTEGER*4, or REAL*4.
- OUT
- Output image. Data type will be the same as the input.
- SCALFACT
- Scale factor(s). Scaling factors in the line and sample directions. They must be nonzero integers.
- DISTRIB
- Function defining distribution of randomly selected multipliers. Options are:
UNIFORM Uniform distribution between RANGE(1) and RANGE(2) GAUSS Gaussian distribution between RANGE(1) and RANGE(2) NEGEXP Decaying exponential specifies distriubtion: relative probabilities of values between RANGE(1) and RANGE(2) are given by exp(-x)
- COEFF(0)
- Coefficient(s) of distribution function. These are needed for the following functions:
GAUSS COEFF(1) Center of distribution COEFF(2) Variance of distribution
- RANGE
- Minimum and maximum multipliers. The minimum and maximum values are specified in RANGE(1) and RANGE(2), respectively.
For some distribution functions, certain combinations of RANGE and COEFF values will result in a distribution whose mean value is not 1.0. In this case, all multiplier values computed using the specified RANGE and COEFF will be normalized by dividing them by their mean, making the new average exactly 1.0. This will result in maximum and minimum values which do not match those specified by RANGE. ZOOM will print an advisory message specifying the adjusted maximum and minimum.
- SELECT("ALL")
- Multiplier selection option for each input grid cell (pixel). This specifies how to select the values by which a given input grid cell is multiplied to produce the corresponding SCALFACT(1) by SCALFACT(2) array of output values. A table of multipliers is created during program initialization. The set of multipliers to be used with each input grid cell is chosen randomly in one one of three ways, depending on the value of SELECT:
ALL Exactly SCALFACT(1) x SCALFACT(2) multipliers are computed during program initialization. The full set of multipliers are used for each input grid cell. However, the assignment of the multipliers to output grid cells is based on a set of pseudorandom numbers which is different for each input grid cell. RAND The multipliers for each input grid cell are randomly selected from a (usually large) set of values. In general, the multipliers chosen for any given input grid cell do not average exactly 1.0, with the result that the set of output values derived from a given input grid cell may have an average value which is less or greater than the input value. See User Note 3. RENORM The multipliers to be used with each input grid cell are randomly selected. Their values are then adjusted to make their average exactly 1.0, so that the average of the output values derived from a given input grid cell will be exactly equal to the input value. See User Note 3.
- NBIN(1000)
- Number of bins in multipier table (ignored if SELECT = "ALL"). To minimize computation time, a table of multipliers is created in which the distribution of values approximates the distribution function specified by DISTRIB, COEFF, and RANGE. A random number generator is used to select values from this table. For SELECT = "RAND" or "RENORM", the default is 1000 bins. For SELECT = "ALL", NBIN is automatially set to SCALFACT(1) x SCALFACT(2).
- SEED(--)
- Initial value for random number generator. This is the "seed" value used to initialize the random number generator. The default is to use the system clock time in seconds when the program starts. If the same numeric value is specified for SEED for successive executions of ZOOM, the pattern of multipliers will be reproduced.
- IN
- Input image(s). The input image(s) may be BYTE, INTEGER*2, INTEGER*4, or REAL*4.
- OUT
- Output image. Data type will be the same as the input.
- SCALFACT
- Scale factor(s). Scaling factors in the line and sample directions. They must be nonzero integers.
This performs an expansion of the input image IN.IMG using a window of 100 lines and 100 pixels centered at the input file coordinates (250,250) specified by the window used. The zoom is performed by a factor of 4 in the line direction and a factor of 2 in the sample direction. The image Z.DAT will be 400 x 200 with the starting pixel of the input image at 200,200.
This performs a scale reduction on image file WASH.DAT. The input window is 512 x 512 and the image WASH.DAT is reduced by 2 in the line and sample directions. The image ZOOM.DAT will be 256 x 256 with the starting pixel of the input image at 1,1.
This expands the image "precip_4km" by a factor of 4 in each direction. The 4 by 4 array of output pixels corresponding to each input pixel is obtained by multiplying the values of the input pixel by a set of factors selected randomly within the range 0.5 to 1.5 with probabilies given by a Gaussian distribution centered at 1.0 with a variance of 0.25. The Gaussian distribution is approximated by dividing the range into 1000 bins (the default), and randomly selecting bins using as an initial seed for the random-number generator the default value, which is the system time when the program is run.
This expands the image "precip_4km" by a factor of 4 in each direction, multiplying each of the 16 output values corresponding to any given input pixel by one of 16 factors distributed uniformly between 0.5 and 1.5. The same set of multipliers is used for each input pixel, but their assignment to output pixels is determined by a random number generator initialized with a seed value of 1.
ZOOM alters image size by replicating or deleting pixels based on user-input scale factors for the line and sample axes.If subcommand -EXPAND is specified, the scale of the image is increased. For a given input image line, each pixel will be replicated by a factor of SCALFACT(2). After performing the replication, each line will then be replicated by a factor of SCALFACT(1). If the resulting image is displayed, it will appear "closer."
If subcommand -REDUCE is specified, the scale of the image is reduced. For a given input image line, every SCALFACT(2) pixel, beginning with the starting pixel, is retained and all other pixels are deleted. Every SCALFACT(1) line, beginning with the first line, is then retained and all other lines are deleted. The minimum output image size possible is 1 X 1. If the resulting image is displayed, it will appear to be "further away." If subcommand -RANDEX is specified, the scale of the image is increased. An array of NBIN multipliers is created whose distribution and range are specified by arguments DISTRIB, COEFF, and RANGE. Then each input pixel is expanded to a SCALFACT(1) by SCALFACT(2) array of output pixels. This is done by using a random number generator to select a set of SCALFACT(1) by SCALFACT(2) multipliers from the multiplier array, normalizing these multipliers to make their sum exactly 1.0, and then using each of the normalized multipliers to create one output pixel by computing the product of the input pixel value and the multiplier. The multipliers are normalized by dividing each unnormalized multiplier by the sum of the unnormalizied multipliers. The random number generator is initialized using the value specified by SEED.
If subcommand -MEANRED is specified, the input image is divided into SCALFACT(1) by SCALFACT(2) rectangles, with the upper left corner of the first rectangle coinciding with the starting line and pixel of the input-image window. For each band, the mean of the input pixels in each rectangle is computed, and used as the value of one output pixel. If the rectangles at the righthand and/or bottom edge of the input image extend beyond the specified input-image window, only pixels within the window are used for computing the mean.
An error occurred when creating the history file.
The minmax file could not be created.
A nonfatal error was encountered during processing. The image data is probably valid.
The set of all multipliers is required to have an average value of exactly 1.0. The set of multipliers generated using the specfied values of RANGE and/or COEFF did not meet this criterion. Each multiplier was normalized by dividing it by the average value, making the new average equal to 1.0. The minimum and maximum of these normalized values, which are given in the error message, were found to differ significantly from the values specified in RANGE.
A fatal error was encountered during processing. The output image file is not deleted, and processing is terminated. The message that is displayed immediately preceding this error message is the specific error that was encountered.
The input images are not of the same data type. Use COPY to change the data types so they are the same.
The <XXXXXX> file could not be opened and processing is
terminated. Verify that the image named in the <XXXXXX>
parameter exists.
The calculated size of the output image is less than one. Do not reduce the input image by such a large factor or increase the size of the input image.
The input images do not have the same window size. Correct the input images window size.
Dynamic memory allocation failed. Check that there is
sufficient virtual memory available for image buffers. For
a very large image, it may be necessary to process the image
in segments.
Range parameters entered in wrong order or incorrectly. Correct the values.
On the other hand, if SELECT = "RAND", the average of all the output pixels corresponding to a given input pixel may differ slightly from the input pixel in value. Over the entire image, however, the average values should be very nearly equal, since the multipliers are randomly selected from an array whose average is exactly 1.0.