can't find OpenCV package on RHEL 8 - opencv

Some sites say OpenCV could be installed on RHEL from the system repository:
sudo yum install opencv opencv-devel opencv-python
I run RHEL UBI container redhat/ubi8 and tried to install OpenCV - package is not found.
Then I install EPEL repos from https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm, same result. The only opencv-related package is libfreenect-opencv.
I understand I could compile OpenCV from the scratch, but I'd like to go with already compiled package.

You need to enable CodeReady Linux Builder Repository on RHEL 8:
subscription-manager repos --enable codeready-builder-for-rhel-8-x86_64-rpms

Related

I can't install ar_track_alvar on ROS Noetic

I download ROS Noetic but when I paste this line on Terminal, it can't found.
$ sudo apt-get install ros-indigo-ar-track-alvar
How can I solve this problem?
As I know, this package is avaliable for Noetic but I can't install it.
That command is trying to install the package for Indigo, not Noetic. Make sure your package names include the ROS distro you’re targeting.
sudo apt install ros-noetic-ar-track-alvar
Edit based on comment: It does appear there is a noetic build for this package, but it doesn't look like it's officially tracked on the ROS wiki. If it isn't supplied via apt you will need to build the package from source. The Noetic source can be found here on GitHub.

Raspberry Pi Open CV Install

