Created
January 2, 2020 21:39
-
-
Save duanebester/c09f4aa5e70f811c007bf467e09edb4d to your computer and use it in GitHub Desktop.
Image Sink
This file contains hidden or 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
def imageSink(path:String, format:String = "png") = Sink.foreach[BufferedImage](bi => { | |
ImageIO.write(bi, format, new File(path)) | |
}) | |
val imagePreProcessFlow = | |
imageToBinaryImage.alsoTo(imageSink("binary.png")) | |
.via(imageEnhance).alsoTo(imageSink("enhanced.png")) | |
.via(imageDeSkew()).alsoTo(imageSink("deskew.png")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment