- let filteredGreenWhitoutInfectionFloat = filteredGreenWhitoutInfection.Convert<Gray, float32>()
- let filteredGreenWhitoutStainFloat = filteredGreenWhitoutStain.Convert<Gray, float32>()
-
- let canny = green.Canny(60., 40.)
-
- (*let min = ref 0.0
- let minLocation = ref <| Point()
- let max = ref 0.0
- let maxLocation = ref <| Point()
- magnitudes.MinMax(min, max, minLocation, maxLocation)
-
- use magnitudesByte = ((magnitudes / !max) * 255.0).Convert<byte>() // Otsu from OpenCV only support 'byte'.
- use edges = new Matrix<byte>(xEdges.Size)
- CvInvoke.Threshold(magnitudesByte, edges, 0.0, 1.0, CvEnum.ThresholdType.Otsu ||| CvEnum.ThresholdType.Binary) |> ignore
-
- logTime "Finding edges" (fun() -> thin edges)*)
-
- let edges, xGradient, yGradient = ImgTools.findEdges filteredGreenWhitoutStainFloat