When SIFT algorithm is used for matching, an error is reported during compilation:
fatal error: opencv2/nonfree/nonfree.hpp: Not having that file or directory
#include <opencv2/nonfree/nonfree.hpp>
When you go online, you basically say to download opencv nonfree:
sudo apt-get update
sudo add-apt-repository --yes ppa:xqms/opencv-nonfree
sudo apt-get update
sudo apt-get install libopencv-nonfree-dev
As a result, a new error is reported when the second instruction is run:
sudo add-apt-repository --yes ppa:xqms/opencv-nonfree
Cannot add PPA: 'ppa:~xqms/ubuntu/opencv-nonfree'.
ERROR: '~xqms' user or team does not exist.
After careful review, it is found that the opencv2. X version is still very good to install under the Ubuntu system. You only need to install it through the above instructions
opencv-3.4.0/opencv_contrib-3.4.0/modules/xfeatures2d/include/opencv2/xfeatures2d/nonfree.hpp
Put #include < opencv2/nonfree/nonfree.hpp> Change to absolute path and solve it.
Read More:
- [Solved] VScode Run C++ File Error: fatal error:opencv2\core.hpp:No such file or diretory
- Opencv Can not Find opencv2/gpu/gpu.hpp [How to Solve]
- [Solved] Cmake compile opencv open-source project Error: but it set OpenCV_FOUND to FALSE so package “OpenCV” is considered to be…
- [Solved] src/delly.h:8:42: fatal error: boost/graph/adjacency_list.hpp: No such file or directory
- [Solved] Opencv Error: Error: Assertion failed (data) in cv::Mat::at, file … mat.inl.hpp, line 897(Accessed pixels of non-existent matrix)
- [Solved] ROS fatal error: alsa/asoundlib. h: There is no such directory or file
- [Solved] MSYS2+ fatal error: zlib.h: There is no such file or directory
- VSCode Unable to find custom header file directory: fatal error: no such file or directory
- CMake Error: The source directory “opencv Install Catalog“ does not appear to contain CMakeLists.txt.
- [Solved] fatal error: Eigen/Geometry: No such file or directory
- [Solved] Opencv Calls PB Model Error: cv2.error: OpenCV(4.2.0)…
- [Solved] 1.fatal error: NvInfer.h: No such file or directory
- [Solved] OpenCV error: #error “This header with legacy C API declarations has been removed from OpenCV.
- fatal error: libusb.h: No such file or directory [How to Solve]
- [Solved] fatal error: bits/libc-header-start.h: No such file or directory
- C++: fatal error: variant: No such file or directory
- [Solved] fatal error C1083: Cannot open included files: “stdafx.h”: No such file or directory
- SLAMBook2 in ch3 code run fatal error: Eigen/Core: No such file or directory
- [Solved] OpenCV Error: AttributeError: module ‘cv2‘ has no attribute ‘data‘
- [Solved] utils.c:33:18: fatal error: zlib.h: No such file or directory