用铁路网络当平板扫描仪:一种创意成像方法
Philo's Website
Philo 的网站
Using the railway network as a flatbed scanner
利用铁路网络作为平板扫描仪
August 17th, 2026 — 4,600 words
2026年8月17日 — 4,600字
Over the past few months, I've been working on using an industrial linear scanning camera to take very wide photos out of trains and ferries. Getting it working has been quite the challenge, but I think the results speak for themselves.
在过去的几个月里,我一直在尝试使用工业线性扫描相机从火车和渡轮上拍摄超宽幅照片。让这一切运转起来颇具挑战,但我认为结果不言自明。
taken on the San Francisco to Oakland ferry in February 2026 (56,894x2,048 pixel grayscale image); scroll to zoom in and click and drag to move
拍摄于2026年2月旧金山至奥克兰的渡轮上(56,894x2,048像素灰度图像);滚动以放大,点击并拖动以移动
More pictures are on display in the gallery.
更多图片展示在画廊中。
I presented a talk on this project at EMFcamp 2026, which you can watch below or read on for the same story in more detail:
我在EMFcamp 2026上就这个项目做了演讲,你可以观看下面的视频,或继续阅读以获取更详细的故事:
What am I even looking at?
我到底在看什么?
The process of capturing an image like the one of the container port above.
捕捉像上面集装箱港口那样的图像的过程。
The camera is pointed out of a moving vehicle and is constantly capturing a single vertical line kinda like these grayscale ones in the diagram, but a lot thinner. As the camera moves, what exactly it sees is changing. If I capture the lines from the camera quickly enough and stitch them together, I can produce a complete-looking image. It's a bit more complicated than that and getting the results looking good was rather tricky, but that's the main idea behind it.
相机从移动的车辆中向外对准,并持续捕捉一条垂直线,类似于图中那些灰度线,但要细得多。随着相机的移动,它看到的内容也在变化。如果我足够快地捕捉这些线并将它们拼接在一起,就能生成一幅完整的图像。这比那要复杂一些,而且让结果看起来不错相当棘手,但这就是其背后的主要思路。
Background and Prior Art
背景与先前技术
Back in the 1990s, digital camera sensor technology hadn't caught up to the size and effective resolution of medium and large format film, so digital scanning backs were developed. They capture a high-resolution image without needing a giant grid of pixels by moving a single line of pixels (or three lines for color) across the frame. In the intervening years, image sensors have gotten pretty big (there's even one that covers 4x5" large format nowadays), but this approach is still cheaper to build for large formats than a giant sensor.
回到1990年代,数码相机传感器技术尚未达到中画幅和大画幅胶片的大小和有效分辨率,因此开发了数字扫描后背。它们通过移动一条像素线(或三条线用于彩色)穿过画面,无需巨大的像素网格即可捕捉高分辨率图像。在随后的几年里,图像传感器变得相当大(如今甚至有覆盖4x5英寸大画幅的传感器),但这种方法在大画幅上构建仍然比巨型传感器更便宜。
I'd been thinking about building my own digital scanning back for my large format camera for a while, but I've never quite gotten around to it because building something to mount properly on my camera seemed too daunting. (Buying one could have been an option, but ones from the 1990s still go for thousands of dollars on ebay and require reconstructing a computing environment of a similar vintage to use.) Late last year, I was watching a video on Gigawipf's medium format scanning camera build and suddenly thought: "what if the entire camera moved and the subject didn't?" and decided to give it a shot.
我一直在考虑为我的大画幅相机制作自己的数字扫描后背,但一直没真正动手,因为构建一个能正确安装在我相机上的东西似乎太艰巨了。(购买可能是一个选项,但1990年代的产品在eBay上仍要数千美元,并且需要重建类似年代的计算机环境才能使用。)去年年底,我在观看Gigawipf的中画幅扫描相机制作视频时,突然想到:“如果整个相机移动而拍摄对象不动呢?”于是决定试一试。
Loading film into my large format camera on top of a mountain in Vermont because I'm allergic to doing photography in a normal way. (The resulting pictures from that trip are here.)
在佛蒙特州的一座山顶上,将胶片装入我的大幅相机,因为我对于以常规方式摄影感到过敏。(那次旅行拍出的照片在此。)
I found some previous photos in the same vein (the Scannoramic project, John Hikerbiker's experiment, Daniel Lawrence Lu's reversal of his stationary camera, and Martin Liebscher's very interesting film shots), but the results seemed like they could be improved upon. Surely taking the speed of motion into account and getting cleaner results wouldn't be too hard, right?
我找到了一些同类风格的先前照片(Scannoramic项目、John Hikerbiker的实验、Daniel Lawrence Lu对固定相机的反转处理,以及Martin Liebscher非常有趣的胶片拍摄),但结果似乎还有改进空间。当然,考虑到运动速度并得到更清晰的结果应该不会太难,对吧?
Slit Scanning My Sofa
扫描我的沙发
On the night I thought up this "big scanner" concept, I had to give it a shot. It was a bit late to go out and catch a train, so I scanned my sofa instead.
在我想到这个“大扫描仪”概念的那个晚上,我不得不尝试一下。当时出门赶火车有点晚了,所以我改而扫描了我的沙发。
I set my phone on my office chair and slowly pushed it along as it captured a video. I then wrote some really slapdash code (which I am choosing not to share here to protect my readers) to grab the leftmost column (a "slit") of each frame and combine them into an image.
我把手机放在办公椅上,在拍摄视频时慢慢推着它移动。然后我写了一些非常草率的代码(为了保护读者,我选择不在此分享),用来抓取每帧最左侧的列(即“狭缝”)并将它们组合成一张图像。
My comments included lyrics from "Future Me Hates Me" by The Beths, which became something of a self-fulfilling prophecy when I started writing a postprocessor for the next version of the camera loosely based on that code and cursed my decisions.
我的注释中包含了The Beths乐队的《Future Me Hates Me》的歌词,这在我开始为相机下一版本编写后处理器时,部分基于那段代码,并诅咒自己的决定时,成了一种自我实现的预言。
It looks vaguely like my sofa, but it's rather squished and the art on the wall is unintelligible. Surely I can do better.
它看起来隐约像我的沙发,但相当压缩,墙上的艺术品也难以辨认。当然,我可以做得更好。
I messed around with the postprocessing and doubled every column, which makes it look less squished, but it's still a mess because I wasn't pushing the chair at a particularly consistent speed.
我调整了后处理,将每一列加倍,这使它看起来不那么压缩,但仍然一团糟,因为我推椅子的速度并不一致。
I knew from the start that I'd need to measure the speed somehow, but I was naïvely hoping that I wouldn't need to measure it that well and could simply fudge it. This image, however, shows that even small variations of speed matter. This was my first glimpse into how much of a pain dealing with speed would turn out to be.
我从一开始就知道需要以某种方式测量速度,但我天真地希望不需要测量得那么精确,可以简单糊弄过去。然而,这张图像表明,即使是微小的速度变化也很重要。这是我第一次瞥见处理速度问题会有多麻烦。
For my next trick, I took a ride on the MBTA orange line. I taped my old phone to the seat to use its accelerometer and held my current phone to the window, making sure to turn the frame rate up all the way to 60 fps.
作为我的下一个尝试,我乘坐了MBTA橙线。我把旧手机用胶带固定在座位上以使用其加速度计,并将当前手机举到窗前,确保将帧率调到最高60fps。
The accelerometer data wasn't very useful and was even less so when I took an integral to get velocity.
加速度计数据并不是很有用,当我对其进行积分以获取速度时,更是如此。
If I remember correctly, y was the axis of the train's movement, but the data is so noisy that the train was apparently moving backwards at the end.
如果我没记错的话,y轴是列车运动的方向,但数据噪声太大,以至于列车显然在最后是向后移动的。
The result looks interesting, though, but I definitely need more lines if I want a properly intelligible image.
不过,结果看起来很有趣,但如果我想要一张清晰可辨的图像,我绝对需要更多的线条。
While I was getting ready for EMFcamp, I noticed another talk on the schedule by Tim Jacobs (better known online as mitxela) that was also about slit scan cameras and started to worry we'd both done the same thing. (He ran up to me after my talk to tell me he'd also worried this.) His talk started in the same way, with taking a slit from a video, but he ended up making really cool and trippy animations by going through every possible slit position for a given video.
当我为EMFcamp做准备时,我注意到日程上还有一场Tim Jacobs(网上更知名的是mitxela)的演讲,同样关于狭缝扫描相机,我开始担心我们俩做了相同的事情。(他在我演讲后跑过来告诉我,他也有同样的担忧。)他的演讲以同样的方式开始,从视频中提取一条狭缝,但他最终通过遍历给定视频的每一个可能的狭缝位置,制作出了非常酷且迷幻的动画。
Industrial Linear Camera
工业线性相机
My source for more lines per second ended up being the Basler ruL2048-19gm, designed to be pointed at fast-moving conveyor belts. The oddly-capitalized name comes from its ability to read out its 1x2048 pixel image sensor just shy of 19,000 times per second.
我获得更多每秒行数的来源最终是Basler ruL2048-19gm,它被设计用于对准快速移动的传送带。这个奇怪大小写的名字来源于它能够以每秒接近19,000次的速度读出其1x2048像素图像传感器。
These capabilities come at a price, however; brand new, the manufacturer's lowest-spec current models go for around US$700. Thankfully for my wallet, I found mine on ebay for a tenth of that.
然而,这些能力是有代价的;全新时,制造商最低规格的当前型号售价约为700美元。幸运的是,对我的钱包来说,我在eBay上以十分之一的价格找到了它。
The price is also measured in light. since it's capturing so quickly (the slowest exposure time is 1/100s), it needs a lot of light. I can only shoot in the daytime, and all but the brightest stations and tunnels are off limits to me.
价格也以光线来衡量。由于它捕捉速度如此之快(最慢曝光时间为1/100秒),它需要大量光线。我只能白天拍摄,除了最明亮的车站和隧道外,其他地点对我来说都是禁区。
To my surprise, having dealt with vendorware before, Basler just let me download the SDK without a support contract or proof of purchase. The most recent version also still supports this camera from 2013, which is less surprising but is still convenient.
出乎意料的是,在处理过供应商软件之后,Basler让我无需支持合同或购买证明就能下载SDK。最新版本也仍然支持这款2013年的相机,这虽然不那么令人惊讶,但仍然很方便。
The camera communicates with the computer over a gigabit ethernet link and the software finds it automatically as long as the relevant interface is set up for APIPA addresses (169.254.0.0/16). I could set static addresses for both ends, but I'm only using one camera at a time, so I haven't been bothered to change it.
相机通过千兆以太网链路与计算机通信,只要相关接口设置为APIPA地址(169.254.0.0/16),软件就能自动找到它。我可以为两端设置静态地址,但我一次只使用一台相机,所以懒得去改。
With surprisingly little swearing at the SDK, apart from some complaints about their use of shutter time rather than shutter speed and what a "frame" is on this camera, I put together a program that grabbed buffers of pixels and wrote them to disk.
除了对他们使用快门时间而非快门速度以及这台相机上“帧”的定义有些抱怨外,我几乎没有对SDK说太多脏话,就编写了一个程序,抓取像素缓冲区并写入磁盘。
This was my first image out of the camera using my own code, and I think it looks pretty good for just moving it freehand.
这是我用自己代码从相机得到的第一张图像,我认为仅凭徒手移动就能得到这样的效果已经相当不错了。
The setup and mechanical design
设置与机械设计
In order to take it on a train without needing to have three hands to hold it, I needed a way to mount it to a tripod. I ended up designing a rather utilitarian case with a heat-set insert in the bottom that my friend Brooke 3D-printed for me. Buying the parts for it gave me an excuse to finally make an order from McMaster-Carr and feel like a real engineer.
为了能带上火车而不需要三只手来拿,我需要一种方法将它安装在三脚架上。最终,我设计了一个相当实用的外壳,底部有热熔嵌件,由我的朋友布鲁克用3D打印帮我制作。购买这些零件给了我一个借口,终于可以在McMaster-Carr下单,感觉自己像个真正的工程师。
My first attempt didn't come out because it turns out there's these things called "manufacturing tolerances" that I completely forgot about.
我的第一次尝试没有成功,因为事实证明,有叫做“制造公差”的东西,我完全忘记了。
Oops, that's a bit too small.
哎呀,这个有点太小了。
In retrospect, I probably should've stuck the sensors on with something other than blue painters' tape, but it's held on pretty well.
回想起来,我可能不应该用蓝色美纹纸胶带粘传感器,但它粘得还挺牢的。
Going clockwise around it, the boards are:
顺时针看,这些板子是:
- 6 degree of freedom accelerometer/gyro, which can be used with some maths to to get the speed
- 六自由度加速度计/陀螺仪,可以通过一些数学运算来获取速度。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力