Created
April 13, 2017 13:43
-
-
Save sminogue/e5e43d2d13a2f8ab312adbf9fbf3f797 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Load test image from disk | |
BufferedImage image = UtilImageIO.loadImage("test.jpg"); | |
//Convert to gray scale image | |
GrayU8 gray = ConvertBufferedImage.convertFromSingle(image, null, GrayU8.class); | |
//Brighten the image to wash out light colors in the background | |
GrayU8 brighter = GrayImageOps.brighten(gray, 100, 255, null); | |
//Reverse the black and white to make the paper page solid black for detection | |
GrayU8 invert = GrayImageOps.invert(brighter, 0, null); | |
panel.addImage(VisualizeBinaryData.renderBinary(invert, false, null), "Enhanced"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment