anipose icon indicating copy to clipboard operation
anipose copied to clipboard

Wand Calibration

Open KenR22 opened this issue 3 years ago • 4 comments

Hi,

I was wondering if I want to calibrate using DLT or easywand and use those calibration values for anipose. What will be the conversion process?

Thanks!

KenR22 avatar Jul 18 '21 22:07 KenR22

You'll need to convert the calibration values from DLT or easywand to the calibration.toml file used by anipose.

You can see some examples of the calibration.toml files here: https://github.com/lambdaloop/anipose/issues/17

I'm not familiar with the DLT or easywand formats, but if you have example calibration outputs from there I can point out how it matches to the anipose calibration format.

lambdaloop avatar Jul 23 '21 21:07 lambdaloop

Hi,

I have attached the mat file that I get from the easywand calibration as well as the json converted data. easy_wand_test.json.txt test_easyWandData.mat.txt (added .txt extension to both of the files to upload) I can see that these files give me a rotational matrix and translational vector. As far as I understand, I need to convert the rotational matrix with cv2.rodrigues to get a rotational vector. However, I am confused about getting the camera matrix from these data.

KenR22 avatar Jul 25 '21 00:07 KenR22

From what I can tell, it seems that the principal points are labeled as principalPoints in the form x y x y x y, and the focal lengths are under estFocalLengths . The anipose matrix definition follows the one from OpenCV: https://docs.opencv.org/3.4/dc/dbb/tutorial_py_calibration.html

The principal points correspond to the optical centers (c_x and c_y). easyWand assumes same focal length for x and y so focal length is f_x = f_y . With this you can fill out the camera matrix.

Seems like the rotations are under rotationMatrices and the translations under translationVector.

Distortions should just be [0, 0, 0, 0, 0] if you have no distortion coefficients (as I think you don't in the example file).

lambdaloop avatar Jul 28 '21 06:07 lambdaloop

I've written a converter that makes an anipose style calibration file from a DLT coefficients file and a camera profile like those used in easyWand and Argus. I have not tested it other than confirming that the file produced looks like an anipose calibration file, but I do currently have videos that I can calibrate by both wand and anipose to test it. Just haven't had time yet.

backyardbiomech avatar Nov 01 '21 14:11 backyardbiomech