Using external opencv version - kinetic
I need to use OpenCV dnn for a ROS node. Since the default OpenCV version that comes with kinetic does not have support for all the functionality that I need, I installed OpenCV4. Then I did the following in the CMake to get it to work.
set(OpenCV_DIR "/usr/local/lib/")
FIND_PACKAGE(OpenCV 4 REQUIRED)
This works fine. Problem arises when I try to use some image related packages (which might be trying to use the ROS OpenCV).
In my node, next I need some image_geometry
functionalities. But when I put image_geometry
in the find_package
, it starts to give me compile errors starting from the message error: ‘dnn’ in namespace ‘cv’ does not name a type
. These are the same compile errors I get if I use the cv_bridge
instead of OpenCV4.
Does anybody have a workaround for this? Some way to point image_geometry
(or any other ROS package using OpenCV) to an OpenCV version other than the ROS OpenCV version.
I believe OpenCV is no different from other system dependencies in this case. See whether #q289264 helps.
Try running the following code at top:
@parzival This node is in
c++