public boolean process ( CameraPinholeBrown intrinsic , Se3_F64 planeToCamera ) { proj . setPlaneToCamera ( planeToCamera , true ) ; proj . setIntrinsic ( intrinsic ) ; // find a bounding rectangle on the ground which is visible to the camera and at a high enough resolution double x0 = Double . MAX_VALUE ; double y0 = Double . MAX_VALUE ; double x1 = - Double . MAX_VALUE ; double y1 = - Double . MAX_VALUE ; for ( int y = 0 ; y < intrinsic . height ; y ++ ) { for ( int x = 0 ; x < intrinsic . width ; x ++ ) { if ( ! checkValidPixel ( x , y ) ) continue ; if ( plane0 . x < x0 ) x0 = plane0 . x ; if ( plane0 . x > x1 ) x1 = plane0 . x ; if ( plane0 . y < y0 ) y0 = plane0 . y ; if ( plane0 . y > y1 ) y1 = plane0 . y ; } } if ( x0 == Double . MAX_VALUE ) return false ; // compute parameters with the intent of maximizing viewing area double mapWidth = x1 - x0 ; double mapHeight = y1 - y0 ; overheadWidth = ( int ) Math . floor ( mapWidth / cellSize ) ; overheadHeight = ( int ) Math . floor ( mapHeight * viewHeightFraction / cellSize ) ; centerX = - x0 ; centerY = - ( y0 + mapHeight * ( 1 - viewHeightFraction ) / 2.0 ) ; return true ; }
Computes the view s characteristics