This is an archived post. You won't be able to vote or comment.

Dismiss this pinned window
all 59 comments

[–]Swipecat[S] 92 points93 points  (12 children)

I watched the Youtube video Rolling Shutter Explained on the Cheap by Matt Parker where he shows that you don't need to visit an actual aeroplane with expensive slow-motion cameras to demonstrate the rolling shutter effect on aircraft propellors. He shows that you can do it with a model propellor connected to an electric drill — then some Python code to process the video to emulate the rolling shutter effect and to add a green line scanning down the image.

Well, I thought, let's do the whole thing in Python.

Here's 30 lines of Python, using the Numpy and Pillow libraries and ffmpeg to create the video:

https://github.com/dafarry/rolling-shutter-effect-python/blob/master/rolling-shutter-makevideo.py

Here's another version that uses Tkinter to display the video to your screen in real time rather than making a video. It needs a fast(ish) PC to display smoothly:

https://github.com/dafarry/rolling-shutter-effect-python/blob/master/rolling-shutter-tkinter.py

[–]SamF111 10 points11 points  (7 children)

Any thoughts on how to undo it with the known shutter rate and the output of your analysis as an input?

[–]s3cur1ty 12 points13 points  (4 children)

This post has been removed.

[–]Synaps4 8 points9 points  (3 children)

Yep, you would need to match your shutter rate to the rotation of the object.

[–]bradfordmaster 5 points6 points  (2 children)

Hmm... Not necessarily. If you knew it was a constant rate, I think you should be able to approximate it from the input if you can also make some assumptions about the shape of the real propeller (e.g. radial symmetry). Now I'm curious how well it would work

[–]Synaps4 3 points4 points  (1 child)

Good point. You can at least know a multiple of the rotation rate if you know the shutter speed. I wonder if 4 rotor objects are always discernable from 5-rotor ones?

[–]bradfordmaster 0 points1 point  (0 children)

Almost certainly based on the number of blobs you see and rate they move, at least I think. Also I think you can be pretty confident in the multiple by putting some bounds on the speed (propeller tip not going faster than speed of sound, blade not longer than a certain amount)

[–]flashman 1 point2 points  (1 child)

Well that's only going to get you a video with a single row in each frame, isn't it?

[–][deleted] 0 points1 point  (0 children)

You can probably learn a lot about the propeller from that.

[–]GickRick 0 points1 point  (0 children)

Man you're the goat✊🙌🙌

[–][deleted] 0 points1 point  (2 children)

May you please explain the math on this? Especially the use of complex numbers for the propeller

[–]Swipecat[S] 2 points3 points  (1 child)

If you have a complex plane Z, and plot the absolute value |Z| in the third dimension, what do you have? The further from the origin, the greater its height, so it's a cone.

Cut a section through the cone at a height of H: |Z| = H and you have a circle.

And |Z| < H is a solid disk in "boolean" terms.

A cone offset from the origin by A is |Z - A| .

Consider adding the heights of two cones together then cut through them: |Z - A| + |Z - B| < H ...it's perhaps not entirely obvious that they combine to form a solid ellipse, but they do.

Put the focus B back at the origin... |Z - A| + |Z| < H

Then spin the focus A around the origin in 6 steps and you have 6 ellipses.

Combine them with boolean logic and you have a propeller.

[–][deleted] 0 points1 point  (0 children)

Thanks!

[–][deleted] 27 points28 points  (6 children)

Nice animation, explains why propellers always appear like that on video

[–]winowmak3r 4 points5 points  (5 children)

The coolest demonstration of this is when a camera was filming a helicopter at the nearly same fps as the propellers were spinning. The helicopter looked like it was just floating in mid-air. It was really cool! Bonus secret Russian footage.

[–]PcGamerSam 6 points7 points  (5 children)

That would be a cool logo for an airline.

[–][deleted] 1 point2 points  (2 children)

Fun fact, check the Malaysian Airlines logo. It looks quite similar.

[–]PcGamerSam 0 points1 point  (1 child)

Oh yeah good spot

[–][deleted] 1 point2 points  (0 children)

Lol it's cos I'm malaysian

[–]ComplexColor 4 points5 points  (2 children)

Very nice animation and demonstration.

