Hello,
the following post is dedicated to calculation of 3D coordinates using the stereo concept for a scene point that is seen by both cameras. The Labview stereo vision library basically lacks the capability (or maybe I should say a function) to extract the 3D information from an arbitrary point. Instead it uses the block matching algorithms to obtain the disparity over the entire measuring range. This significantly slows down the 3D reconstruction process even though sometimes only a few points are relevant for the mesurements.
I am attaching a program that briefly explains the method behind stereo calculation for a single point. Two different calculations are shown: 1. using the Q matrix (perspective transformation matrix) to obtain the 3D coordinates and 2. using step-by-step calculation. In both cases, the results are the same.
Prior to any measurements system calibration needs to be performed, which is not covered by this post (see: https://decibel.ni.com/content/blogs/kl3m3n/2013/07/26/stereo-setup-parameters-calculation-and-labvi... and the stereo calibration in the NI Vision example folder). For the actual measurements after the calibration, I've used the same calibration board (see Figure 1 below) to extract all dots and calculated their 3D position.
Figure 1. Calibration board from the left and the right camera.
The 3D position of the dots is shown in Figure 2, along with the coordinates of the four points I've selected (the units are in mm).
Figure 2. 3D reconstruction of grid pattern dots.
I've also calculated the Euclidean distance between the measured points and compared them with the actual distance on the calibration board. The distances between points Pt1, Pt2 and Pt3 differ for less than 1mm, while the difference between Pt1 and Pt4 is approximately 5mm. Mind that this is not the proper way to evaluate the measuring accuracy (for one thing, the board is flat), but gives some basic idea about the results (they are not way off, for example ).
The program attached is saved for Labview 2012. The code is messy, but I have no time to optimize it. If somebody finds it useful, I am certain that he/she will need to perform some modifications (for example, the method for the object detection on images from both cameras).
Best regards,
K
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.