Skip to content

Instantly share code, notes, and snippets.

@sudipto80
Created January 22, 2016 08:21
Show Gist options
  • Save sudipto80/5babd395b84c9fd00f71 to your computer and use it in GitHub Desktop.
Save sudipto80/5babd395b84c9fd00f71 to your computer and use it in GitHub Desktop.
Rose And Potato
open System.IO
let image = System.Drawing.Image.FromFile(@"C:\personal\rose.jpg")
let image2 = System.Drawing.Image.FromFile(@"C:\personal\potato.jpg")
let ms = new MemoryStream()
image.Save(ms,System.Drawing.Imaging.ImageFormat.Jpeg)
let bytes = ms.ToArray() |> Array.map int |> List.ofArray
let ms2 = new MemoryStream()
image2.Save(ms2,System.Drawing.Imaging.ImageFormat.Jpeg)
let bytes2 = ms2.ToArray() |> Array.map int |> List.ofArray
let bytesPDF = listToHist bytes |> List.map snd
let bytesPDF2 = listToHist bytes2 |> List.map snd
let simCanberra = canberra bytesPDF bytesPDF2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment