img.MinMax(min, max, minLocation, maxLocation)
float32 (!min).[0], float32 (!max).[0]
- let bin (x: float32) : int =
+ let inline bin (x: float32) : int =
let p = int ((x - min) / (max - min) * float32 nbSamples)
if p >= nbSamples then nbSamples - 1 else p
mat.MinMax(min, max, minLocation, maxLocation)
float32 !min, float32 !max
- let bin (x: float32) : int =
+ let inline bin (x: float32) : int =
let p = int ((x - min) / (max - min) * float32 nbSamples)
if p >= nbSamples then nbSamples - 1 else p
if v < min then min <- v
if v > max then max <- v
- let bin (x: float32) : int =
+ let inline bin (x: float32) : int =
let p = int ((x - min) / (max - min) * float32 nbSamples)
if p >= nbSamples then nbSamples - 1 else p
let thresholdHigh, thresholdLow =
let sensibilityHigh = 0.1f
let sensibilityLow = 0.0f
- use magnitudesByte = magnitudes.Convert<byte>()
let threshold, _, _ = otsu (histogramMat magnitudes 300)
threshold + (sensibilityHigh * threshold), threshold - (sensibilityLow * threshold)