Skip to content

Virtual Interaction using C++ and OpenCV for painting and mouse input

Notifications You must be signed in to change notification settings

sam-coleman/Virtual_Interaction

Repository files navigation

Virtual Interaction

Human Computer Interaction project utilizing OpenCV and C++

Identifies a color target in webcam frame and uses that input to either paint or move a mouse.

Requirements:

- Opencv >= 3.0 
- X11

Installation

Create a build directory, run cmake .., and then run make.

mkdir build
cd build
cmake ..
make

Usage

Painting

Run the Painting file in the build directory and use a red color target to virtually "paint".

cd build
./Painting

To change the the color target, add lower and upper bound HSV values when running the file

./Painting lower_H lower_S lower_V upper_H upper_S upper_V

Press the 's' key to save the image, and enter a file name including extension in the command line. The images will be saved in the folder saved_outputs. Press the 'esc' key to exit the painting canvas.

Run the Determine Color file to determine the lower and upper bound HSV values of a color target with a GUI. Adjust the sliders until only your color target is displayed, and press the 's' key to output the bounds to the terminal.

python3 determineColor.py

Mouse Movement

Run the Mouse file in the build directory and use a red color target to move the mouse around.

cd build
./Mouse

To change the color target, add lower and upper bound HSV values when running the file

./Mouse lower_H lower_S lower_V upper_H upper_S upper_V

Press the 'esc' key to exit the program.

Contributors

Written by Sam Coleman and Kate Mackowiak for Software Systems at Olin College of Engineering

About

Virtual Interaction using C++ and OpenCV for painting and mouse input

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages