-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tuning parameters #18
Comments
Problems 3 and 5 seem to be because of the erosion, not the speed of the ants. Some of the blobs appeared to be very small, even single-pixel-width sticks. The erosion was so strong that some frames didn't even have any foreground pixels. Rather than decreasing the effect of the erosion, I first sought to try setting the One thing to note: problem 3 improved after this step but didn't completely resolve. |
After reducing the |
It's important to have a MinimumBlobArea that is non-zero. Otherwise, not-ants will appear in the tracking output. See 5ddcee9 |
Problem 3 has become a very real problem. The large majority of NA values in the tracking output are because ants don't start getting tracked until they reach the center of the bridge. But we determine which direction they are moving in only by looking at whether they move from one side of the frame to the other. Either come up with a new strategy for determining direction or fix the problem of late appearing ants. Also, you should crop out everything but the bridge to see whether that helps things. |
Cropping out everything but the bridge has helped confirm that some ants (approximately 8 in the first test video) are not getting tracked at all. Interestingly, the output doesn't include ants with IDs 6, 9, and 11. Perhaps these three ants are part of the 8 that are missing. Maybe the pipeline is deleting ant tracks before it returns them to us? |
I also changed the output of the pipeline. Now, it outputs the sum of the distances that the ant travels in each frame. Negative distances represent moving right to left (instead of left to right). I have yet to verify this data manually. Update: there's no point to summing the distances between frames. just do it from start to finish (see commit f9b9137) |
Reduce the number of frames that an ant can be invisible before its track is deleted, to reduce the length of tracks that go off frame. This led to mild success! The pipeline now accurately tracks 16 of the 17 ants that actually cross the bridge. (see #18 for more details)
I made some visualizations to aid in further debugging and committed the code for generating them in b89aaba. |
Update: the missing ant appears at 0:48 in Also, reducing the minimumBlobArea seems to maybe slow down the tracking pipeline? |
I found the missing ant! Hoorah! We now have 17/17 of the ants tracked in |
I can confirm that ant 11 does actually become ant 9 at the end of its lifetime. Reducing the costOfNonAssignment for the Hungarian Algorithm did not help. As you reduce the costOfNonAssignment, other tracks start to break up into fragments before ant 9 does; it's quite stubborn. I also tried splitting the unassignedTrackCost and unassignedDetectionCost by calling the assignDetectionsToTracks() function in its second form, but to no avail. |
things I was going to do next but never got the chance to(but that @JarredAllen might want to do)
|
Reduce the number of frames that an ant can be invisible before its track is deleted, to reduce the length of tracks that go off frame. This led to mild success! The pipeline now accurately tracks 16 of the 17 ants that actually cross the bridge. (see #18 for more details)
Hey @JarredAllen, I was looking around the repo and noticed that you had pushed some changes to In fact, I had actually left those uncommitted because I considered those parameters to be overall worse than the ones I had been using before. If it was truly your intention to commit them because you decided they were actually better than the original parameters, then please disregard this message. I just wanted to make sure you weren't using them solely because you thought that was the "best" version of the pipeline before I left. I actually considered the "best" version to have been the one right before your commit. Sorry for the confusion. I should have communicated this to you earlier. My bad. |
Thanks for letting me know about that. I have since changed a couple of the values there to other things, but I also have not yet gotten around to all of the values which were changed in that commit, because I have been working on a fair number of other things, as well. I'll keep this in mind when looking at the rest of the values which I haven't tweaked yet. |
After working to fully understand morphological operations for the past couple weeks, I was able to solve the blob coalescence problem. The current solution only performs erosion (and nothing else), leading to blobs that are actually smaller than the ants themselves.
The blob coalescence problem is also helped by the Kalman filter, which accurately rescues the identification of the ants after they've coalesced by keeping a semi-accurate location of the disappeared ant in memory as a prediction and then correctly reassigning the ants after they've separated sufficiently.
Unfortunately, there are still a few errors with the pipeline.
In the future, we may want to crop out the full length of a bridge instead of simply a segment. I don't see any reason why we wouldn't want to, and it will allow the pipeline to have more information about whether the ant actually crosses a bridge or stops 2/3 of the way and turns back, for example.
The simplest solution to this problem is to extract only the bridge during cropping and nothing below or above it, unlike what was previously done. Unfortunately, bridges are rarely exactly horizontal in a video, so they probably won't fit perfectly. Future versions of the pipeline may include a "rotation" step, in which a video is rotated so that bridges are exactly horizontal before cropping.
The text was updated successfully, but these errors were encountered: