User avatar
jbeale
Posts: 3641
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

half-transparent overlay for stop motion?

Wed May 20, 2020 3:49 am

One of the RPi project pages shows a simple stop-motion project using the Pi camera:
https://projects.raspberrypi.org/en/pro ... top-motion

The new High Quality pi camera is more interesting to me for this use than the previous pi cams, because of the variety of available C/CS lenses with manual adjustments for focus, aperture etc. The one thing I haven't seen is a program that provides the "onion skin" function that most smartphone stop-motion apps have, where the previous captured frame is overlaid with (for example) 50% transparency on the live view. Is this something anyone has tried before, if it is possible?

Thinking about it, in this case you don't necessarily need a high framerate, or max resolution on the live view. So I guess you could just take a series of stills MJPEG style, and combine the images on the CPU without needing real alpha-compositing on live video preview from the GPU side.

ethanol100
Posts: 637
Joined: Wed Oct 02, 2013 12:28 pm

Re: half-transparent overlay for stop motion?

Wed May 20, 2020 6:54 am

I think this could be done with picamera. You could modify overlaying images on the preview to use the last captured file?

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

Re: half-transparent overlay for stop motion?

Wed May 20, 2020 6:59 am

jbeale wrote:
Wed May 20, 2020 3:49 am
The one thing I haven't seen is a program that provides the "onion skin" function that most smartphone stop-motion apps have, where the previous captured frame is overlaid with (for example) 50% transparency on the live view. Is this something anyone has tried before, if it is possible?
Things like that can be done with dispmanx API. Near zero documentation. But AndrewFromMelbourne created a nice repo with many samples:
https://github.com/AndrewFromMelbourne/raspidmx
I forked it in order to create a i420 live video viewer that would allow to view live raspividyuv stream of frames. I based it on rgb_triangle demo.
For your application alpha blending is available in dispmanx as well. I have not tried, but radar_sweep_alpha demo seems to demonstrate what you want.

P.S:
His raspi2png takes screenshot inclusive overlays, regardless whether in console or X11 mode, and uses dispmanx API as well:
https://github.com/AndrewFromMelbourne/raspi2png
https://stamm-wilbrandt.de/en/Raspberry_camera.html
https://stamm-wilbrandt.de/en#raspcatbot
https://github.com/Hermann-SW/raspiraw
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264

Return to “Camera board”