Welcome to the ARC Computer Vision Workshop! This repository contains example scripts and materials to introduce fundamental computer vision concepts with the help of OpenCV. The workshop is designed to be around two hours in length, including presentations and hands-on coding exercises.
-
Installation
- Clone this repository
- Install dependencies:
pip install -r requirements.txt
-
Basic Concepts
- Image representation: Images can be thought of as multi-dimensional arrays (e.g., height × width × channels).
- Color spaces: RGB (Red, Green, Blue), Grayscale, HSV, etc.
- Transformations: Scaling, translation, rotation.
- Filtering: Gaussian blur, median blur, etc.
- Edge Detection: Identifying boundaries in images (Canny, Sobel, etc.).
-
Scripts
scripts/basic_opencv.py
: Simple demonstration of how to load, display, and save images using OpenCV.scripts/edge_detection.py
: Example of edge detection using Canny.
-
Project
- At the end of this workshop, participants will create a mini-project applying these techniques to a real-world or fun dataset. More details will be provided in the workshop slides.
- OpenCV Documentation: docs.opencv.org
- Image Processing and Computer Vision Basics:
-
Make sure you have Python 3.8+ installed.
-
Clone this repo and install the dependencies:
git clone https://github.com/purdue-arc/cv_workshop.git cd cv_workshop pip install -r requirements.txt
-
Run any of the scripts in the
scripts/
folder: This script shows a live grayscale version of your video stream.python scripts/basic_opencv.py
This script shows a screen containing edge detections from your live video stream.
python scripts/edge_detection.py
This script shows a simple YOLOv8 Detection running through the
ultralytics
package. You could also run a more general, pre-trained YOLOv8 with theinference
package: YOLOv8 Website instructionspython scripts/yolov8_detection.py
You will be writing a snake game uses your hand as a controller to a camera to move it around to move a snake on screen to control it. The mediapipe
package will be used for this.
To get an idea of how the snake game works generally, using your keyaboard's w
, a
, s
and d
keys for up, left, down and right movements respectively, run this from the cv_workshop
directory.
python snake/keyboard_run.py
You will be filling in code inside of snake/hand_run.py
based on how opencv
was used so far to get it running. Everything is commented so ONCE YOU ARE DONE, the following should work.
python snake/hand_run.py