Wand calibration for XMAlab

89 views
Skip to first unread message

Clyde Webster

unread,
Mar 18, 2019, 2:19:24 AM3/18/19
to XMALab
Hi, 


I don't know what the courtesy is on feature requests, but I wonder if it would be possible to include a wand calibration tool in a future release? Similar to Hedrick's Wand Calibration tool (http://biomech.web.unc.edu/wand-calibration-tools/), wand calibration allows us to calibrate cameras with significantly different FOV's. This can mean, keeping number of cameras the same, less potential for occlusion.

A wand can be any easily detectable known distance, although I've been developing my own (see attached) using internally lit spheres to reduce the effect of ambient light. I've also written code in MATALB to automatically detect it for the calibration and I've gotten really good results so far by combining this with an individual full frame checkerboard calibration for each camera's intrinsics. Combined with tools like DeepLabCut (http://www.mousemotorlab.org/deeplabcut) a more autonomous work flow would allow us to process much bigger data sets with many camera setups!

I don't expect this to be done quickly (or maybe at all) as I know the devs are probably very busy. But I thought I might ask anyway. Thank you for your consideration.

Regards,

Clyde Webster
20180910_211919.jpg

Beth Brainerd

unread,
Mar 18, 2019, 8:23:24 AM3/18/19
to Clyde Webster, XMALab
Hi Clyde — thanks for this suggestion! The best way to make a feature request is by opening an “Issue" on the XMALab Bitbucket site. https://bitbucket.org/xromm/xmalab/issues?status=new&status=open. Then others can vote for the priority of issues. It is also fine to email this XMALab Google Group so others know about the request and can vote for it, if it is a priority for them.

When creating an Issue for a feature request, select “Proposal" in the “Kind" drop down menu for a big new feature (such as wand calibration) and “Enhancement" for an upgrade to an existing function.

Users have to sign into Bitbucket to be able to create and vote for (as opposed to just view) issues.

All that being said, it is unlikely that we’ll be able to add a big new feature like this any time soon. The current NSF funding for XMALab is a small “Advances in Biological Informatics Sustaining” grant. There is only funding to maintain the software and provide some user support, and no funding for new features. 

— Beth

Elizabeth Brainerd
Professor of Biology and Medical Science
Department of Ecology & Evolutionary Biology
Brown University, Box G-B210
Providence RI 02912
o: 401-863-9261
m: 401-225-9811
www.brainerdlab.org
www.xromm.org 

--
You received this message because you are subscribed to the Google Groups "XMALab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xmalab+un...@brown.edu.
<20180910_211919.jpg>

Benjamin Knorlein

unread,
Apr 24, 2019, 1:24:40 PM4/24/19
to Beth Brainerd, Clyde Webster, XMALab

Hi Clyde,

I discussed the Wand Calibration with Beth again and as she already mentioned we cannot add a wand calibration at the moment.

However, we opened an issue to allow using other tools for calibration: https://bitbucket.org/xromm/xmalab/issues/194/wand-calibration-data-entry

The basic idea is to let a user enter the calibrations values, instead of requiring a calibration. Internally XMALab uses the standard Computer Vision camera model, consisting of :

Internal parameters : Focal length and Principal point in x and y

External parameters: Rotation and position of the camera

(optional) Distortion parameters

Do you know if these parameters are available in Hedrick's Wand Calibration tool. I checked the code and the manual and it seems as they are, but i want to make sure that you can extract the parameters.

Best,

Ben

Hedrick, Tyson L

unread,
Apr 24, 2019, 1:36:48 PM4/24/19
to Benjamin Knorlein, xma...@brown.edu, elizabeth...@brown.edu, crweb...@gmail.com
Hi all,

The standard camera model information is available from both the MATLAB and Python versions of my wand calibration tools, with the following caveats:
1) The final orientation & position of all cameras is not included in the standard camera model coefficients; the origin and Z axis are determined from the base camera in the set
2) The rotations may require modification for use in XMAlab because (for historical reasons) the MATLAB and Python Hedrick lab code places the image coordinate origin in the lower left corner instead of upper left
3) The Python wand tool can use some mildly exotic distortion models that may not be present in XMALab; these are mostly for dealing with fisheye lenses - the standard radial+tangential distortion model is available for "normal" cameras

I'm quite tied up with end of semester tasks through May 9 but can put some time toward documenting all this myself after that time; in the interim I'd be happy to answer emails about where to find the necessary values in the MATLAB or Python outputs.

Cheers,
Ty Hedrick

--
Tyson Hedrick
  Professor
  Department of Biology
  University of North Carolina at Chapel Hill
  Chapel Hill, NC 27599-3280
  https://biomech.web.unc.edu/

Benjamin Knorlein

unread,
Apr 24, 2019, 2:27:06 PM4/24/19
to Hedrick, Tyson L, xma...@brown.edu, elizabeth...@brown.edu, crweb...@gmail.com

Hi Ty,

Thanks so much for the fast answer. And there is no rush. I am myself out next week so it will take a little bit until I finish the feature.  I will also run the tutorial of the wand calibration and  try to find the parameters. If you don't mind I might ask you some questions if i get stuck.

And regarding the mentioned caveats I think there should be no problem. But thanks for letting me know as I will have to take them into account.

1) If I understand correctly you mean that all cameras are expressed in relation to the first one. This is fine. I can simply place the first camera in the origin. The positions of the cameras in regard to world space do not matter for XMALab

2) I know. OpenCV and C++ see images different than matlab, but it is easy to convert. I will take this into account and will add a checkbox for matlab. I will also have to adjust the principal points as the indices in Matlab and c++ differ

3) XMALab supports the full 8 parameter distortion model from OpenCV. (CV_CALIB_RATIONAL_MODEL ). I think it was published here: Claus, D. and Fitzgibbon, A.W. A Rational Function Lens Distortion Model for General Cameras Computer Vision and Pattern Recognition (June 2005). I assume you are using the same model.

Best,

Ben

Reply all
Reply to author
Forward
0 new messages