Skip to content

Color Percentage Segregation and Analysis with OpenCV and Matplotlib.

License

Notifications You must be signed in to change notification settings

SKsaikiran/Colors_Extraction

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Color Percentage Segregation and Analysis with OpenCV and Matplotlib

This Jupyter notebook contains Python code that uses the OpenCV and Matplotlib libraries to extract the percentage of colors and segregate them for a single input image using image processing. It also displays the color names and their percentages with bar graph and highlighted highest color point as output.

Required Libraries

To run the code in this notebook, you will need the following libraries:

  • OpenCV (cv2)
  • NumPy (np)
  • Matplotlib.pyplot (plt)

You can install these libraries using the pip package manager in your terminal or command prompt:

pip install opencv-python
pip install numpy
pip install matplotlib

Usage

To use this notebook, follow these steps:

1. Make sure you have all the required libraries installed.

2. Save the image you want to process in your local directory or provide the path of the image in the code.

3. Copy and paste the code into a new cell in the Jupyter notebook.

4. Run the code cell.

5. The output will display the percentage of each color in the image, a bar graph showing the percentage of each color, and the highest color point in the image.

6. Save the Jupyter notebook and the output images for future reference.

Note: The code may take some time to execute depending on the size of the image and the processing power of your system. Also, make sure that the image is in a format supported by OpenCV, such as .jpg, .png, etc.

Conclusion

This notebook provides a simple and efficient way to extract the percentage of colors and segregate them in a single input image using OpenCV and Matplotlib. The analysis is displayed along with the color names and their percentages. The output bar graph and highlighted highest color point provide visual representations of the analysis for easy understanding and interpretation.

About

Color Percentage Segregation and Analysis with OpenCV and Matplotlib.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published