Dear DAVID Community,

In 2016, DAVID and this forum have been integrated into HP Inc.
This forum has been read-only since then, and will be switched off by then end of 2019.

To everyone who has contributed here, we thank you for all your work and for the constructive, helpful and friendly atmosphere you have created!
Please continue to discuss on the HP Support Forums.

newbie needs some help

newbie needs some help

Postby Nuno Fernandes » Fri Mar 11, 2011 2:05 pm


I'm currently building a structured light scanner based on Douglas Lanman approach. I am using the c++ code (with some changes I made) using opencv libraries. My scanning object is placed on a rotating table. The light emitter(video projector) and the detector (logitech 9000 camera) have a fixed position outside the rotating table. The rotation step corresponds to 6.25 degrees between consecutive scans. The distance separating the camera from the center of the rotating table is 875 mm.
I had successfully calibrated both camera and projector, but I have some doubts interpreting the extrinsic and intrinsic parameters files I get. I know that the intrinsic parameters correspond to focal length, principal point and scale factors, while the extrinsic parameters correspond to the rotation matrix and the translation vector.
When finishing the calibration, I get the following files: cam_distortion.xml ; cam_extrinsic.xml; cam_intrinsic.xml; cam_rotation_vectors.xml; cam_translation_vectors.xml; config.xml; proj_distortion.xml; proj_extrinsic.xml; proj_intrinsic.xml; proj_rotation_vectors.xml; proj_translation_vectors.xml.

Now, I have the following questions:
1) If the camera's rotation and translation belong to the extrinsic parameters, why do I have three different files, instead of only having the cam_extrinsic.xml ?
2) In the config.xml we have the following:

<minimum_distance_mm>750.</minimum_distance_mm> --->2.1) Is this the minimum distance between the camera and the area determined for the object to be positioned?
<maximum_distance_mm>1000.</maximum_distance_mm> --->2.2) Is this the maximum distance between the camera and the area determined for the object to be positioned?
<maximum_distance_variation_mm>100.</maximum_distance_variation_mm> --->2.3)What is this for? The program can make max. distance - min. distance.
<minimum_background_distance_mm>20.</minimum_background_distance_mm> ---> 2.4)This distance is related to my camera?

3) In the cam_extrinsic.xml I have the following:

<?xml version="1.0"?>
<cam_extrinsic type_id="opencv-matrix">
-2.00187469e+000 -2.08160806e+000 -5.57140887e-001 -1.59499664e+002
-8.67975845e+001 8.86059509e+002</data></cam_extrinsic>

What do this numbers mean? They should be related to the rotation and translation between my camera and the scanning object. Right? Can I get the distance from my camera and the scanning object from this file?

I am asking all of this because after had setting up my scanner, I started to developing the algorithm for the alignment of the point clouds I got, using VTK. I have 1 first point cloud; and then I read a second point cloud. I apply the transformation to the second point cloud:

vtkTransformPolyDataFilter *TF = vtkTransformPolyDataFilter::New();
vtkTransform *ActualPosition = vtkTransform::New();

ActualPosition -> Identity();
ActualPosition -> PostMultiply();
ActualPosition -> Translate( 0, 0, -875); // bings the 2º point cloud to
the origin
ActualPosition -> RotateY( 6.25 ); // rotates the 2º point cloud
ActualPosition -> Translate( 0, 0, 875); // places the 2º point cloud back
to where it was

TF -> SetInput( polyData2 );
TF -> SetTransform( ActualPosition );
TF -> Update();

After doing this, I apply ICP.
The problem is that the images are not correctly aligned because the transformation is not done properly. So, if I could get the correct distance between the camera and the object, from the cam_extrinsic.xml or any other file, may I could apply that to vtkTransformPolyDataFilter and make the correct transformation.

Any help is greatly appreciated!
Best regards,
Nuno Fernandes
Posts: 3
Joined: Fri Mar 11, 2011 11:13 am

Re: newbie needs some help

Postby MagWeb » Fri Mar 11, 2011 3:18 pm

Hi Nuno,

for this is a non-DAVID thread. So I moved it to the third party section to avoid confusion.

I´m sure you´ll get help here too - if anybody knows something about.

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

Return to Software

Who is online

Users browsing this forum: No registered users and 2 guests