glsmudge
Description
glsmudge is a utility designed to “smudge” the low-pass data of a JCU GLORIA format sidescan file. This process aims to remove long-wavelength stripes by linearly interpolating the pixel intensities between two specified reference records (-first and -last). This is typically applied to the .low component resulting from a destriping operation.
Usage
glsmudge [-first <record_number>] [-last <record_number>] <infile_prefix>
Arguments
| Option | Description | Default |
|---|---|---|
-first <record_number> | Specifies the record number to use as the “before” reference for smudging. | 0 |
-last <record_number> | Specifies the record number to use as the “after” reference for smudging. | 0 |
<infile_prefix> | Required. The prefix for the input GLORIA low-pass file. The tool assumes the input file has a .low extension. The output file will have a .low_smudge extension. |
How It Works
- Input Files: The tool takes a single JCU GLORIA low-pass file (e.g.,
<infile_prefix>.low) as input. - Reference Records:
- It seeks to the records specified by
-firstand-lastand reads them intobefore_recandafter_recrespectively. These records serve as the fixed endpoints for the linear interpolation.
- It seeks to the records specified by
- Linear Interpolation: For each record
ibetween thefirstandlastrecords (exclusive):- It calculates
before_weightandafter_weightbased on the current record’s position relative tofirstandlast. - For each pixel (
j) in theall_dataarray of the current record (out_rec):- The pixel’s new intensity is calculated as a linear interpolation between the corresponding pixels in
before_recandafter_rec, usingbefore_weightandafter_weight.out_rec.all_data[j] = (unsigned char) ((float) before_rec.all_data[j] * after_weight + (float) after_rec.all_data[j] * before_weight);
- The pixel’s new intensity is calculated as a linear interpolation between the corresponding pixels in
- Records outside the
firstandlastrange are written directly without modification.
- It calculates
- Write Output: The processed (or copied) record (
out_rec) is written to the output file (e.g.,<infile_prefix>.low_smudge). - Loop: This process repeats for all records in the input file.