Skip to content

AasthathecoderX/Colour-Segmentation

 
 

Repository files navigation

Color Segmentation Tools

A collection of OpenCV-based tools for color-based image and video segmentation.

Features

  • img_segment.py: Interactive image segmentation using HSV color space
    • Real-time trackbars for adjusting lower/upper HSV thresholds
    • Displays original image, mask, and segmented result
  • palette.py: RGB color palette generator
    • Interactive trackbars for color mixing
    • Visual feedback of selected color
  • segment.py: Video segmentation tool
    • Processes video frames with adjustable HSV thresholds
    • Shows original video, mask, and segmented output

Prerequisites

  • Python 3.x
  • OpenCV (pip install opencv-python)
  • NumPy (pip install numpy)

Installation

  1. Clone the repository:
git clone https://github.com/GauravKarakoti/color-segmentation.git
cd color-segmentation
  1. Install dependencies:
pip install -r requirements.txt

Usage

Image Segmentation

python img_segment.py
  • Adjust trackbars to set HSV thresholds
  • Press ESC to exit
  • Ensure image1.webp exists in project directory or modify filename

Color Palette

python palette.py
  • Use RGB trackbars to mix colors
  • Displays resulting color in window

Video Segmentation

python segment.py
  • Adjust trackbars for real-time video processing
  • Ensure video1.mp4 exists or modify video path
  • Press ESC to exit

Contributing

Contributions are welcome! Please see Contributing.md for guidelines.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%