我正在尝试从GitHub构建网球场检测算法

时间:2019-07-15 11:40:51

标签: c++ opencv

我正在尝试使用一种算法,该算法可以从GitHub上的C ++项目中获得(我只知道Python和一些R,我主要将其用于数学),但是我不确定如何克服它错误。 我曾尝试直接在Python的研究论文中实现该算法,但无法正确实现,因此我认为我可以从python脚本中调用它。

链接到项目:https://github.com/gchlebus/tennis-court-detection

这是我在终端中运行“ make”时的输出:


MacBook-Pro-de-Vacher-Coponat:tennis-court-detection musique$ make
g++ -g -Wall -std=c++0x -o detect *.cpp `pkg-config --cflags --libs opencv`
CourtLineCandidateDetector.cpp:135:17: error: use of undeclared identifier 'DIST_L2'
  fitLine(A, X, DIST_L2, 0, 0.01, 0.01);
                ^
1 error generated.
DebugHelpers.cpp:12:24: error: 'this' argument to member function 'get' has type 'const cv::VideoCapture', but function is not marked const
  int frameCount = int(vc.get(CV_CAP_PROP_FRAME_COUNT));
                       ^~
/usr/local/Cellar/opencv@2/2.4.13.7_3/include/opencv2/highgui/highgui.hpp:223:28: note: 'get' declared here
    CV_WRAP virtual double get(int propId);
                           ^
DebugHelpers.cpp:13:19: error: 'this' argument to member function 'get' has type 'const cv::VideoCapture', but function is not marked const
  int width = int(vc.get(CV_CAP_PROP_FRAME_WIDTH));
                  ^~
/usr/local/Cellar/opencv@2/2.4.13.7_3/include/opencv2/highgui/highgui.hpp:223:28: note: 'get' declared here
    CV_WRAP virtual double get(int propId);
                           ^
DebugHelpers.cpp:14:20: error: 'this' argument to member function 'get' has type 'const cv::VideoCapture', but function is not marked const
  int height = int(vc.get(CV_CAP_PROP_FRAME_HEIGHT));
                   ^~
/usr/local/Cellar/opencv@2/2.4.13.7_3/include/opencv2/highgui/highgui.hpp:223:28: note: 'get' declared here
    CV_WRAP virtual double get(int propId);
                           ^
DebugHelpers.cpp:15:17: error: 'this' argument to member function 'get' has type 'const cv::VideoCapture', but function is not marked const
  int fps = int(vc.get(CV_CAP_PROP_FPS));
                ^~
/usr/local/Cellar/opencv@2/2.4.13.7_3/include/opencv2/highgui/highgui.hpp:223:28: note: 'get' declared here
    CV_WRAP virtual double get(int propId);
                           ^
4 errors generated.
TennisCourtModel.cpp:306:17: error: implicit instantiation of undefined template 'std::__1::basic_ofstream<char, std::__1::char_traits<char> >'
  std::ofstream outFile(filename);
                ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/iosfwd:133:32: note: template is declared here
    class _LIBCPP_TEMPLATE_VIS basic_ofstream;
                               ^
1 error generated.
make: *** [detect] Error 1

0 个答案:

没有答案