Repairs lines or segments in a given image with a constant or by averaging
Provides a means of replacing rectangular groups of pixels (repair windows) within an image. The inserted values may be either weighted averages of the pixels surrounding the repair window or a user-specified constant. The maximum number of repair windows that may be specified is 10. SEGMREPR handles images with single or multiple bands and any data type.When an output image is supplied SEGMREPR calls COPY to copy all of the input images to this file and then modifies the new output image. If no output image is supplied, then SEGMREPR modifies the original image.
- IN
- Input image. Specifies the input image(s) to be corrected. IN may of any data type and may be windowed or subbanded. When updating the input image a combination of images cannot be used (ie. "IMG1 + IMG2").
- OUT
- Output image. Specifies the output image that is to contain the corrected data. The output image is of the same size, data type, and number of bands as the input image. If a combination of input images is specified then the output image will have the same data type as the first input image. If OUT is set to NULL (--) then the input image is modified.
- REPLOPT(AVER)
- Replacement option. Indicates whether the user wants to replace the pixels within each repair window with a constant or an average of the neighboring pixels.
= AVER : Use both horizontal and vertical averaging = CONS : Replace by PIXVAL = HORI : Use horizontal averaging only = VERT : Use vertical averaging only
- PIXVAL(0,0,0,0,0,0,0,0,0,0)
- Pixel value. The value used for replacement pixels if REPLOPT = CONS. The replacement value must lie within the range of the image data type.
Each element within PIXVAL corresponds to the same window, i.e., PIXVAL(1) corresponds to INWIND1, PIXVAL(8) corresponds to INWIND8, etc.
- INWIND1
- Window specification. INWIND1 through INWIND10 specify the repair windows to be fixed. Each is of the form (SL, SS, NL, NS) where
SL = starting line SS = starting sample NL = number of lines NS = number of samplesYou may specify at most 10 repair windows. When specifying repair windows you must not skip any of the parameters. For example, when specifying one window, use INWIND1; when specifying three windows, use INWIND1, INWIND2, and INWIND3; etc. When SEGMREPR encounters a repair window with a null value, it ignores all of the remaining INWIND parameters.
The repair windows specified should not overlap nor should their boundaries touch. Such cases may produce misleading results and are NOT guarded against by SEGMREPR.
- INWIND2(--)
- See parameter description for INWIND1.
- INWIND3(--)
- See parameter description for INWIND1.
- INWIND4(--)
- See parameter description for INWIND1.
- INWIND5(--)
- See parameter description for INWIND1.
- INWIND6(--)
- See parameter description for INWIND1.
- INWIND7(--)
- See parameter description for INWIND1.
- INWIND8(--)
- See parameter description for INWIND1.
- INWIND9(--)
- See parameter description for INWIND1.
- INWIND10(--)
- See parameter description for INWIND1.
SEGMREPR copies the input image TEST to the output image NEW and then replaces the region INWIND1 with zeroes in the image NEW.
SEGMREPR copies the input image TEST to the output image NEW and then replaces the regions INWIND1 and INWIND2 of image NEW with averages of their borders.
SEGMREPR modifies the input image TEST by replacing the region INWIND1 with the average of the lines above and below the region. Since there is no line that lies above the starting line of INWIND1, the line just below the window is used for this line.
COPY copies the input images TEST and OLD to the output image NEW and then SEGMREPR replaces the region INWIND1 with the average of the pixels to the left and right of the region.
SEGMREPR replaces the region INWIND1 of image TEST with zeroes.
Note that INWIND1 is relative to the input image window. Therefore lines 109 and 110 from sample 109 to sample 128 are replaced with zeroes.
SEGMREPR copies the windowed portion of the input image TEST to the output image NEW and then replaces the region INWIND1 of image NEW with zeroes.
Note that INWIND1 is relative to the input image window. Therefore lines 10 and 11 from sample 10 to sample 29 are set to zero in image NEW. This corresponds to lines 109 and 110 in image TEST from sample 109 to sample 128.
If the user requests constant replacements (REPLOPT=CONS), the value of PIXVAL is used to fill the given repair window(s).
For weighted averaging (REPLOPT=AVER), the following applies:
For (REPLOPT=VERT), the following description holds true:
For (REPLOPT=HORI), the following description holds true:
Note that if a given repair window prevents formation of the boundary on one or two sides, ie. a repair window edge overlaps an image edge, the replacement value is computed based on the remaining boundary pixels.
An error occurred during processing of associated files. The image is saved and presumed to be accurate.
An error occurred when attempting to allocate enough memory to process the image. See system manager.
When updating the input image a combination of images cannot be specified. Run SEGMREPR once for each of the images specified.
The repair window must be a subset of the entire image area for all replacement options except CONS. Respecify the repair window.
A fatal error was encountered during processing. Processing is terminated. The error message that is displayed immediately preceding this message is the specific error that was encountered.
The repair window cannot span the entire image in the horizontal direction when the parameter REPLOPT is set to HORI or AVER. Respecify the repair window or change the replacement option.
Specify a value that is within the range of the image's data type.
The repair window lies partially outside of the specified image or windowed image. Respecify the repair window so that it is relative to the image or it's window and it is contained entirely within the image or it's window.
The input images are of different sizes. Make sure the input images have the same number of lines and samples or specify windows for the images.
The repair window cannot span the entire image in the vertical direction when the parameter REPLOPT is set to VERT or AVER. Respecify the repair window or change the replacement option.