Skip to content

Commit a14f703

Browse files
Create Readme.md
1 parent c22f62f commit a14f703

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Virtual Painter Project
2+
3+
## Description
4+
The Virtual Painter is an interactive project where users can draw on the screen by tracking a colored object (e.g., a red pen or green object) via a webcam. As the object moves across the screen, it leaves a virtual trail, creating a painting or drawing effect. This project uses OpenCV to detect the object's color and track its movement, allowing for real-time drawing on the screen.
5+
6+
This fun and engaging project can be used for educational purposes, drawing games, or creative activities by tracking specific color objects and adjusting the canvas features.
7+
8+
## Features
9+
- **Real-time color tracking**: Detect and track an object with a specific color using the HSV color range.
10+
- **Dynamic Drawing**: Draw on the screen by moving the color object in front of the webcam.
11+
- **Customizable canvas**: Modify the color range and adjust the drawing features.
12+
- **Noise Filtering**: Ignores smaller irrelevant contours to prevent noise from interfering with the drawing.
13+
14+
## Dependencies
15+
To run this project, the following Python packages are required:
16+
- OpenCV for image processing:
17+
```pip install opencv-python```
18+
19+
- Numpy for numerical operations:
20+
```pip install numpy```
21+
22+
## How to Run
23+
- Install the required dependencies mentioned above.
24+
- Download or clone the project files:
25+
```git clone https://github.com/your-repo/your-project.git```
26+
- Navigate to the project directory:
27+
```cd your-project-folder```
28+
- Run the script:
29+
```python virtual_painter.py```
30+
- **Use a colored object** (like a red or green pen) in front of the webcam to start drawing. Move the object around to see the trail created on the screen.
31+
32+
## How It Works
33+
34+
The project works by using OpenCV to capture video from the webcam and detect the movement of an object based on its color. The HSV (Hue, Saturation, and Value) color space is used to define a range for detecting specific colors. Once the object is detected, its coordinates are tracked, and a trail is drawn on the canvas.
35+
## Color Detection
36+
The color detection is done using the HSV color range, which separates color (Hue) from intensity (Saturation and Value). The object's color is detected by defining lower and upper bounds in HSV format, which is then used to create a mask to highlight the colored object.
37+
## Tracking and Drawing
38+
Once the object is detected, its position is tracked, and the coordinates are stored in a list. The cv2.line() or cv2.circle() function is then used to draw lines or points on the screen at those coordinates, creating a virtual drawing effect.
39+
## Project Structure
40+
```
41+
- virtual_painter.py # Main script for the virtual painter
42+
- README.md # Documentation for the project
43+
```
44+

0 commit comments

Comments
 (0)