Git Product home page Git Product logo

color_detection's Introduction

Project Title: Color Detection

Introduction This project is a Python application that allows users to select an image and detect the dominant colors in it. It provides a graphical user interface (GUI) for image selection, displays the detected colors, and allows for pixel-by-pixel RGB value identification. Additionally, the application generates and saves a grayscale version of the selected image and visualizes pixel intensity distribution through histograms and pie charts.

Packages Required: tkinter - For creating the GUI. PIL (Python Imaging Library) - For image manipulation. colorthief - For extracting dominant colors from images. os - For interacting with the operating system. numpy - For numerical operations. opencv (OpenCV) - For image processing. pandas - For handling CSV files. matplotlib - For plotting graphs. argparse - For command-line argument parsing. Install all packages using the pip command:

bash Copy code pip install tkinter pillow colorthief numpy opencv-python pandas matplotlib argparse Ensure the color.csv file is in the same directory as the main Python program file.

Usage Run the Python file in either PyCharm or a Python console with the required libraries installed. A graphical user interface will appear upon execution.

Follow these steps:

Click the "Select Image" button and choose an image from your computer.

Click the "Detect Color" button to display the dominant colors in the corresponding side panel along with their RGB values.

Click the "Info" button to view a pixel intensity distribution histogram and a corresponding pie chart.

After closing the histogram and pie chart, a new window will appear. Click on any part of the image to display the RGB value and color name of the corresponding pixel.

Methodology

GUI Creation: We used the tkinter library to create the graphical user interface.

Image Selection: The filedialog module from tkinter allows users to select an image.

Dominant Color Extraction: The colorthief library extracts dominant colors from the image along with their RGB values.

Pixel Intensity Distribution: Using matplotlib's pyplot, the program plots the pixel intensity distribution in the form of a histogram and pie chart.

Grayscale Image Generation: The program generates a grayscale image of the selected image using OpenCV.

Pixel RGB Value Identification: Using OpenCV and mouse capturing, the program allows users to select a particular pixel and display its RGB value and color name from a predefined CSV file.

color_detection's People

Contributors

abhishekr2555 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.