ivoflipse / Pawlabeling

Tool for processing and analyzing pressure measurements
Other
18 stars 1 forks source link

Improve the way contacts are tracked #24

Closed ivoflipse closed 10 years ago

ivoflipse commented 11 years ago

Currently the whole process of tracking contacts is somewhat hacked together code from previous endeavours.

Zero-based padding around the edges is added, in order for cv2.findContours to detect the entire contact. However, this leads means the entire contour is off-by-one when you try to relate the values back to the original plate.

My proposal would be to isolate the padding to just the tracking function. Have the tracking function return Contact objects instead of contours, which automatically get their coordinates adjusted for the padding.

ivoflipse commented 11 years ago

I've removed the padding, such that its only used in track_contacts and removed when creating Contact objects (even from their contours).

Given that track_contacts has been moved to the model, things are already a lot cleaner

ivoflipse commented 11 years ago

I'm reopening, because I've decided the way things are now are still a bit convoluted. I have a Contact object, why wouldn't I use this to keep track of everything, paw_label, paw_data, max_of_max etc? Exactly, which is why I'm going to pull all that stuff into Contact and probably move Contact to model.py

ivoflipse commented 11 years ago

I've added a lot of attributes to Contact, so they can be used to keep track of things. But some things are a bit hard to keep in sync, for example filtering isn't done on a Contact level, its done of a list of all the data for that paw_label. Figuring out which contact that belongs too is a bit of a hassle.

ivoflipse commented 11 years ago

While its nice that tracking.merging_contacts gets the thresholds straight out of the configuration, now I have no idea how to update these values, for example by providing sliders in the processing widget, because every module loads configuration.py on its own and I'm not sure if they share the instance.

So figure out how I can update these values, while the program is running.

ivoflipse commented 10 years ago

With the changes to settings, this shouldn't be much of a problem. So I'm closing this issue