Skip to content

JMUWRobotics/peak-cv-bridge

Repository files navigation

peak-cv-bridge

installing

Dependencies:

  • opencv
  • ids-peak
  • asio (libasio-dev)
  • optional: v4l2loopback (v4l2loopback-utils, v4l2loopback-dkms) for video4linux2 support in peakcvbridge-capture
$ cmake -Bbuild -Wno-dev -DCMAKE_BUILD_TYPE=Release
$ cmake --build build
# cmake --install build

This will install to /usr/local:

  • dynamic library libpeakcvbridge.so
  • header peakcvbridge.hpp
  • executables peakcvbridge-example, peakcvbridge-streamer
  • systemd service template [email protected] (to /etc/systemd/system)
  • example configuration file to /etc/peakcvbridge-streamers which can be used like systemctl start [email protected]. The number then refers to /etc/peakcvbridge-streamers/0.env.

using the library

Since the header depends on both ids-peak and opencv, you have to both include their headers and link to their libraries.

$ g++ ... -I/usr/include/opencv4 -I/usr/include/ids_peak-1.10.0 -lopencv_core -lids_peak -lpeakcvbridge

using peakcvbridge-streamer

This will start a websocket server that listens on the specified port which opens up the first IDS camera on the system upon connection of a client. Then, a client can send one of:

  • status: query the status of the server (e.g. idle, streaming, camera in use, ...)
  • start: start sending images encoded as specified by -c
  • stop: stop sending images as string messages.

It will not use the camera / stop using it when there are no clients connected, for other programs to be able to use it.

using peakcvbridge-capture

This will open up the first IDS camera connected to your device and spawn a cv::imshow window that shows the stream. See peak-webcam.sh for example usage with v4l2loopback.

using cctv-tui.py

experimental

This is a simple terminal application that can be used for connecting to multiple peakcvbridge-streamers. The dependencies are:

  • websockets
  • textual
  • numpy
  • opencv-python

You can either install these on your system and run python3 src/cctv-tui.py. Another option is using the cctv-tui-setup.sh script which will setup a virtual environment (given that python3, python3-venv and python3-pip is installed) in /opt/cctv with a script /opt/cctv/tui that instantiates the virtual environment and launches the application.

About

Use IDS cameras in OpenCV via peak for synchronized image streaming over a network

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published