Line scan camera image processing for train photography

(daniel.lawrence.lu)

107 points | by dllu 6 hours ago

10 comments

  • its-summertime 0 minutes ago
    > Hmm, I think my speed estimation still isn’t perfect. It could be off by about 10%.

    Probably would be worth asking a train driver about this, e.g. "what is a place with smooth track and constant speed"

  • JKCalhoun 50 minutes ago
    Reminds me of the early experiments with using a flat-bed scanner as a digital back. Here is one: https://www.sentex.net/~mwandel/tech/scanner.html
  • bscphil 1 hour ago
    IMO the denoising looks rather unnatural and emphasizes the remaining artifacts, especially color fringe around details. Personally I'd leave that turned off. Also, with respect to the demosaic step, I wonder if it's possible to implement a version of RCD [1] for improved resolution without the artifacts that seem to result from the current process.

    [1] https://github.com/LuisSR/RCD-Demosaicing

  • card_zero 19 minutes ago
    It's neat that it captured the shadow of the subway train, too, which arrived just ahead of the train itself. This virtual shadow is thrown against a sort of extruded tube with the profile of the slice of track and wall that the slit was pointed at.
  • ncruces 26 minutes ago
    That's a lot more than I thought I'd want to know about this, but I was totally nerd sniped. Great writeup.
  • GlibMonkeyDeath 1 hour ago
    If you like this sort of thing, check out https://www.magyaradam.com/wp/ too. A lot of his work uses a line scan camera.
    • JKCalhoun 1 hour ago
      The video [https://www.magyaradam.com/wp/?page_id=806] blew my mind. I can only image he reconstructed the video by first reconstructing one frame's worth of slits — then shifting them over by one column and adding the next slit data.
  • whartung 1 hour ago
    These are amazing images. I don't understand what's going on here, but I do like the images.
    • Etheryte 1 hour ago
      Imagine a camera that only takes pictures one pixel wide. Now make it take a picture, for example, 60 times a second and append every pixel-wide image together in order. This is what's happening here, it's a bunch of one pixel wide images ordered by time. The background stays still as it's always the same area captured by that one pixel, resulting in the lines, but moving objects end up looking correct as they're spread out over time.

      At first, I thought this explanation would make sense, but then I read back what I just wrote and I'm not sure it really does. Sorry about that.

      • JKCalhoun 1 hour ago
        Yeah, like walking past a door that's cracked just a bit so you can see into an office only a slit. Now reconstruct the whole office from that traveling slit that you saw.

        Very cool.

      • whartung 38 minutes ago
        No, thank you. This was perfect. It completely explains where the train comes from and where the lines come from.

        Lightbulb on.

        Aha achieved. (Don’t you love Aha? I love Aha.)

      • kiddico 1 hour ago
        It made sense to me!
  • j_bum 2 hours ago
    What a beautiful example of image processing. Great post
  • jeffbee 2 hours ago
    Okay I was stumped about how this works because it's not explained, as far as I can tell. But I guess the sensor array has its long axis perpendicular to the direction the train is traveling.
    • eschneider 1 hour ago
      You use a single vertical line of sensors and resample "continuously". When doing this with film, the aperture is a vertical slit and you continuously advance the film during the exposure.

      For "finish line" cameras, the slit is located at the finish line and you start pulling film when the horses approach. Since the exposure is continuous, you never miss the exact moment of the finish.

    • miladyincontrol 1 hour ago
      Line scan sensors are basically just scanners, heck people make em out of scanners .

      Usually the issue is they need rather still subjects, but in this case rather than the sensor doing a scanning sweep they're just capturing the subject as it moves by, keeping the background pixels static.

    • dllu 1 hour ago
      Thanks, I added a section called "Principle of operation" to explain how it works.
      • blooalien 1 hour ago
        Absolutely fascinating stuff! Thank you so much for adding detailed explanations of the math involved and your process. Always wondered how it worked but never bothered to look it up until today. Reading your page pushed it beyond idle curiosity for me. Thanks for that. And thanks also to HN for always surfacing truly interesting reading material on a daily basis!
      • ansgri 1 hour ago
        What's your FPS/LPS in this setup? I've experimented with similar imaging with an ordinary camera, but LPS was limiting, and I know line-scan machine vision cameras can output some amazing numbers, like 50k+ LPS.