The project is part of the MeFormei organization and processes images obtained from a camera to determine its position on the screen coordinates and send to interested listeners, making it possible to simulate a cursor or generate commands from the position variation enabled by triggers when limit areas are reached.
These instructions will show how to configure your environment and how to have your project up and running.
What things you need to install the software and how to install them
Its necessary to use a Linux or other Unix based system to run the project (like Ubuntu, Debian, MacOS X and others). You can also use the available version to run on a Raspberry Pi running the Raspibian system.
To run the project you also need to install its dependencies, listed above.
The first dependency is the Python, on version 3.4+. You can install it running following the instructions:
sudo apt-get install python3
You can check if the correct version was installed searching from Python 3.4+ version after running:
python --version
You also need to install some libraries listed in the requirements.txt file using the Pip, already included on Python 2.7.9+ or Python 3.4+ versions. You can install these dependencies running the command:
sudo pip install -r requirements.txt
You also need to install OpenCV, on version 3+. You can install it following the instructions given in one of the following links:
- Install OpenCV 3.0 and Python 3.4+ on Ubuntu - In this tutorial you need to compile the OpenCV code, but you can run the latest version available on its repository.
After installing it, the following commands should work perfectly:
python3
>>> import cv2
You can run the Mosquitto MQTT Broker in an easier way using Docker. To install Docker you can following the instructions available on its website.
First you must download the image that will be used to run the MQTT broker. You can do it running the command:
docker pull toke/mosquitto
Now you can run the Mosquitto MQTT Broker with Docker using the following command:
docker run -ti -p 1883:1883 -p 9001:9001 --name mosquitto toke/mosquitto
In a new terminal window, navigate to the project folder and run the following command:
python camera-tracker.py --mqtt <MOSQUITTO_IP>
On MOSQUITTO_IP value, given as argument to --mqtt (or -q) you should pass the IP from the MQTT Broker host. When running Docker on Linux, it will be localhost (or 127.0.0.1). On other systems it will be the IP from the created VM (e.g 192.168.99.100). You can omit this argument if you don't want to send the calculated information to the MQTT Broker (when checking the environment or running tests, for example).
You can also pass the argument --showimage (or -i) to show the image output with the processing results.
- Python - The programming language used
- OpenCV - Image processing library used
- MQTT - Connectivity protocol used
0.1.0
- Lucas Cristiano - Initial work - Github page
- Roberto Dantas - Initial work - Github page
- Lucas Cristiano - Initial work - Github page
See also the list of contributors who participated in this project.