denisecailab / ezTrack

Free, platform independent, behavior tracking software.
GNU General Public License v3.0
118 stars 41 forks source link

How to not consider a big clip in my cable (smaller than the mice) #8

Closed juliencarponcy closed 4 years ago

juliencarponcy commented 4 years ago

mouse-top Hi,

I have some weight compensation mechanism which pull the cable at a close distance from the mouse, and then appears on top videos as a big black point which is detected by ezTrack. It then mess up with COM detection. Side videos are perfectly fine, but I was wondering if you could think of a particular section in the code that I could look at to discard any "mass" that is smaller that a certain extent ? I guess it could be tricky to disambiguate two different "blobs" of pixel changes, especially it they come close or overlapping. Any thought about how to solve my issue ?

Thank you very much in advance,

Julien

mouse-top-tracking

ZachPenn commented 4 years ago

You could almost certainly implement a size exclusion criteria in the Locate function, contained within LocationTracking_Functions.py. The Mahotas package has some good tools for thresholding images and counting distinct 'blobs', and also has a tool for excluding blobs above or below a given threshold. I've used this doing cell counts with good results. All very simple.

The other more mechanical solution that might help is if you could use a white cable (or coat your cable). Especially if you set tracking_params['method']='dark', tracking should be much more in line with your mouse.

Hope this helps!