analyze¶
The main command for processing hyperspectral seed imagery.
Synopsis¶
Description¶
The analyze command performs complete hyperspectral seed analysis:
- Loads ENVI format hyperspectral data
- Applies reflectance calibration with white/dark references
- Performs spectral preprocessing
- Segments individual seeds
- Extracts spectral signatures
- Exports results to CSV or HDF5
Arguments¶
INPUT_PATH(required)- Path to the hyperspectral dataset directory
Options¶
Output Options¶
-o, --output PATH(required)- Output file path (
.csvor.h5) --export-plots- Generate visualization plots (distribution, segmentation, spectra)
--export-mask- Export segmentation mask as
.npyfile
Processing Options¶
-c, --config PATH- Path to YAML configuration file
--preprocess CHOICE- Preprocessing preset:
minimal,standard,advanced,none - Default:
standard --segmentation CHOICE- Segmentation algorithm:
threshold,watershed,connected,combined - Default:
watershed --min-pixels INT- Minimum seed size in pixels
- Default:
200 --no-outlier-removal- Disable automatic outlier detection and removal
Logging Options¶
-v, --verbose- Enable verbose logging
-d, --debug- Enable debug mode with detailed logging
Examples¶
Basic Analysis¶
With Visualizations¶
Recommended Settings for Seeds¶
hyperseed analyze dataset/sample_data \
--output seed_analysis.csv \
--min-pixels 50 \
--preprocess minimal \
--export-plots
Using Custom Configuration¶
Disable Outlier Removal¶
hyperseed analyze dataset/sample_data \
--output results.csv \
--min-pixels 50 \
--no-outlier-removal
Output Files¶
For input dataset/sample with output results.csv and --export-plots:
- results.csv - Extracted seed spectra with metadata
- results_distribution.png - Spatial and size distribution
- results_segmentation.png - Numbered seed visualization
- results_spectra.png - Individual and mean spectra
- results_spectra_statistics.png - Statistical analysis
- results_mask.npy - Segmentation mask (if
--export-mask)
CSV Output Format¶
seed_id,index,centroid_y,centroid_x,area,eccentricity,solidity,band_1000nm,band_1005nm,...
1,0,234.5,156.2,435,0.34,0.92,0.234,0.237,...
2,1,345.6,234.1,421,0.28,0.94,0.229,0.232,...
Columns: - seed_id: Sequential seed identifier - index: Original label from segmentation - centroid_y, centroid_x: Seed center coordinates - area: Seed area in pixels - eccentricity: Shape eccentricity (0=circle, 1=line) - solidity: Shape solidity (convex hull ratio) - band_*: Reflectance values at each wavelength
See Also¶
- batch: Process multiple datasets
- Configuration Guide: Detailed configuration options
- Quick Start: Tutorial walkthrough