Dear DAVID Community,

As you are probably aware, the entire DAVID company, team and product range has been integrated into HP Inc.
This forum is now read-only. Relevant content has been migrated to HP and merged into HP's Support Forums on November 1, 2016.

To start new discussions for 3D Scanning, please register and post your new topic at the HP Support Forums

Calibration Calculator "Calibcalc"

The place for questions, problems, comments and tips regarding the camera calibration.

Calibration Calculator "Calibcalc"

Postby MagWeb » Tue Jan 15, 2008 11:23 pm

Hello Davidians,

I created a little tool to modify the calibpoints.dat file to use DAVID to scan with a windowsetup. It's nothing more than a crutch...
Note: If you use to scan with the normal setup (closed corner), as described in the official manual, you do not need this tool!
(decent note: For I am no developer: There may be more elegant, slighter solutions....but it does its job)

The EXE alters the values of the calibpoints according to:
Square root ((C*60/S)*(C*60/S)/2)+normal values

So its basic assumptions are:


2. Possibilities :
-Copy the two files (*.exe and*.rtf) in your DAVID folder: The calibpoints.dat DAVID refers to will be altered automatic if you click “save calibpoints”;
-Copy the two files to another folder. The *.exe will create a calibpoints.dat in this folder. You may replace the one in DAVID with it by hand.


-Run calibcalc.exe before starting DAVID
-The tool starts with the normal values of windowwidth C (zero), scale S (60) and patternboard P (zero)... (So if you click now: 1.“update preview” AND then 2.“save Calibpoints” : You create a calibpoints.dat with DAVID's standard values)
-Put in the measures of your windowsetup C (windowwidth) and S (scale)
-The value P (patternboard) discribes the thickness of separate boards, you´ve might have fixed the patterns on to remove them while scanning (if your patterns are fixed directly on the detection planes as usual, this value has to stay zero).
Click LMB “Update preview”: The resulting value are shown in the preview on the right.
Click LMB “Save Calibpoints”: The values of the PREVIEW are put in the calibpoints.dat in the current directory of the Calibcalc.exe. ( if it´s the folder of DAVID, DAVID will refer to the altered file. If not and there is not such a file yet, the calibcalc.exe will create one)

Ok-that´s it ...close Calibcalc. Open DAVID and :
KEEP ON SCANNING – wise those looking out of their window!

-For the demo version of the exe-file-generator prohibits commercial usage – commercial use is prohibited for this *.exe file too.
-Ignore the demo-warning, appearing when you close the prog. This is refering to the project file. The Calibcalc.exe will keep on running...
-If you find bugs on this tool - be quick for the evaluation period of the project file ends in 6 days (see date of post)
-Usually I´m working on Mac. There´s a updated virus scanner on the WinXP partion... but Win stays to be please scan the files.

hope to have paid some tribute to DAVID for now....

... but think something similar could be implemented into DAVID...


Edit 30.06.08: There is a mistake in calculating the used patternboards (P). See my post in this topic 30.06.08

Edit 10.10.08 with DAVID version 2.1 that problem doesn´t exist any longer :lol:
Last edited by MagWeb on Fri Oct 10, 2008 4:21 pm, edited 3 times in total.
Posts: 2499
Joined: Wed Jul 18, 2007 8:48 pm

Postby Tobias » Thu Jan 24, 2008 10:00 am

Nice Tool MagWeb :)

can u tell me how u calculate the calib - values, if i only use a patternboard (with p > 0)?

nice day @ all

User avatar
Posts: 37
Joined: Mon Mar 19, 2007 2:04 pm

Postby MagWeb » Thu Jan 24, 2008 10:51 am

Hello Tobias,

You may leave C=0 and put in your scale value S and P
But your patternboards intersect at the origin. So cut of P off one of the boards inner sides.

P has to be smaller than ((40/(60/S))-minimal distance) otherwise the inner points would intersect.

Or did you ask for the rule?
Calibcalc simply adds the value of P*(60/S) to X or Z where they are equal zero ( C doesn´t matter for this calculation)

Patternboards zero.jpg
Posts: 2499
Joined: Wed Jul 18, 2007 8:48 pm

sometimes returns...

Postby hal » Thu Jan 24, 2008 1:20 pm

Salve a tutti,
hello MagWeb :D . I'm here, again :wink: , after long period of silence :oops: .
I see that you are the most productive user of David. Compliments :!: .
And compliments for this tools. Good work :shock: .
I hope to be able to show something: I am doing various scans. I hope I will be fine as yours :oops: .
And I hope to be able to put online an abstract of my school thesis, with the 3D model of my statue. But I have to wait for permission from the museum: is copyrighted, unfortunately :cry: .

Now I'm at work: I want to build an calib-angle precise as your and as WalterMo. bye

