validateSHOALS
Description
validateSHOALS is a specialized validation tool for SHOALS (Scanning Hydrographic Operational Airborne Lidar Survey) data. It processes two 8-bit image files: a “reference” image (typically representing backscatter intensity or other signal quality metrics) and a “height” image (e.g., bottom return height, roughness, or standard deviation of depths). By comparing overlapping pixels in these two images against user-defined thresholds, the program classifies seabed characteristics, primarily focusing on the presence of submerged vegetation (weed detection) and other data quality aspects. The output is a new 8-bit image where each pixel represents a validation status.
Usage
validateSHOALS -reference <filename> -reference_threshold <value> -height <filename> -height_threshold <value> -out <filename> [OPTIONS]
Arguments
| Option | Description | |
|---|---|---|
-reference <filename> | Required. Specifies the input 8-bit image file that contains the reference data (e.g., backscatter intensity, often used to indicate signal strength from the seabed). | |
-reference_threshold <value> | Required. Sets a floating-point threshold for the reference data. Pixels above or below this threshold are evaluated for classification. | |
-height <filename> | Required. Specifies the input 8-bit image file that contains height-related data (e.g., bottom return height variability, roughness, or a derived metric of vertical uncertainty). | |
-height_threshold <value> | Required. Sets a floating-point threshold for the height data. Pixels are evaluated against this value for classification. | |
-ignore <value> | Optional. Specifies a single unsigned character pixel value (defaulting to 0) that should be ignored in both input files. Pixels with this value are typically considered “no data” and are excluded from the classification process. | 0 |
-bs | Optional. Activates a “backscatter mode” which specifically sets ignore_ref to 255 and ignore_height to 0. This is a specific configuration for backscatter processing. | |
-out <filename> | Required. Specifies the filename for the output 8-bit image file, which will contain the classification results. |
How It Works
- File Handling: Opens the specified
referencefile,heightfile, andoutfile. Reads theJHC_headerfrom both input files to obtain image dimensions (dx,dy) and min/max intensity values for scaling. - Output Header Initialization: A
JHC_header(based on thereferencefile’s header but with modifiedmin_valueandmax_valueto reflect the classification range) is written to theoutfile. - Data Processing Loop (Pixel Classification): Iterates through each row (
head1.dy) and column (head1.dx) of the input images:- Reads the 8-bit pixel data into
freferenceandfheightbuffers. - Ignoring No-Data Pixels: Before classification, it checks if a pixel’s value matches the
ignore_reforignore_heightvalues. If so, it marks the corresponding output pixel infoutas1(indicating “not overlapping data”) and skips classification. - Value Scaling: For valid pixels, the 8-bit unsigned char values are converted back to their original floating-point representations using the
min_valueandmax_valuestored in their respectiveJHC_headers. Special handling for backscatter data is noted ifbs_flagis set. - Classification Logic: A set of
if-else ifstatements applies the core validation rules:- If
freference_val >= reference_thresholdANDfheight_val <= height_threshold: Result:WEED(or vegetated rock), assignedvalue = 9(red). - If
freference_val < reference_thresholdANDfheight_val <= height_threshold: Result:SUSPICIOUS(or vegetated sand), assignedvalue = 13(yellow). - If
freference_val < reference_thresholdANDfheight_val > height_threshold: Result:VALID SOUNDING(unvegetated sand), assignedvalue = 11(blue). - If
freference_val >= reference_thresholdANDfheight_val > height_threshold: Result:NO WEED LIKELY(unvegetated rock, potential hazard), assignedvalue = 12(cyan).
- If
- The classified
value(anunsigned charrepresenting a color index) is stored in thefoutbuffer. - After processing a row, the
foutbuffer is written to theoutfile.
- Reads the 8-bit pixel data into
- Output Header Finalization: After all pixel rows are processed, the output
JHC_headeris updated to reflect themin_value(1) andmax_value(17), defining the range of output classification colors.
Output Files
<filename>: A new 8-bit JHC-format image file (.8bit) containing the classification results.
Dependencies
array.h: ForJHC_headerstructure and functions (get_print_JHC_header,write_JHC_header).support.h: For utility functions (usage,error,strtoint,strtodbl).
Notes
validateSHOALS is a specialized and essential tool within hydrographic data processing workflows, particularly for airborne lidar bathymetry. Its main purposes are automated quality control, vegetation detection, seabed characterization, and data interpretation. The tool is invaluable for hydrographers, marine scientists, and environmental managers working with SHOALS data to produce accurate charts, conduct habitat assessments, and ensure navigation safety.