swarm-lab / trackR

trackR - A simple video tracking software for R
https://swarm-lab.github.io/trackR/
GNU General Public License v3.0
30 stars 9 forks source link

Include option to batch or sequentially track multiple video files in a directory? #33

Open ayexander opened 1 year ago

ayexander commented 1 year ago

Issue: I'm using trackR to track individual ants in a multi chamber setup. My experiments are recorded for 5 hours and partitioned into 10 30-minute videos. Currently I have to manually start trackR running on every video, taking extra time I'd like to not spend.

The ants are unable to move between chambers, but are in different positions at the start of each video, meaning their ID's switch from video to video, as shown in the images below (and related to the ROI ID jump issue I also posted). Thus it takes additional manual work to make the ID's consistent across the results for each video file.

Feature suggestion: Could a feature be added allowing batch or sequential tracking of multiple videos of the same experiment contained within a directory? Ie. the trackR settings defined for one video in the selected directory/experiment would be applied to all videos in the selected directory/experiment. Results could be output per video file, or in concatenated form.

Additional thoughts: In concert with my multiple ROI feature suggestion, making the ROI_track ID's consistent across multiple video files could be much easier.

Example images of issue: trackR_multiple_videos_issue

sjmgarnier commented 1 year ago

@ayexander It's something I have had in mind for a while. It's not as trivial to implement as it sounds (ideally, I would need to implement that directly into Rvision, the computer vision library used by trackR, and not in trackR directly). I'll try to make some progress on it over the next few months depending on my workload. In the meantime, there are several easy ways to merge videos together before feeding them to trackR. I use Quicktime (on Mac) and VLC (on Windows and Linux) for that.

ayexander commented 1 year ago

Hi Simone,

Thanks for your responses and ideas.

It makes sense to me that implementing the changes I suggested in the code may not be straightforward at all, but thanks for taking the ideas into consideration!

For now, I’ll move ahead with merging videos together before using trackR as you suggest to possibly reducing ID correction time.

Best, Alex

On Jan 22, 2023, at 10:20 AM, Simon Garnier @.**@.>> wrote:

Caution: External email

@ayexanderhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ayexander&d=DwMCaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=mHjEnPoAuJYsJzTvHpmQ89iguDIrEOFVqB0oDxTqxTE&m=PnkR737J0WIrQzkFtfztT-8iUi-ytBBu1C7CA3PU6zGfuFQR_IkXjJJyI-qLSumL&s=c-CZ1AzPwHE6MrqsIct_qoPu87HL84JQFhcRP8Jinrk&e= It's something I have had in mind for a while. It's not as trivial to implement as it sounds (ideally, I would need to implement that directly into Rvision, the computer vision library used by trackR, and not in trackR directly). I'll try to make some progress on it over the next few months depending on my workload. In the meantime, there are several easy ways to merge videos together before feeding them to trackR. I use Quicktime (on Mac) and VLC (on Windows and Linux) for that.

— Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_swarm-2Dlab_trackR_issues_33-23issuecomment-2D1399517357&d=DwMCaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=mHjEnPoAuJYsJzTvHpmQ89iguDIrEOFVqB0oDxTqxTE&m=PnkR737J0WIrQzkFtfztT-8iUi-ytBBu1C7CA3PU6zGfuFQR_IkXjJJyI-qLSumL&s=GgFEUCWu912fDY2CYhfoU0R1VTW7mCKV7JqAoMSMPFY&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_A5KTX55GLQRILQPQ7G7NEDDWTVF4BANCNFSM6AAAAAAT7VW4NQ&d=DwMCaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=mHjEnPoAuJYsJzTvHpmQ89iguDIrEOFVqB0oDxTqxTE&m=PnkR737J0WIrQzkFtfztT-8iUi-ytBBu1C7CA3PU6zGfuFQR_IkXjJJyI-qLSumL&s=FdWbU8_iwXPd2XutEitBb9LsJmnkAW5FoMSFbz-9Z0o&e=. You are receiving this because you were mentioned.Message ID: @.***>

sjmgarnier commented 1 year ago

@ayexander It might not take that long to get this working with trackR after all. I've just pushed a new feature into the development version of Rvision to create video stacks (https://github.com/swarm-lab/Rvision/commit/da9dbddb2d1d26b4485a8033fe37b9849b8080b6). I'll need a bit more time to test it more thoroughly and integrate it into trackR seamlessly, but the building blocks are all in place.

ayexander commented 1 year ago

Cool! Let me know when the updated version with the feature is available. Thanks again for your help Simon!

On Jan 25, 2023, at 11:11 AM, Simon Garnier @.***> wrote:

 Caution: External email

@ayexanderhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_ayexander&d=DwMCaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=mHjEnPoAuJYsJzTvHpmQ89iguDIrEOFVqB0oDxTqxTE&m=_xUhHokcW2Rqu8slnBlfEUtKfyG0R-Azm1B2RuwtnqBPnHtw2Zt5DTLj6ya0lAUS&s=25NLwL5xkIE97MFR-HRlksNLaAiCrycbq5bQAuIIe9g&e= It might not take that long to get this working with trackR after all. I've just pushed a new feature into the development version of Rvision to create video stacks @.***https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_swarm-2Dlab_Rvision_commit_da9dbddb2d1d26b4485a8033fe37b9849b8080b6&d=DwMCaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=mHjEnPoAuJYsJzTvHpmQ89iguDIrEOFVqB0oDxTqxTE&m=_xUhHokcW2Rqu8slnBlfEUtKfyG0R-Azm1B2RuwtnqBPnHtw2Zt5DTLj6ya0lAUS&s=wfLLFwqgtJaoPPUUJHXjHUTEgMZUE2p--bgTgCm5hYY&e=). I'll need a bit more time to test it more thoroughly and integrate it into trackR seamlessly, but the building blocks are all in place.

— Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_swarm-2Dlab_trackR_issues_33-23issuecomment-2D1403860439&d=DwMCaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=mHjEnPoAuJYsJzTvHpmQ89iguDIrEOFVqB0oDxTqxTE&m=_xUhHokcW2Rqu8slnBlfEUtKfyG0R-Azm1B2RuwtnqBPnHtw2Zt5DTLj6ya0lAUS&s=YGuEcrljQY2nZe-6LPFOSfBnRw8GGKQKg2n6rpVlQUI&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_A5KTX5YWQEDCGYEVX3MREXLWUFGB7ANCNFSM6AAAAAAT7VW4NQ&d=DwMCaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=mHjEnPoAuJYsJzTvHpmQ89iguDIrEOFVqB0oDxTqxTE&m=_xUhHokcW2Rqu8slnBlfEUtKfyG0R-Azm1B2RuwtnqBPnHtw2Zt5DTLj6ya0lAUS&s=Qil13shPkwStruA8jjYHYnt75CqaK6_gCE1EtAlJoMM&e=. You are receiving this because you were mentioned.Message ID: @.***>

sjmgarnier commented 1 year ago

@ayexander I pushed a version of trackR on the develop branch that should work with multiple files, if you want to give it a try. However, I just modified the main app for now. The helper apps (e.g., trackFixer) are not capable of handling multiple files yet.