Automatic Image Calibration
Charlie Taylor from United States  [4 posts]
7 months
I am trying to run Roborealm on a Kangaroo for a project where I need to identify the specific location of a point in each frame after unwarping the image.  However, I am finding that the Automatic Image Calibration (AIC) module (with Intrinsic Transform Only selected) to be too resource intensive.  But since I only need to collect the XY from a single pixel in the calibrated image, I'm trying to transform only the single point.  However, I am not able to duplicate the calibrated values of selected points using the parameters given by the AIC module.  

Specifically, I used the AIC module in version 2.83.10 against a standard checkerboard pattern.  It gave me parameters of:
K0=-1019.89                   K1=0.0674738
K2=-0.0000591188          KS=998.23
U0=0                              V0=0.0732422.

If I let (x,y) represent a point on the raw image and XY represent the exact same point on the unwarped image, my understanding from the documentation for Radial Distortion module and the forum response http://www.roborealm.com/forum/index.php?thread_id=5843 is that I can use the following equations to get (XY) from (xy).
Let X*=x-U0 and Y*=y-V0 then
and finally X=s * X* and Y=s * Y*.

However, as you can see below this approach is not working.  I precisely identified 7 points on the same checkerboard that I used for calibration.   My observations  and calculated values were:
x    y    X    Y        X Calculated    Y Calculated
1180    811    1187    817        1128.536531    775.5597204
1140    248    1148    253        1114.654976    242.4147318
725    298    731    301        721.8199082    296.6199517
720    861    727    867        706.0713252    844.2718011
358    862    364    868        354.6309866    853.8154651
360    502    365    507        359.3362007    501.0012616
360    137    366    141        358.6539781    136.4147955

Clearly my XY observed and my XY calculated are not matching up.  I would very much appreciate it if you can help me understand what I am doing wrong here.

Thank you in advance,
Charlie Taylor
Steven Gentner from United States  [1370 posts] 7 months

Have you tried just unchecking the [x] Show Calibrated image in that module? That will still convert points that you transform using the variable list but not perform the image transform which makes it significantly faster!

The transform of the image is largely just to show you what things look like calibrated but need not be done to get calibrated points.

Charlie Taylor from United States  [1 posts] 7 months
Thank you for the quick response.  I think this approach would work if I could input points from the Point_Location module.  For instance, I would like to transform the NW point of a blob image.   Is that possible?  My "Available variables" window is completely blank.  
Thank you very much  for your guidance.

Steven Gentner from United States  [1370 posts] 7 months

Due to the way the interface is, it will only transform arrays that contain X, Y coordinates. Because with a single variable its unknown if its the X or Y coordinate it will only do arrays.

Add a SetVariable module and use

my_points = [NORTHWEST_X], [NORTHWEST_Y] [x] IsArray

that will create a 2 item array that will appear in the AIC module.

Note, this ability to create an array using expressions *JUST* added to the SetVariable module so you will need to download the latest version for this to work.

Options button->Download button.

Charlie Taylor from United States  [4 posts] 7 months
This solution worked very well-- Thank you very much!!

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index