Help! - Cam Calibration - MATLab to .dat (standart DV Cam)

Hi! I need help!

I have Sony DVR-TRV33E Pal Dv-Cam. With Lens:
Carl Zeiss® Vario-Sonnar®
F 1.8-2.0
f (Focal Distance) (mm) 3.7-37
I completed MatLAB part of tutor (from ARTK+ page).

Got two types of files:

  1. Willson and Heikkila’s format
  2. Zhang’s format

Question: How to get .dat? (If anyone can,- compile it PLS)

*Hopefully will be an answer cause lens is like standard
Will save hours-and hours of time//…š

DCR-TRV-33E.zip (30.5 kB)

If nobody have time for that maybe a little explanation on how to workout that from Visual C+ Studio? I don’t have even a bit of programming knowledge but maybe anyone can point me to where i should load all the files:

There is some kind of calib_inp.cpp witch stores some values but how to import values in that from MatLab?
{CODE(ln=>1)}1>e:\vvvvorold_tracking\artoolkitplus_2.1.1\tools\cameracalib\src\calib_dist.cpp(234) : error C3861: ‘alloc’: identifier not found
1>e:\vvvvorold_tracking\artoolkitplus_2.1.1\tools\cameracalib\src\calib_dist.cpp(235) : error C2065: ‘evec’ : undeclared identifier
1>e:\vvvvorold_tracking\artoolkitplus_2.1.1\tools\cameracalib\src\calib_dist.cpp(235) : error C3083: ‘Matrix’: the symbol to the left of a ‘::’ must be a type
1>CameraCalib - 175 error(s), 4 warning(s)
1>e:\vvvvorold_tracking\artoolkitplus_2.1.1\tools\cameracalib\src\main.cpp(7) : fatal error C1083: Cannot open include file: ‘GL/glut.h’: No such file or directory
1>Generating Code…
****= Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ****=

The build log… What is ‘GL/glut.h’ what should i put in it?

I think guys if you don’t have a time for that might you can point me on some forum where i can search/ask for the answer? The problem is in that ARTK+ .dat camera is too-wide angled for my, can i resolve this with some modifier like FOV?

Matlab result:
{CODE(ln=>1)}ocal Length: fc = [ 968.72182 977.25738 ]( 968.72182 977.25738 ) ± [ 5.61941 5.33140 ]( 5.61941 5.33140 )
Principal point: cc = [ 351.63803 255.00235 ]( 351.63803 255.00235 ) ± [ 12.54781 9.20398 ]( 12.54781 9.20398 )
Skew: alpha_c = 0.00000 ± 0.00000 => angle of pixel axes = 90.00000 ± 0.00000 degrees
Distortion: kc = [ -0.20137 0.34432 0.00159 0.00542 0.00000 ]( -0.20137 0.34432 0.00159 0.00542 0.00000 ) ± [ 0.04859 0.56319 0.00201 0.00254 0.00000 ]( 0.04859 0.56319 0.00201 0.00254 0.00000 )
Pixel error: err = [ 0.24548 0.32068 ]( 0.24548 0.32068 )

All the calib results are in ZiP

helo antokhio,

not sure about the .dat files myself. but:

did you do the calibration with this tool: GML MatLab Camera Calibration Toolbox?

it is the one recommendet at the bottom of this page, where it also says that you’ll get a resulting ASCII file. did you get that? if not, you should be able to create it like specified from the “Matlab result” info you provided above.

then i know, the default LogitechPro4000.dat file is binary (not sure why) but you may as well just try naming your ascii file .dat or .cal and try to load that. does that work?

helo joreg,
Yep i used GML Matlab Camera Calibration Toolbox, it’s completely strange cause in some kind of Internet mailing list it was also about some kind of ASCII file generated in MatLab.
I may be bit unclear cause i’m not really educated in that matter. But who cares about that so i did following:
Opened MATLAB\TOOLBOX\Calib_Results.m found in there:
{CODE(ln=>1)}
%-- Focal length:
fc = [ 900.940659622523870 ; 983.306088379418720 ]( 900.940659622523870 ; 983.306088379418720 );

%-- Principal point:
cc = [ 383.489340230308020 ; 267.605870449966740 ]( 383.489340230308020 ; 267.605870449966740 );

%-- Skew coefficient:
alpha_c = 0.000000000000000;

%-- Distortion coefficients:
kc = [ -0.194433920501837 ; 0.377263215996281 ; -0.000950572197367 ;
-0.001328216797006 ; 0.000000000000000 ];

%-- Focal length uncertainty:
fc_error = [ 10.430957289288527 ; 14.269937985482994 ]( 10.430957289288527 ; 14.269937985482994 );

%-- Principal point uncertainty:
cc_error = [ 28.113662523655293 ; 19.119543705188224 ]( 28.113662523655293 ; 19.119543705188224 );

%-- Skew coefficient uncertainty:
alpha_c_error = 0.000000000000000;

%-- Distortion coefficients uncertainty:
kc_error = [ 0.048898132341148 ; 0.303991013717686 ; 0.004210683669601 ; 0.006197581716276 ; 0.000000000000000 ]( 0.048898132341148 ; 0.303991013717686 ; 0.004210683669601 ; 0.006197581716276 ; 0.000000000000000 );

%-- Image size:
nx = 720;
ny = 576;

THEN According to this:
{CODE(ln=>1)}The ASCII-file containing the camera calibration parameters should look as follows:
line1: ARToolKitPlus_CamCal_Rev02
line2: xsize ysize cc_x cc_y fc_x fc_y kc1 kc2 kc3 kc3 kc5 kc6 iter

Made new notepad file looking like this:
{CODE(ln=>1)}ARToolKitPlus_CamCal_Rev02
720 576 383.489340230308020 267.605870449966740 900.940659622523870 983.306088379418720 -0.194433920501837 0.377263215996281 -0.000950572197367 -0.001328216797006 0.000000000000000 0.000000000000000 0.000000000000000^

And it’s OPENED!
But i can’t figure out where to get the ‘iter’ and the kc1,kc2,kc3,kc3,kc5,kc6 i don’t have kc6 anywhere!
So i replaced it with zeros…

I’m not sure i did all right…
But it’s works ;)

great to hear it works.

never mind the kc6, the site mentioned above notes:
kc6 currently not in use
and concerning the iter
iter: number of iterations for distortion compensation
so this kinda sounds like a value to play around with…

Forgot to attach file :]]
Can report marker recognition is improved.

SONY-DCR-TRV-33E.DAT (244 Bytes)