Computer vision 3D Stereo camera Bumblebee 25 August 2014 Copyright 2001 2014 by NHL Hogeschool and Van de Loosdrecht Machine Vision BV All rights reserved Thomas Osinga j.van.de.loosdrecht@nhl.nl, jaap@vdlmv.nl 3D Stereo Camera Bumblebee Overview: Camera stereo parameters Accuracy with different baselengths Examples Advantages / Disadvantages 3D Stereo camera Bumblebee 2 Jaap van de Loosdrecht, NHL, vdlmv, j.van.de.loosdrecht@nhl.nl 1
3D Stereo camera Bumblebee 3 Stereo vision camera s are used to perform 3D measurements Stereo vision is based on the human eyes: The camera takes two snapshots from different positions. When a certain object can be identified as a pixel location in one image and in the other image, then the distance can be calculated based on the translation of the object pixel Some problems in stereo vision: Identifying of pixels in multiple images for matching the same world coordinates Correct calibration of both camera s, so the pixels can be correlated Less accuracy on larger distances 3D Stereo camera Bumblebee 4 Jaap van de Loosdrecht, NHL, vdlmv, j.van.de.loosdrecht@nhl.nl 2
Identifying of pixels in multiple images for matching the same world coordinates: This can be solved with stereo vision algorithms. There are many algorithms available. A stereo vision SDK is delivered with the BumbleBee camera s. 3D Stereo camera Bumblebee 5 Correct calibration of both camera s, so the pixels can be correlated A stereo rig is used to calibrate the camera s. The images have to be mapped to a pin-hole camera model. This image is called rectified. Raw image with lens distortion Rectified pin-hole image 3D Stereo camera Bumblebee 6 Jaap van de Loosdrecht, NHL, vdlmv, j.van.de.loosdrecht@nhl.nl 3
Less accuracy on larger distances The distance calculation is based on the following equation: Dist ( m) = f ( pix) base Disp ( pix) ( m) in this equation f is the focal length of the lens in pixels. The disparity is the difference in x-direction of the pixel coordinates in both images 3D Stereo camera Bumblebee 7 Less accuracy on larger distances When the distance according to each pixelvalue is plotted, the following graph will appear 16 Disparity y = 184,35x -1,0033 R 2 = 0,9972 Afstand(m) 14 12 10 8 6 4 2 0 0 20 40 60 80 Pixelwaarde Disparity Macht (Disparity) 3D Stereo camera Bumblebee 8 Jaap van de Loosdrecht, NHL, vdlmv, j.van.de.loosdrecht@nhl.nl 4
To get a correct depth image, a few steps need to be taken: 3D Stereo camera Bumblebee 9 Camera stereo parameters Mode The BumbleBee camera s have 7 different modes: 1: Raw Image 2: Rectified Color 3: Rectified 4: Disparity (this gives a depth image) 5: Disparity Color (this gives a depth image in false colors) 6: Disparity Validation (when certain area s are not volidated in the vision algorithm they get a certain color) 7: Absolute (in this mode the absolute world coordinates are given) Pan With this parameter the user can choose witch camera s are used to perform stereo vision algorithm s 3D Stereo camera Bumblebee 10 Jaap van de Loosdrecht, NHL, vdlmv, j.van.de.loosdrecht@nhl.nl 5
Camera stereo parameters Disparity The disparity range is the range of pixelvalues in wich the stereo algorithm searches for a best match. A disparity value of 0 means that an object is unlimited far away. A maximum disparity value means that this is the closest distance that an object can be measured Disparity Mapping With disparity mapping the user can define a pixel range in wich the result pixels will be shown. This is comparable with a contrast stretch. Stereo Mask The user can define the size of the mask that is used to correlate both images. Edge Mask The user can define the size of the edge mask that is used to correlate both images. 3D Stereo camera Bumblebee 11 Accuracy with different baselengths To achieve higher accuray a bigger baselength is needed. When measuring the same distance with the same stereo camera s on a bigger base. The accuracy will be like the following graph Nauwkeurigheid Nauwkeurigheid (m) 2,3 2,2 2,1 2 1,9 1,8 1,7 1,6 1,5 1,4 1,3 1,2 1,1 1 0,9 0,8 0,7 0,6 0,5 0,4 0,3 0,2 0,1 0 0 1 2 3 4 5 6 Basis (m) Nauwkeurigheid 3D Stereo camera Bumblebee 12 Jaap van de Loosdrecht, NHL, vdlmv, j.van.de.loosdrecht@nhl.nl 6
Examples Rectified Color Image 3D Stereo camera Bumblebee 13 Examples Disparity image (on 3m distance) 3D Stereo camera Bumblebee 14 Jaap van de Loosdrecht, NHL, vdlmv, j.van.de.loosdrecht@nhl.nl 7
Examples Disparity image (on 2m distance) 3D Stereo camera Bumblebee 15 Examples Disparity image (on 1m distance) 3D Stereo camera Bumblebee 16 Jaap van de Loosdrecht, NHL, vdlmv, j.van.de.loosdrecht@nhl.nl 8
Advantages / Disadvantages Advantages High accuracy can be achieved by using the correct base Accuracy on different distances can be calculated When focal length of the lens is known, the needed base can be calculated for good accuracy Disadvantages Not possible to calculate distance of every pixel in the image Accuracy is not linear 3D Stereo camera Bumblebee 17 Jaap van de Loosdrecht, NHL, vdlmv, j.van.de.loosdrecht@nhl.nl 9