Skip to content

Conversation

@guhur
Copy link

@guhur guhur commented Aug 5, 2021

As described to the issue #80, we can easily upgrade the code to OpenCV 4.

OpenCV 4 is delivered by default in Ubuntu 20.04, and I updated the Dockerfile accordingly.

I observed I was often using the script linked in the issue and reproduced below. So why not creating a PR since it could ease the installation.

#!/bin/sh

find .  \( -name '*.cpp' -or -name '*.hpp' -or -name '*.h' \)  \
  -exec sed -i \
  -e 's/CV_IMWRITE_/cv::IMWRITE_/g' \
  -e 's/CV_LOAD_IMAGE_ANYDEPTH/cv::IMREAD_ANYDEPTH/g' \
  -e 's/CV_LOAD_IMAGE_COLOR/cv::IMREAD_COLOR/g' \
  -e 's/CV_L2/cv::NORM_L2/g' \
  -e 's/CV_TERMCRIT_EPS/cv::TermCriteria::EPS/g' \
  -e 's/CV_TERMCRIT_ITER/cv::TermCriteria::MAX_ITER/g' \
  -e 's/CV_CALIB_CB_/cv::CALIB_CB_/g' \
  -e 's/CV_BGR2GRAY/cv::COLOR_BGR2GRAY/g' \
  -e 's/CV_GRAY2BGR/cv::COLOR_GRAY2BGR/g' \
  -e 's/CV_HAAR_/cv::CASCADE_/g' \
  -e 's/CV_INTER_/cv::INTER_/g' \
  -e 's/CV_WARP_INVERSE_MAP/cv::WARP_INVERSE_MAP/g' \
  -e 's/CV_WINDOW_/cv::WINDOW_/g' \
  -e 's/CV_WND_/cv::WND_/g' \
  -e 's/CV_CAP_/cv::CAP_/g' \
  -e 's/CV_FOURCC/cv::VideoWriter::fourcc/g' \
  '{}' ';'

@ZhuFengdaaa
Copy link

cool, it works.

My issue on Ubuntu 20.04

/home/Matterport3DSimulator/src/lib/NavGraph.cpp: In member function ‘void mattersim::NavGraph::Location::loadCubemapImages()’:
/home/Matterport3DSimulator/src/lib/NavGraph.cpp:59:89: error: ‘CV_LOAD_IMAGE_ANYDEPTH’ was not declared in this scope
   59 |         cv::Mat depth = cv::imread(skyboxDir + viewpointId + "_skybox_depth_small.png", CV_LOAD_IMAGE_ANYDEPTH);
      |                                                                                         ^~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/MatterSim.dir/build.make:90: CMakeFiles/MatterSim.dir/src/lib/NavGraph.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:106: CMakeFiles/MatterSim.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants