-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error: ‘CV_IMWRITE_PNG_COMPRESSION’ was not declared in this scope #5
Comments
Hi @paul-shuvo I am setting up Kinect v2 with ROS Noetic by following post. However, I have no problem using libfreenect2 but got errors with paul-shuvo/iai_kinect2_opencv4. May I please ask if this post is correct? https://www.reddit.com/r/ROS/comments/uj1auq/set_up_kinect_v2_with_ros_noetic/ Btw, my current opencv version is 4.2.0. Do I need to switch it to 4.0.0? Thanks a lot. in your post above, do you mean this as shown below? If not, at which step shall I run cmake .. -DENABLE_CXX11=ON, please Build (if you have run cd depends previously, cd .. back to the libfreenect2 root directory first.) mkdir build && cd build |
You are right on both counts. It should be fine on OpenCV 4.2.0, but this was only tested for 4.0.0; if it doesn't, comment here, I'll take a look. |
@SalvaTure98, I guess the error was here |
@paul-shuvo Thank you so much for your great help. I still get errors. Could you please take a look at the steps I used? Did I do anything wrong? First of all, my I've got dual graphics cards installed and nvidia was made the default one for higher performance. Install libfreenect2: Download libfreenect2 source Install build tools sudo apt-get install libusb-1.0-0-dev Install TurboJPEG Install OpenGL
Install OpenCL (optional)
Install CUDA (optional, Nvidia only): I didn't install CUDA. Because I don't know if I need it. Is it required? Install VAAPI (optional, Intel only) Build Set up udev rules for device access: sudo cp ../platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/, then replug the Kinect. Install libfreenect2: To summarize, I did follow the instructions and enable C++11 by using cmake .. -DENABLE_CXX11=ON instead of cmake ... but I did run cmake .. -DENABLE_CXX11=ON -DCUDA_PROPAGATE_HOST_FLAGS=off. because I am not sure if I am compiling libfreenect2 with CUDA. Clone this repository into your catkin workspace, install the dependencies and build it: Then it throws the following errors. Could you please tell me what I did wrong? Thanks a lot. |
@stevensu1838 did you do the following?
|
@paul-shuvo Hi, thanks a lot. Yes, I did it with catkin_make -DCMAKE_BUILD_TYPE="Release" -Dfreenect2_DIR=/home/ysu66/freenect2/lib/cmake/freenect2 .Same error: And after deleting the freenect2 and libfreenect2 a couple of times and re-installation, I couldn't even run ./bin/Protonect It throws these errors but it worked for me before. Any chance you know how to fix it first? Thanks in advance. |
@stevensu1838 this is the most frustrating thing about working with anything ROS. I used to spend countless hours to make different libraries/modules work (together) and the whole thing is a dependency hell, and thus finding the root cause is very difficult. That's why me and my colleagues would use a separate machine, as for us it was easier to reinstall everything from scratch than trying to find the needle in the hay stack. I know this is not a solution, but that's what I can offer right now. |
Hi, I'm trying to install the package and I followed all the instructions. I'm using Ros Noetic, ./bin/Protonect and NiViewer2 work fine and the current version of OpenCv is 4.2.0, but then when I use:
cd ~/catkin_ws/src/
git clone https://github.com/code-iai/iai_kinect2.git
cd iai_kinect2
rosdep install -r --from-paths .
cd ~/catkin_ws
catkin_make -DCMAKE_BUILD_TYPE="Release" -Dfreenect2_DIR=/home/salvo/libfreenect2/lib/cmake/freenect2
Base path: /home/salvo/catkin_ws
This happens:
atkin_make -DCMAKE_BUILD_TYPE="Release" -Dfreenect2_DIR=/home/salvo/libfreenect2/lib/cmake/freenect2
Base path: /home/salvo/catkin_ws
Source space: /home/salvo/catkin_ws/src
Build space: /home/salvo/catkin_ws/build
Devel space: /home/salvo/catkin_ws/devel
Install space: /home/salvo/catkin_ws/install
Running command: "cmake /home/salvo/catkin_ws/src -DCMAKE_BUILD_TYPE=Release -Dfreenect2_DIR=/home/salvo/libfreenect2/lib/cmake/freenect2 -DCATKIN_DEVEL_PREFIX=/home/salvo/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/salvo/catkin_ws/install -G Unix Makefiles" in "/home/salvo/catkin_ws/build"
-- Using CATKIN_DEVEL_PREFIX: /home/salvo/catkin_ws/devel
-- Using CMAKE_PREFIX_PATH: /home/salvo/catkin_ws/devel;/opt/ros/noetic
-- This workspace overlays: /home/salvo/catkin_ws/devel;/opt/ros/noetic
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3")
-- Using PYTHON_EXECUTABLE: /usr/bin/python3
-- Using Debian Python package layout
-- Using empy: /usr/lib/python3/dist-packages/em.py
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/salvo/catkin_ws/build/test_results
-- Forcing gtest/gmock from source, though one was otherwise available.
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python3 (found version "3.8.10")
-- Using Python nosetests: /usr/bin/nosetests3
-- catkin 0.8.10
-- BUILD_SHARED_LIBS is on
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~ traversing 5 packages in topological order:
-- ~~ - iai_kinect2 (metapackage)
-- ~~ - kinect2_registration
-- ~~ - kinect2_bridge
-- ~~ - kinect2_calibration
-- ~~ - kinect2_viewer
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin metapackage: 'iai_kinect2'
-- ==> add_subdirectory(iai_kinect2/iai_kinect2)
-- +++ processing catkin package: 'kinect2_registration'
-- ==> add_subdirectory(iai_kinect2/kinect2_registration)
-- CPU based depth registration enabled
-- OpenCL based depth registration enabled
CMake Warning at iai_kinect2/kinect2_registration/CMakeLists.txt:60 (message):
Your libOpenCL.so is incompatible with CL/cl.h. Install ocl-icd-opencl-dev
to update libOpenCL.so?
-- +++ processing catkin package: 'kinect2_bridge'
-- ==> add_subdirectory(iai_kinect2/kinect2_bridge)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- +++ processing catkin package: 'kinect2_calibration'
-- ==> add_subdirectory(iai_kinect2/kinect2_calibration)
-- +++ processing catkin package: 'kinect2_viewer'
-- ==> add_subdirectory(iai_kinect2/kinect2_viewer)
-- Eigen found (include: /usr/include/eigen3, version: 3.3.7)
-- The imported target "vtkParseOGLExt" references the file
"/usr/bin/vtkParseOGLExt-7.1"
but this file does not exist. Possible reasons include:
"/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
but not all the files it references.
-- The imported target "vtkRenderingPythonTkWidgets" references the file
"/usr/lib/x86_64-linux-gnu/libvtkRenderingPythonTkWidgets.so"
but this file does not exist. Possible reasons include:
"/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
but not all the files it references.
-- The imported target "vtk" references the file
"/usr/bin/vtk"
but this file does not exist. Possible reasons include:
"/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
but not all the files it references.
-- The imported target "pvtk" references the file
"/usr/bin/pvtk"
but this file does not exist. Possible reasons include:
"/usr/lib/cmake/vtk-7.1/VTKTargets.cmake"
but not all the files it references.
-- OpenNI found (include: /usr/include/ni, lib: /usr/lib/libOpenNI.so)
-- OpenNI2 found (include: /usr/include/openni2, lib: /usr/lib/libOpenNI2.so)
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
** WARNING ** io features related to libusb-1.0 will be disabled
-- OpenNI found (include: /usr/include/ni, lib: /usr/lib/libOpenNI.so)
-- OpenNI2 found (include: /usr/include/openni2, lib: /usr/lib/libOpenNI2.so)
-- QHULL found (include: /usr/include, lib: optimized;/usr/lib/x86_64-linux-gnu/libqhull.so;debug;/usr/lib/x86_64-linux-gnu/libqhull.so)
-- OpenNI found (include: /usr/include/ni, lib: /usr/lib/libOpenNI.so)
-- looking for PCL_COMMON
-- looking for PCL_KDTREE
-- looking for PCL_OCTREE
-- looking for PCL_SEARCH
-- looking for PCL_SAMPLE_CONSENSUS
-- looking for PCL_FILTERS
-- looking for PCL_2D
-- looking for PCL_GEOMETRY
-- looking for PCL_IO
-- looking for PCL_FEATURES
-- looking for PCL_ML
-- looking for PCL_SEGMENTATION
-- looking for PCL_VISUALIZATION
-- looking for PCL_SURFACE
-- looking for PCL_REGISTRATION
-- looking for PCL_KEYPOINTS
-- looking for PCL_TRACKING
-- looking for PCL_RECOGNITION
-- looking for PCL_STEREO
-- looking for PCL_APPS
-- looking for PCL_IN_HAND_SCANNER
-- looking for PCL_POINT_CLOUD_EDITOR
-- looking for PCL_OUTOFCORE
-- looking for PCL_PEOPLE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/salvo/catkin_ws/build
Running command: "make -j12 -l12" in "/home/salvo/catkin_ws/build"
[ 33%] Built target kinect2_registration
[ 41%] Building CXX object iai_kinect2/kinect2_calibration/CMakeFiles/kinect2_calibration.dir/src/kinect2_calibration.cpp.o
[ 50%] Building CXX object iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge_nodelet.dir/src/kinect2_bridge.cpp.o
[ 58%] Building CXX object iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge.dir/src/kinect2_bridge.cpp.o
[ 66%] Building CXX object iai_kinect2/kinect2_viewer/CMakeFiles/kinect2_viewer.dir/src/viewer.cpp.o
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_calibration/src/kinect2_calibration.cpp: In constructor ‘Recorder::Recorder(const string&, const string&, const string&, const string&, Source, bool, bool, const Size&, float)’:
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_calibration/src/kinect2_calibration.cpp:113:22: error: ‘CV_IMWRITE_PNG_COMPRESSION’ was not declared in this scope
113 | params.push_back(CV_IMWRITE_PNG_COMPRESSION);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp: In member function ‘void Kinect2Bridge::initCompression(int32_t, int32_t, bool)’:
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:464:28: error: ‘CV_IMWRITE_JPEG_QUALITY’ was not declared in this scope
464 | compressionParams[0] = CV_IMWRITE_JPEG_QUALITY;
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:466:28: error: ‘CV_IMWRITE_PNG_COMPRESSION’ was not declared in this scope
466 | compressionParams[2] = CV_IMWRITE_PNG_COMPRESSION;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp: In member function ‘void Kinect2Bridge::initCompression(int32_t, int32_t, bool)’:
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:464:28: error: ‘CV_IMWRITE_JPEG_QUALITY’ was not declared in this scope
464 | compressionParams[0] = CV_IMWRITE_JPEG_QUALITY;
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:468:28: error: ‘CV_IMWRITE_PNG_STRATEGY’ was not declared in this scope
468 | compressionParams[4] = CV_IMWRITE_PNG_STRATEGY;
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:466:28: error: ‘CV_IMWRITE_PNG_COMPRESSION’ was not declared in this scope
466 | compressionParams[2] = CV_IMWRITE_PNG_COMPRESSION;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:469:28: error: ‘CV_IMWRITE_PNG_STRATEGY_RLE’ was not declared in this scope
469 | compressionParams[5] = CV_IMWRITE_PNG_STRATEGY_RLE;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:468:28: error: ‘CV_IMWRITE_PNG_STRATEGY’ was not declared in this scope
468 | compressionParams[4] = CV_IMWRITE_PNG_STRATEGY;
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:469:28: error: ‘CV_IMWRITE_PNG_STRATEGY_RLE’ was not declared in this scope
469 | compressionParams[5] = CV_IMWRITE_PNG_STRATEGY_RLE;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp: In member function ‘void Kinect2Bridge::receiveColor()’:
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1103:45: error: ‘CV_BGRA2BGR’ was not declared in this scope
1103 | cv::cvtColor(tmp, images[COLOR_HD], CV_BGRA2BGR);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1107:45: error: ‘CV_RGBA2BGR’ was not declared in this scope
1107 | cv::cvtColor(tmp, images[COLOR_HD], CV_RGBA2BGR);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp: In member function ‘void Kinect2Bridge::processIrDepth(const cv::Mat&, std::vectorcv::Mat&, const std::vectorKinect2Bridge::Status&)’:
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1183:50: error: ‘CV_BGRA2BGR’ was not declared in this scope
1183 | cv::cvtColor(tmp, images[COLOR_SD_RECT], CV_BGRA2BGR);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1187:50: error: ‘CV_RGBA2BGR’ was not declared in this scope
1187 | cv::cvtColor(tmp, images[COLOR_SD_RECT], CV_RGBA2BGR);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp: In member function ‘void Kinect2Bridge::processColor(std::vectorcv::Mat&, const std::vectorKinect2Bridge::Status&)’:
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1250:55: error: ‘CV_BGR2GRAY’ was not declared in this scope
1250 | cv::cvtColor(images[COLOR_HD], images[MONO_HD], CV_BGR2GRAY);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1254:65: error: ‘CV_BGR2GRAY’ was not declared in this scope
1254 | cv::cvtColor(images[COLOR_HD_RECT], images[MONO_HD_RECT], CV_BGR2GRAY);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1258:57: error: ‘CV_BGR2GRAY’ was not declared in this scope
1258 | cv::cvtColor(images[COLOR_QHD], images[MONO_QHD], CV_BGR2GRAY);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp: In member function ‘void Kinect2Bridge::receiveColor()’:
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1103:45: error: ‘CV_BGRA2BGR’ was not declared in this scope
1103 | cv::cvtColor(tmp, images[COLOR_HD], CV_BGRA2BGR);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1262:67: error: ‘CV_BGR2GRAY’ was not declared in this scope
1262 | cv::cvtColor(images[COLOR_QHD_RECT], images[MONO_QHD_RECT], CV_BGR2GRAY);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1107:45: error: ‘CV_RGBA2BGR’ was not declared in this scope
1107 | cv::cvtColor(tmp, images[COLOR_HD], CV_RGBA2BGR);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp: In member function ‘void Kinect2Bridge::processIrDepth(const cv::Mat&, std::vectorcv::Mat&, const std::vectorKinect2Bridge::Status&)’:
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1183:50: error: ‘CV_BGRA2BGR’ was not declared in this scope
1183 | cv::cvtColor(tmp, images[COLOR_SD_RECT], CV_BGRA2BGR);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1187:50: error: ‘CV_RGBA2BGR’ was not declared in this scope
1187 | cv::cvtColor(tmp, images[COLOR_SD_RECT], CV_RGBA2BGR);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp: In member function ‘void Kinect2Bridge::processColor(std::vectorcv::Mat&, const std::vectorKinect2Bridge::Status&)’:
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1250:55: error: ‘CV_BGR2GRAY’ was not declared in this scope
1250 | cv::cvtColor(images[COLOR_HD], images[MONO_HD], CV_BGR2GRAY);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1254:65: error: ‘CV_BGR2GRAY’ was not declared in this scope
1254 | cv::cvtColor(images[COLOR_HD_RECT], images[MONO_HD_RECT], CV_BGR2GRAY);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1258:57: error: ‘CV_BGR2GRAY’ was not declared in this scope
1258 | cv::cvtColor(images[COLOR_QHD], images[MONO_QHD], CV_BGR2GRAY);
| ^~~~~~~~~~~
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_bridge/src/kinect2_bridge.cpp:1262:67: error: ‘CV_BGR2GRAY’ was not declared in this scope
1262 | cv::cvtColor(images[COLOR_QHD_RECT], images[MONO_QHD_RECT], CV_BGR2GRAY);
| ^~~~~~~~~~~
make[2]: *** [iai_kinect2/kinect2_calibration/CMakeFiles/kinect2_calibration.dir/build.make:63: iai_kinect2/kinect2_calibration/CMakeFiles/kinect2_calibration.dir/src/kinect2_calibration.cpp.o] Errore 1
make[1]: *** [CMakeFiles/Makefile2:2392: iai_kinect2/kinect2_calibration/CMakeFiles/kinect2_calibration.dir/all] Errore 2
make[1]: *** Attesa per i processi non terminati....
make[2]: *** [iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge.dir/build.make:63: iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge.dir/src/kinect2_bridge.cpp.o] Errore 1
make[1]: *** [CMakeFiles/Makefile2:1042: iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge.dir/all] Errore 2
make[2]: *** [iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge_nodelet.dir/build.make:63: iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge_nodelet.dir/src/kinect2_bridge.cpp.o] Errore 1
make[1]: *** [CMakeFiles/Makefile2:1069: iai_kinect2/kinect2_bridge/CMakeFiles/kinect2_bridge_nodelet.dir/all] Errore 2
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_viewer/src/viewer.cpp: In member function ‘void Receiver::imageViewer()’:
/home/salvo/catkin_ws/src/iai_kinect2/kinect2_viewer/src/viewer.cpp:279:84: error: ‘CV_AA’ was not declared in this scope
279 | cv::putText(combined, oss.str(), pos, font, sizeText, colorText, lineText, CV_AA);
| ^~~~~
make[2]: *** [iai_kinect2/kinect2_viewer/CMakeFiles/kinect2_viewer.dir/build.make:63: iai_kinect2/kinect2_viewer/CMakeFiles/kinect2_viewer.dir/src/viewer.cpp.o] Errore 1
make[1]: *** [CMakeFiles/Makefile2:2473: iai_kinect2/kinect2_viewer/CMakeFiles/kinect2_viewer.dir/all] Errore 2
make: *** [Makefile:141: all] Errore 2
Invoking "make -j12 -l12" failed
The text was updated successfully, but these errors were encountered: