opencv4_lower_noetic_install - Extended-Object-Detection-ROS/wiki_english GitHub Wiki
Installing OpenCV 4.2.0 for ROS Melodic
Some of the package's greatest strengths require the use of OpenCV version 4.2.0, this concerns Tracking and the dnn module. However, ROS Melodic comes preinstalled with OpenCV 3.2.0, where these features are either not available or implemented in limited functionality and therefore not included in the Extended Object Detection package. Thus, under ROS Melodic, you can use a package without the listed functionality, or update the OpenCV version. However, in this case, the author of the package recommends thinking about switching to ROS Noetic, because did not find a good way to "lodge" two different versions of OpenCV on the same system, which in turn requires removing the old version of OpenCV. In addition, a complete rearrangement can (and most likely will) affect the operation of other packages.
If you do decide to go by a complete reshuffle of OpenCV.
TODO
WIP For Jetson Xavier
Install OpenCV 4.2.0 with script https://github.com/Extended-Object-Detection-ROS/nano_build_opencv Create symlink /usr/include/opencv --> /usr/include/opencv4
cd /usr/include
sudo ln -s opencv4/ opencv
Clone and build updated cv_bridge cv4 cv_bridge https://github.com/Extended-Object-Detection-ROS/cv_bridge_fixed_for_jetson