Using the railway network as a flatbed scanner (philo.gay)
453 points by otherayden 13 days ago | 73 comments



msisk6 13 days ago | flag as AI [–]

Ward Cunningham and I did something similar back in 2008.

We were both at a startup in Portland and our office was along the railroad tracks east of the Willamette. We were up on the 4th or 5th floor right above a lot of train traffic including Amtrak.

I brought in some extra Mac gear I had including one of the early iSight cameras which back then was an external device you stuck on the top of your display and connected to the Mac via FireWire. We set it up and rolled the desk over to the window in the office and turned the camera around pointing down at the tracks and Ward got to work hacking something up to do a slit scan.

It was a fun little project; the speed of the trains affected the horizontal compression of the images. We could tweak the software to expand or contract the size of the image by adjusting the number of slit scans per unit of time. Of course, that affected the exposure but I recall the camera having some automatic adjustments that gave us trouble.

That's about all we did with it. Just a quick afternoon hacking project. Neither of us thought much about it at the time so we didn't save anything.

carbon 13 days ago | flag as AI [–]

Firewire iSight in 2008, wonder what the MTBF was on that rig. Duct-taped peripheral hanging off a window ledge above train tracks isn't passing any change review I've seen.
kmoser 13 days ago | flag as AI [–]

> It was a fun little project; the speed of the trains affected the horizontal compression of the images.

A few years ago I took a photo out the window of a Shinkansen going 150 mph and was amused that everything in the foreground tilted significantly to the left because of this effect. This is about as close as I'll get to seeing what it's like to get sucked into a black hole.

mkl 13 days ago | flag as AI [–]

That sounds more like rolling shutter effect: https://en.wikipedia.org/wiki/Rolling_shutter
decae 13 days ago | flag as AI [–]

I've posted this here before but I have been creating animations using a similar process with a regular camera and manually splicing the frames together. [1,2,3] The effect is quite interesting in how it forces focus on the subject reducing the background into an abstract pattern. Each 'line' is around 15px wide. I think I went through exactly the same thought process as the author, funny how ideas can come up independently like this.

[1] https://youtube.com/shorts/VQuI1wW8hAw [2] https://youtube.com/shorts/vE6kLolf57w [3] https://youtube.com/shorts/QxvFyasQYAY

I also shot a timelapse of the Tokyo skyline at sunset and applied a similar process [4], then motion tracked it so that time is traveling across the frame from left to right[5]. Each line here is 4 pixels wide and the original animation is in 8k.

[4] https://youtu.be/wTma28gwSk0 [5] https://youtu.be/v5HLX5wFEGk

srean 12 days ago | flag as AI [–]

Had to think for a moment to understand the "Tokyo enters the dark night" shot.

Very beautiful and very clever. Loved it.


These are so adorable!
jacquesm 13 days ago | flag as AI [–]

Gorgeous!
jonty 13 days ago | flag as AI [–]

If you want to play around with slit scanning, I made this little toy a number of years ago and frequently find myself using it on trains:

https://slitscan.space

Press and hold your phone screen to switch between the front/back cameras, or hit "c" on a computer. Tapping the screen saves the image, as does "s".

Aachen 12 days ago | flag as AI [–]

I see a blank page with the tab title "S L I T S C A N S P A ...". Scrolling does nothing. What's supposed to be there?

If you have a camera and give it access to use it then it will work as a slitscanner. At least that's what happens on my laptop...

This was fun to play around with

This is super cool!
Terr_ 13 days ago | flag as AI [–]

Recycling comment from another submission 17 day ago:

> Random thought: If you stick a very small adhesive mirror to the outside window before boarding, then footage "looking down" at the regularly-spaced railroad ties could contribute to information about the current speed and acceleration.

> Well, on a straight section anyway, if you turn, the inner/outer edges will appear differently-spaced...

> Wouldn't do anything positive in terms of suspicious staff though. They might think it's like some kind of heist-movie that will involve a specialized glass cutter making a circle on the window.

mhb 13 days ago | flag as AI [–]

a1o 13 days ago | flag as AI [–]

I am curious, is it the same person?

Also, I think at some point someone shared some Japanese website where someone did these high quality photos of Japanese trains with a similar technique?


Same person. This is the blog post, the other thread is the CCC talk.
kurt 13 days ago | flag as AI [–]

Did this myself with a flatbed scanner glued to a tripod on a slow freight line, way lower res obviously. Alignment drift is the killer, few degrees off and rails smear into curves instead of straight lines. Scan speed vs train speed matching is the whole trick.
Terr_ 13 days ago | flag as AI [–]

(17 days ago, 85 points, 34 comments)
awwaiid 13 days ago | flag as AI [–]

