private void processImage ( CameraPinholeBrown intrinsic , BufferedImage buffered , ImagePanel gui ) { Font font = new Font ( "Serif" , Font . BOLD , 24 ) ; GrayU8 gray = new GrayU8 ( buffered . getWidth ( ) , buffered . getHeight ( ) ) ; ConvertBufferedImage . convertFrom ( buffered , gray ) ; Se3_F64 fiducialToCamera = new Se3_F64 ( ) ; try { detector . detect ( gray ) ; } catch ( RuntimeException e ) { System . err . println ( "BUG!!! saving image to crash_image.png" ) ; UtilImageIO . saveImage ( buffered , "crash_image.png" ) ; throw e ; } Graphics2D g2 = buffered . createGraphics ( ) ; for ( int i = 0 ; i < detector . totalFound ( ) ; i ++ ) { detector . getFiducialToCamera ( i , fiducialToCamera ) ; long id = detector . getId ( i ) ; double width = detector . getWidth ( i ) ; VisualizeFiducial . drawCube ( fiducialToCamera , intrinsic , width , 3 , g2 ) ; VisualizeFiducial . drawLabelCenter ( fiducialToCamera , intrinsic , "" + id , g2 ) ; } saveResults ( 0 ) ; if ( intrinsicPath == null ) { g2 . setColor ( Color . RED ) ; g2 . setFont ( font ) ; g2 . drawString ( "Uncalibrated" , 10 , 20 ) ; } gui . setImage ( buffered ) ; }
Displays a simple image