Metadata-Version: 2.4
Name: mvos_hsi
Version: 0.2.0
Summary: HSI calibration & utilities for MVOS workflows
Author: Rishik Aggarwal
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: spectral
Requires-Dist: scikit-image
Requires-Dist: opencv-python
Requires-Dist: imgaug
Requires-Dist: matplotlib

# mvos_hsi

**MVOS Hyperspectral Imaging Utilities**  
Python package for calibration, clipping, and augmentation of hyperspectral leaf images, ported from MATLAB scripts.

---

## 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
Clone this repository and install in **editable mode**:

```bash
conda activate hyperspectral
pip install -e .
