void computeProjectionTable ( int width , int height ) { output . reshape ( width , height ) ; depthMap . reshape ( width , height ) ; ImageMiscOps . fill ( depthMap , - 1 ) ; pointing = new float [ width * height * 3 ] ; for ( int y = 0 ; y < output . height ; y ++ ) { for ( int x = 0 ; x < output . width ; x ++ ) { // Should this add 0.5 so that the ray goes out of the pixel's center? Seems to increase reprojection // error in calibration tests if I do... pixelTo3 . compute ( x , y , p3 ) ; if ( UtilEjml . isUncountable ( p3 . x ) ) { depthMap . unsafe_set ( x , y , Float . NaN ) ; } else { pointing [ ( y * output . width + x ) * 3 ] = ( float ) p3 . x ; pointing [ ( y * output . width + x ) * 3 + 1 ] = ( float ) p3 . y ; pointing [ ( y * output . width + x ) * 3 + 2 ] = ( float ) p3 . z ; } } } }
Computes 3D pointing vector for every pixel in the simulated camera frame