10 ms·
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 stit
by jo-m 3y ago
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/ https://trains.jo-m.ch/.
Edit: it's currently raining and the rain drops are disturbing the images a bit.
- Aeolun 3y agoWhat’s up with the duplicated cars at the top?
- mkl 3y agoThe 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.
- LoveMortuus 3y agoFrom 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.
- iridium184 3y agoThey 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.
- birracerveza 3y agoThis is amazing
- spyremeown 3y agoThis is awesome. Really nice!
- markusw 3y agoCool! :D
- grilledcheez 3y agoThis is so cool!
- globalise83 3y agoNo interest in trains, but your website is great - simple, visual and effective.
- sirwitti 3y agoThis is really cool! Thanks for creating and sharing!
- Jleagle 3y agoSounds 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?
- jo-m 3y agoThere 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.
- prenoob 3y agoTaking trainspotting to a new level, congratulations
- Nextgrid 3y agoMade me think of Kartrak (an early optical barcode-like system for tracking rolling stock): https://www.youtube.com/watch?v=5K8UpMNYIPo https://www.youtube.com/watch?v=5K8UpMNYIPo
- habi 3y agoAwesome. Congratulations from a fellow Swiss (and panorama photo dabbler).
- crossroadsguy 3y agoAnd 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 :)
- fransje26 3y agoReally cool. They look like model trains! :-)
- dmd 3y agoYeah! I've never seen trains so clean and modern looking in my life. They look like they came out of a futuristic toy set.
- 4ggr0 3y agoThey'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.
- uuuuuuuuuuuuuuu 3y agoThat's Europe for you. Usable train infra is actually a thing.
- tuukkah 3y agoI 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.
- jo-m 3y agoYes, the APIs are there, with minute accurate real time data. Would just have to do it ;)
- sandos 3y agoNice job! I would be really happy if I ever finished my own hobby projects this well.
- detaro 3y agothat is very neat, thanks for sharing!
- Hypergraphe 3y agoSo RAD !
- megalord 3y agoThis is really impressive. Very nice work
- jcutrell 3y agoI live on an airport - Id really like to do this.
- nXqd 3y agothis is so cool :D
- jokteur 3y agoGiven 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.
- jo-m 3y agoYes.
- wkat4242 3y agoEspecially 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
- wizzwizz4 3y agoGiven an approximate location, even I could do that. You just look at the camera angle.
- terran57 3y agoCool project - thanks for sharing!
- mertd 3y agoThat's amazing. Very cool.
- chankstein38 3y agoThis 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!
- e4e5 3y agoThere 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-deep-learning-traffic-tracker/ https://nathanrooy.github.io/posts/2019-02-06/raspberry-pi-d...
- chankstein38 3y agoThank you for this! It's great!
- imstil3earning 3y agowow that is so cool!
- noman-land 3y agoThis is so cool!!
- jo-m 3y agoTip: 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/350 https://trains.jo-m.ch/#/trains/3224 https://trains.jo-m.ch/#/trains/3224 https://trains.jo-m.ch/#/trains/4045 https://trains.jo-m.ch/#/trains/4045 Etc
- ornornor 3y agoI think the first one is a firefighter train. There is one (the same?) that lives near me.
- LetsGetTechnicl 3y agoWow this is cool as hell!!
- mNovak 3y agoWow that's very cool. The resulting super flat images of the trains is really interesting -- like taking a photo from immense distance
- eiiot 3y agoThis is really sick!
- blakecaldwell 3y agoI love this so much. Amazing use of creativity and tech chops. A++ would trainspot again.
- ipsum2 3y agoVery cool, how does the stitching work?
- BHSPitMonkey 3y agoI think this might be my favorite. Wonderful idea and execution!
- bombcar 3y agoThis 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.
- hyeomans 3y agoSame 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?
- bombcar 3y agoMy 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.
- password4321 3y agohttps://news.ycombinator.com/item?id=11714207 https://news.ycombinator.com/item?id=11714207
- robodan 3y agoI 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.
- Tempest1981 3y agoCould you show average speed vs car manufacturer? Or vs car type (compact, European luxury, minivan, truck). I've always wondered if this is correlated.
- bombcar 3y agoWould be interest; perhaps the red ones ARE faster.
- formerly_proven 3y agoA hybrid between area and line scan - block scan camera?
- ant6n 3y agoVery neat. What are those power cars (triebkopf)? I thought sbb was only using proper locomotives (cabs at both ends) and EMUs (kiss, twindexx, …).
- jo-m 3y agohttps://de.wikipedia.org/wiki/SBB_Re_450 https://de.wikipedia.org/wiki/SBB_Re_450
- imhoguy 3y agoSome cool tech there too - client side sqlite db over wasm, neat! :)
- jollyllama 3y agoReminds me of the 90's Lego computer game "Lego Loco"
- yellowapple 3y agoI'm glad there's at least one other person in the world who remembers that game.
- dllu 3y agoHave 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/ https://daniel.lawrence.lu/photos/ Incidentally I also built some tech for it: https://github.com/dllu/nectar https://github.com/dllu/nectar but I need to update the readme...
- seabass-labrax 3y agoI 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 :)
- stavros 3y agoI know he told us how already, but that would have left the background sharp, rather than always the same.
- dllu 3y agoI 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.
- seabass-labrax 3y agoDo it sooner than 2038 and you get the privilege of 32-bit timestamps on the metadata :)
- mcast 3y agoThanks for sharing, those photographs are very clear and sharp (especially this one: https://pics.dllu.net/file/dllu-pics/boston-pcc.jpg https://pics.dllu.net/file/dllu-pics/boston-pcc.jpg) it seems to tickle my brain.
- cinntaile 3y agoThis reminds me of Wes Anderson movies for some reason.
- INTPenis 3y agoWhen 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.
- uuuuuuuuuuuuuuu 3y agoI 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.
- 6510 3y agoIf 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.
- ilyin 3y agoA 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 https://en.m.wikipedia.org/wiki/Liziba_station
- rnjailamba 3y agoCurious to know how you manage to concentrate during waking hours on work and how you sleep peacefully?
- fckthisguy 3y agoThere'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.
- CTDOCodebases 3y agoThis 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.
- unixhero 3y agoAmazing photos
- helloguillecl 3y agoThis is incredible. Congrats.
- ggambetta 3y agoVery nice! Pleasantly surprised to see the SBB logo <3
- wigster 3y agothese pics look great. like some big model trail set catalog.
- Alifatisk 3y agoHow accurate is the speed and length measurement?
- utmishra 3y agoSharing 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