Thursday, 9 May 2013

3D Lightning

Reddit is a great website, where the ability to share and discuss things on the web gives some great little discoveries. Things that would otherwise seem impossibly unlikely, like two people in completely different places getting a photo of the same lightning bolt, suddenly pop up all the time.

 Pic by chordnine

 Pic by Bobo1010

Having two pictures of the exact same lightning bolt lets you do something pretty amazing; reconstruct its path in 3D. In this case because the precise location and elevation of the photographers isn't known this is slightly more art than science, but it is still fun!

These are the two bolts, scaled to approximately the same size:


It is immediately clear that they are taken from about the same direction but different heights: the second bolt looks squashed vertically. This means the pair of images are roughly a stereo pair, but with a vertical shift instead of a horizontal. This is just like the pair of images you would see with your eyes if you had two eyes positioned vertically instead of horizontally on your head.


To analyse this the first step is to trace the lightning bolt, making sure that every point in one image matches up to the corresponding point in the other image, then record the coordinates of all the points. This gives a nice table of numbers where you can calculate the difference in x and y position in the two images.


Now we need to do some maths... except I don't like doing complicated maths and it turns out there is a big simplification you can make! If both pictures are taken from a long way away from the lightning bolt (i.e. the object has quite a small angular size in the image) then the shift in position between the images is proportional to the distance from the camera. Bigger shifts mean that bit of the bolt is closer to the camera. This approximation is pretty accurate for the majority of cameras, so I used it here.

The other problem is the proportionality factor. If one part of the lightning bolt shifts twice as much between the two images as another part that means it is twice as close. But twice as close as what? Without knowing exactly where the cameras were positioned that means only the relative distance, not absolute distance, can be calculated. Oh well, close enough!

So what does the lightning bolt look like in 3D? I plugged the coordinates into Blender and this is the result:


Pretty amazing really!

Software used:
ImageJ: Image analysis.
Blender: 3D modelling and rendering.

