gocv icon indicating copy to clipboard operation
gocv copied to clipboard

calib3d.cpp:64:74: error: too many arguments to function 'bool cv::findChessboardCornersSB(cv::InputArray, cv::Size, cv::OutputArray, int)'

Open rahulmysore23 opened this issue 2 years ago • 1 comments

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

  1. Using Golang 1.17.5
  2. Installing Gocv (Works fine without errors)
  3. 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 or env.cmd script before trying to go run or go build? No

rahulmysore23 avatar Dec 22 '21 10:12 rahulmysore23

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.

pvorontsovd avatar Jan 30 '22 14:01 pvorontsovd