- let mutable totalElement = 0
- let mutable fgElement = 0
- for y in (if minY < 0 then 0 else minY) .. (if maxY >= fg.Height then fg.Height - 1 else maxY) do
- for x in (if minX < 0 then 0 else minX) .. (if maxX >= fg.Width then fg.Width - 1 else maxX) do
- let yf, xf = float y, float x
- if e.Contains xf yf && neighbors |> List.forall (fun (otherE, _, _) -> otherE.Removed || not <| otherE.Contains xf yf)
+ let stdDiviation = MathNet.Numerics.Statistics.StreamingStatistics.StandardDeviation(seq {
+ for y in (if minY < 0 then 0 else minY) .. (if maxY >= h then h - 1 else maxY) do
+ for x in (if minX < 0 then 0 else minX) .. (if maxX >= w then w - 1 else maxX) do
+ if e.Contains (float x) (float y)