Open liang-grape opened 3 years ago
hello, I met the same issue, did u solve it?
Ok,I solve it. Modify the cvbridgeConfig.cmake file,change the SET_OPENCV_DIR to the path of opencv 3.x.x
Hi fjlv520,
I met same issue with Jetson Nano, image is Jetpack4.5.1. OpenCV 4.1.1 is pre-installed here. Do you install openCV3.x in parallel?
Thanks!
@zeta0707 Yes, I installed opencv3.4.1 additionally.
@fjlv520
I delete pre-installed opencv4.1.1, then installed opencv3.4.6 into /usr/local. I also built successfully.
Thanks!
same issue!
I want to work with yolov4 with opencv4, leggedrobotics branch support opencv4 but not yolov4 and Tossy0423 branch support yolov4 but not opencv4.
@fjlv520
I delete pre-installed opencv4.1.1, then installed opencv3.4.6 into /usr/local. I also built successfully.
Thanks!
Could you eloborate the steps. I install the opencv 3.4.1 using pip, however I couldn't locate it in /usr/include. Additionally I couldn't even locate "SET_OPENCV_DIR". Instead I found the include path as below
Am I doing something wrong? (I'm on noetic) I'm new to opencv, sorry for asking a silly doubt, Thanks for the help!
4.1 addi
Could you eloborate the steps, please? I am having the same issue.
@fettahyildizz I got it running by following the below steps. Just install OpenCV 3 and changed cvbridge opencv path.
@fettahyildizz Here are the detailed steps:
Installing OpenCV 3.4.6 (along with previous '4.5.3') https://learnopencv.com/install-opencv3-on-ubuntu/
cd /usr/include/
git clone https://github.com/opencv/opencv.git
cd opencv
git checkout 3.3.1
cd ..
cd opencv_contrib
git checkout 3.3.1
cd ..
cd opencv
mkdir build
cd build
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 WITH_QT=ON \
-D WITH_OPENGL=ON \
-D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..
Now lets check if we can import previous version of opencv i.e 4.5.3
python3
import cv2 cv2.version ⇒ Should output '4.5.3', if not and give the below error
ImportError: ERROR: recursion is detected during loading of "cv2" binary extensions. Check OpenCV installation.
Then run this: sudo pip3 install opencv-python --upgrade --force-reinstall
Now, Lets change opencv version in cv_bridge cd /opt/ros/noetic/share/cv_bridge/cmake code cv_bridgeConfig.cmake
@iamrajee wow you're a life saver. Thanks a lot for detailed explanations. I will try it on monday.
@iamrajee I will be using this package on Ros-Melodic therefore, I will run it on Python 2.7. I am going to change every "pip3" command to "pip" while following your steps.
A bit late but I found an easier fix was using
sudo apt -y --allow-downgrades install libopencv-dev=3.2.0+dfsg-4ubuntu0.1
to force downgrade my opencv version to 3.2 from 4.1. as mentioned here
Is there any way to get it work with OpenCV 4.x itself, like by adding -std=c++11
somewhere in CMakeLists.txt
as suggest here(1, 2). I tried adding below lines, but none of them helped.
add_definitions(-std=c++11)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
What is the root problem here? Could somebody elaborate? Thank you!
@iamrajee Did you solve the issue? I am having the same problem. Installed opencv 3.4 on jetson nano. Also running ros-melodic.
After a while I revisited this issue and finally able to build and run on ROS noetic + CUDA 12.2 + opencv4+ You can checkout my forked version of darknet_ros as branch opencv4 and clone to your catkin workspace. https://github.com/kyuhyong/yolov4-for-darknet_ros/tree/opencv4
When I catkin_make,
the error "/usr/include/opencv4/opencv2/core/cvdef.h:690:4: error: #error "OpenCV 4.x+ requires enabled C++11 support" occurs. I have tried all ways I can search online, but I cannot solve the problem.
Could you give some advice?
Thank you