News for hackers. Stuff that matters.
Re:Ask HN: Most interesting tech you built for just yourself? by jo-m on Friday April 28, 2023 @04:49AM (#35738987)
I have a rail line right under my apartment, so I built a small computer vision app running on a Rasperry Pi which records each train passing, and tries to stitch an image of it.

It has a frontend at https://trains.jo-m.ch/.

Edit: it's currently raining and the rain drops are disturbing the images a bit.

Re:Ask HN: Most interesting tech you built for just yourself? by Nextgrid on Friday April 28, 2023 @05:32AM (#35739221)
Made me think of Kartrak (an early optical barcode-like system for tracking rolling stock): https://www.youtube.com/watch?v=5K8UpMNYIPo
Re:Ask HN: Most interesting tech you built for just yourself? by Jleagle on Friday April 28, 2023 @05:30AM (#35739211)
Sounds interesting id love to know how you do it. Is the speed calculated based on the noise of the wheels going over a track join? Then you can work out the length/speed based on the time it takes etc. Are the train types/images random or calculated some how?
Re:Ask HN: Most interesting tech you built for just yourself? by jo-m on Friday April 28, 2023 @06:32AM (#35739550)
There is a parameter which tells the program how many pixels there are per meter. From this you can compute the length after stitching. Using framerate, you can compute the speed in the same way.
Re:Ask HN: Most interesting tech you built for just yourself? by prenoob on Friday April 28, 2023 @05:30AM (#35739212)
Taking trainspotting to a new level, congratulations
Re:Ask HN: Most interesting tech you built for just yourself? by sirwitti on Friday April 28, 2023 @05:27AM (#35739186)
This is really cool! Thanks for creating and sharing!
Re:Ask HN: Most interesting tech you built for just yourself? by globalise83 on Friday April 28, 2023 @05:12AM (#35739098)
No interest in trains, but your website is great - simple, visual and effective.
Re:Ask HN: Most interesting tech you built for just yourself? by grilledcheez on Friday April 28, 2023 @05:11AM (#35739094)
This is so cool!
Re:Ask HN: Most interesting tech you built for just yourself? by markusw on Friday April 28, 2023 @05:03AM (#35739052)
Cool! :D
Re:Ask HN: Most interesting tech you built for just yourself? by habi on Friday April 28, 2023 @06:05AM (#35739399)
Awesome. Congratulations from a fellow Swiss (and panorama photo dabbler).
Re:Ask HN: Most interesting tech you built for just yourself? by crossroadsguy on Friday April 28, 2023 @08:38AM (#35740553)
And yet again I forgot it’s not the Chinese TLD.

By the way I have a quick expansion for most TLDs and for the Swiss .ch “cheese” sounds rather more apt and easier than the real one in my head :)

Re:Ask HN: Most interesting tech you built for just yourself? by fransje26 on Friday April 28, 2023 @06:18AM (#35739464)
Really cool. They look like model trains! :-)
Re:Ask HN: Most interesting tech you built for just yourself? by dmd on Friday April 28, 2023 @09:23AM (#35741008)
Yeah! I've never seen trains so clean and modern looking in my life. They look like they came out of a futuristic toy set.
Re:Ask HN: Most interesting tech you built for just yourself? by 4ggr0 on Friday April 28, 2023 @10:03AM (#35741388)
They're swiss trains, I guess we have enough wealth to make sure that our trains are clean. The interior is also almost always clean, except early morning on weekends (drunk people).

From time to time I see a train with graffiti on it, but usually they remove such things very fast.

Re:Ask HN: Most interesting tech you built for just yourself? by uuuuuuuuuuuuuuu on Saturday April 29, 2023 @02:25AM (#35750537)
That's Europe for you. Usable train infra is actually a thing.
Re:Ask HN: Most interesting tech you built for just yourself? by lpapez on Saturday April 29, 2023 @09:10AM (#35752550)
Maybe West Europe. Definitely not here in the east.
Re:Ask HN: Most interesting tech you built for just yourself? by jo-m on Friday May 05, 2023 @01:36AM (#35825562)
There are visitors from the east sometimes ;)

https://trains.jo-m.ch/#/trains/2483

Re:Ask HN: Most interesting tech you built for just yourself? by cinntaile on Saturday April 29, 2023 @09:16PM (#35758853)
It somewhat works but let's not exaggerate how well it works.
Re:Ask HN: Most interesting tech you built for just yourself? by tuukkah on Friday April 28, 2023 @07:02AM (#35739755)
I wonder if there's open data or an open API for the schedule or location information. That way, you could include information on which train is which.
Re:Ask HN: Most interesting tech you built for just yourself? by jo-m on Friday April 28, 2023 @09:56AM (#35741316)
Yes, the APIs are there, with minute accurate real time data. Would just have to do it ;)
Re:Ask HN: Most interesting tech you built for just yourself? by sandos on Friday April 28, 2023 @07:02AM (#35739756)
Nice job! I would be really happy if I ever finished my own hobby projects this well.
Re:Ask HN: Most interesting tech you built for just yourself? by detaro on Friday April 28, 2023 @07:15AM (#35739856)
that is very neat, thanks for sharing!
Re:Ask HN: Most interesting tech you built for just yourself? by Aeolun on Friday April 28, 2023 @07:20AM (#35739890)
What’s up with the duplicated cars at the top?
Re:Ask HN: Most interesting tech you built for just yourself? by mkl on Friday April 28, 2023 @07:51AM (#35740146)
The camera is pointing at the car. The train is moving past the car. The images of the whole train are made by stitching together lots of photos, all containing the bit of the train in front of the car as it moves past it.
Re:Ask HN: Most interesting tech you built for just yourself? by LoveMortuus on Friday April 28, 2023 @08:25AM (#35740454)
From what I can see, they're not actually duplicated, I would suggest taking a closer look at the windows. But I do agree that it's quite hard to see the difference.

The trains look very clean from the outside. I do wonder how loud is it, to live so near the tracks.

Re:Ask HN: Most interesting tech you built for just yourself? by iridium184 on Sunday April 30, 2023 @03:35AM (#35760400)
They are also very clean from the inside :).

I also live right next to a train line in CH (that has exactly the same kind of rolling stock passing by as the ones captured by jo-m). These are modern commuter trains (no cargo and long distance trains), and are a lot less loud than you'd expect. A somewhat busy street nearby would be an order of magnitude more annoying.

Re:Ask HN: Most interesting tech you built for just yourself? by spyremeown on Friday April 28, 2023 @07:52AM (#35740154)
This is awesome. Really nice!
Re:Ask HN: Most interesting tech you built for just yourself? by Hypergraphe on Friday April 28, 2023 @08:16AM (#35740372)
So RAD !
Re:Ask HN: Most interesting tech you built for just yourself? by megalord on Friday April 28, 2023 @08:43AM (#35740582)
This is really impressive. Very nice work
Re:Ask HN: Most interesting tech you built for just yourself? by jcutrell on Friday April 28, 2023 @08:44AM (#35740596)
I live on an airport - Id really like to do this.
Re:Ask HN: Most interesting tech you built for just yourself? by amenghra on Friday April 28, 2023 @10:09AM (#35741448)
https://skybot.cam/ (see also https://github.com/IQTLabs/SkyScan) and might be of interest to you?
Re:Ask HN: Most interesting tech you built for just yourself? by unixhero on Saturday April 29, 2023 @01:13AM (#35750233)
Do you mean by an airport?

Or do you litteratur love in or on an airport?

Re:Ask HN: Most interesting tech you built for just yourself? by nXqd on Friday April 28, 2023 @09:04AM (#35740795)
this is so cool :D
Re:Ask HN: Most interesting tech you built for just yourself? by jokteur on Friday April 28, 2023 @09:25AM (#35741028)
Given the type of trains that are passing (it seems no IC/IR), along with their precise timing and direction, I'm sure it is easy to figure out where exactly you are living.
Re:Ask HN: Most interesting tech you built for just yourself? by jo-m on Friday April 28, 2023 @09:32AM (#35741090)
Yes.
Re:Ask HN: Most interesting tech you built for just yourself? by wkat4242 on Friday April 28, 2023 @05:35PM (#35747375)
Especially in Switzerland where the trains actually go on time :P But anyway does it really matter? It'll still be hard to identify the actual apartment.

Most online webcams are easier to identify

Re:Ask HN: Most interesting tech you built for just yourself? by wizzwizz4 on Friday April 28, 2023 @08:26PM (#35748784)
Given an approximate location, even I could do that. You just look at the camera angle.
Re:Ask HN: Most interesting tech you built for just yourself? by wkat4242 on Friday April 28, 2023 @09:04PM (#35748977)
But the camera image here is heavily processed. Getting an angle out of that looks difficult.
Re:Ask HN: Most interesting tech you built for just yourself? by lostlogin on Saturday April 29, 2023 @02:46AM (#35750649)
Wonder if we can get a nice photo of an HN reader?
Re:Ask HN: Most interesting tech you built for just yourself? by wizzwizz4 on Saturday April 29, 2023 @07:54AM (#35752083)
Please don't actually do this without permission. It's bloody terrifying when 4chan does it.
Re:Ask HN: Most interesting tech you built for just yourself? by terran57 on Friday April 28, 2023 @09:42AM (#35741183)
Cool project - thanks for sharing!
Re:Ask HN: Most interesting tech you built for just yourself? by birracerveza on Friday April 28, 2023 @10:21AM (#35741583)
This is amazing
Re:Ask HN: Most interesting tech you built for just yourself? by mertd on Friday April 28, 2023 @10:29AM (#35741681)
That's amazing. Very cool.
Re:Ask HN: Most interesting tech you built for just yourself? by chankstein38 on Friday April 28, 2023 @10:35AM (#35741761)
This is such a cool project! I live right next to a busy road and for a long time have wanted to do something like this that would count the vehicles passing. I've always been curious how many cars pass on a given day and I feel like the hardest part now adays would be getting the right camera angle so if cars are occupying all 3 lanes they aren't counted incorrectly. From there I just need to detect cars as they pass and count them.

It's really cool to see it used like this! The resulting images are really neat as well!

Re:Ask HN: Most interesting tech you built for just yourself? by e4e5 on Friday April 28, 2023 @01:13PM (#35744213)
There was a post yesterday about counting traffic on a pi, you might want to check it out: https://nathanrooy.github.io/posts/2019-02-06/raspberry-pi-d...
Re:Ask HN: Most interesting tech you built for just yourself? by chankstein38 on Friday April 28, 2023 @01:45PM (#35744652)
Thank you for this! It's great!
Re:Ask HN: Most interesting tech you built for just yourself? by imstil3earning on Friday April 28, 2023 @10:46AM (#35741910)
wow that is so cool!
Re:Ask HN: Most interesting tech you built for just yourself? by noman-land on Friday April 28, 2023 @10:49AM (#35741953)
This is so cool!!
Re:Ask HN: Most interesting tech you built for just yourself? by jo-m on Friday April 28, 2023 @10:51AM (#35741980)
Tip: some more interesting ones (including failed ones) show up if you filter for shortest.

https://trains.jo-m.ch/#/trains/350

https://trains.jo-m.ch/#/trains/3224

https://trains.jo-m.ch/#/trains/4045

Etc

Re:Ask HN: Most interesting tech you built for just yourself? by ornornor on Saturday April 29, 2023 @04:05PM (#35756629)
I think the first one is a firefighter train. There is one (the same?) that lives near me.
Re:Ask HN: Most interesting tech you built for just yourself? by LetsGetTechnicl on Friday April 28, 2023 @11:16AM (#35742282)
Wow this is cool as hell!!
Re:Ask HN: Most interesting tech you built for just yourself? by mNovak on Friday April 28, 2023 @11:48AM (#35742809)
Wow that's very cool. The resulting super flat images of the trains is really interesting -- like taking a photo from immense distance
Re:Ask HN: Most interesting tech you built for just yourself? by eiiot on Friday April 28, 2023 @12:08PM (#35743209)
This is really sick!
Re:Ask HN: Most interesting tech you built for just yourself? by blakecaldwell on Friday April 28, 2023 @12:15PM (#35743361)
I love this so much. Amazing use of creativity and tech chops. A++ would trainspot again.
Re:Ask HN: Most interesting tech you built for just yourself? by ipsum2 on Friday April 28, 2023 @12:29PM (#35743573)
Very cool, how does the stitching work?
Re:Ask HN: Most interesting tech you built for just yourself? by BHSPitMonkey on Friday April 28, 2023 @12:45PM (#35743806)
I think this might be my favorite. Wonderful idea and execution!
Re:Ask HN: Most interesting tech you built for just yourself? by bombcar on Friday April 28, 2023 @01:52PM (#35744731)
This is close to what I've always wanted to build; a camera watching the road next to me that records the speed of the vehicle traveling by. I should have everything needed from a simple camera setup, but I've not bothered actually doing it.

Since you have speed, I should dig into this.

Re:Ask HN: Most interesting tech you built for just yourself? by hyeomans on Friday April 28, 2023 @02:26PM (#35745202)
Same here, I have a Pi 3 but I want to have this outside in the balcony, the question that always stops me is how to power it and what camera do I meed?
Re:Ask HN: Most interesting tech you built for just yourself? by bombcar on Friday April 28, 2023 @03:31PM (#35746033)
My plan was to stick the Pi inside, and power both it and the camera with Power over Ethernet (external-rated PoE cameras are a dime-a-dozen on Alibaba and friends).

I even got so far as to get it working with Zoneminder to dump out the clips that had motion, but didn't get further.

Re:Ask HN: Most interesting tech you built for just yourself? by password4321 on Friday April 28, 2023 @03:47PM (#35746206)
Re:Ask HN: Most interesting tech you built for just yourself? by robodan on Friday April 28, 2023 @06:01PM (#35747621)
I wanted that with noise levels. I'm so very tired of hearing illegally modified exhausts. It seems like an I2S mic would give calibrated levels.
Re:Ask HN: Most interesting tech you built for just yourself? by Tempest1981 on Saturday April 29, 2023 @11:38AM (#35753942)
Could you show average speed vs car manufacturer? Or vs car type (compact, European luxury, minivan, truck). I always wondered if this is correlated.
Re:Ask HN: Most interesting tech you built for just yourself? by bombcar on Saturday April 29, 2023 @04:24PM (#35756800)
Would be interest; perhaps the red ones ARE faster.
Re:Ask HN: Most interesting tech you built for just yourself? by oever on Saturday April 29, 2023 @05:44PM (#35757535)
The short ones are fastest.
Re:Ask HN: Most interesting tech you built for just yourself? by dharisd on Sunday April 30, 2023 @03:59AM (#35760517)
I actually have done something similar to this, since I had pretty clear view of the road infront and had my old android phone laying around,

Used to yolov5 to detect vehicles and deepsort to track them, also got a rough estimate for the speed of the pass

heres the two part blog i wrote about it

https://dharisd.github.io/posts/vehicle-monitor/

https://dharisd.github.io/posts/vehicle-monitor-part-two/

Re:Ask HN: Most interesting tech you built for just yourself? by formerly_proven on Friday April 28, 2023 @02:06PM (#35744938)
A hybrid between area and line scan - block scan camera?
Re:Ask HN: Most interesting tech you built for just yourself? by ant6n on Friday April 28, 2023 @02:11PM (#35745018)
Very neat. What are those power cars (triebkopf)? I thought sbb was only using proper locomotives (cabs at both ends) and EMUs (kiss, twindexx, …).
Re:Ask HN: Most interesting tech you built for just yourself? by jo-m on Saturday April 29, 2023 @07:15AM (#35751891)
Re:Ask HN: Most interesting tech you built for just yourself? by imhoguy on Friday April 28, 2023 @02:45PM (#35745415)
Some cool tech there too - client side sqlite db over wasm, neat! :)
Re:Ask HN: Most interesting tech you built for just yourself? by jollyllama on Friday April 28, 2023 @02:45PM (#35745424)
Reminds me of the 90's Lego computer game "Lego Loco"
Re:Ask HN: Most interesting tech you built for just yourself? by yellowapple on Sunday April 30, 2023 @01:17PM (#35764583)
I'm glad there's at least one other person in the world who remembers that game.
Re:Ask HN: Most interesting tech you built for just yourself? by dllu on Friday April 28, 2023 @02:48PM (#35745463)
Have you considered getting a line scan camera for sharper and higher resolution images? I took some train scans with one: https://daniel.lawrence.lu/photos/

Incidentally I also built some tech for it: https://github.com/dllu/nectar but I need to update the readme...

Re:Ask HN: Most interesting tech you built for just yourself? by seabass-labrax on Friday April 28, 2023 @03:56PM (#35746302)
I remember seeing your photographs on Wikimedia Commons and wondering how you did them - now I know! I always assumed that you just used a very quick shutter with an f-stop of zero :)
Re:Ask HN: Most interesting tech you built for just yourself? by stavros on Friday April 28, 2023 @04:30PM (#35746709)
I know he told us how already, but that would have left the background sharp, rather than always the same.
Re:Ask HN: Most interesting tech you built for just yourself? by dllu on Friday April 28, 2023 @07:29PM (#35748450)
I have a huge backlog of photos that I need to contribute to Wikimedia Commons! I'll get around to doing it eventually, hopefully before 2045.
Re:Ask HN: Most interesting tech you built for just yourself? by seabass-labrax on Sunday April 30, 2023 @06:14PM (#35767067)
Do it sooner than 2038 and you get the privilege of 32-bit timestamps on the metadata :)
Re:Ask HN: Most interesting tech you built for just yourself? by mcast on Friday April 28, 2023 @03:58PM (#35746328)
Thanks for sharing, those photographs are very clear and sharp (especially this one: https://pics.dllu.net/file/dllu-pics/boston-pcc.jpg) it seems to tickle my brain.
Re:Ask HN: Most interesting tech you built for just yourself? by cinntaile on Friday April 28, 2023 @04:46PM (#35746904)
This reminds me of Wes Anderson movies for some reason.
Re:Ask HN: Most interesting tech you built for just yourself? by bradgessler on Friday April 28, 2023 @06:26PM (#35747895)
His style is to shoot his subjects straight-on. Most other movies have the camera at an angle.
Re:Ask HN: Most interesting tech you built for just yourself? by dllu on Friday April 28, 2023 @07:23PM (#35748407)
I'm a big fan of Wes Anderson's aesthetics and would love to shoot that funicular train from Grand Budapest Hotel (which actually exists --- the Buda Hill funicular) using my line scan camera.
Re:Ask HN: Most interesting tech you built for just yourself? by dllu on Friday April 28, 2023 @07:21PM (#35748386)
I have three of those actually:

https://daniel.lawrence.lu/photos/pcc

Technically, the photo could be twice the resolution, since the length of the line scan sensor is 4096. It consists of two lines, RGRGRG and GBGBGB. By interpolating the red and blue channels, it would be possible to get images 4096 pixels tall. The challenge is that the two green channels apparently have quite different sensitivity and also each pixel has some variation in sensitivity, which also seems to drift with temperature and settings, so it's quite annoying to calibrate everything properly haha.

Re:Ask HN: Most interesting tech you built for just yourself? by jo-m on Friday April 28, 2023 @07:09PM (#35748299)
Wow, the pictures look amazing! Yes, the look of line scan images were an inspiration for this project. But of course, I also tried to keep BOM costs down and so ended up with a RP4 + RPi Camera.
Re:Ask HN: Most interesting tech you built for just yourself? by dllu on Friday April 28, 2023 @07:12PM (#35748327)
The RPi HQ camera is a nice step up from the regular RPi camera while being not too expensive too. Incidentally, I also have a project using that [0] but unfortunately no trains where I live.

[0] https://daniel.lawrence.lu/blog/y2022m01d27/

Re:Ask HN: Most interesting tech you built for just yourself? by svara on Saturday April 29, 2023 @06:28AM (#35751665)
How do you get the x scaling right? You have to measure the speed of the train somehow?
Re:Ask HN: Most interesting tech you built for just yourself? by dllu on Saturday April 29, 2023 @03:33PM (#35756292)
When the train is moving at a constant speed, you can just scale the image manually to make it just right. If it's moving at a non-constant speed, you can apply a spline or similar to remove the distortion.
Re:Ask HN: Most interesting tech you built for just yourself? by maurits on Saturday April 29, 2023 @07:02AM (#35751821)
Your blog is a gem, thanks for sharing!
Re:Ask HN: Most interesting tech you built for just yourself? by qwertyuiop_ on Saturday April 29, 2023 @07:35AM (#35751980)
Woah the resolution! You can see the earpods on a person behind the tinted windows of Shinkansen.
Re:Ask HN: Most interesting tech you built for just yourself? by dahart on Saturday April 29, 2023 @09:55AM (#35752870)
I love how the line scan camera’s horizontal background makes it look like the trains are moving impossibly fast. Not only are the images sharp & high res, it has a great aesthetic and implies you were tracking an action shot.
Re:Ask HN: Most interesting tech you built for just yourself? by IIAOPSW on Sunday April 30, 2023 @05:09AM (#35760889)
Have you tried the opposite direction? Sitting on the train with the line feed and taking a picture of outside? Like say, a panorama view of the entire run-length of the line, distorted in proportion to the trains turns and accelerations.
Re:Ask HN: Most interesting tech you built for just yourself? by INTPenis on Friday April 28, 2023 @04:05PM (#35746416)
When you say "right under my apartment", where exactly do you mean? Because I also have a train line going underground very near my apartment but it's not directly under. Could I capture such images? And I'm on the 4th floor.
Re:Ask HN: Most interesting tech you built for just yourself? by uuuuuuuuuuuuuuu on Saturday April 29, 2023 @02:24AM (#35750533)
I got confused at first too. What he means is "somewhere outside on the ground level while my apt is not on the ground level, there are trains passing by which I can see from my apt". You need line of sight.

This is not mysterious tech deriving images from sound traveling through the floor. You will be out of luck with your underground subway.

Re:Ask HN: Most interesting tech you built for just yourself? by 6510 on Saturday April 29, 2023 @10:43PM (#35759281)
If you have the schedule and the sound I'm sure you could make a cam with translucent ground. You should be able to figure out where it is, which model and how long it is. Who knows, maybe the orchestra of break sounds (it has many) is unique enough to spot which it is exactly.
Re:Ask HN: Most interesting tech you built for just yourself? by ilyin on Monday May 01, 2023 @06:03PM (#35779827)
A fun fact is that there is a monorail station built in the middle of a residential building, so it might also be literal.

https://en.m.wikipedia.org/wiki/Liziba_station

Re:Ask HN: Most interesting tech you built for just yourself? by rnjailamba on Friday April 28, 2023 @05:59PM (#35747604)
Curious to know how you manage to concentrate during waking hours on work and how you sleep peacefully?
Re:Ask HN: Most interesting tech you built for just yourself? by fckthisguy on Saturday April 29, 2023 @06:41AM (#35751725)
There's a lot of trains in Switzerland so there's a lot of apartments by tracks. For the most part, the apartments are just built well.

Plus, the trains and tracks are very well maintained, so they create a lot less noise than you may be used to.

Re:Ask HN: Most interesting tech you built for just yourself? by CTDOCodebases on Friday April 28, 2023 @09:26PM (#35749090)
This is cool. How do you calculate the speed of the train?

I'm assuming you are measuring how far a certain feature of the train takes to get from one point of the frame to the other. Similar to how police catch people speeding by measuring how long road markings take to pass in a given frame.

Re:Ask HN: Most interesting tech you built for just yourself? by unixhero on Saturday April 29, 2023 @01:09AM (#35750218)
Amazing photos
Re:Ask HN: Most interesting tech you built for just yourself? by helloguillecl on Saturday April 29, 2023 @04:49AM (#35751252)
This is incredible. Congrats.
Re:Ask HN: Most interesting tech you built for just yourself? by ggambetta on Saturday April 29, 2023 @05:44AM (#35751495)
Very nice! Pleasantly surprised to see the SBB logo <3
Re:Ask HN: Most interesting tech you built for just yourself? by wigster on Sunday April 30, 2023 @08:32AM (#35761959)
these pics look great. like some big model trail set catalog.
Re:Ask HN: Most interesting tech you built for just yourself? by Alifatisk on Sunday April 30, 2023 @02:04PM (#35765014)
How accurate is the speed and length measurement?
Re:Ask HN: Most interesting tech you built for just yourself? by utmishra on Tuesday May 02, 2023 @07:35AM (#35785999)
Sharing this with SBB

I hope they notice (also makes me want to guess the location). I am in Zurich and I hope I don't find this spot