Skip to content

🌳An OpenCV-based tool for analyzing and visualizing deforestation using satellite imagery. Includes image preprocessing, vegetation detection, and comparative analysis to highlight forest cover changes.

License

Notifications You must be signed in to change notification settings

HeleenaRobert/deforestation-analysis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Deforestation Analysis using Color Segmentation

Banner

Python OpenCV Matplotlib License

✨ Created with ❀️ by Heleena Robert


🏞 Overview

Deforestation Analysis is a simple computer vision project that uses color segmentation to analyze vegetation cover in satellite or aerial images.
It highlights green areas, calculates the percentage of vegetation coverage, and visualizes pixel distribution using BGR and HSV histograms.
This tool is ideal for tracking deforestation trends or comparing forest cover across different time periods.
By automating segmentation and analysis, it provides an easy way to visualize environmental changes over time.


✨ Features

  • Vegetation Segmentation: Detects green regions using HSV color thresholds.
  • Green Coverage Calculation: Computes % of vegetation pixels.
  • Histogram Analysis: Plots BGR and HSV histograms for vegetation trends.
  • Automated Output Saving: Saves segmented results and histograms in output/.
  • Visual Comparison: Displays original vs segmented images side-by-side.

πŸ“‚ Folder Structure

deforestation-analysis/
β”‚
β”œβ”€β”€ deforestation_analysis.py          # Main script
β”‚
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ color_utils.py                 # Segmentation + green coverage
β”‚   └── visualization_utils.py         # Histograms + visualization
β”‚
β”œβ”€β”€ input/                             # Input images for analysis
β”‚   β”œβ”€β”€ 1985.png
β”‚   β”œβ”€β”€ 1993.png
β”‚   β”œβ”€β”€ 2001.png
β”‚   └── 2011.png
β”‚
β”œβ”€β”€ output/                            # Results auto-saved here
β”‚   β”œβ”€β”€ 1985_segmented.png
β”‚   β”œβ”€β”€ 1985_histogram.png
β”‚   β”œβ”€β”€ 1993_segmented.png
β”‚   β”œβ”€β”€ 1993_histogram.png
β”‚   └── ...
β”‚
β”œβ”€β”€ assets/                            # For README visuals
β”‚   β”œβ”€β”€ banner.png
β”‚   β”œβ”€β”€ sample_segmented.png
β”‚   └── sample_histogram.png
β”‚
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .gitignore
β”œβ”€β”€ LICENSE
└── README.md

πŸ–Ό Visual Outputs

🌳 Segmentation Example

Segmented Vegetation

πŸ“Š Histogram Example

Vegetation Histograms


πŸš€ How It Works

  1. Place your forest or aerial images into the input/ folder.
  2. Run the script to process all images.
  3. View results in the console and check output/ for segmented vegetation maps and histograms.

πŸ“¦ Requirements

This project requires the following Python libraries:

  • opencv-python – For image processing and color segmentation.
  • numpy – For numerical operations and pixel calculations.
  • matplotlib – For plotting histograms and displaying results.

πŸ”§ Installation

git clone https://github.com/HeleenaRobert/deforestation-analysis.git
cd deforestation-analysis
pip install -r requirements.txt

▢️ Usage

python deforestation_analysis.py

Results will be displayed on-screen and saved automatically in the output/ folder.


πŸ›  Technologies Used


πŸ“ License

This project is licensed under the MIT License.


πŸ‘©β€πŸ’» Author

Heleena Robert
GitHub

About

🌳An OpenCV-based tool for analyzing and visualizing deforestation using satellite imagery. Includes image preprocessing, vegetation detection, and comparative analysis to highlight forest cover changes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages