The next stage was to develop the software and hardware solution required to automate the use of the cameras PAN/TILT & 20x Optical ZOOM features via its IP control API/Interface
It was decided to use a dedicated second camera that could always see the full scene, rather than running CV/Image recognition on the main camera, because if the main camera was zoomed in on a performer it would not see some action outside of its vision to zoom out to capture.
I set up a raspberry pi 3 and camera running openCV software and a simple python change/movement detect loop to watch a chosen section of the pi camera (excluding audience at bottom of screen) . This then calculated a target and zoom level to command the PTZ camera to focus on.
There was also a time sequence to for example every 5 minutes zoom right at and do a slow pan left and right to 'look around' before resuming focus on the main action.
The Pi had a calibrated conversion table to convert its pixel coordinates into corresponding tracking commands and zoom levels for the PTZ camera.
Ive since switched the pi and camera combo for a ip camera, and made it that the opencv script is run by the "Live Streams" computer that receives the PTZ stream.





Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.