Scorpions Robotics #7672
FRC Rapid React Vision Processing
Runs on:
How do we process the vision?
We use the Open Source Computer Vision Library OpenCV with Cascade Classifier features to detect and track the target.
Details:
-
Detect the host computer's OS, hostname and IP address.
-
Initialize NetworkTables client and stream server, then connect to the "vision" table.
-
Define the camera according to the OS and parameters.
-
Define the cascade classifier path. (The classifier we used is trained to detect FRC Power Ports, and can be downloaded from here)
-
while True:
- Read the image from the camera.
- Detect the target using the cascade_classifier.detectMultiScale() method.
- If the target is detected, draw a rectangle around it.
- Display the image.
- Send the target's position to the NetworkTables.
- Wait for the next frame.
Compatible Operating Systems:
Installation:
-
Clone the repository.
git clone https://github.com/Scorpions-Robotics/vision-2022.git
-
Install the required dependencies.
pip install --upgrade -r requirements.txt
-
On Linux you have to install extra dependencies.
cd misc/bash/
chmod +x *
./install_os_dependencies.sh
Installation for ROB (Run On Boot) Usage (Only for Linux):
Use this installation method to make the script run on boot.
-
Clone the repository.
git clone https://github.com/Scorpions-Robotics/vision-2022.git
-
Run:
sudo python setup.py --service_name service-name
service_name defaults to "vision" if not provided
-
Enjoy
Usage:
-
Copy
settings.ini.template
and rename it tosettings.ini
. Then edit it to your needs. -
Run the
vision.py
file to start the vision processing.
Important Note:
-
Always make sure to run the file from the root directory of the project.
-
Always keep the dependencies up to date.
-
Always use the latest stable version of this project.
Our Social Media Accounts and Discord Server
-
Instagram: https://instagram.com/scorpions7672
-
YouTube: https://www.youtube.com/channel/UCLsK3acedtyaD6dABW39g2Q
-
Discord Server: https://discord.gg/MqvbYPecgt
Contact
Contributing:
-
If you have any suggestions, or found any bugs, please open an issue or create a pull request.
-
Don't hesitate to open an issue if you have any questions about the code.
Authors
License
This project is licensed under the Apache-2.0 license. All rights reserved.