colinlaney / animal-tracking

Object tracking with OpenCV in open field behavioral test (overhead view maze)
https://youtu.be/GebcshN4OdE
Creative Commons Zero v1.0 Universal
50 stars 23 forks source link

Improving CLI functionality #3

Open TheChymera opened 7 years ago

TheChymera commented 7 years ago

Hello, I finally got around to cloning, testing, and having a closer look at this. Your code looks fairly simple and straightforward, especially compared to e.g. Pyper.

Ideally, though, in order to accommodate more functionalities (e.g. explicit target file specification, batch processing, different evaluation metrics) , the script functionality would be covered by a CLI.

This would require a bit of code rearrangement.

I'm basically writing to ask whether you would be interested to pull. If not, I might instead want to fork your code into behaviopy.

Haptein commented 7 years ago

Hi, I'm also interested in contributing. I've gone ahead and forked your code in order for it to work with a wider range of experimental settings and would be happy to help here if you're interested in pulling and you see these changes fit to the way you want your code to work. I've also written some changes in regard to CLI functionality and some other stuff. PS. The forked work here isn't up to date, since I'm currently away from home.

TheChymera commented 7 years ago

@Haptein cool! Could you show us a link to your forked code? While the author responds I would be interested to have a look at your code and see if it can already address (or whether I can easily hack it to address) my present use case.

Basically, if you're also interested in extending the scope, you could try and have a look at a sample recording from our lab, I uploaded one here. The issues I have encountered with the original code available here is:

Haptein commented 7 years ago

@TheChymera The fork is here. Although I wouldn't pay too much attention to it since it's been heavily modified since and is on a very incomplete stage. I'll update it as soon as I go back home, which should happen later this month.

About the issues you mentioned. The original code indeed assumes a list of hard-coded values and stuff about the experiments. The up-to-date fork doesn't assume a square stage and doesn't rely on stage Vs. wall contrast. The automatic stage area selection is something I completely removed for the time being, it made working with acrylic floor/walls troublesome and I think it's more convenient to save the selected region specs instead. I also added a config utility.

I didn't encounter any problem working with mkv files with the fork, but I don't think it should be any different with the original code. I think it might have something to do with your OpenCV version, although I'm not completely sure. I've been working with OpenCV 3.3.

TheChymera commented 7 years ago

I'm on =opencv-3.2.0

Haptein commented 7 years ago

I just tried the original code with your video and it loads it but indeed fails because the hard-coded assumptions about your experimental setting. Have you tried converting the included 'rat.avi' to .mkv and running the code with it? What's your error output?