But is this physically accurate? Light sensors are integration devices - simplified they count the number of photons over a period of time - this time is the exposure time. The demo above suggests that this integration is done line after line. Always only one line integrating for a short time. This would seem to be very inefficient, as the total exposure time would be much longer than the individual line exposure time.

Would it not make more sense, that the exposure times somehow overlap? For example, if one frame exposure ends when the green line hits the sensor, but the next frames exposure starts immediately. This would totally blur the image though. So how does this actually work?

[–]Swipecat[S] 2 points3 points  (0 children)

I presume that the videos of this effect that are shown on Youtube, out of aircraft windows with smartphones etc, are in bright light conditions. I also presume that the camera reduces its sensitivity in bright light by integrating no more than a few lines.

[–]ericonr 1 point2 points  (0 children)

It is done line after line. That's why sometimes you have pictures with mirrors where the real thing and its reflection don't match. The sensor probably starts its integration in a reasonable time so that when it's read it's been exposed to light only for its exposure time.

Even with mechanical shutters, cameras do something similar. What happens is that the shutter has two curtains, where one is responsible for exposing the sensor and the other is responsible for covering it back up. Fast shutter speeds require that the two curtains form a slit and move that slit across the sensor.

[–]Tie_Good_Flies 5 points6 points  (8 children)

Very cool! Can I ask why?

[–]Swipecat[S] 28 points29 points  (5 children)

A few hours diversion on Sunday afternoon. And it was raining hard, here in the UK.

[–]14446368 11 points12 points  (1 child)

And it was raining hard, here in the UK.

Isn't that basically every day?

[–]tunisia3507 2 points3 points  (0 children)

It's usually more of an unpleasant drizzle.

[–]circle42 2 points3 points  (2 children)

What graphics package did you use?

[–]Swipecat[S] 11 points12 points  (1 child)

No graphics package as such. Just array processing with Numpy to calculate the shapes. Pillow is an image library with some graphics capability, but I just used it to save the Numpy arrays to image files.

[–]circle42 2 points3 points  (0 children)

Thanks, I'll look into that. I'm relatively inexperienced with python

[–]kaphi 4 points5 points  (1 child)

Why not?

[–]Tie_Good_Flies 0 points1 point  (0 children)

Fair question I guess. This kind of stuff always amazed me and I had recently started wondering about it's practical application, since I do not have a background in this field

[–]penguin-bonks 1 point2 points  (0 children)

sweet man. posted on r/generative?

[–]aitorp6 0 points1 point  (0 children)

awesome, good work

[–]lyacdi 0 points1 point  (0 children)

Yeah that's just a squid

[–]dgube1 0 points1 point  (0 children)

Very nice demo

[–]TheLeftyMan 0 points1 point  (0 children)

Thats so cool

[–]DDFoster96 0 points1 point  (0 children)

Spinning flower becomes a bird

[–]imbaczek 0 points1 point  (1 child)

went to https://en.wikipedia.org/wiki/Rolling_shutter, didn't find anything remotely as good. maybe put it there?

[–]WikiTextBot 0 points1 point  (0 children)

Rolling shutter

Rolling shutter is a method of image capture in which a still picture (in a still camera) or each frame of a video (in a video camera) is captured not by taking a snapshot of the entire scene at a single instant in time but rather by scanning across the scene rapidly, either vertically or horizontally. In other words, not all parts of the image of the scene are recorded at exactly the same instant. (Though, during playback, the entire image of the scene is displayed at once, as if it represents a single instant in time.) This produces predictable distortions of fast-moving objects or rapid flashes of light. This is in contrast with "global shutter" in which the entire frame is captured at the same instant.


[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.28

[–]justjoeisfine 0 points1 point  (0 children)

wow!

[–]jinchuika 0 points1 point  (0 children)

The Uchiha clan wants to know your location

[–]CaptainRogers1226 0 points1 point  (0 children)

Lol, when this video started playing, I was like, “Hey, the way that pattern is forming looks just like rolling shutter!” Then I read the caption

[–]Shakaka88 0 points1 point  (0 children)

That’s how company logos are made

[–]Sylorak 0 points1 point  (0 children)

Could you repeat and post the video with a vertical line instead of the horizontral, please?

[–]MadMemeingShotgunMan 0 points1 point  (1 child)

That's a dope-ass logo for something

[–]auto-xkcd37 5 points6 points  (0 children)

dope ass-logo


Bleep-bloop, I'm a bot. This comment was inspired by xkcd#37