HanjieLuo / Image-Enhancement-for-SLAM

Image Enhancement for SLAM
GNU General Public License v2.0
46 stars 14 forks source link

error:'traits' has not been declared #2

Open qianqianzige opened 2 years ago

qianqianzige commented 2 years ago

In fgs_filter.cpp:149:37

gaowen1221 commented 2 years ago

In fgs_filter.cpp:149:37

I have this problem too, have you solved it?

HanjieLuo commented 2 years ago
  1. Try to comment all the statements ${PROJECT_SOURCE_DIR}/thirdparty/opencv-3.4 in the CMakeLists.txt file.
  2. Upgrade your opencv and try to build it with contrib.
gaowen1221 commented 2 years ago
  1. Try to comment all the statements ${PROJECT_SOURCE_DIR}/thirdparty/opencv-3.4 in the CMakeLists.txt file.

    1. Upgrade your opencv and try to build it with contrib.

thanks, solved

flyover-26 commented 2 years ago

@gaowen1221 hi! Could you tell me how to slove it? I download opencv3.4.1 without contrib and set Opencv_dir.

HanjieLuo commented 2 years ago

@gaowen1221 hi! Could you tell me how to slove it? I download opencv3.4.1 without contrib and set Opencv_dir.

opencv_contrib Install OpenCV on Ubuntu 20.04 - Step by Step Tutorial

flyover-26 commented 2 years ago

@HanjieLuo hi I install opencv 3.4.1 and opencv_contrib 3.4.1.

this is my cmakelist set(OpenCV_DIR "/home/zr/software/opencv-3.4.1/install/share/OpenCV")

find_package(OpenCV REQUIRED) message(STATUS "OpenCV_DIR = ${OpenCV_DIR}") message(STATUS "OpenCV_include_DIR = ${OpenCV_INCLUDE_DIRS}")

this is out put -- Found OpenCV: /home/zr/software/opencv-3.4.1/install (found version "3.4.1") -- OpenCV_DIR = /home/zr/software/opencv-3.4.1/install/share/OpenCV -- OpenCV_include_DIR = /home/zr/software/opencv-3.4.1/install/include;/home/zr/software/opencv-3.4.1/install/include/opencv -- Found OpenCV: /usr (found version "3.2.0")

However ,I got error below: /home/zr/project/Image-Enhancement-for-SLAM/src/image_enhance/fgs_filter.cpp:99:47: error: expected ‘;’ at end of member declaration void operator () (const Range& range) const CV_OVERRIDE; ^~~~~ /home/zr/project/Image-Enhancement-for-SLAM/src/image_enhance/fgs_filter.cpp:99:53: error: ‘CV_OVERRIDE’ does not name a type; did you mean ‘CV_VERSION’? void operator () (const Range& range) const CV_OVERRIDE; ^~~ CV_VERSION /home/zr/project/Image-Enhancement-for-SLAM/src/image_enhance/fgs_filter.c

Looking for your help!

HanjieLuo commented 2 years ago

@HanjieLuo hi I install opencv 3.4.1 and opencv_contrib 3.4.1.

this is my cmakelist set(OpenCV_DIR "/home/zr/software/opencv-3.4.1/install/share/OpenCV")

find_package(OpenCV REQUIRED) message(STATUS "OpenCV_DIR = ${OpenCV_DIR}") message(STATUS "OpenCV_include_DIR = ${OpenCV_INCLUDE_DIRS}")

this is out put -- Found OpenCV: /home/zr/software/opencv-3.4.1/install (found version "3.4.1") -- OpenCV_DIR = /home/zr/software/opencv-3.4.1/install/share/OpenCV -- OpenCV_include_DIR = /home/zr/software/opencv-3.4.1/install/include;/home/zr/software/opencv-3.4.1/install/include/opencv -- Found OpenCV: /usr (found version "3.2.0")

However ,I got error below: /home/zr/project/Image-Enhancement-for-SLAM/src/image_enhance/fgs_filter.cpp:99:47: error: expected ‘;’ at end of member declaration void operator () (const Range& range) const CV_OVERRIDE; ^~~ /home/zr/project/Image-Enhancement-for-SLAM/src/image_enhance/fgs_filter.cpp:99:53: error: ‘CV_OVERRIDE’ does not name a type; did you mean ‘CV_VERSION’? void operator () (const Range& range) const CV_OVERRIDE; ^~~~~ CV_VERSION /home/zr/project/Image-Enhancement-for-SLAM/src/image_enhance/fgs_filter.c

Looking for your help!

Try opencv 4.5.4 or another newer version of opencv.

a12fghoenNew commented 1 year ago

I compiled it directly on ubuntu20,using the ros environment(OpenCV 4.2)