Closed natevw closed 11 months ago
Hi!
I have had some issues with trains being split too often as well. Mostly with ICEs and freight trains. I guess the ICEs just look to uniform in the X direction at some points. And the freight trains do have gaps, at least in the upper two thirds (empty cars).
I have tinkered with the train detection a bunch in https://github.com/clonejo/trainbot/commit/bed35a54f9c1424e5e150c8b241370a45a53ea77 to make things work, but i need to clean that up before an MR.
@jo-m Thanks, getting much closer! I think the main thing was rotating it by about 6º anti-clockwise. (And then also had to pre-crop my sample video due to #19.)
Then with:
export INPUT=sample-crop2.mp4
export RECT_X=50
export RECT_Y=50
export RECT_W=198
export RECT_H=133
export PX_PER_M=19
export MIN_SPEED_KPH=5
export MAX_SPEED_KPH=200
./trainbot
I do get quite a bit of the train 🎉
from this file:
https://github.com/jo-m/trainbot/assets/265902/611dc998-bd75-4e0b-ac34-6eac70d58e02
but it is missing the front engines. (Which it did detect in an earlier run with some different settings which I've lost :-/ but that was still lots of smaller chunks rather than almost the whole train.)
I think this can probably be closed, as it was a discussion rather than an issue anyway!
With a little different sample and playing around with exact crop regions and stuff (still only pre-recorded files), I was able to get my first full train panorama! 🎊
Thank you, so very fun! And @clonejo thank you as well I hope to at some point test out your fork as well and maybe try some of my own changes if I have a chance in coming weeks.
Next step for me is probably get set up with even further telephoto lens and camera mounted better so it's not needing software rotation — then dial in the values better.
nice!
I am nearly half a kilometer from the tracks but do have a view of passing trains. But I am not getting great results (sidestepping the issues of #15 for now by passing it directly a file path instead of V4L) and wondering if you have any advice/insight.
With the annotated crop region it does detect the motion of the train:
But it does not combine the whole train, only small bits. This is the first image, i.e. it misses the engine completely:
followed by:
and:
and a nice little stretch:
but then that's it for the whole train!
Any tips as to what crop region I should be aiming for? For example, if I expand the box to include the train on both sides of the tree, trainbot seems to just not trigger on the motion at all.
Admittedly this is not very ideal view of the train, but it seems to be showing some promise! 🥳 Any tips as to what to try? What sorts of things matter most — would the first step be to try straighten out the camera so it's not angled? adjust the crop region bigger or smaller? use a longer telephoto lens for more pixels/meter?