Files
gocv/cuda/helpers_test.go
deadprogram fa26c1f4ae cuda: a number of changes such as adding HoughLinesDetector and HoughSegmentDetector,
adding a test for the CannyEdgeDetector and some refactoring of the API,
      and adding dockerfiles for OpenCV 4.5.1 with CUDA 11.2

Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-03-24 19:29:08 +01:00

18 lines
335 B
Go

package cuda
import "math"
var eps = 0.00000001
func floatEquals(a, b float32) bool {
if math.Abs(float64(a-b)) < eps {
return true
}
return false
}
// round helper from https://stackoverflow.com/questions/39544571/golang-round-to-nearest-0-05
func round(x, unit float32) float32 {
return float32(int32(x/unit+0.5)) * unit
}