cloudmixtape
Posts: 1
Joined: Sun Feb 09, 2020 12:05 am

How to Overlay Shape to Real-Time Pi Camera

Wed Mar 25, 2020 2:08 am

I'm needing to overlay an oval shape to the real-time frame of a RPi camera. Any tips on how to do that? I see helpful links to add text to a real-time camera frame but not for shapes. It would need to be centered in the frame to help direct someone to make sure they're standing close enough/in the correct spot.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8121
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: How to Overlay Shape to Real-Time Pi Camera

Wed Mar 25, 2020 11:09 am

You want the oval in any recorded image, or just on the preview? If only on the preview then create an extra layer with alpha blending - https://picamera.readthedocs.io/en/late ... he-preview if using Picamera.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
HermannSW
Posts: 2035
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: How to Overlay Shape to Real-Time Pi Camera

Wed Mar 25, 2020 7:29 pm

6by9 had solution for preview, I have for alpha blending of real video, so the recorded video will have that:
https://github.com/Hermann-SW2/userland ... a-blending
alpha-blending.png
alpha-blending.png (73.35 KiB) Viewed 92 times
This is another application:
Image
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

Return to “Camera board”