denisecailab / ezTrack

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

How to batch process with image cropping and ROI selection available for each video #16

Closed DZneuro closed 4 years ago

DZneuro commented 4 years ago

Hi, I am trying to use the LocationTracking_batch script to process my videos. I am wondering if it's possible to 'crop image', 'set reference image' and 'select ROI' for each individual video instead of using the first video file, just leave the 'load video file ' and 'output csv file' to be batch process? Thank you so much!

ZachPenn commented 4 years ago

Hello,

The reference frame is not generated from the first video and then used for all subsequent videos - it is generated for each individual separately. However, currently there is no way to select regions of interest and crop differently for individual videos. The logic for this decision is that if you have to manually do this for each individual video it really isn't a batch process.

If you want to 'speed' the process of using location tracking individual (by speed, I mean less clicks), you can always take the LocationTracking_Individual.ipynb file and delete cells of code you don't use, and combine any of the ones that don't have interactive output (e.g. drawing regions of interest, interactive graphs).

Perhaps this doesn't address what you'd like though. Let me know your thoughts. We are always open to suggestions.

DZneuro commented 4 years ago

Thanks a lot for the suggestions! It makes sense to keep the regions of interest the same across the all the videos. I was initially thinking it was the case and would be nice if each video is stored in a structure-like data type bundled with it's own ROI, ROI1 and ROI2 information, so it allows input of ROI for each video and batch process/output them. It may help reduce the effort to keep the chamber aligned with cameras very consistently across experiments or during cleanings and can runs faster than process individually, but it's just a thought. Your suggestions about cutting the code is very helpful.

ZachPenn commented 4 years ago

Thanks for the input! I want to highlight that if your cameras/videos are relatively consistent, if regions of interest are defined based upon a single video they can often be applied to a batch without any issues (depending upon how precise regions of interest need to be; in many cases I find fluctuations from one camera to the next to not be an issue). Also, at the end of batch processing the reference frame of each video will be displayed with the regions of interest outlined on top so that you can visually confirm that this is the case.