08-19-2015 04:48 AM - edited 08-19-2015 04:52 AM
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
08-20-2015 03:41 AM
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:
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:
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
08-21-2015 03:06 AM
Hi Klemen
Thanks for your reply!
I test some stereo parameters like fundamental matrix (F) essential matrix (E), Those are tested to be right.
But I think this equation is wrong.
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,
Normally fx fy cx cy are in pixels. Maybe there are something wrong.
Best regards,
Zhuo Li
08-21-2015 05:03 AM
Hello,
regarding the first equation - the first T should be an uppercase, so i think it's a copy-paste typo. So:
The second equation is wrong. Should be:
f in pixels, F in mm and s in pix/mm.
Regards,
K
08-21-2015 07:08 AM
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,
08-21-2015 07:51 AM - edited 08-21-2015 07:57 AM
08-21-2015 09:19 PM - edited 08-21-2015 09:21 PM
08-28-2015 02:54 AM
Hello,
take a look at this post:
Best regards,
K