- I am glad to still here and write to davidians! :D -
PC: DELL Alienware 17, Intel I7-4710MQ, 32 Gb Ram, AMD Radeon R9 M290X 4GB.
SO: Win 8.1 64Bit.
CAMs: USB 3.0 CMOS B/N (1280x960, 60 fps).
LENS: 12 mm.
User avatar
Posts: 1527
Joined: Thu Mar 01, 2007 4:08 pm
Location: Cavaria con Premezzo (VA), Italy.

Postby Tobias » Thu Jan 24, 2008 2:53 pm

Hello MagWeb,

thank you for reply!

I think u do a mistake with the caculation for a patternboard, or maybe i do.

its not usefull only change the x and z values, which are equal zero.

you have to cchange all values also the y. this u have to do with a factor not with a summand, u can adjust the scale factor !

example: if your patternboard has a thickness of 2mm and u use a calibfield with real scalefactor of 9mm for calibration. you have to use a scalefactor of 9.24. then scan has right values in all space diractions.

to find out the right factor, do a "normal" scan without removing patternboard and measure a distance on your scan, after that, remove the patternboard and scan, know u measure the same distance on your scan, divide the values and you get your corrected scalefactor.

i do some scans with a planar pattern and two markers (real distance bettwen markes ca. 40,2 mm)

the first result (picture two) with your method and a corrected calibpoints.dat ( look picture one), the second is with a corrected scalefactor and a normal calibpoints.dat

otherwise it’s the same setup…

does anybody measure similar things to me or do I something wron?

I hope u understand my english :oops:

Nice day@all
change calibpoints only use 9mm scale and 2 for p
result with Magwebs calculator, dont know why there is such bad bend
result only with corrected scalefactor
User avatar
Posts: 37
Joined: Mon Mar 19, 2007 2:04 pm

Postby MagWeb » Thu Jan 24, 2008 3:50 pm

Hi Tobias,

maybe I'm wrong, but I cann´t find a mistake:

DAVID's basic assumption is that the points are 60mm apart. With the scale value you simply set a new relation: So if you tell DAVID that the points are only 9mm from each other, David devides ALL (also the Y-values) by 60/9=6.666.... So if you use a patternboard of 2mm you have use this factor. Means 2*6.666.. =13.333...DAVID devides 13.333/6.666 and finally gets 2.

I think the either problem is the small scale of your setup. A slightly inaccurate fixing of the pattern or some air between patternboard and detectionplanes ... result: great effects

So in this case your solution, of measuring real resulting values and comparing them might be the better way to do.

@ Hal

nice, that you're back and I´m sure your results have the same quality-you proved it with your Waxhead.


Edit: @ Simon and Sven:
Perhaps the lens distortion values cann´t be set right using a patternboard?
Posts: 2499
Joined: Wed Jul 18, 2007 8:48 pm

Postby Tobias » Thu Jan 24, 2008 5:58 pm

Hello MagWeb,

Let me explain it more precise with a though experiment:

First you use two patternboards (thickness 5mm for example) and a calibrationfield with a scalefactor of 20mm,. Then you put one calibrationfield on the first board (board A) and one on the second board (board B) patternboard. Both boards are equal and the calibrationfield is at the same position on both boards.
After next you put board B on board A and do calibration.
Now you compare the size of the calibrationfield, in camera image, with B on A and B not on A. You will see that Calibrationfield A is lager then Calibrationfield B and sure it is larger in all space directions, because the camera is more far away from board A then to board B
Well if you use patternboard B for calibration and Patternboard A for scanning, you must say DAVID that the calibrationfield is rather larger as in calibration progress.

So if you want to fit the values you had to do this in all space directions, this means you had to change the x- y- and z- values. Your calculator only changes the x – z- values, never the y values. You only have to fit the Scalefactor, because he considers all space directions. How to get the right Scalefactor u can use the procedure I write before. You can also calculate it, but then you must know the distance h between camera - center and board b, look at picture.

factor = 1 + d/h

i hope there is no mistake, but this problem i tried out in some scans with planar - reference - objects and the distance measurements were ok.

maybe anybody can also try it out and give a feedback

nice day

x = distance on board A
x' = distance on board B
User avatar
Posts: 37
Joined: Mon Mar 19, 2007 2:04 pm

Postby MagWeb » Fri Jan 25, 2008 1:28 am

Hi Tobias,

perspective might be a confusing thing.... for things with same (in at least one plane) values might appear in diffrent sizes. So have a look at my drawing.

All green lines have the same value in Z ; all blue lines have te same value in X;
the Y value stays the same for the group of all upper lines as well as for the group of all lower lines.

the vertical darker (green or blue) lines are appearing longer than the vertical brighter (green or blue) ones. Nevertheless they have the same dimensions in y.
the orange circle owns: Let's say zero in Y, zero in X and 4 in Z. The pink circle owns zero in Y, 4 in Z, and let's say 1 in X;
Note: the Y value stays the same. But the pink point APPEARES to be lower.

Again: Your comparison seems to be the preciser methode for smaller scales.

it's late at night...
Posts: 2499
Joined: Wed Jul 18, 2007 8:48 pm

Postby Tobias » Fri Jan 25, 2008 11:30 am

Hello MagWeb,

