Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Camera extrinsic parameters in stereo vision calibration and get rectified image

Hello! everyone

I would like to know if somene could help me understand a few things regarding the extrinsic parameters of camera in stereo calibration.

 

I already get my stereo vision system calibrated and get all parameters LabVIEW can output.

 

How to calculate single camera extrinsic parameter R and T? Because LabVIEW only give Projection Matrix, and it says "In NI Vision calibration software, homography (H) is a 3 × 3 matrix which is the product of two matrices: a camera matrix (M) and a homography matrix (W)." I can get [r1 r2 t], but I can`t get r3 In this post http://forums.ni.com/t5/Machine-Vision/Extrinsic-parameters-camera-calibration/m-p/2317838/highlight... invancea said r3 = r1 x r2 , but I use some example to verify it is wrong.

 

How to get the rotation matrix for applying left image to get the left rectified image? LabVIEW only can transform whole image, and it`s time-consuming. I read Ni Vision Concept Help http://zone.ni.com/reference/en-XX/help/372916T-01/nivisionconcepts/stereo_image_rectification_in-de... Is there the "translation matrix T " mean single camera extrinsic parameter or translation matrix between two cameras?

 

Zhuo Li

CLD
CAU
Message 1 of 8
(10,087 Views)

Hello,

 

I agree that the documentation and support regarding the stereo reconstruction in Labview is lacking to say the least. The good news is that better documentation regarding this can be found - check O'Reilly's Learning OpenCV for starters.

 

You can use fundamental matrix (F) to calculate the epipolar lines, for example:

 

test1png.png

 

Computing the rectification involves more work though. I found a good example code (Matlab) here:

 

http://vgl-ait.org/cvwiki/doku.php?id=matlab:tutorial:rectification

 

If you would like to just obtain the rectification transforms for both cameras, I suggest using this:

 

http://docs.opencv.org/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html#void%20ster...

 

or

 

the uncalibrated rectification.

 

I plan to create a .dll library in Labview based on OpenCV stereo methods to compare the results to Labview's stereo library. When I get the results, I will let you know.

 

Best regards,

K

 

 

 


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 2 of 8
(10,025 Views)

Hi Klemen

 

Thanks for your reply!

 

I test some stereo parameters like fundamental matrix (F) essential matrix (E), Those are tested to be right.

2015-08-21_153839.png2015-08-21_154119.png

But I think this equation is wrong.

2015-08-21_154156.png It is in Stereo Calibration In-Depth page of NI vision concept Help.

 

I do a lot test, find there is some strange definition in LabVIEW. In page of In-Depth Discussion for Spatial Calibration, 2015-08-21_155055.png

Normally fx fy cx cy are in pixels. Maybe there are something wrong.

 

Best regards,

Zhuo Li

CLD
CAU
0 Kudos
Message 3 of 8
(10,002 Views)

Hello,

 

regarding the first equation - the first T should be an uppercase, so i think it's a copy-paste typo. So:

 

eq.png

 

The second equation is wrong. Should be:

 

eq1.png

 

f in pixels, F in mm and s in pix/mm.

 

Regards,

K

 


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 4 of 8
(9,988 Views)

Hi 

 

Yes, you're absolutely right!  And  I think cx cy should in pixel unit。

 

But I still not understand how to calculate camera extrinsic parameters of stereo vision in LabVIEW. 

If r3= r1*r2 in camera extrinsic parameters R,

I test T=t1-Rt2 ,there are still mistake.

where R and T are rotation and translation matrices between two cameras, t1 and t2 equal the translation vector of left and right camera.

According to NI Vision Concepts Help,In-Depth Discussion

In NI Vision calibration software, homography (H) is a 3 × 3 matrix which is the product of two matrices: a camera matrix (M) and a homography matrix (W).

 H=MW

W=M^(-1)H=[r1 r2 t]

so I get t1 and t2 for two camera 

Here is my code. Default paremeters are extract from .calib file and .png file.

 

Could you help me? THANKS!

Best regards,

 

 

CLD
CAU
Download All
0 Kudos
Message 5 of 8
(9,971 Views)
forget a sub vi,please use this attachment http://pan.baidu.com/s/1gdB71on
CLD
CAU
0 Kudos
Message 6 of 8
(9,958 Views)
Hi I read the book learning opencv that you recommended . I use the method to calculate Camera extrinsic parameters R T, and test R=R1(R2)^-1, but there still wrong. Here are the program. http://pan.baidu.com/s/1kThDgcJ Could you help me with than? Best regards!
CLD
CAU
0 Kudos
Message 7 of 8
(9,930 Views)

Hello,

 

take a look at this post:

 

http://forums.ni.com/t5/Machine-Vision/Pixelwise-rectification-in-the-Stereo-library/m-p/3184043/hig...

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 8 of 8
(9,829 Views)