-
Notifications
You must be signed in to change notification settings - Fork 1
opencv_contrib_noetic_install
OpenCV contrib is an add-on to OpenCV, not included in the version of the library that is came with ROS. However, this part contains a number of useful implementations, incl. detection using key points (methods SIFT, SURF, ORB, etc.).
To install this module, however, you have to reinstall the entire OpenCV (in any case, I have not found a reliable way to do otherwise). For this:
- Create a directory where the sources will be placed
cd
mkdir Libs
cd Libs
- Download OpenCV and OpenCV contrib
git clone https://github.com/opencv/opencv.git
git clone https://github.com/opencv/opencv_contrib.git
- Checkout in both repositories to version we need, for ROS Noetic this is 4.2.0
cd opencv_contrib
git checkout 4.2.0
cd ../opencv
git checkout 4.2.0
- Create build directory
mkdir build
cd build
- Configure Watch the parameters, OPENCV_EXTRA_MODULES_PATH must contain the correct path to the modules folder of the opencv_contrib package. See for CUDA build (in process).
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D WITH_TBB=ON -D WITH_V4L=ON -D OPENCV_EXTRA_MODULES_PATH=~/Libs/opencv_contrib/modules -D OPENCV_ENABLE_NONFREE=ON -D WITH_CUDA=OFF -D BUILD_EXAMPLES=ON ..
- If the configuration was successful, then we collect. Find out how many processes are available
nproc
Make with an indication of the number of available processes.
make -j<NUM PROC>
For example
make -j4
This is a rather lengthy operation. At its end, we carry out the final steps.
sudo make install
sudo sh -c 'echo "/usr/local/lib" >> /etc/ld.so.conf.d/opencv.conf'
sudo ldconfig
Then, to build Extended Object Detection based on OpenCV contrib, you need to replace the line in the CMakeLists.txt file located in the root of the repository
set(opencv_contrib OFF)
to
set(opencv_contrib ON)
And build the project. If the project has already been built before, then you may need to delete the collected files. The most reliable, but at the same time barbaric, way to do this is to delete the build and devel folders of your workspace and rebuild it entirely.
During assembly, this type of vornings may appear
runtime library [libopencv_calib3d.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in:
/usr/local/lib
Don't pay attention to them.
- Home
- ROS-interface
- Interacting with a package through a configuration file
- Common structure of the configuration file
-
Simple objects
- Clusterization
- Filtering
- Tracking
- Attributes
- HSVcolor
- HistColor
- HaarCascade
- Size
- Hough
- Dimension
- BasicMotion
- Aruco
- Feature
- Pose
- DNN
- QR
- QR_Zbar
- LogicAnd
- LogicNot
- LogicOr
- Blob
- Depth
- RoughDist
- Dist
- FaceDlib
- ExractedInfoId
- ExractedInfoString
- UnitTranslation
- SquareObjectDistance
- TorchYOLOv7Attribute
- TorchYOLOv7KeypointAttribute
- ROSSubcriberOpenPoseRaw
- DummyHumanPose
- Complex objects
- Install Guides
- Usage Guides
- Troubleshooting
- Developing