frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Line scan camera image processing for train photography

https://daniel.lawrence.lu/blog/y2025m09d21/
118•dllu•6h ago

Comments

j_bum•2h ago
What a beautiful example of image processing. Great post
jeffbee•2h 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.
miladyincontrol•2h 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.

krackers•9m ago
It only works for trains because the image of train at t+1 is basically image of train at time t shifted over by a few pixels, right? It doesn't seem like this would work to capture a picture of a human, since humans don't just rigidly translate in space as they move.
dllu•2h ago
Thanks, I added a section called "Principle of operation" to explain how it works.
ansgri•1h 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.
blooalien•1h 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!
eschneider•2h 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.

whartung•2h ago
These are amazing images. I don't understand what's going on here, but I do like the images.
Etheryte•1h 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.

kiddico•1h ago
It made sense to me!
JKCalhoun•1h 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•1h 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.)

bscphil•1h 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

GlibMonkeyDeath•1h 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•1h 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.
JKCalhoun•1h 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
ncruces•52m ago
That's a lot more than I thought I'd want to know about this, but I was totally nerd sniped. Great writeup.
card_zero•45m 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.
its-summertime•26m 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"

lttlrck•4m ago
They have an amazing painterly quality. I'm not a huge train fan but I'd put some of these on my wall.

Romhack.ing's Internet Archive Mirror No Longer Available

https://romhack.ing/database/news/entry/DW8BKnRHSEqaGDwXTiKjMw
34•pharrington•1h ago•1 comments

How can AI ID a cat?

https://www.quantamagazine.org/how-can-ai-id-a-cat-an-illustrated-guide-20250430/
53•sonabinu•3d ago•12 comments

A 2k-year-old sun hat worn by a Roman soldier in Egypt

https://www.smithsonianmag.com/smart-news/a-2000-year-old-sun-hat-worn-by-a-roman-soldier-in-egyp...
42•sensiquest•3h ago•7 comments

Line scan camera image processing for train photography

https://daniel.lawrence.lu/blog/y2025m09d21/
118•dllu•6h ago•21 comments

Static sites with Python, uv, Caddy, and Docker

https://nkantar.com/blog/2025/08/static-python-uv-caddy-docker/
56•indigodaddy•1d ago•34 comments

Manim: Animation engine for explanatory math videos

https://github.com/3b1b/manim
357•pykello•15h ago•63 comments

Librebox: An open source, Roblox-compatible game engine

https://github.com/librebox-devs/librebox-demo
204•libreboxdevs•11h ago•57 comments

Acronis True Image costs performance when not used

https://randomascii.wordpress.com/2025/05/26/acronis-true-image-costs-performance-when-not-used/
49•juanviera23•3d ago•9 comments

Motion (YC W20) Is Hiring Senior Software Engineers

https://jobs.ashbyhq.com/motion/7355e80d-dab2-4ba1-89cc-a0197e08a83c?utm_source=hn
1•ethanyu94•1h ago

RFC 9839 and Bad Unicode

https://www.tbray.org/ongoing/When/202x/2025/08/14/RFC9839
202•Bogdanp•9h ago•97 comments

The Amiga games and demo scene collection

https://amiga.vision/
13•doener•1h ago•1 comments

Children of the Geissler Tube

https://www.hopefulmons.com/p/children-of-the-geissler-tube
26•paulkrush•3d ago•2 comments

Writing Speed-of-Light Flash Attention for 5090 in CUDA C++

https://gau-nernst.github.io/fa-5090/
119•dsr12•10h ago•19 comments

Optimizing FizzBuzz in Rust

https://github.com/nrposner/fizzcrate
17•Bogdanp•3h ago•4 comments

Gutenprint Discontinues macOS Support

https://gimp-print.sourceforge.io/p_FAQ_OS_X.php
3•soraminazuki•57m ago•0 comments

Ergonomic errors in Rust: write fast, debug with ease, handle precisely

https://gmcgoldr.github.io/2025/08/21/stackerror.html
7•garrinm•1d ago•3 comments

Practical approach for streaming UI from LLMs

https://www.timetler.com/2025/08/19/unlocking-rich-ui-components-in-ai/
41•scranglis•4d ago•2 comments

A simple way to generate random points on a sphere

https://www.johndcook.com/blog/2025/05/06/random-points-on-a-sphere/
49•piinbinary•4d ago•39 comments

Optimizing our way through Metroid

https://antithesis.com/blog/2025/metroid/
89•eatonphil•1d ago•11 comments

Exploring EXIF (2023)

https://hturan.com/writing/exploring-exif
30•jxmorris12•2d ago•4 comments

Recreationally overengineering my location history

https://overengineer.dev/blog/2025/08/19/overengineering-location-history/
20•kickofline•3d ago•3 comments

I made a floppy disk from scratch

https://kottke.org/25/08/i-made-a-floppy-disk-from-scratch
170•bookofjoe•12h ago•68 comments

450× Faster Joins with Index Condition Pushdown

https://readyset.io/blog/optimizing-straddled-joins-in-readyset-from-hash-joins-to-index-conditio...
88•marceloaltmann•4d ago•30 comments

Rethinking the Linux cloud stack for confidential VMs

https://lwn.net/Articles/1030818/
104•Bogdanp•10h ago•42 comments

Lightning declines over shipping lanes following regulation of sulfur emissions

https://theconversation.com/the-world-regulated-sulfur-in-ship-fuels-and-the-lightning-stopped-24...
207•lentoutcry•4d ago•52 comments

Determinants and causal effects of admission to selective private colleges [pdf] (2023)

https://www.nber.org/system/files/working_papers/w31492/w31492.pdf
24•EvgeniyZh•12h ago•23 comments

Reproducing prospect theory with 'differentiable decision theories'

https://www.science.org/doi/full/10.1126/science.abe2629
15•timshell•2d ago•4 comments

Stepanov's biggest blunder? The curious case of adjacent difference

https://mmapped.blog/posts/43-stepanovs-biggest-blunder
17•signa11•2d ago•2 comments

Developer's block

https://underlap.org/developers-block/
170•todsacerdoti•13h ago•89 comments

WebR – R in the Browser

https://docs.r-wasm.org/webr/latest/
130•sieste•4d ago•29 comments