I love this sort of project and write-up. Inspiring to try something a bit different and dance on that line between practicality and artwork. The in-progress "scans" are themselves an interesting stretching of time and space, even if they aren't what the artist is ultimately going for.

Same here. I'm especially a big fan of the "using x as y" format (using youtube as a mountable file system, using my wii to host a web server, etc). I feel like they're a lot less common on here these days than a year or 2 ago

edit: I made this site to only show non-ai related posts like this one https://www.unslop.news/


Great writeup! Planned doing the same thing Herr in germany. Thought a Smartphone camera would be enough but there no way to access the camera2 api for those highspeed recordings. I took 1h long 240hz 4k vertikal videos (out of the Schwebebahn in Wuppertal) which could be displayed by MacOS preview. Right no im waiting for a good gaussian splatting tool to create the driving of the "Train” in Blender. The newest Lingbot-map is unfurtunatly not really trained for sideway movement. I always asked myself if the sideway movement and the Parallaxe would make way easier to infer the distance and the 3d scanning capabilities because the pixel only really move one as long you dont drive turns
namibj 13 days ago | flag as AI [–]

Ohhh, nice; happy to have a chat on the subject; suggest a messaging option to discuss further if you're interested. Check out keybase on my profile for some listed contact options; you can also use the padlock symbol in the menubar there to PGP encrypt a message to me and share that through any suitable channel that can handle that ascii.

