public static void sharpen ( ) { BufferedImage buffered = UtilImageIO . loadImage ( UtilIO . pathExample ( imagePath ) ) ; GrayU8 gray = ConvertBufferedImage . convertFrom ( buffered , ( GrayU8 ) null ) ; GrayU8 adjusted = gray . createSameShape ( ) ; ListDisplayPanel panel = new ListDisplayPanel ( ) ; EnhanceImageOps . sharpen4 ( gray , adjusted ) ; panel . addImage ( ConvertBufferedImage . convertTo ( adjusted , null ) , "Sharpen-4" ) ; EnhanceImageOps . sharpen8 ( gray , adjusted ) ; panel . addImage ( ConvertBufferedImage . convertTo ( adjusted , null ) , "Sharpen-8" ) ; panel . addImage ( ConvertBufferedImage . convertTo ( gray , null ) , "Original" ) ; panel . setPreferredSize ( new Dimension ( gray . width , gray . height ) ) ; mainPanel . addItem ( panel , "Sharpen" ) ; }
When an image is sharpened the intensity of edges are made more extreme while flat regions remain unchanged .