bitsy-ai / rpi-object-tracking

Object tracking tutorial using TensorFlow / TensorFlow Lite, Raspberry Pi, Pi Camera, and a Pimoroni Pan-Tilt Hat.
https://medium.com/@grepLeigh/real-time-object-tracking-with-tensorflow-raspberry-pi-and-pan-tilt-hat-2aeaef47e134
MIT License
184 stars 68 forks source link

Inverted pi camera image #25

Closed TCIII closed 4 years ago

TCIII commented 4 years ago

Description

I found it preferable to mount the pi camera on the tilt gimbal with the CSI cable coming from the top of the gimbal as this keeps the cable from having to wrap around the pan gimbal during gimbal movement. Of course this resulted in an inverted image compared to the normal pi camera image during the pi camera test and is unacceptable when running the detect program.

What I Did

In the python 3.7 site packages there is a picamera library. In the picamera library there is a camera.py program that controls the functions of the camera. At line 495 of the camera.py program change the "rotation" value from 0 to 180. This will correct the image during the pi camera test program, but will not correct the pi camera image during the detect program. To correct the pi camera image used in the detect program, change the "rotation" value from 0 to 180 in the detect/camera.py program and all will be well.

Paste the command(s) you ran and the output.
If there was a crash, please include the traceback here.