Metadata-Version: 2.4
Name: mvos_hsi
Version: 0.2.1
Summary: Hyperspectral imagery (HSI) preprocessing utilities for Machine Learning applications
Author: Rishik Aggarwal, Pappu Kumar Yadav, Moon Kim, Thomas Burks, Jianwei Qin
Maintainer-email: Rishik Aggarwal <rishik.aggarwal@sdstate.edu>, Pappu Kumar Yadav <pappu.yadav@sdstate.edu>
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy<2.0,>=1.24
Requires-Dist: scipy>=1.10
Requires-Dist: spectral
Requires-Dist: scikit-image
Requires-Dist: opencv-python
Requires-Dist: imgaug
Requires-Dist: matplotlib

# mvos_hsi

**MVOS Hyperspectral Imaging Utilities**

`mvos_hsi` is a Python package developed at the  
**Machine Vision and Optical Sensors (MVOS) Lab, South Dakota State University (SDSU)**  
for preprocessing and managing hyperspectral imaging (HSI) data.

The package provides a reproducible pipeline for:

- Calibrating raw hyperspectral cubes  
- Clipping sample regions (e.g., leaves)  
- Applying data augmentation  
- Generating graphs for spectral comparisons
- Organizing outputs into clean, ML-ready datasets  

It was originally designed for leaf-level agricultural experiments (e.g., nitrogen status in corn leaves) but is broadly applicable to other hyperspectral imaging tasks.


---

## Features
- **Calibration**
  - Single image or batch folder calibration
  - Dark and white reference correction
  - Spectral binning & spatial binning options
  - Outputs calibrated reflectance and fluorescence cubes
  - Saves calibrated cubes as `.mat` files (`*_R.mat`, `*_F.mat`)

- **Clipping**
  - Detect leaves using vegetation indices:
    - NDVI (Normalized Difference Vegetation Index)
    - CI-RedEdge (Chlorophyll Index Red-Edge)
    - GCI (Green Chlorophyll Index)
  - Thresholding via Otsu (auto) or manual (e.g., NDVI > 0.45)
  - Flexible cropping:
    - Square windows (fixed size, e.g., 30×30 pixels)
    - Tight bounding boxes fit to each leaf
  - Saves clipped cubes as ENVI files (`.hdr` + `.img`) in `clipped_hypercubes/`

- **Augmentation**
  - Apply data augmentation to calibrated or clipped cubes
  - Options:
    - Per image (single `.mat` or `.hdr`)
    - Per folder
    - Per class (each subfolder = class label)
  - User-defined number of augmentations
  - Saves augmented cubes in `augmented_hypercubes/`

---

## Installation

### From PyPI 

```bash
pip install mvos_hsi
