mooch443 / trex

TRex, a fast multi-animal tracking system with markerless identification, and 2D estimation of posture and visual fields.
https://trex.run
GNU General Public License v3.0
81 stars 8 forks source link

Allow TGrabs detections in a single direction (brighter or darker than background) #215

Closed roaldarbol closed 7 months ago

roaldarbol commented 8 months ago

First of all: I can see on the interface commits you're working hard away on 2.0 (seems just around the corner?!) - lots of cheering on from here, it doesn't go unnoticed, and I for one am really looking forward to it! 🥳 And this feature request may be covered by the new version, so feel free to close if that is the case.

Is your feature request related to a problem? Please describe. Not really. But the idea is that often your animal will look darker than the background, or it will look brighter than the background, whereas other irrelevant features (e.g. reflections) are in the opposite direction. Currently, TGrabs looks for differences in both directions (both brighter and darker than the background).

Describe the solution you'd like Maybe it could make sense to have a parameter to specify detection in only one direction (e.g. brighter only detects when pixels are brighter than the comparison, darker only detects when pixels are darker). That would help a lot on stuff like reflections.

Describe alternatives you've considered Currently the alternative is to use max or min as the averaging method to only detect in a single direction. This would allow using mode or average whilst still only caring about differences in a single direction.

mooch443 commented 7 months ago

Hey! First of all I have taken basically two months to respond, but in my defence - field season started and I am not there most of the time. Seems that I am a biologist after all!

Version 2.0 is basically running as it should in most respects. It is just that there remains some confusion with regards to parameters and paths and general usability questions that need to be addressed before it becomes a finished program. Thanks for cheering on, that has also not gone unnoticed! It is a lot of work, especially with real-life also existing. :)

There is an option called enable_absolute_difference. If you disable that, only positive differences will remain. Then, use image_invert to invert darker/lighter. Maybe this helps!

roaldarbol commented 7 months ago

No need to defend at all - life man, I totally get it - hope the field season went well! :-)

Ah, that's a neat solution, I'll use that! Thanks! (and continued cheering on!!!🥳)