This GitHub repository contains the source code and resources for a Python project that performs color detection in images. Detecting colors in images is a fundamental task in computer vision and has various applications, including image processing, object recognition, and more. This project aims to provide a simple yet comprehensive tool for color analysis in images.
Color detection in images involves identifying and extracting specific colors or color ranges from an image. In this project, we utilize the Python programming language and popular libraries like OpenCV and NumPy to perform color detection. The primary objectives of this project are:
- Color Recognition: Identify and recognize predefined colors or user-specified color ranges in an image.
- Visualization: Provide visual representations of the detected colors, such as color histograms, masks, and color filtering.
- Image Analysis: Offer insights into the color distribution within an image, including the percentage of each color present.
Before using the code in this repository, ensure that you have the following prerequisites installed:
- Python 3.6+
- OpenCV (cv2) library
- NumPy library
You can install the required libraries using pip:
- "pip install opencv-python numpy"
Use this command to run the program: python color_detection.py -i "Image path".
- The dataset folder contains the dataset and some sample images to work on.
- Code folder contains the python file.
- Model folder contains the Random Forest impplementation on the data.