kl3m3n's blog

Community Browser
cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Stereo vision (OpenCV and Labview comparison)

Klemen
Active Participant

Hello,

the purpose of this post is to evaluate and compare (only visually) the performance of the stereo vision libraries from OpenCV and Labview. I have used a pair of horizontally positioned webcameras (Logitech c210) mounted on a stand with a baseline distance of approximately 100 mm. The OpenCV stereo functions were built as a .dll and called in Labview (FULL CALIBRATION AND MEASUREMENT EXAMPLE IS A PART OF Labview PCLOpenCV Toolkit THAT CAN BE DOWNLOADED FROM ONE OF MY PREVIOUS POSTS). One of the advantages of the OpenCV calibration procedure is that the rectification transformation for both cameras can be accessed, while this is (to my knowledge) impossible in Labview. All parameters regarding the calibration are saved in a user-specified file and are read during the measurement procedure.

The calibration based on Labview's stereo library can be found here:

https://decibel.ni.com/content/blogs/kl3m3n/2013/07/26/stereo-setup-parameters-calculation-and-labvi...

For the purpose of testing the matching algorithms (to obtain the disparity image), I have also used a DLP projector to project a random pattern on the measured scene. This helps to make the correspondence problem a little easier for the regions with less texture. The results are shown in Figures 1-4 below. The rectified images from both cameras, the disparity map (semi global block matching) and the reconstructed 3D surface are shown for OpenCV and Labview, where the measured scene was not illuminated in one case and illuminated with the projector in the other case.

without_projection.png

Figure 1. OpenCV without projection pattern


without_projectionLV.png

Figure 2. Labview without projection pattern


with_projection.png

Figure 3. OpenCV with projection pattern


with_projectionLV.png

Figure 4. Labview with projection pattern


Also, I have achieved 5-10 frames per second performance with OpenCV. I have not yet tested the speed performance of the Labview stereo library. I have also noted some discrepancies in the calibration parameters between both calibration procedures.

I am wondering for some time now if the Labview stereo library is partially (fully?) based on the one form OpenCV? There is definitely a lack in documentation in Labview regarding this, and to my experience the NI support could also be a bit better.

Any comments and experiences regarding this are appreciated.

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."
Comments
lizhuo_lin
Member

Hi, Klemem

I test your calibration stereo example, which type of file does the program save?

I try.txt .calib and folder,but none file is saved.

CLD
CAU
Klemen
Active Participant

Hello,

are you talking about the OpenCV implementation?

specify the full path e.g.,

C:\Program Files (x86)\stereocalibrationFile.yml

It will create a new file in the destination folder. You could use any other extension also.

Tell me how it goes.

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."
lizhuo_lin
Member

Hello!

Yes, I am talking about calibrationStereo_example based on opencv, it doesn`t work, no *.yml is created. .xml file also doesn`t work.

Is it a bug?

CLD
CAU
Klemen
Active Participant

Hello,

probably a silly question, but did you click on calibrate button at the bottom after you acquired the specified number of grids? Did you get the calibration error? Also, do the grid points get detected? You need to click on detection start to start acquiring images for calibration.

Strange, because I had no problems with this. Will definitely check this out, but I can do this on Monday, because I don't have the cameras with me right now. Thank you for the feedback.

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."
lizhuo_lin
Member

Hi

Find the problem, the program have no authority to create file in c:\ or C:\Program Files folder. I change the path to D:\ and it`s ok.

Thanks!

CLD
CAU