I installed opencv-python and opencv-python-contrib
after i installed them I realized I wasn't supposed to
How do I uninstall it
Also, which one should I keep, to do facial recongnition with raspberry pi
Import cv2 didn't work when I tried to run a python file, I don't know why it is happening!
If you are using armbian or raspbian, you can uninstall packages with apt:
apt uninstall opencv-python opencv-python-contrib
I suggest that if you want to completely uninstall and remove configuration files use purge:
apt purge opencv-python opencv-python-contrib
and aftter that, you can uninstall packages that came with opencv:
apt autoremove --purge
If you need Extra modules: just keep opencv-python-contrib
Extra modules https://docs.opencv.org/4.x/index.html
pypi.org https://pypi.org/project/opencv-contrib-python/
Installation and Usage
If you have previous/other manually installed (= not installed via pip) version of OpenCV installed (e.g. cv2 module in the root of Python's site-packages), remove it before installation to avoid conflicts.
Make sure that your pip version is up-to-date (19.3 is the minimum supported version): pip install --upgrade pip. Check version with pip -V. For example Linux distributions ship usually with very old pip versions which cause a lot of unexpected problems especially with the manylinux format.
Select the correct package for your environment:
There are four different packages (see options 1, 2, 3 and 4 below) and you should SELECT ONLY ONE OF THEM. Do not install multiple different packages in the same environment. There is no plugin architecture: all the packages use the same namespace (cv2). If you installed multiple different packages in the same environment, uninstall them all with pip uninstall and reinstall only one package.
a. Packages for standard desktop environments (Windows, macOS, almost any GNU/Linux distribution)
Option 1 - Main modules package: pip install opencv-python
Option 2 - Full package (contains both main modules and contrib/extra modules): pip install opencv-contrib-python (check contrib/extra modules listing from OpenCV documentation)
b. Packages for server (headless) environments (such as Docker, cloud environments etc.), no GUI library dependencies
These packages are smaller than the two other packages above because they do not contain any GUI functionality (not compiled with Qt / other GUI components). This means that the packages avoid a heavy dependency chain to X11 libraries and you will have for example smaller Docker images as a result. You should always use these packages if you do not use cv2.imshow et al. or you are using some other package (such as PyQt) than OpenCV to create your GUI.
Option 3 - Headless main modules package: pip install opencv-python-headless
Option 4 - Headless full package (contains both main modules and contrib/extra modules): pip install opencv-contrib-python-headless (check contrib/extra modules listing from OpenCV documentation)

Pydrake has issue with python 3 point 9

Is Python3.9 supported?
I got this error with Python3.9:
File "/home/drake/drake/drake-build/install/lib/python3.6/site-packages/pydrake/common/__init__.py", line 8, in <module> from ._module_py import * ModuleNotFoundError: No module named 'pydrake.common._module_py'
There is no "python3.9" folder in .../install/lib.
I am running Ubuntu 18, and I am building Drake from source with latest github commit in master.
EDIT: Can someone explain how exactly Drake sets up pydrake?
It seems it detects the default Python installation somewhere automatically. I tried with a new installation, the default python was 3.8, and I also install:
apt install -y python3.10
Then I followed Drake python setup instructions.
git clone https://github.com/RobotLocomotion/drake.git
mkdir drake-build
cd drake-build
cmake ../drake
make -j
Pydrake only became available in 3.8. How to make it available for 3.10?
The current version of Pydrake (1.11.0) is officially supported on Ubuntu 20.04 with Python 3.8 and Ubuntu 22.04 with Python 3.10 when building from source. However, we recommend that most users use a binary release, and don't try to rebuild Drake from scratch themselves.
There are precompiled wheels at https://pypi.org/project/drake/ aka pip install drake; helpful installation details are at https://drake.mit.edu/pip.html. The wheels when run on Ubuntu support Python versions 3.8, 3.9, 3.10, or 3.11.
For example:
python3 -m venv env
env/bin/pip install --upgrade pip
env/bin/pip install drake
source env/bin/activate
For additional details, see https://drake.mit.edu/installation.html for full instructions and supported versions.
The last version of Pydrake to support Ubuntu 18.04 was v1.1.0 (released in March of 2022). If you need a newer version of Pydrake, you'll need to use a newer version of Ubuntu.

Docker - centos:7 kernel-header 3.10.0 vulnerabilities -> what to do?

My client uses a Docker images that has a base image of centos:7 from DockerHub. I noticed that Google Cloud Container registry flagged my latest built images with 17 vulnerabilities that all target the kernel-headers package from CentOs, version 3.10.0.
What are my options ?
Can I just upgrade this package or the kernel while staying on CentOs 7 or do I need to upgrade to version 8 ?
With an upgrade to version 8, are there specific breaking updates I should keep an eye on ?
Thank you guys
Update : We are using hdf5, hdf5-devel, devtoolset-7-gcc-c++ and openmpi packages to run some simulations. Removing the kernel-headers tries to remove devtoolset-7-gcc, glibc-devel and glibc-headers packages. I will do some testing without those packages.
yum install -y kernel-headers --enablerepo=centos-kernel

How to setup ROS environment variable on Ubuntu 20.04?

I tried following this guide to install ROS, but even after adding ROS source.list and its key
sudo apt install ros-melodic-desktop-full
gave error.
E: Unable to locate package ros-melodic-desktop-full
Then I ran this command
sudo apt search ros
to see if any such package exists. I couldn't find ros-melodic-desktop-full but I found another similar package ros-desktop-full.
So I installed it instead. The installation went smooth without giving any errors.
Next step in the guide is to set-up ROS environment variable, but I have no such directory
/opt/ros
So how do I setup the environment variable?
P.S.
I also installed some tools and dependencies with this command
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
and initialized rosdep
sudo rosdep init
rosdep update
The ros-desktop-full package you installed is part of the official Ubuntu release.
ROS Melodic (and in the future, Noetic) is published by the OSRF in a separate repository (packages.ros.org). These packages install to /opt/ros/. However, some ROS packages have also been ported to Debian, which is how they found their way to Ubuntu (which derives from Debian).
The Debian packages are fully functional, but they do not install to /opt/ros. Instead, everything is integrated in the operating system itself. This means that you need to set up your personal workspace slightly differently.
Given that most tutorials assume that you use the OSRF packages, I suggest you either wait for the Noetic release (scheduled for the end of May 2020), then install ros-noetic-desktop-full, or downgrade to Ubuntu 18.04 LTS to use ROS Melodic.
From the documentation here, melodic is only supported on Ubuntu 18.04. The ROS version targeting Focal (20.04) is Noetic, but that one has not been released yet (see Distributions). I'm not sure what ROS version Ubuntu packages (the ros-desktop-full one you installed), but I was not successful in using it.
If you really do want to use Ubuntu 20.04, then I think your best option currently is to compile from source. Last time I checked the precompiled debs for Noetic are not yet available at http://packages.ros.org/ros/ubuntu (you can track release progress at github issue 21513). No idea if compiling Noetic from source is easy or hard, but I was able to compile ROS2 foxy from source without too much trouble though.

Resources