Me again :) your are right with your picture, but maybe it’s a nother problem!

Sorry I do some mistakes in last post! but the meaning is still the same…

I try it again, first i was on wrong way:

Look at Picture one, there you can see two calibrationfields the green field is recordet from a far distance (paatern A), the blue (pattern B) from a near distance (ca. 15 mm nearer) ! The nearer field is bigger in x, y, and z direction!

If you calibrate DAVID with the nearer field and the scalefactor in real and scan at pattern from the far field and you don’t correct anything however, you make a mistake, there we are agreed. J

But I think it is a 2D Problem, the camera first don’t know the distance to the calibration corner! If you use a calibrationfield and say DAVID (with scalfactor) the distance between two Points, it can calculate the real camera distance to the calibration corner. If you calibrate the camera for nearer distance and scan on farer distance the object in scan get smaller in all space directions. Because the distance a and b are 9mm on pattern B, but on pattern A the distance a’ and b’ are 9mm, too. If u scan on A, but calibrate on B, DAVID use the reference distances a and b. But correctly it must use a’ and b’. The means an Object that is 9mm large would wrongly “compered” with a and b, but in cameraimage it is only long as a’ and b’, that’s why the scanresult is smaller than is has to be. So you must DAVID say, that a and b are bigger then thay are in real. That you can do with a factor for all space directions, The factor must be f = a / a’. That means the newscalefactor is newscal= realscale * f .

That’s why im think: only too add values on x and z coordinates (where they are euqal zero) is not the correct way. Maybe u have time for some testscans, and measure them out, if you use a big setup (scale 60mm) try to increase the distance between board a and b, maybe 60 or 100mm and compare with “normal” setup. Try to correct with you calculator and maybe with my way and without correction and see what happens.

Maybe im on wrong way, but I hope to find the right way

Nice day @ all
User avatar
Posts: 37
Joined: Mon Mar 19, 2007 2:04 pm

Postby MagWeb » Fri Jan 25, 2008 9:55 pm

Hi Tobias,

sure, I'm going to test your methode. (But it's not possible to use such thick patternboards doing it my way , for the inner markers would be invisible, think about 30mm is the max for the points are only 40mm from the origin in scale 60mm). But be patient. I´m working on a new motorized setup and not able to scan at the moment.

I never noticed wrong data doing it my way (as the calculator does): All my scans added to the Wiki were done using a patternboard 16mm( in scale30).
So I added 32.....

nice evening
Posts: 2499
Joined: Wed Jul 18, 2007 8:48 pm

Postby MagWeb » Mon Jun 30, 2008 10:25 am


it lasted very long, but now I have to admit, that the patternboard-calculation is wrong, for it is based on a wrong assumption:

I was assuming, that DAVID expects the lines left and right coming from the zero-planes (were either X or Z are equal zero). That´s wrong. So also the strategie to define the detectionplanes as zero planes is wrong.

DAVID expects the lines coming from the planes defined by the calibration patterns!

So if you use patternboards, you move the patterns from the zero planes to a parallel plane, nearer to the cam and after calibration DAVID expects the laserlines coming from that parallel plane. But if you remove them the laserlines are reflected by the zeroplanes! This will have little effect if you are calibrating with thin boards and use a big scale, for the planes are parallel. The object is only a little smaler. Also wide cam angles might cause errors....

So Tobias is absolutly right: The only way to compensate this size difference is to rise the scale value!

Sorry for causing trouble,

Posts: 2499
Joined: Wed Jul 18, 2007 8:48 pm


Postby humanticnc » Mon Jun 30, 2008 10:45 am

Hi MagWeb
What is it necessary to correct punctually?
Pc Hardware : AMD Sepron 2800 2.1 GHz 1 GB RAM
Cam : Microszoft LifeCam VX- 6000
Laser : 5 Mw Red pointer glass pole you are green laser Mattia timer clock
User avatar
Posts: 444
Joined: Sun Sep 30, 2007 7:42 pm
Location: Hungary Szentmártonkáta

Postby MagWeb » Mon Jun 30, 2008 12:19 pm

Hi Tibor,

I came across this problem today.

I´m not quite shure, but one cann´t solve it simply modifying the calibpoints.dat. Once the calibration result is saved in the config.xml one should be able to correct these values.....

For now use the way Tobias described above: Compare the sizes and increase your scalevalue in the same relation.

Posts: 2499
Joined: Wed Jul 18, 2007 8:48 pm

Postby MagWeb » Fri Oct 10, 2008 4:08 pm


version 2.1 corrected the problem described above. As long as you use a rightangled corner the Calibcalc works right now.

There ´s a Calibcalc2 comming that handles different cornerangles and distorted patterns. Now with the completed command file interpreter it should also be possible to set the normal-vectors needed to define the detection and mirrorplanes in the advanced settings.xml....

So long
Posts: 2499
Joined: Wed Jul 18, 2007 8:48 pm

Return to Camera Calibration

Who is online

Users browsing this forum: No registered users and 1 guest