Opencv_contrib: Build failes (obelfilterwidget.cpp: error: ‘FILTER_SCHARR’ was not declared in this scope)

Created on 19 Nov 2018  Â·  3Comments  Â·  Source: opencv/opencv_contrib

System information (version)
  • OpenCV => master
  • Operating System / Platform => Fedora29 (CUDA 10)
  • Compiler => 8.2.1 20181105
Detailed description

Building fails with error :

opencv_contrib/modules/cvv/src/qtutil/filter/sobelfilterwidget.cpp: In member function ‘virtual void cvv::qtutil::SobelFilterWidget::applyFilter(cvv::qtutil::SobelFilterWidget::InputArray, cvv::qtutil::SobelFilterWidget::OutputArray) const’:
opencv_contrib/modules/cvv/src/qtutil/filter/sobelfilterwidget.cpp:136:11: error: ‘FILTER_SCHARR’ was not declared in this scope
   ksize = FILTER_SCHARR;
           ^~~~~~~~~~~~~
opencv_contrib/modules/cvv/src/qtutil/filter/sobelfilterwidget.cpp:136:11: note: suggested alternative:
In file included from opencv_contrib/modules/cvv/src/qtutil/filter/sobelfilterwidget.cpp:3:
opencv/modules/imgproc/include/opencv2/imgproc.hpp:208:5: note:   ‘FILTER_SCHARR’
     FILTER_SCHARR = -1
     ^~~~~~~~~~~~~
opencv_contrib/modules/cvv/src/qtutil/filter/sobelfilterwidget.cpp: In member function ‘virtual std::pair<bool, QString> cvv::qtutil::SobelFilterWidget::checkInput(cvv::qtutil::SobelFilterWidget::InputArray) const’:
opencv_contrib/modules/cvv/src/qtutil/filter/sobelfilterwidget.cpp:261:11: error: ‘FILTER_SCHARR’ was not declared in this scope
   ksize = FILTER_SCHARR;
           ^~~~~~~~~~~~~
opencv_contrib/modules/cvv/src/qtutil/filter/sobelfilterwidget.cpp:261:11: note: suggested alternative:
In file included from opencv_contrib/modules/cvv/src/qtutil/filter/sobelfilterwidget.cpp:3:
opencv/modules/imgproc/include/opencv2/imgproc.hpp:208:5: note:   ‘FILTER_SCHARR’
     FILTER_SCHARR = -1
     ^~~~~~~~~~~~~
opencv_contrib/modules/cvv/src/qtutil/filter/sobelfilterwidget.cpp:265:15: error: ‘FILTER_SCHARR’ was not declared in this scope
  if (ksize == FILTER_SCHARR)
               ^~~~~~~~~~~~~
opencv_contrib/modules/cvv/src/qtutil/filter/sobelfilterwidget.cpp:265:15: note: suggested alternative:
In file included from opencv_contrib/modules/cvv/src/qtutil/filter/sobelfilterwidget.cpp:3:
opencv/modules/imgproc/include/opencv2/imgproc.hpp:208:5: note:   ‘FILTER_SCHARR’
     FILTER_SCHARR = -1
     ^~~~~~~~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-unnamed-type-template-args’
make[2]: *** [modules/cvv/CMakeFiles/opencv_cvv.dir/build.make:440: modules/cvv/CMakeFiles/opencv_cvv.dir/src/qtutil/filter/sobelfilterwidget.cpp.o] Error 1

I think that fix it to "cv :: FILTER_SCHARR" or add "using namespace cv;".

bug builinstall cvv

Most helpful comment

I added "using namespace cv;" and fixed the build error.
I would like to send a pull request.

All 3 comments

I added "using namespace cv;" and fixed the build error.
I would like to send a pull request.

Where would one add the line:
"using namespace cv;"

Thanks.

@AeroClassics #1915

Was this page helpful?
0 / 5 - 0 ratings