private static void displayResults ( BufferedImage orig , Planar < GrayF32 > distortedImg , ImageDistort allInside , ImageDistort fullView ) { // render the results Planar < GrayF32 > undistortedImg = new Planar <> ( GrayF32 . class , distortedImg . getWidth ( ) , distortedImg . getHeight ( ) , distortedImg . getNumBands ( ) ) ; allInside . apply ( distortedImg , undistortedImg ) ; BufferedImage out1 = ConvertBufferedImage . convertTo ( undistortedImg , null , true ) ; fullView . apply ( distortedImg , undistortedImg ) ; BufferedImage out2 = ConvertBufferedImage . convertTo ( undistortedImg , null , true ) ; // display in a single window where the user can easily switch between images ListDisplayPanel panel = new ListDisplayPanel ( ) ; panel . addItem ( new ImagePanel ( orig ) , "Original" ) ; panel . addItem ( new ImagePanel ( out1 ) , "Undistorted All Inside" ) ; panel . addItem ( new ImagePanel ( out2 ) , "Undistorted Full View" ) ; ShowImages . showWindow ( panel , "Removing Lens Distortion" , true ) ; }
Displays results in a window for easy comparison ..