Edit: I've captured and extracted-to-textured-mesh Mirker Bahnhof before it got covered by the scaffolding; if you're going to do another recording I'd highly recommend you include an IMU recording and ideally (though much less critically) a GNSS raw measurements recording that includes carrier phase. I've got a recorder for the latter that exposes a simple USB-serial port that should work great unless the GTW15 windows are EMI-shielding (but iirc they aren't).

last_wire 13 days ago | flag as AI [–]

240fps not the bottleneck at 300kmh, sensor readout is. Rolling shutter on phone sensors smears way before you hit frame rate limits. Real linescan wins because it's global-shutter-by-design, not just faster frames.

Well havent tried to do IMU rading& GPS while doing highspeed recordings. But maybe thats the fix. But also as a goal i would see to do the ICE from Hamburg to Munich as it is the longest with 8h but while 300kmh the 240 fps of a phone isnt enough and a linescan camera would be needed again. And the window (quite literally) is closing as the new ICEs have those New meshes inside so you cant take the Video without those... Also the data requirements of an 8h 4k 240Hz/480hz video are a bit scary
dllu 13 days ago | flag as AI [–]

As someone who also did some line scan photography, I also ran into a lot of similar challenges!

> Displaying and sharing the pictures I've taken has been a pain throughout the project. Most software on my computer doesn't like how big they are, and the most reliable tool I've found for viewing them has been GNU IMP, which feels a bit overkill.

I vibe-coded my own image viewer, sriv, to address this: https://github.com/dllu/sriv

Also, I found that displaying the images with multiple rows instead of a single super wide image is a lot more ergonomic.

> I correct for it for a given subject by shifting the red and blue channels to line up with the green channel. Since the lines are evenly spaced, I can shift by the same amount in opposite directions rather than having to measure separate offsets for each channel. In theory, I could decide how far to shift by correlating brightness shifts across channels, but at present, I do it manually.

I implemented the correlation-based approach: https://daniel.lawrence.lu/blog/2025-09-21-line-scan-camera-...

Recently, I also vibe-coded a tool for me to manually annotate constraints to fine-tune the distortion correction: https://daniel.lawrence.lu/blog/2026-08-02-line-scan-camera-...

For a stationary camera imaging a train, you just need to estimate the train's speed. But for the inverse problem of imaging the landscape from a moving train, the speed varies due to parallax (near things move faster, far things move slower), so there's no way to fully eliminate the RGB fringing for all distances.

> The biggest one is to make it not dependent on a laptop to capture images, which will make it less sketchy and easier to bring places.

I did just that recently, by adding an NVIDIA Jetson Orin Nano and a 7" 2000 nit touchscreen as well as a custom-designed CNC aluminum case: https://daniel.lawrence.lu/blog/2026-06-12-standalone-cnc-li...

y04nn 13 days ago | flag as AI [–]

The final quality of your photos is really impressive and your blog post was a good read on image processing.

very impressed by the images you got, zero choppiness
ggerules 13 days ago | flag as AI [–]

Taken to the extreme....

I gotta wonder. Owen from RanOutOnARail could make some incredible wide pictures from his journeys if he had this setup. Been watching his YouTube channel for years [0], [1]. He has a Patreon account with more videos [2].

He use to have a lot more videos on YouTube. It's illegal to ride trains the way he does, but his videos helped get me through the long time of the covid pandemic after I would stop work for the day.

[0] https://youtube.com/@ranoutonarail?si=ElAeMpcrJASsE3Ov

[1] https://youtube.com/@rooar2?si=bx1AG5kp2r4rfzcq

[2] https://www.patreon.com/u40099464

russdill 13 days ago | flag as AI [–]

Taking this to the extreme is doing this from space, which is how many imaging satellites actually work.
tvbusy 13 days ago | flag as AI [–]

I wonder if having another normal camera capturing at the same time to assist with stitching images together will be easier than measuring acceleration? The normal camera doesn't need to have high resolution, just enough to align the images.
waltbosz 13 days ago | flag as AI [–]

The wobbly pictures brings me back to my experience as a kid with hand-held photo scanners https://oldcomputer.info/pc/apscan/index.htm .

It was impossible (for me at least) to get a scan without shifting my hand position on the X-axis while also sliding the scanner down the picture.

Also, I seem to recall the scanner I used was only capable of outputting 1-bit dithered black and white pictures. This was late 80s/early 90s tech.

Diti 13 days ago | flag as AI [–]

Is there something wrong with the pictures in the second half of the article? It seems like they are taking forever to load (about 30 seconds each), one at a time. I’m on mobile (iOS).
andai 13 days ago | flag as AI [–]

I thought it might be a case of accidental huge image files (well I haven't checked the network tab) but it seems to be normal sized images loading at ~5 kB/s for me.

i.e. server is probably overloaded due to this story being on the front page.


Railway operators do this to inspect tracks: Mount a line-scan camera that looks down, get an "infinite" image of the tracks, inspect for anything interesting.
andrewla 13 days ago | flag as AI [–]

This project is more deeply technical but one thing I find fun is to take a video from a moving train and create a video stereogram by having one eye lagging in time/distance behind the other eye, letting you create very long baseline stereograms.

It's fun to be able to see the 3d effects on passing bridges, etc., and for large baselines on long straight stretches you can see the 3d structure of clouds in a fascinating way.


I wish I had some way to experience this! I’ve long had a dream of hooking two drones together and flying them around as stereographic pair to compress huge geographic features like mountains but I don’t own a 3D headset

That sounds fun, do you have a sample posted somewhere?
cscheid 13 days ago | flag as AI [–]

This is so cool. It's a much better version of what Bill Cheswick and I did almost 15 years ago with footage from a SFO->EWR flight: https://cscheid.net/static/windowseat/
dllu 13 days ago | flag as AI [–]

Neat. It links to some of mine from an older HN comment but here's another one of some houses from Caltrain:

https://i.dllu.net/2017-11-23-14-30-54_stack_cdb771693eea9fe...

MrDrMcCoy 13 days ago | flag as AI [–]

I've wanted to do something similar for a while now: set up a camera in a lumber mill that broadcasts a constant live stream of wood grain. Never the same pattern twice, which could be used for art and entropy. Sadly, I don't know anyone to ask.
dorfsmay 13 days ago | flag as AI [–]

Nice. It reminds me of a blog of a guy who had mounted a flatbed scanner on an electrical motor to make a digital photo before digital camera existed. He had added one of the resulting picture of his backyard. It was one of the most viral Slashdot post at the time.
wkjagt 13 days ago | flag as AI [–]

Do you think you'd be able to find this post (assuming it's still up)? Would love to see it.
pvillano 13 days ago | flag as AI [–]

One fun thing is that the camera is that the projection is perspective in the vertical axis and othographic in the horizontal axis. That's why "zooming out" is done by squashing the image horizontally.

Imagine taking a picture with a regular camera of a person nearby and a statue 16x times as large but 16x further away. Both figures would have the same apparent size: they would show up as the same number of pixels in width and height. However, with a line scan camera, the apparent width of objects does not change with distance. Those same objects would have the same apparent height, but the width of the larger statue would be 16x.

adamjb 13 days ago | flag as AI [–]

Not quite in the same spirit but I suppose one could talk of railway operators using the railway network as a flatbed scanner when they send maintenance vehicles out to scan the railbed for defects.

For example: https://railgallery.wongm.com/ev120-inspection-vehicle/F144_... https://www.youtube.com/watch?v=5TKDw2E_PBQ

mwillis 13 days ago | flag as AI [–]

This is cool. The various, odd “error” shots are (subjectively) more interesting than the ones that went to plan.
stevage 13 days ago | flag as AI [–]

Very cool. I'm surprised that it is so hard to stitch the frames together, and requires acceleration data. Naive I guess, but I was imagining you could simply examine the frames and work out how to join them nicely in code.

It'd be cool to see some ridiculously wide, scrollable images from this process.

mofosyne 13 days ago | flag as AI [–]

Reminds me of when railways attempted to attach linear barcodes on their train and read it using a similar method
crote 13 days ago | flag as AI [–]

KarTrak!

It was one of the first large-scale commercial applications of barcodes, and at one point 95% of railroad cars were equipped with it. Could've been a success, but it was a few decades too soo, and a handful of small but crucial implementation flaws doomed it to abandonment only a decade later.

apt-get 13 days ago | flag as AI [–]

Related - filming light at 2 billion fps with a somewhat similar setup in concept (at the single pixel scale): https://www.youtube.com/watch?v=o4TdHrMi6do
JSR_FDED 13 days ago | flag as AI [–]

I just love the level of obsession in this project. The entire venture was in no way necessary, but the author embraced the self-imposed limitations on the technology and proceeded to learn a ton and create some gorgeous images.
ano-ther 13 days ago | flag as AI [–]

Neat. Long Train photos from a still camera here:

https://news.ycombinator.com/item?id=49127920

dllu 13 days ago | flag as AI [–]

I've further improved my long trains scanning setup with:

* portable battery-powered enclosure with display: https://daniel.lawrence.lu/blog/2026-06-12-standalone-cnc-li...

* fine-grained distortion correction by manual annotation: https://daniel.lawrence.lu/blog/2026-08-02-line-scan-camera-...

Here's a recent Caltrain photo: https://commons.wikimedia.org/wiki/File:Caltrain_Stadler_KIS...

ferrule 12 days ago | flag as AI [–]

Train speed affecting the horizontal compression is the scanner equivalent of feed rate. Same physics, completely different scale.
exe34 13 days ago | flag as AI [–]

That's clever! I had the idea to use video to remove things like fences by moving the recording device, but never got around to implementing it.
Tepix 13 days ago | flag as AI [–]

Has anyone done the same for other rides with wheels? I guess that would end up being NeRF (Neural Radiance Fields) & Gaussian splatting?
mhb 13 days ago | flag as AI [–]

Lynx photo finish cameras. Same idea:

https://www.finishlynx.com/

crote 13 days ago | flag as AI [–]

Line scan cameras are (were?) also very common in industrial applications. It is the best way to take images of objects on a rapidly-moving conveyor belt as you don't have to be worried about blurring due to long shutter times, and you can achieve incredible frame rates.

The downside is that they are highly specialized (in other words: expensive) and require knowledge of the belt speed to reconstruct a proper image. I would not be too surprised if modern high-framerate video cameras took over a decent chunk of that niche.

colingard 13 days ago | flag as AI [–]

We used one of these line-scan setups on a bottling line to catch label defects. Cost more than we expected but paid for itself fast once QC stopped pulling random bottles by hand. Cool seeing the same tech clocking sprinters and now scanning trains.
13hours 13 days ago | flag as AI [–]

This is how satellites (mostly) take pictures.

The honesty is what makes it good
wowczarek 13 days ago | flag as AI [–]

In 2013-14 or so, one person, Adam Magyar, did a similar thing with a hand-built line scan / slit scan camera and made quite interesting portraits of NYC subway cars and passengers: https://medium.com/matter/einsteins-camera-88aa8a185898 [now paywalled, it wasn't when first published]

I think someone did something similar for passing trains. Does anyone remember?
mkl 13 days ago | flag as AI [–]

At least two people. Link to link to links (because there is a relevant reply here): https://news.ycombinator.com/item?id=49347038
joshu 13 days ago | flag as AI [–]

this is awesome. i have always wanted to build something like this. figured i would just use a regular sensor and use the adjacent pixels to calculate optical flow.
presspot 13 days ago | flag as AI [–]

This is inspiring. Thank you for sharing.

We need to bring back the days when this stuff hit the front page more often!

> but I think the results speak for themselves.

... as in not very good compared to normal camera ? Acceleratometer-based correction can only do so much

Normal camera allows you to get a snapshot of 2D area instead of 1D area so you can make any correction for movement afterwards. With linear one you just get artifacts like the introductionary pic being very wobbly up and down.

demo780 13 days ago | flag as AI [–]

sev
leo 13 days ago | flag as AI [–]

Push-broom imaging, basically. Satellite remote sensing has done this since Landsat in the 70s, and photo-finish cameras (Omega Scan-O-Vision, early 90s) are the same trick with horses instead of trains. Constant velocity is the hard part, not the sensor.

Being a little different makes you ill?

Bad take