
11. SUPPLIED SOFTWARE
// the f i r s t detected SceneScan
AsyncTransfer asyncTransfer ( d e v i c e s [ 0 ] ) ;
// Receive 100 images
f o r
(
i n t
i =0; i <100; i++) {
std : : cout <<
" Receiving image "
<< i << std : : endl ;
// Receive image
ImagePair imagePair ;
while
( ! asyncTransfer . co lle c t Re ce iv ed I m a g e Pa i r ( imagePair ,
0 . 1
/
∗
timeout
∗
/
) ) {
// Keep on t r y i n g u n t i l r e c e p t i o n i s s u c c e s s f u l
}
// Write both images one a f t e r another
f o r
(
i n t
imageNumber = 0 ; imageNumber <=1; imag+) {
// Create PGM f i l e
char
fileName [ 1 0 0 ] ;
s n p r i n t f ( fileName ,
s i z e o f
( fileName ) ,
"image%03d_%d . pgm"
, i ,
imageNumber ) ;
imagePair . writePgmFile ( imageNumber , fileName ) ;
}
}
}
catch
(
const
std : : exception& ex ) {
std : : c e r r <<
" Exception occurred : "
<< ex . what ( ) << std : : endl ;
}
return
0 ;
}
10.4 3D Reconstruction
As described in Section 8.2, the disparity map can be transformed into a
set of 3D points. This requires knowledge of the disparity-to-depth mapping
matrix
Q
(see Section 8.2), which is transmitted by SceneScan along with each
disparity map.
An optimized implementation of the required transformation, which uses
the SSE or AVX instruction sets, is provided by the API through the class
Reconstruct3D. This class converts a disparity map into a map of 3D point
coordinates. Please see the API documentation for further details.
11 Supplied Software
11.1 NVCom
The available source code or binary software release also includes the NVCom
client application, which is shown in Figure 28. When compiling this appli-
44