You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to build cv_bridge in order to run OpenCV 4.2, Ubuntu 16.04 (ROS Kinetic) and python 2.7.
I will explain what I do for that.
I built it before with OpenCV 3.3.1 in order to use GPU and it was very fine and it is still working now. To best my knowledge, there is ros-kinetic-opencv3 , it is working only on CPU. I removed it using sudo apt remove ros-kinetic-opencv3
After removing, I just downloaded your here and put in my ~/catkin_ws/src/, then making ~/catkin_ws/catkin_make on my PC without any modifications. I think that I was lucky.
Now, I'd like use some advantage of OpenCV 4.2 that is not with older versions like OpenCV 3.3.1. Meanwhile, I can't update robot's system, it is Ubuntu 16.04.
So, I tried to build cv_bridge, all modifications as following:
I copied and pastedmodule_opencv3.cpp, then change its name to module_opencv4.cpp so that became three models 4, 3 and 2.cpp instead of two 3 and 2.cpp. Next ,Sreevan mentioned here some changes, I did like Sreevan:
In cv_bridge/src/module_opencv3.cpp change signature of two functions
3.1) UMatData* allocate(int dims0, const int* sizes, int type, void* data, size_t* step, int flags, UMatUsageFlags usageFlags) const
to
UMatData* allocate(int dims0, const int* sizes, int type, void* data, size_t* step, AccessFlag flags, UMatUsageFlags usageFlags) const
3.2) bool allocate(UMatData* u, int accessFlags, UMatUsageFlags usageFlags) const
to
bool allocate(UMatData* u, AccessFlag accessFlags, UMatUsageFlags usageFlags) const
Next, I went to this file ~/catkin_ws/src/vision_opencv/cv_bridge$ CMakeLists.txt and change it as:
from:
Hi @Algabri, I just came maintainer of this repo and I'm sorry this issue didn't get a response previously. As this is related to ROS Kinetic which has reached EOL, I'm going to close the issue. Please feel free to re-open it if the problem persists in the active distributions. Thanks!
I tried to build cv_bridge in order to run OpenCV 4.2, Ubuntu 16.04 (ROS Kinetic) and python 2.7.
I will explain what I do for that.
I built it before with OpenCV 3.3.1 in order to use GPU and it was very fine and it is still working now. To best my knowledge, there is
ros-kinetic-opencv3
, it is working only on CPU. I removed it usingsudo apt remove ros-kinetic-opencv3
After removing, I just downloaded your here and put in my ~/catkin_ws/src/, then making ~/catkin_ws/catkin_make on my PC without any modifications. I think that I was lucky.
Now, I'd like use some advantage of OpenCV 4.2 that is not with older versions like OpenCV 3.3.1. Meanwhile, I can't update robot's system, it is Ubuntu 16.04.
So, I tried to build cv_bridge, all modifications as following:
I copied and pasted
module_opencv3.cpp
, then change its name tomodule_opencv4.cpp
so that became three models 4, 3 and 2.cpp instead of two 3 and 2.cpp.Next , Sreevan mentioned here some changes, I did like Sreevan:
In cv_bridge/src/module_opencv3.cpp change signature of two functions
3.1) UMatData* allocate(int dims0, const int* sizes, int type, void* data, size_t* step, int flags, UMatUsageFlags usageFlags) const
to
UMatData* allocate(int dims0, const int* sizes, int type, void* data, size_t* step, AccessFlag flags, UMatUsageFlags usageFlags) const
3.2) bool allocate(UMatData* u, int accessFlags, UMatUsageFlags usageFlags) const
to
bool allocate(UMatData* u, AccessFlag accessFlags, UMatUsageFlags usageFlags) const
Next, I went to this file
~/catkin_ws/src/vision_opencv/cv_bridge$
CMakeLists.txt and change it as:from:
to:
Next, I went to this file
~/catkin_ws/src/vision_opencv/cv_bridge/src$ CMakeLists.txt
and change it as:from:
to
Next, I think this step is not important, I went to this file
~/catkin_ws/src/vision_opencv/cv_bridge$
package.xml and change any opencv3 to opencv4Finally,
~/catkin_ws$ catkin_make
everything was ok but when I run the code:
It runs by OpenCV 3.3.1
If I need to run it by OpenCV 4.2
I added those lines in first the code:
The output is:
What is wrong?
It is possible to run it by OpenCV or not?? If yes, it is easy or difficult??
I read some answer, someone said " it is impossible"
Please your opinions or any suggestions?
The text was updated successfully, but these errors were encountered: