anchor.diff:          form.Controls.Add(pictureBox)
           System.Windows.Forms.Application.Run(form)
   
  -//FIXME lots of OpenCV types are IDisposable, possibly there are lots of memory leaks at the moment
  +//FIXME lots of OpenCV types are IDisposable, possibly eats memory at the moment
   module ImageProcessing =   
       open System.IO
       open Microsoft.FSharp.Reflection
  
positive.code:     plain colour of the background is likely mixed up with an object on top of it
      *)
      let getActivePolygons (screenshot:byte[]) (iframeRect:System.Drawing.Rectangle) =
          let webcamImage = cropWebcamImage screenshot iframeRect
          []
  
  module PianoLogic =
  
negative.code:         coordsTopAndBottom
          |> Seq.pairwise
          |> Seq.zip (FSharpType.GetUnionCases typeof<Note>)
          |> Seq.map (fun (label, ((topLeft, bottomLeft), (topRight, bottomRight))) ->
              { Label = FSharpValue.MakeUnion(label, [||]) :?> Note; Points = [| topLeft; topRight; bottomRight; bottomLeft |] })
          |> Array.ofSeq
        
      let cropWebcamImage (screenshotBytes:byte[]) (iframeRect:System.Drawing.Rectangle) =
          use uncropped = Mat.FromImageData(screenshotBytes, ImreadModes.GrayScale)
          uncropped.SubMat(Rect(iframeRect.Left, iframeRect.Top, iframeRect.Width, iframeRect.Height))
  
      let createMaskImage (contours:Point[]) (topRight:Point) (bottomLeft:Point) =        
          let mask =
              Mat.Zeros(
                  bottomLeft.Y - topRight.Y,
                  topRight.X - bottomLeft.X,
                  MatType.CV_8UC1).ToMat()
          mask.DrawContours(
                  [contours:> Collections.Generic.IEnumerable<Point>] :>
                  Collections.Generic.IEnumerable<Collections.Generic.IEnumerable<Point>>,
                  -1,
                  Scalar(255., 255., 255.),
                  -1)
          mask
  
      //assumes polygons slopes down from right to left
      let createMaskedPolygon (wholeImage:Mat) (contours:Point[]) =
          let topRight = contours.[1]
          let bottomLeft = contours.[3]
          let mask = createMaskImage contours topRight bottomLeft
          use regionOfInterest = wholeImage.SubMat(topRight.Y, bottomLeft.Y, bottomLeft.X, topRight.X)
          Cv2.BitwiseAnd(InputArray.Create(mask), InputArray.Create(regionOfInterest), OutputArray.Create(mask))
          mask
  
      let euclidianDistance () =
          ()
  