Hi,
for the last months and days i was trying to code a python skript to measure the time of aRC Boat when its crossing a line. This my tries are working for good conditions (Sun, no waves, fast boat)
But for the last competition we had big waves and slow boats.
i recorded some videos.
Video
At the moment me and the AI dont get a good tracking for the boat. Most of the time other motion is tracked.
Do you guys have an idea how to track the boat?
Here the Background Subtraction Video
Video
yeah the wind and camera movement is a problem. But thats not the biggest issue.
peolple could get a window where no tracking is allowed.
At the moment i’am tuning the BGSEG to filter most of the waves to nearly nothing. And the Boat and following postions are guessed from the direction and speed to get the next tracking point
this is working in maybe 80% of the time.
i could try AI object detection. But i never did something like that.
this tracking an line crossing should be used on competitions for time measuring. So it need to work live on the video stream
it’s fairly trivial. get some AI to write you the example code.
I asked Gemini for how a “segment anything model” would fare. it seems to think “SAM 2” would do a good job. these models do more work than you need (a segmentation is more than just object detection) but at the start you need to select the RC speed boat and then let the model track it though the video.
OpenCV itself has DNN-based object tracking that should be cheaper than “SAM 2”. pick any here: https://docs.opencv.org/5.0/main_modules/video_track.html
pick a model, like https://docs.opencv.org/5.0/main_modules/classcv_1_1TrackerDaSiamRPN.html
instantiate it, init it, update it https://docs.opencv.org/5.0/main_modules/classcv_1_1Tracker.html
a blog post showing this