We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot build projects using gocv after upgrading to v0.38.0.
When building a simple project with go using gocv v0.38.0, it returns the stack trace below:
# gocv.io/x/gocv dnn.cpp: In function ‘Rect Net_BlobRectToImageRect(Rect, Size, double, Size, Scalar, bool, int, int, int, Scalar)’: dnn.cpp:134:104: error: no matching function for call to ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(cv::Scalar&, cv::Size&, cv::Scalar&, bool&, int&, cv::dnn::dnn4_v20230620::DataLayout&, cv::dnn::dnn4_v20230620::ImagePaddingMode&, cv::Scalar&)’ 134 | cv::dnn::Image2BlobParams params = cv::dnn::Image2BlobParams(sf, sz, cm, swapRB, ddepth, dl, pm, bv); | ^ In file included from /usr/local/include/opencv4/opencv2/dnn.hpp:76, from /usr/local/include/opencv4/opencv2/opencv.hpp:62, from dnn.h:7, from dnn.cpp:1: /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1218:17: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(const Scalar&, const Size&, const Scalar&, bool, int, cv::dnn::dnn4_v20230620::DataLayout, cv::dnn::dnn4_v20230620::ImagePaddingMode)’ 1218 | CV_WRAP Image2BlobParams(const Scalar& scalefactor, const Size& size = Size(), const Scalar& mean = Scalar(), | ^~~~~~~~~~~~~~~~ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1218:17: note: candidate expects 7 arguments, 8 provided /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1217:17: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams()’ 1217 | CV_WRAP Image2BlobParams(); | ^~~~~~~~~~~~~~~~ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1217:17: note: candidate expects 0 arguments, 8 provided /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(const cv::dnn::dnn4_v20230620::Image2BlobParams&)’ 1215 | struct CV_EXPORTS_W_SIMPLE Image2BlobParams | ^~~~~~~~~~~~~~~~ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate expects 1 argument, 8 provided /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(cv::dnn::dnn4_v20230620::Image2BlobParams&&)’ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate expects 1 argument, 8 provided dnn.cpp:136:29: error: ‘struct cv::dnn::dnn4_v20230620::Image2BlobParams’ has no member named ‘blobRectToImageRect’ 136 | cv::Rect bRect = params.blobRectToImageRect(cv::Rect(rect.x, rect.y, rect.width, rect.height), cv::Size(originalSize.width, originalSize.height)); | ^~~~~~~~~~~~~~~~~~~ dnn.cpp: In function ‘Rects Net_BlobRectsToImageRects(Rects, Size, double, Size, Scalar, bool, int, int, int, Scalar)’: dnn.cpp:160:104: error: no matching function for call to ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(cv::Scalar&, cv::Size&, cv::Scalar&, bool&, int&, cv::dnn::dnn4_v20230620::DataLayout&, cv::dnn::dnn4_v20230620::ImagePaddingMode&, cv::Scalar&)’ 160 | cv::dnn::Image2BlobParams params = cv::dnn::Image2BlobParams(sf, sz, cm, swapRB, ddepth, dl, pm, bv); | ^ In file included from /usr/local/include/opencv4/opencv2/dnn.hpp:76, from /usr/local/include/opencv4/opencv2/opencv.hpp:62, from dnn.h:7, from dnn.cpp:1: /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1218:17: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(const Scalar&, const Size&, const Scalar&, bool, int, cv::dnn::dnn4_v20230620::DataLayout, cv::dnn::dnn4_v20230620::ImagePaddingMode)’ 1218 | CV_WRAP Image2BlobParams(const Scalar& scalefactor, const Size& size = Size(), const Scalar& mean = Scalar(), | ^~~~~~~~~~~~~~~~ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1218:17: note: candidate expects 7 arguments, 8 provided /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1217:17: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams()’ 1217 | CV_WRAP Image2BlobParams(); | ^~~~~~~~~~~~~~~~ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1217:17: note: candidate expects 0 arguments, 8 provided /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(const cv::dnn::dnn4_v20230620::Image2BlobParams&)’ 1215 | struct CV_EXPORTS_W_SIMPLE Image2BlobParams | ^~~~~~~~~~~~~~~~ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate expects 1 argument, 8 provided /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(cv::dnn::dnn4_v20230620::Image2BlobParams&&)’ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate expects 1 argument, 8 provided dnn.cpp:163:12: error: ‘struct cv::dnn::dnn4_v20230620::Image2BlobParams’ has no member named ‘blobRectsToImageRects’ 163 | params.blobRectsToImageRects(_cRects, detected, cv::Size(originalSize.width, originalSize.height)); | ^~~~~~~~~~~~~~~~~~~~~ dnn.cpp: In function ‘cv::Mat* Net_BlobFromImageWithParams(Mat, double, Size, Scalar, bool, int, int, int, Scalar)’: dnn.cpp:192:104: error: no matching function for call to ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(cv::Scalar&, cv::Size&, cv::Scalar&, bool&, int&, cv::dnn::dnn4_v20230620::DataLayout&, cv::dnn::dnn4_v20230620::ImagePaddingMode&, cv::Scalar&)’ 192 | cv::dnn::Image2BlobParams params = cv::dnn::Image2BlobParams(sf, sz, cm, swapRB, ddepth, dl, pm, bv); | ^ In file included from /usr/local/include/opencv4/opencv2/dnn.hpp:76, from /usr/local/include/opencv4/opencv2/opencv.hpp:62, from dnn.h:7, from dnn.cpp:1: /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1218:17: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(const Scalar&, const Size&, const Scalar&, bool, int, cv::dnn::dnn4_v20230620::DataLayout, cv::dnn::dnn4_v20230620::ImagePaddingMode)’ 1218 | CV_WRAP Image2BlobParams(const Scalar& scalefactor, const Size& size = Size(), const Scalar& mean = Scalar(), | ^~~~~~~~~~~~~~~~ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1218:17: note: candidate expects 7 arguments, 8 provided /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1217:17: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams()’ 1217 | CV_WRAP Image2BlobParams(); | ^~~~~~~~~~~~~~~~ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1217:17: note: candidate expects 0 arguments, 8 provided /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(const cv::dnn::dnn4_v20230620::Image2BlobParams&)’ 1215 | struct CV_EXPORTS_W_SIMPLE Image2BlobParams | ^~~~~~~~~~~~~~~~ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate expects 1 argument, 8 provided /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(cv::dnn::dnn4_v20230620::Image2BlobParams&&)’ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate expects 1 argument, 8 provided dnn.cpp: In function ‘void Net_BlobFromImagesWithParams(Mats, Mat, double, Size, Scalar, bool, int, int, int, Scalar)’: dnn.cpp:226:104: error: no matching function for call to ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(cv::Scalar&, cv::Size&, cv::Scalar&, bool&, int&, cv::dnn::dnn4_v20230620::DataLayout&, cv::dnn::dnn4_v20230620::ImagePaddingMode&, cv::Scalar&)’ 226 | cv::dnn::Image2BlobParams params = cv::dnn::Image2BlobParams(sf, sz, cm, swapRB, ddepth, dl, pm, bv); | ^ In file included from /usr/local/include/opencv4/opencv2/dnn.hpp:76, from /usr/local/include/opencv4/opencv2/opencv.hpp:62, from dnn.h:7, from dnn.cpp:1: /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1218:17: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(const Scalar&, const Size&, const Scalar&, bool, int, cv::dnn::dnn4_v20230620::DataLayout, cv::dnn::dnn4_v20230620::ImagePaddingMode)’ 1218 | CV_WRAP Image2BlobParams(const Scalar& scalefactor, const Size& size = Size(), const Scalar& mean = Scalar(), | ^~~~~~~~~~~~~~~~ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1218:17: note: candidate expects 7 arguments, 8 provided /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1217:17: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams()’ 1217 | CV_WRAP Image2BlobParams(); | ^~~~~~~~~~~~~~~~ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1217:17: note: candidate expects 0 arguments, 8 provided /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(const cv::dnn::dnn4_v20230620::Image2BlobParams&)’ 1215 | struct CV_EXPORTS_W_SIMPLE Image2BlobParams | ^~~~~~~~~~~~~~~~ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate expects 1 argument, 8 provided /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate: ‘cv::dnn::dnn4_v20230620::Image2BlobParams::Image2BlobParams(cv::dnn::dnn4_v20230620::Image2BlobParams&&)’ /usr/local/include/opencv4/opencv2/dnn/dnn.hpp:1215:32: note: candidate expects 1 argument, 8 provided
package main import ( "fmt" "gocv.io/x/gocv" "io" "os" ) func main() { f, err := os.Open("/path/to/an/image") if err != nil { fmt.Println(err) return } defer f.Close() content, err := io.ReadAll(f) if err != nil { fmt.Println(err) return } dstMat := gocv.NewMat() srcMat, err := gocv.IMDecode(content, gocv.IMReadColor) if err != nil { fmt.Println(err) return } gocv.CvtColor(srcMat, &dstMat, gocv.ColorBGRToRGB) return }
go build .
It failed.
env.sh
env.cmd
go run
go build
The text was updated successfully, but these errors were encountered:
That sounds like an incompatible version of OpenCV being installed by python, or installed missing required module.
Perhaps you can check pkg-config command output. In any case, the only tested installation for Linux is installing OpenCV from source.
pkg-config
Sorry, something went wrong.
No branches or pull requests
Cannot build projects using gocv after upgrading to v0.38.0.
Description
When building a simple project with go using gocv v0.38.0, it returns the stack trace below:
Steps to Reproduce
go build .
It failed.
Your Environment
env.sh
orenv.cmd
script before trying togo run
orgo build
? NoThe text was updated successfully, but these errors were encountered: