gocv
gocv copied to clipboard
calib3d.cpp:64:74: error: too many arguments to function 'bool cv::findChessboardCornersSB(cv::InputArray, cv::Size, cv::OutputArray, int)'
Error when trying to build Go code with latest gocv
Description
# gocv.io/x/gocv
calib3d.cpp: In function 'bool FindChessboardCornersSBWithMeta(Mat, Size, Mat, int, Mat)':
calib3d.cpp:64:74: error: too many arguments to function 'bool cv::findChessboardCornersSB(cv::InputArray, cv::Size, cv::OutputArray, int)'
64 | return cv::findChessboardCornersSB(*image, sz, *corners, flags, *meta);
| ^
In file included from /usr/local/include/opencv4/opencv2/opencv.hpp:56,
from calib3d.h:5,
from calib3d.cpp:1:
/usr/local/include/opencv4/opencv2/calib3d.hpp:952:19: note: declared here
952 | CV_EXPORTS_W bool findChessboardCornersSB(InputArray image,Size patternSize, OutputArray corners,int flags=0);
| ^~~~~~~~~~~~~~~~~~~~~~~
Steps to Reproduce
- Using Golang 1.17.5
- Installing Gocv (Works fine without errors)
- Trying to build my go server/code (above error occurs)
Your Environment
- Operating System and version: Official golang 1.17.5 docker image
- OpenCV version used: 4.1.0
- How did you install OpenCV?
- GoCV version used: latest, used - go get -u -d gocv.io/x/gocv
- Go version: 1.17.5
- Did you run the
env.sh
orenv.cmd
script before trying togo run
orgo build
? No
I had the same problem in Ubuntu 20.04 with libopencv-dev version 4.2.0 installed from the default repository. As far as I understand, in order to work correctly, you need to install the correct version of opencv. For example, gocv version v0.29.0 requires opencv version v4.5.4. The best way to install it on linux is to do as write here https://gocv.io/getting-started/linux.