Automatic chlorophyll content estimation for sugarcane monitoring using PlanetScope satellite imagery. This tool converts multispectral satellite images into detailed chlorophyll maps with health status classification and area analysis.
- ๐ Automatic Processing: Upload TIFF โ Get instant chlorophyll maps
- ๐ฏ Multi-band Support: Compatible with 4-band PlanetScope and 8-band SuperDove imagery
- ๐ฟ Vegetation Detection: Intelligent masking to analyze only vegetated areas
- ๐งฌ Scientific Calibration: NDVI-based chlorophyll estimation validated against GIS data
- ๐ฅ Health Classification: 5-level health status classification system
- ๐ Area Analysis: Automatic calculation of areas in hectares for each health category
- ๐ Interactive Visualizations: Dynamic chlorophyll maps and health status overlays
- ๐ Statistical Analysis: Comprehensive vegetation indices and correlation plots
- ๐พ Export Options: Download chlorophyll data and area reports in CSV format
- ๐ฌ Quality Control: Built-in NDVI-Chlorophyll correlation validation
- ๐จ Multi-view Display: RGB composite, false color, and chlorophyll maps
- Installation
- Quick Start
- Usage Guide
- Scientific Methodology
- Health Status Classification
- Area Calculation
- Requirements
- Project Structure
- Contributing
- License
- Citation
- Python 3.8 or higher
- pip package manager
git clone https://github.com/pishapis/chlorophyll-converter.git
cd chlorophyll-converter# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On Linux/Mac:
source venv/bin/activatepip install -r requirements.txt- Run the Application
streamlit run app.py-
Open Browser The app will automatically open at
http://localhost:8501 -
Upload Image
- Click "Browse files" or drag-and-drop your PlanetScope TIFF file
- Supported formats:
.tif,.tiff
- Process
- Click "๐งฎ Calculate Chlorophyll Content"
- Wait for processing to complete
- View Results
- Explore chlorophyll maps, health status, and area analysis
- Download reports and data as needed
| Satellite | Bands | Resolution | Supported |
|---|---|---|---|
| PlanetScope 4-band | Blue, Green, Red, NIR | 3m | โ |
| SuperDove 8-band | Coastal Blue to NIR + Red Edge | 3m | โ |
- Format: GeoTIFF (.tif, .tiff)
- Bands: 4 or 8 bands
- Projection: Any projected CRS (UTM recommended)
- Data Type: Surface reflectance (0-1 or 0-10000)
-
Chlorophyll Map
- Spatial distribution of chlorophyll content (ยตg/cmยฒ)
- Color-coded visualization
- Vegetation-masked output
-
Health Status Map
- 5-level classification (Severely Stressed to Very Healthy)
- Color-coded categories
- Legend with thresholds
-
Area Analysis
- Total image area (ha)
- Vegetation coverage area (ha)
- Health status area breakdown (ha)
- Percentage distribution
-
Statistical Reports
- Chlorophyll statistics (mean, std, min, max)
- NDVI-Chlorophyll correlation
- Vegetation indices summary
- Downloadable CSV reports
The tool uses a scientifically calibrated NDVI-Chlorophyll relationship based on field validation and GIS analysis:
# NDVI Range โ Chlorophyll Content (ยตg/cmยฒ)
NDVI 0.15-0.25 โ 8-20 ยตg/cmยฒ # Stressed vegetation
NDVI 0.25-0.35 โ 20-35 ยตg/cmยฒ # Moderate health
NDVI 0.35-0.45 โ 35-50 ยตg/cmยฒ # Healthy vegetation
NDVI >0.45 โ 50+ ยตg/cmยฒ # Very healthy vegetation- NDVI (Normalized Difference Vegetation Index)
- GNDVI (Green NDVI)
- RVI (Ratio Vegetation Index)
- DVI (Difference Vegetation Index)
- NDRE (Normalized Difference Red Edge) - for 8-band imagery
- CI Red Edge (Chlorophyll Index Red Edge)
- GIS Cross-Validation: Results validated against QGIS raster calculations
- NDVI Correlation: Built-in correlation analysis (target: >0.7)
- Conservative Thresholds: Prevents overestimation of chlorophyll content
- Vegetation Masking: NDVI-based filtering (threshold: 0.15)
| Status | Chlorophyll Range | NDVI Range | Color | Interpretation |
|---|---|---|---|---|
| Severely Stressed | 5-15 ยตg/cmยฒ | 0.15-0.20 | ๐ด Dark Red | Critical condition - Immediate intervention needed |
| Stressed | 15-25 ยตg/cmยฒ | 0.20-0.28 | ๐ Red Orange | Plant stress detected - Monitor closely |
| Moderate | 25-35 ยตg/cmยฒ | 0.28-0.35 | ๐ก Gold | Average health - Normal conditions |
| Healthy | 35-45 ยตg/cmยฒ | 0.35-0.42 | ๐ข Yellow Green | Good plant health - Optimal growth |
| Very Healthy | 45-60 ยตg/cmยฒ | >0.42 | ๐ Forest Green | Excellent condition - Peak performance |
-
Pixel Size Extraction
- Automatically extracted from GeoTIFF metadata
- Uses rasterio transform parameters
- Handles any projected CRS
-
Area Conversion
pixel_width = abs(transform[0]) # meters pixel_height = abs(transform[4]) # meters pixel_area_m2 = pixel_width ร pixel_height pixel_area_ha = pixel_area_m2 / 10000
-
Health Status Areas
- Counts pixels for each health category
- Multiplies by pixel area
- Calculates percentage distribution
- Total Image Area: Complete image coverage in hectares
- Vegetation Area: Only vegetated pixels in hectares
- Health Status Areas: Area for each of 5 health categories
- Coverage Percentage: Vegetation coverage ratio
streamlit>=1.28.0
pandas>=2.0.0
numpy>=1.24.0
rasterio>=1.3.0
matplotlib>=3.7.0
seaborn>=0.12.0
scikit-learn>=1.3.0
xgboost>=2.0.0
plotly>=5.17.0
See requirements.txt for complete list.
chlorophyll-converter/
โ
โโโ app.py # Main Streamlit application
โโโ requirements.txt # Python dependencies
โโโ README.md # This file
โโโ LICENSE # MIT License
โ
โโโ docs/ # Documentation
โ โโโ screenshot.png # Demo screenshot
โ โโโ methodology.md # Detailed methodology
โ โโโ user_guide.md # User guide
โ
โโโ examples/ # Example files
โ โโโ sample_input.tif # Sample PlanetScope image
โ โโโ sample_output.csv # Sample output report
โ
โโโ tests/ # Unit tests (optional)
โโโ test_converter.py
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name
- Commit your changes
git commit -m "Add your feature description" - Push to the branch
git push origin feature/your-feature-name
- Open a Pull Request
- Follow PEP 8 style guide
- Add docstrings to new functions
- Update README if adding new features
- Test with both 4-band and 8-band imagery
This project is licensed under the MIT License - see the LICENSE file for details.
If you use this tool in your research, please cite:
@software{planetscope_chlorophyll_converter,
title = {PlanetScope Chlorophyll Content Converter},
author = {pishapis},
year = {2024},
url = {https://github.com/pishapis/chlorophyll-converter}
}- PlanetScope/Planet Labs for satellite imagery
- Rasterio for geospatial data handling
- Streamlit for the web framework
- Scientific Community for NDVI-Chlorophyll research
- Author: pishapis
- Email: hapisadi12@gmail.com
- GitHub: @pishapis
- โ Initial release
- โ Support for 4-band and 8-band PlanetScope imagery
- โ Automatic chlorophyll estimation
- โ Health status classification
- โ Area analysis in hectares
- โ Interactive visualizations
- โ CSV export functionality
- ๐ Batch processing for multiple images
- ๐ Time-series analysis
- ๐ Machine learning model integration
- ๐ Additional crop type support
- ๐ API endpoint for automation
โญ If you find this project useful, please consider giving it a star on GitHub!
Made with โค๏ธ pishapis
