A short python program that can detect the information of the objects from the stereo camera using YOLO model
Copy this repository under your local computer.
Before running this program, it is advised to have the following environments installed:
OpenCV
PyTorch
Ultralytics (pip install ultralytics)
Connect your stereo camera onto the computer. It is advised to check the resolution of your stereo camera to make sure if it matches with the resolution in the python code. If your stereo camera has a different resolution than the original code (1280x960 for each camera), please make the proper adjustment.
Compile the code and run. It will download the model during the first run. You should see a window frame with the objects being detected using bounding boxes.
Update: Now the distance in cm from each object detected to the camera is also displayed! The parameter for the length between two cameras can be set under the variable named 'd'.
Press "q" in your keyboard to quit the window.