module ParasitemiaCore.IO open System open System.Drawing open Emgu.CV open Emgu.CV.Structure let saveImg (img: Image<'TColor, 'TDepth>) (filepath: string) = img.Save(filepath) let saveMat (mat: Matrix<'TDepth>) (filepath: string) = use img = new Image(mat.Size) mat.CopyTo(img) saveImg img filepath