hybridgroup / gocv

Go package for computer vision using OpenCV 4 and beyond. Includes support for DNN, CUDA, OpenCV Contrib, and OpenVINO.
https://gocv.io
Other
6.74k stars 868 forks source link

MatExpr (e.g. simply scaling Mat by scalar) #1209

Closed kubaraczkowski closed 2 months ago

kubaraczkowski commented 2 months ago

Thanks for the awesome effort!

I must be missing something - how do you do MatExpr stuff, e.g. Mat * 5.0 in gocv? If there's no 'operator overloading' in Go, and I don't really see functions implementing the same, how do you normally do it?

https://docs.opencv.org/3.4/d1/d10/classcv_1_1MatExpr.html

Thanks for the info!

deadprogram commented 2 months ago

As you already understand, overloading is not a thing that exists in the Go programming language.

Instead see functions such as https://pkg.go.dev/gocv.io/x/gocv#Mat.MultiplyFloat

Hope that helps!

kubaraczkowski commented 2 months ago

Excellent! That's exactly what I have been looking for, I must have missed it! Thanks a lot for such a quick reply!