Git Product home page Git Product logo

install-opencv-on-friendlycore's Introduction

Installing OpenCV 4.2.0 on FriendlyCore/FriendlyDesktop

The easiest way to install it is to run FriendlyELEC's script.
Here are the packages and utilities your system will have after you follow the instructions in this tutorial:

  • Qt 5.10.0 version of the HighGUI module (Better 2D window interface with zoom, image saving capabilities, etc)
  • C++ interface and examples
  • C interface and examples
  • Python 3.6+ interface and examples

Currently supported boards

  • RK3399
    NanoPC T4
    NanoPC M4
    NanoPC NEO4
    Som-RK3399

If you are using the s5p4418/s5p6818 development board, please checkout to the "s5pxx18" branch.

Installation

Note: OpenCV has been pre-installed in FriendlyCore/FriendlyDesktop (Version after 201905) and does not require manual installation.
Please download the latest FriendlyCore/FriendlyDesktop Image file from the following URL: http://download.friendlyarm.com

To make it easy to test python3 examples, you may copy cv-env.sh to the system directory,run the commands below:

git clone https://github.com/friendlyarm/install-opencv-on-friendlycore
cd install-opencv-on-friendlycore
cp examples/py/cv-env.sh /usr/bin/

Test out the OpenCV 4.2.0 and Python3 install

Run the commands below:

cd ~/install-opencv-on-friendlycore/examples/py/
. cv-env.sh
python ver.py

Will display:

4.2.0

it will activate a virtualenv, if you want to switch projects or otherwise leave your virtualenv, simply run:

deactivate 

Test python sample included in OpenCV 4.2.0: turing

image

. ~/install-opencv-on-friendlycore/cv-env.sh
. setqt5env
cd /usr/local/share/opencv4/samples/python
python turing.py

Build Qt5 MIPI-Camera example

image

Note: To run this demo you will need a camera(ov13850/ov4689/logitech c920 pro) and a display connected.
Run the commands below:

cd ~/install-opencv-on-friendlycore/examples/qt5/mipi-camera-videoprocessor/
qmake-qt5 .
make -j4

Run on FriendlyDesktop:

su pi
. setqt5env
export DISPLAY=:0.0
./mipi-camera-videoprocessor

Run on FriendlyCore:

./run-on-friendlycore.sh

Python: Stereo match example

image

Run the commands below:

cd ~/install-opencv-on-friendlycore/examples/py/single-camera-python-demo/
./run.sh

Python: Test single camera example

Note: To run this demo you will need a camera(ov13850/ov4689/logitech c920 pro) and a display connected.
Run the commands below:

cd ~/install-opencv-on-friendlycore/examples/py/single-camera-python-demo/
./run.sh

Python: Test dual camera example

Note: To run this demo you will need two cameras(ov13850/ov4689/logitech c920 pro) and a display connected.
Run the commands below:

cd ~/install-opencv-on-friendlycore/examples/py/dual-camera-python-demo/
./run.sh

C++: Test UVC camera example

image

Note: To run this demo you will need a usb camera(logitech c920 pro) and a display connected.
Build and run the commands below:

git clone https://github.com/friendlyarm/rk3399-opencv-uvccamera-cpp-demo.git
cd rk3399-opencv-uvccamera-cpp-demo
mkdir build
cd build
cmake ..
make
su pi
export DISPLAY=:0.0
. setqt5env
./opencamera

install-opencv-on-friendlycore's People

Contributors

friendlyarm avatar lawrencetg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

install-opencv-on-friendlycore's Issues

dependencies broken

hi,
Dependencies seems to be broken after apt-get upgrade :

#./mipi-camera-videoprocessor 
#./mipi-camera-videoprocessor: symbol lookup error: /usr/local/Trolltech/Qt-5.10.0-rk64one/plugins/egldeviceintegrations/libqeglfs-kms-integration.so: undefined symbol: gbm_create_device

error when videocapture from gstreamer

when I running a demo script to capture rtsp stream using cv2.VideoCapture() in python on the fire3 as following:

if name == "main":
print("OpenCV version: {}".format(cv2.version))
gst_str = "rtspsrc location=rtsp://192.168.0.101:554/Streaming/Channels/101 protocols=GST_RTSP_LOWER_TRANS_TCP ! rtph264depay ! h264parse ! nxvideodec ! video/x-raw, width=1280, height=720, format=(string)BGRx ! appsink"
cap=cv2.VideoCapture(gst_str, cv2.CAP_GSTREAMER)

the error occurred and the output recorded as,

OpenCV version: 3.4.2-dev
mime type = video/x-h264
NumSps = 1, NumPps = 1, type = avcC type
node found for device nx-vpu-dec: /dev/video15
<<<<<<<<<< InitializeCodaVpu(Min=7, 1280x720) (ret = 0) >>>>>>>>>

(python:1011): GStreamer-CRITICAL **: gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed

Installing snap

I am trying to use snap on friendlycore OS on my NanoPi NEO.
I have install snapd with the commend sudo apt install snapd.

In the installation I get the following errors:

md5sum: /etc/apparmor.d/usr.lib.snapd.snap-confine: No such file or directory
snapd.failure.service is a disabled or a static unit, not starting it.
snapd.snap-repair.service is a disabled or a static unit, not starting it.
Update rpimonitor Packages Status
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
W: Could not lock the cache file; this usually means that dpkg or another apt tool is already installing packages. Opening in read-only mode; any changes you make to the states of packages will NOT be preserved!

And then it recognize the snap commend but when I run sudo snap install hello-world I get the following error:

error: system does not fully support snapd: cannot mount squashfs image using "squashfs": mount:
/tmp/sanity-mountpoint-573191352: mount failed: Unknown error -1

This OS is based on Ubuntu core so I was expecting it will support snap, It would be nice if you will add the support out of the box.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.