Giter Site home page Giter Site logo

testplace's Introduction

opendlv-device-camera-opencv

OpenDLV Microservice to interface with OpenCV-accessible camera devices

Adjusting the maximum size of pages in bytes that can be locked in RAM by adding the following lines to /etc/security/limits.conf:

*    hard   memlock           unlimited
*    soft   memlock           unlimited

To use this microservice, your need to allow access to your X11 server:

xhost +

Next, you can start the streaming (omit --verbose to not display the window showing the raw image; the parameter ulimit specifies that maximum bytes to be locked in RAM and must match with the desired video resolution: Width * Height * BitsPerPixel/8):

docker run \
           --rm \
           -ti \
           --init \
           --device /dev/video0 \
           -v /tmp/.X11-unix:/tmp/.X11-unix \
           -e DISPLAY=$DISPLAY \
           -v /dev/shm:/dev/shm \
           --ulimit memlock=2359296:2359296 \
           producer:latest \
               --camera=/dev/video0 \
               --cid=111 \
               --name=camera0 \
               --width=1024 \
               --height=768 \
               --bpp=24 \
               --freq=5 \
               --verbose

The directory example contains a small program that demonstrates how to access the shared memory that is created from the previous microservice. You can build it as follows:

cd example
docker build -t consumer -f Dockerfile.amd64 .

Finally, you can run the example as follows (obviously, the parameters must match with the settings for producer; the parameter ulimit specifies that maximum bytes to be locked in RAM):

docker run \
           --rm \
           -ti \
           --init \
           -v /tmp/.X11-unix:/tmp/.X11-unix \
           -e DISPLAY=$DISPLAY \
           -v /dev/shm:/dev/shm \
           --ulimit memlock=2359296:2359296 \
           example \
               --cid=111 \
               --name=camera0 \
               --width=1024 \
               --height=768 \
               --bpp=24 \
               --verbose

Testplace

testplace's People

Contributors

jay-man avatar

Watchers

 avatar

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.