Yocto how to add a gstreamer plugin? - opencv

I'm trying to build a custom image for an i.MX6 board by using Yocto.
I want to add the plugin 'gstmotioncells' from Gstreamer OpenCV Plugins ( https://github.com/GStreamer/gst-plugins-bad/tree/master/ext/opencv )
to my build.
But I can't figure out how to add this plugin to my yocto build.
I tried some things but these have not worked.
Do I need to add something to my local.conf file or do I need to modify a .bb file?
After following the instructions of jku, I still got an error.
ERROR: esomimx6-sta-image-1.0-r0 do_rootfs: Unable to install packages. Command '/home/toon/yocto/sta/esomimx6/build_esom/tmp/sysroots/x86_64-linux/usr/bin/opkg --volatile-cache -f /home/toon/yocto/sta/esomimx6/build_esom/tmp/work/esomimx6micro-poky-linux-gnueabi/esomimx6-sta-image/1.0-r0/opkg.conf -o /home/toon/yocto/sta/esomimx6/build_esom/tmp/work/esomimx6micro-poky-linux-gnueabi/esomimx6-sta-image/1.0-r0/rootfs --force_postinstall --prefer-arch-to-version install fsl-alsa-plugins packagegroup-core-ssh-openssh libfreetype6 packagegroup-esom-qt5 cpufrequtils glib-networking libcairo2 openssh-sftp-server packagegroup-core-boot packagegroup-core-x11-base glibmm packagegroup-fsl-gstreamer1.0-full packagegroup-esom-tools-testapps alsa-state ruby packagegroup-fsl-gstreamer1.0 packagegroup-fsl-tools-gpu gstreamer1.0-plugins-bad-opencv packagegroup-fsl-tools-testapps packagegroup-core-tools-debug opkg packagegroup-base-extended libfontconfig1' returned 255:
Collected errors:
* opkg_prepare_url_for_install: Couldn't find anything to satisfy 'gstreamer1.0-plugins-bad-opencv'.
Do you know what is going wrong?

As a first step, you need to enable the opencv plugin in the gstreamer1.0-plugins-bad recipe. There's a packageconfig for that already so this should work in local.conf or your distro configuration:
PACKAGECONFIG_append_pn-gstreamer1.0-plugins-bad = " opencv"
(The space in front of the string is required)
This will make the recipe depend on opencv which is not in the oe-core layer. You will have to add meta-oe to your layers if it's not there already.
You'll also want to add the relevant packages to your image: Probably at least gstreamer1.0-plugins-bad-opencv. In production this would probably happen so that an application recipe that requires the opencv plugin would DEPEND on it. For testing you can just add
IMAGE_INSTALL_append = " gstreamer1.0-plugins-bad-opencv"
into your local.conf.

Related

Pybind11 - Failing in Travis / Virtualenv

My Pybind project seems to be compiling fine on my system, but when I perform unit testing on travis, it throws the following error:
-- Found PythonInterp: /opt/pyenv/shims/python3.7 (found version "1.4")
CMake Error at 3rdparty/pybind11/tools/FindPythonLibsNew.cmake:95 (message):
Python config failure:
pyenv: python3.7: command not found
The `python3.7' command exists in these Python versions:
3.7
3.7.1
This seems to be something to do with virtualenv which I have never used. I currently have no idea how to solve this issue, and given that its in a travis instance, i'm not sure how to recreate it on my system so I may fix it
What is happening in your case is that the wrong Python version is being used by travis.
For example, if you are using Ubuntu 16.04 (Xenial) in your .travis.yml configuration, you have to specify the version you want for Python when you call CMAKE.
For example, something like
cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$(python-config --prefix)/bin/python3.5 -DPYTHON_LIBRARY=$(python-config --prefix)/lib/libpython3.5m.so -DPYTHON_INCLUDE_DIR=$(python-config --prefix)/include/python3.5m ..
Other versions of Ubuntu will have different versions of Python.
References:
https://github.com/vgc/vgc/issues/42
https://github.com/pybind/pybind11/issues/99#issuecomment-207782425
just to add to Murilo's answer, you could use Miniconda as a workaround as well, and configure CMAKE in a similar way by just changing the paths to the ones in your Miniconda env. I ran into issues when using multiple jobs for different Ubuntu distributions (xenial and bionic), which had somewhat different paths to the python libraries and headers.
Here there's a link to a travis with miniconda snippet which you could use to setup miniconda along a travis build.
You can then use the following CMAKE configuration in your travis.yml file (note that the environment with name travis_env was created with python=3.6):
script:
# ...
- cmake -DCMAKE_BUILD_TYPE=Release -DPYTHON_EXECUTABLE=$HOME/miniconda/envs/travis_env/bin/python3.6 -DPYTHON_LIBRARY=$HOME/miniconda/envs/travis_env/lib/libpython3.6m.so -DPYTHON_INCLUDE_DIR=$HOME/miniconda/envs/travis_env/include/python3.6m ..
# ...

Cannot get Emscripten path, please specify it either by EMSCRIPTEN environment variable or --emscripten_dir option(opencv.js build error)

I am totally new for opencv.js.I have some problems on building opencv.js
I am using Windows 10.I follow below steps for setup opencv.js
https://docs.opencv.org/3.3.1/d4/da1/tutorial_js_setup.html
1-)First I used below link to download the Empscripten
https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html#sdk-installation-instructions
2-)And execute this line son command propmpt(in empscripten folder)
emsdk
emsdk_env.bat
After this Execution , Empscripten set the path
EMSDK = C:/Users/q/Desktop/web/opencv.js/emsdk-portable-64bit
EM_CONFIG = C:\Users\q\.emscripten
3-)Download phyton 3
4-)Clone opencv
git clone https://github.com/opencv/opencv.git
5-)Execute this code to build opencv.js but i get this error
python C:\Users\q\opencv\platforms\js\build_js.py C:\OpencvJS
Error:
Cannot get Emscripten path, please specify it either by EMSCRIPTEN environment variable or --emscripten_dir option.
The problem look like "EMPSCRÄ°PTEN cannot set the path properly and part 5 fail to execute".How can i solve this problem?
export EMSCRIPTEN=~/path_to_emsdk/emsdk/upstream/emscripten
on linux
i run
# Clone, pull, and build the latest "sdk" Emscripten environment
./emsdk install sdk-incoming-64bit
# Set the "incoming SDK" as the active version.
./emsdk activate sdk-incoming-64bit
then run
source ./emsdk_env.sh
emsdk require tool and sdk
this script helped me, you can have a try

kerl --with-wx doesn't create wxe_driver.so

kerl --with-wx doesn't create an erlang installation with wxe_driver.so. Should it? I'm trying to make an erlang build that will run observe, but still get:
ERROR: Could not find 'wxe_driver.so' in: /home/don/erlangs/17.4/lib/wx-1.3.2/priv
.kerlrc contains:
KERL_CONFIGURE_OPTIONS="--with-wx"
Erlang build procedure just skips some optional components build steps if build host system does not have all the required dependencies to build that components, even configure (or kerl) was told to make build with that components included
If you find yourself in a situation where Erlang, that was built from source, blames some module could not be loaded, you should check if it was built
In this particular case
Look for errors in a file named config.log under ~/.kerl. It should indicate what's missing.
To build wxe_driver you should have WX development libraries installed on your system. You have to refer to your system documentation to learn how to install them. In this case, since glu.h was missing, running sudo apt-get install build-essential libsdl1.2debian libsdl1.2-dev libgl1-mesa-dev libglu1-mesa-dev libsdl-image1.2 libsdl-image1.2-dev added the missing file.

ImageMagick Needs a Dependency That Doesn't Exist?

In attempting to install the latest ImageMagick (and devel) RPM from http://www.imagemagick.org/download/linux/CentOS/x86_64/ I receive this message
ImageMagick-libs = 6.8.5-8 is needed by ImageMagick-devel-6.8.5-8.x86_64
Confusingly, there is no ImageMagick-libs RPM listed, and searching has yet to yield a solution. Is there a way around this existential dependency?
Neither I nor Google know where ImageMagick-libs lives nor what it contains, but for posterity this gets things up and running on CentOS 5.8 (the distribution listed on imagemagick.org):
>: rpm -Uvh --nodeps ImageMagick-6.8.5-8.x86_64.rpm ImageMagick-devel-6.8.5-8.x86_64.rpm
>: ln -s /usr/include/ImageMagick-6 /usr/include/ImageMagick
The symbolic link was necessary for software relying on ImageMagick header files.
If someone were to stumble upon this, the ImageMagick-libs RPM are now downloadable from the link in the question.
I ran into the same thing when building the RPMs myself.
line 66 of the SRPM's included ImageMagick spec file includes:
Requires: %{name}-libs = %{version}-%{release}
I just commented out that line and the build completes; the resultant RPM satisfies the requirement cleaner. In sum, I believe it a bug in the SPEC file bundled in the SRPM. It isn't necessary for functionality even when building against php magickwand and similar finicky tools that require headers from ImageMagick.

How to do digital image processing using opencv on Eclipse

I am new to Digital Image Processing and want to do it using OpenCV on Eclipse. I just want to know how can i start doing it and how i can configure opencv and eclipse using CMAKE . Please suggest me some good tutorial.Also please help me with adding opencv include files and library in Eclipse.
I am using Eclipse Juno.
on Windows 7.
Thanks.
Your best bet is to begin with the OpenCV documentation. Their Getting Started tutorial should be your first stop. They have another strategy with a custom FindOpenCV.cmake file as documented here but I would suggest sticking with the strategy outlined in Getting Started.
In terms of eclipse, cmake generates IDE related metadata for you and Kitware does provide an eclipse CDT generator, documented here. Two important things to keep in mind. First cmake actually generates the eclipse metadata which you then import as an existing project. Second, the example they give is intended to work with Unix makefiles:
cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../certi_src
If you are using windows you'll want to choose an appropriate generator instead of "Unix Makefiles"

Resources