Close

Time-Scan effect

A project log for Free Beer Selfie

Take a chance to offer a free beer to a stranger ! Or be creative with a photobooth.

muthMuth 01/29/2019 at 13:352 Comments

For quite some time now, I'd like to add a creative mode on the photobooth. And I had the idea of a real-time "time scan" effect.

The idea is to apply a different time delay for each pixel of the image. For example the bottom line has no delay, and gradually to the top lines there is more delay:

The frame rate of the video input should be quite high in order to have the full image scanned in around 3 seconds.

After exploring different solutions, I got some help directly from raspberry pi forum user 6by9. As he told me, I then derived the raspividyuv C code. And it runs rather fast. The camera acquisition is at 90 fps, the rotating buffer filled accordingly. The rendering is at around 30 fps for 15% of total cpu usage.

The code is still messy but can be found here : github RaspiVidYUV.c and the raspberry pi forum page is here: https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=230926

The code uses a greyscale image to determine the time delay of each pixels, so it is not limited to a vertical scan.

For a vertical gradient :

For a circle gradient:

Discussions

Mike Szczys wrote 01/29/2019 at 17:42 point

Oh wow! I read this without watching the video and you've got to watch the video to get the full effect.

That's a really neat approach to making the captured images more fun. Are you thinking about an option to generate animated GIFs from short recordings with the effects on? I think people would love posting them from the event if you did.

  Are you sure? yes | no

Muth wrote 01/29/2019 at 20:36 point

Thanks a lot Mike! 

What an awesome idea you just have with the animated gif ! I'll think about it :D

  Are you sure? yes | no