Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Calibrating tracked lengths from px to cm

36 views
Skip to first unread message

Juee Dhar

unread,
Mar 5, 2024, 4:52:15 AM3/5/24
to idtracker.ai users group

Hello,

I'm currently attempting to calibrate the tracked lengths from pixels to centimeters but am having difficulty figuring out how to do so using the idtrackerai GUI. Could you assist me with this? Specifically, I'd like to understand what one pixel represents in relation to an external measure, such as the dimensions of the arena. Once I have this information, I can proceed with further conversion using the Trajectorytools code provided for the same.

Thanks!

Juee

idtrackerai

unread,
Mar 5, 2024, 6:14:40 AM3/5/24
to idtracker.ai users group
Hi Juee,

Right now, idtrackerai returns the trajectories in pixels. These pixels units are not related to anything in particular (not the arena nor animals size), pixels are just the most naive position measure one can have in a video.

There's no way to calibrate the trackings with some "pixel to cm" conversion yet. But, adding this tool to the Validator is something we want to do and, now that you insist, we will try to make it a priority.

Jordi

idtrackerai

unread,
Mar 5, 2024, 12:43:37 PM3/5/24
to idtracker.ai users group
Well, I just worked a bit on this and I implemented the tool :)

It will be available in the next main release of idtrackerai (in one or two weeks). If you want to use it now and test it a little bit, you can install the current alpha version i just released with:

    python -m pip install -U --pre idtrackerai

You'll find this tool named "Length calibration" in the "Extra tools" section of the Validator (top right). It doesn't modify the trajectory values but it adds a "length_unit" number in the trajectories metadata to convert the data by yourself whenever you want.

I hope it's helpful,
Jordi

Juee Dhar

unread,
Mar 6, 2024, 5:32:35 AM3/6/24
to idtracker.ai users group
Hi Jordi,

I do see the length calibration tool in the current alpha version. Thanks a lot for the help! Really appreciate it.

Warm regards,
Juee

idtrackerai

unread,
Mar 22, 2024, 10:59:43 AM3/22/24
to idtracker.ai users group
Hi Juee,

I just released the new version of idtrackerai which includes the lenth calibration. There's a key difference with the alpha version you tried, the resulting length_unit in trajectory files is the inverse of the one in your version (pixel distance over real distance, no the other way around). You can recompute the length unit of the sessions you already calibrated by just opening them in the Validator and saving them, without any other action. The Validator will load your calibrations and compute the length unit from that using the new definition.

Jordi
Reply all
Reply to author
Forward
0 new messages