Created
October 24, 2013 23:44
-
-
Save jcollard/7147088 to your computer and use it in GitHub Desktop.
Example usage of outline' on a ColorImage
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
import Data.Image | |
import Data.Image.Interactive | |
import System.IO.Unsafe | |
stopImage = unsafePerformIO $ do | |
stop <- readColorImage "images/stop.ppm" | |
return stop | |
binaryStop = (r + g + b) .> 196 where | |
(r, g, b) = colorImageToRGB stopImage | |
grayToColor img = makeImage (rows img) (cols img) toColor where | |
toColor r c = RGB (g, g, g) where | |
g = ref img r c | |
outlineBlue :: ColorImage | |
outlineBlue = outline' white blue (grayToColor binaryStop) where | |
white = RGB (1,1,1) | |
blue = RGB (0,0,1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment