Air Carvas (python OpenCV project)
This project implements a real-time color tracker and paint application using OpenCV and Python. It allows users to:
Track a colored object using a color detection algorithm and display its position on the screen. Draw on a virtual canvas with various colors by selecting them from a color palette and tracking the movement of the colored object. Clear the canvas by clicking a designated button.
Color tracking: Tracks a specified color in real-time. Color selection: Allows choosing a drawing color from a color palette. Drawing: Enables drawing on a virtual canvas using the tracked object's movement. Clearing: Offers a clear button to erase the canvas.
Prerequisites: Ensure you have Python 3 and OpenCV installed. You can install OpenCV using:
Bash pip install opencv-python
Clone the repository:
Bash git clone https://github.com//color-tracker-paint.git
Navigate to the project directory:
Bash cd color-tracker-paint
Run the script:
Bash python color_tracker_paint.py
Camera feed: You'll see a live video feed from your webcam.
Color tracking: The script will automatically attempt to track a blue color by default.
Color selection: Click on the desired color rectangle in the color palette above the canvas to change the drawing color.
Drawing: Move the colored object within the camera frame to draw on the canvas.
Clearing: Click the "CLEAR ALL" button above the canvas to erase all drawings.
Exit: Press the "q" key on your keyboard to quit the application.
I'd be glad to help you create a comprehensive README file for your GitHub project, incorporating the best aspects of the previous responses and addressing identified shortcomings:
This project implements a real-time color tracker and paint application using OpenCV and Python. It allows users to:
Track a colored object using a color detection algorithm and display its position on the screen. Draw on a virtual canvas with various colors by selecting them from a color palette and tracking the movement of the colored object. Clear the canvas by clicking a designated button.
Color tracking: Tracks a specified color in real-time. Color selection: Allows choosing a drawing color from a color palette. Drawing: Enables drawing on a virtual canvas using the tracked object's movement. Clearing: Offers a clear button to erase the canvas.
Prerequisites: Ensure you have Python 3 and OpenCV installed. You can install OpenCV using:
Bash pip install opencv-python Use code with caution. Clone the repository:
Bash git clone https://github.com//color-tracker-paint.git Use code with caution. Navigate to the project directory:
Bash cd color-tracker-paint Use code with caution.
Run the script:
Bash python color_tracker_paint.py Use code with caution. Camera feed: You'll see a live video feed from your webcam.
Color tracking: The script will automatically attempt to track a blue color by default.
Color selection: Click on the desired color rectangle in the color palette above the canvas to change the drawing color.
Drawing: Move the colored object within the camera frame to draw on the canvas.
Clearing: Click the "CLEAR ALL" button above the canvas to erase all drawings.
Exit: Press the "q" key on your keyboard to quit the application.
Adjust the color tracking parameters in the code (Hue, Saturation, and Value ranges) if needed to better match your desired color. Experiment with different colors and drawing styles to create your artwork!
Implement additional features like:
- Support for tracking multiple colors simultaneously.
- Brush size and shape customization.
- Undo/redo functionality.
- Saving and loading drawings. Explore advanced computer vision techniques for object recognition and manipulation.
This project is licensed under the MIT License: https://choosealicense.com/licenses/mit/.
Feel free to fork the repository and submit pull requests with your improvements or suggestions!