Skip to content

🍌 A computer vision system for analyzing banana ripeness using OpenCV and machine learning. Implements multi-stage analysis including color detection, feature extraction, and segmentation for accurate ripeness classification.

License

Notifications You must be signed in to change notification settings

notsuperganang/Banana-Ripeness-Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍌 Banana Ripeness Detection System

Computer Vision-based Banana Ripeness Analysis

Banana Ripeness Detection System

Python OpenCV License

An advanced computer vision system that analyzes banana ripeness using multiple image processing techniques and machine learning algorithms.

πŸš€ Features

  • Multi-Stage Analysis

    • Color Analysis (HSV & LAB Color Spaces)
    • Texture Analysis (SIFT Features)
    • Shape Analysis (Contour Detection)
    • Segmentation (Watershed Algorithm)
  • Comprehensive Visualization

    • Original Image Processing
    • Edge Detection Results
    • Feature Point Mapping
    • Contour Visualization
    • Ripeness Distribution Charts
  • Advanced Detection

    • Three-stage ripeness classification
    • Percentage-based analysis
    • Confidence scoring
    • Dark spot detection

πŸ“‹ Requirements

opencv-python>=4.5.0
numpy>=1.19.0
scikit-learn>=0.24.0
matplotlib>=3.3.0

πŸ› οΈ Installation

  1. Clone the repository:
git clone https://github.com/notsuperganang/Banana-Ripeness-Detection
cd banana-ripeness-detection
  1. Create and activate virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate  # Linux/Mac
.\venv\Scripts\activate   # Windows
  1. Install dependencies:
pip install -r requirements.txt

πŸ’» Usage

Basic Usage

from banana_detector import BananaRipenessDetector

# Initialize detector
detector = BananaRipenessDetector()

# Analyze image
results = detector.detect_ripeness('path/to/banana.jpg')

# Visualize results
detector.visualize_results('path/to/banana.jpg', results)

Jupyter Notebook

We provide a comprehensive Jupyter notebook demonstrating the system's capabilities:

jupyter notebook Banana_Ripeness_Analysis.ipynb

πŸ“Š Example Results

Input Image

Banana Ripeness Detection System

Analysis Results

Analysis Results

Results:
Ripeness Level: Ripe
Percentages:
- Unripe: 5.97%
- Ripe: 19.07%
- Overripe: 8.42%

πŸ”¬ Technical Details

Color Ranges (HSV)

  • Unripe: H(25-35), S(50-255), V(50-255)
  • Ripe: H(20-30), S(100-255), V(100-255)
  • Overripe: H(0-20), S(50-255), V(20-255)

Processing Pipeline

  1. Image Preprocessing
  2. Edge Detection
  3. Feature Extraction
  4. Segmentation
  5. Ripeness Analysis
  6. Visualization

πŸ“ Project Structure

banana-ripeness-detection/
β”œβ”€β”€ examples/
β”‚   β”œβ”€β”€ input/
|   |   └── pisang.jpg
β”‚   └── results/
|       └── output.png
β”œβ”€β”€ notebooks/
β”‚   └── Banana_Ripeness_Analysis.ipynb
β”œβ”€β”€ requirements.txt
└── LICENSE
└── README.md

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Computer Vision course at Syiah Kuala University
  • OpenCV documentation and community
  • scikit-learn documentation and community

πŸ“¬ Contact

Ganang Setyo Hadi - @notsuperganang - ganangsetyohadi@gmail.com

Project Link: https://github.com/notsuperganang/Banana-Ripeness-Detection

πŸ“š Citation

If you use this project in your research, please cite:

@software{banana_ripeness_detection,
  author = {Ganang Setyo Hadi},
  title = {Banana Ripeness Detection System},
  year = {2024},
  url = {https://github.com/notsuperganang/Banana-Ripeness-Detection}
}

Made with ❀️ for 🍌

About

🍌 A computer vision system for analyzing banana ripeness using OpenCV and machine learning. Implements multi-stage analysis including color detection, feature extraction, and segmentation for accurate ripeness classification.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published