41 comments:

  1. This is amazing, I think of doing it, but wouldn't be able to do a better job !!

    ReplyDelete
    Replies
    1. I'm going to upload this gif and host it on https://browseplay.com

      really cool visual

      Delete
  2. This is great. It also makes me wonder how much "forking" is actually just an optical illusion caused by "folding." Looking at the second picture you might think there's a short fork as the main bolt changes direction, but adding the second picture it is clearly just a direction change in the same plane.

    ReplyDelete
    Replies
    1. Forking is real, but my understanding is that most forking happens prior to the actual lightning strike. When the event starts, there is a period of time during which the cloud seeks the path of least resistance to the ground. There is a lot of forking that happens here. However, once a connection is found, the resistance drops suddenly and all of the current is directed along that path. Consequently, the other forks are abandoned as the connection is a (locally) preferable conduit between the cloud and the surface.

      Delete
    2. With cloud->cloud lightning I think forking is much more common as the charge dissipates into many different parts of the cloud which is being struck.

      Delete
    3. This gif might make what Brad said clearer:

      https://i.imgur.com/8qV7l.gif

      Delete
  3. WOWZERS THAT ELECTRIC FEEL

    ReplyDelete
  4. Here's another angle of that same lightning bolt. If you want to redo the math, it can be more science than art. :)

    http://5280lensmafia.wordpress.com/2013/05/08/enlightening

    ReplyDelete
    Replies
    1. In addition, here is a more precise layout of the probable strike point in relation to the photographers: http://www.reddit.com/r/Denver/comments/1dxs0s/it_was_a_shocking_day_at_coors_field_xpost_from/c9uwmw2

      Delete
    2. Wow, if that really is the same bolt then that is perfect for a more accurate reconstruction. Because you are much closer to the lightning it will need some more complex perspective corrections etc., but could make something epic! The maths will take days rather than minutes though :)

      Delete
    3. Wow, this would be awesome to see..

      Delete
  5. This is cool.
    I hope someone does the same thing more often with cameras & a bolt from known positions. Since lightning regularly strikes Cape Kennedy two cameras could be positioned at known heights & distances from the shuttle pad. Turn on high speed cameras during storms & wait.
    SCIENCE!

    ReplyDelete
  6. I believe you could get some more info on the positions of the cameras from their content and some aerial photograpy, maybe even Google maps of similar would be sufficient, as one is in a stadium and the other seems to be in an industrial facility.

    ReplyDelete
  7. LET`S PRINT IT ON A 3D-PRINTER!!!!

    ReplyDelete
  8. Como puede la luz hacer sombra sobre si misma??? A parte de ese detalle ,Increíble !,,,,,

    ReplyDelete
    Replies
    1. Es una representación 3D, hombre, lo importante es la forma del rayo, no las sombras...

      Delete
  9. That's a funky shadow your lightning is producing.. :D Otherwise, very very cool!

    ReplyDelete
  10. I gotta throw this in there - could blender's object tracking pick that variation from two or three frames to get the same result?

    ReplyDelete
  11. The result is indeed pretty amazing considering that two people took these photos. Thank you for sharing the step by step process. Who says converting still images into 3D photos is difficult?

    Image3D

    ReplyDelete
  12. I'm also working on something like this. Congrats. The more images the better the result.

    ReplyDelete
    Replies
    1. Very cool! Has it been done before, I couldn't find anything..

      Delete
  13. Fantastic post Richard. It was fun to read and must have been lots of fun to work on this. Thanks for sharing.

    ReplyDelete
  14. Get Amazed with the Natural Northern Lights One of the beautiful creation.Battery Led Picture Light

    ReplyDelete
  15. Can you provide info on how you did it in Blender?

    ReplyDelete
    Replies
    1. I did it by using the mesh editor, just by typing in the locations for the vertices that I had calculated in Excel... Tedious!

      Delete
  16. Nice, have you thought about making more?
    There must be more dual pics of other strikes.

    ReplyDelete
    Replies
    1. I haven't been able to find one! If you look at meteorological research papers no one else seems to have ever managed it before either.

      Delete
  17. Cool job, But couldn't you possibly back calculate the approximate locations of the photographers?

    The baseball diamond has very precise dimensions. These could be use to determine the angel and relative location of the photographer.

    For the other image. There seems to be quite a few references that would allow one to accomplish the same thing.

    Once the locations are established, then wouldn't it then be possible to determine the location of the entry and exit point of the lightning bolt?

    I believe that his is called photogrametery.

    ReplyDelete
    Replies
    1. I did look into doing it. It's probably possible, but the maths is tough! Especially with cameras that aren't designed for photogrametery (one was an iPhone)... Maybe one day I will manage it!

      Delete
  18. Bad luck scrub lightening won' produce a shadow in a dark room learn to phsics 8¬|

    ReplyDelete
  19. Where can I learn about the math you used to do this with? This looks very interesting and I'd like to learn more, even though math isn't my strong subject.

    ReplyDelete
  20. Looking at clarity of the pictures. Graphics rocks

    ReplyDelete
  21. Great 3 dimensional effects. Good job! I am also aware of one 3D Rendering Company proffering services for 3D Architectural Visuals, 3D Architectural Renderings, 3D Interior Rendering for buildings and house architecture, before build up, just visit here- http://my3dhouse.com

    ReplyDelete
  22. I have done this myself but i am wondering how to plug the coordinates into blender. Please help.

    ReplyDelete
  23. I wonder if you could do it with these wave pictures : https://petapixel.com/2018/03/07/two-photographers-unknowingly-shot-millisecond-time/

    ReplyDelete
  24. > This is just like the pair of images you would see with your eyes if you had two eyes positioned vertically instead of horizontally on your head.

    So I rotated them to create a quick-and-dirty stereo pair: https://imgur.com/a/5BcFf . Thanks for the article.

    ReplyDelete
  25. wuah,,, that's amazing, you are very talented.

    ReplyDelete

Note: only a member of this blog may post a comment.