Real-Time Video Transmission Based On Opencv - ADEEPT AWR Wheeled Robot Manual

4wd smart robot kit compatible with raspberry pi 4 3 model b+ b, opencv target tracking
Table of Contents

Advertisement

113
25 Real-time Video Transmission Based on
OpenCV
● This chapter introduces real-time video transmission, which can transmit the images collected by the
camera to other places in real time for displaying images or handing it to the host computer for machine vision
processing.
● The software functions of this tutorial are based on opencv, numpy, zmq (read Zero MQ) and base64
libraries. Before writing the code, you need to install these libraries.
pip3 install opencv-contrib-python numpy zmq pybase64
●In this tutorial, the hardware mainly uses a PC and a Raspberry Pi with a camera installed, because it
can introduce the installation methods of related libraries on the Windows platform and Linux platform at the
same time.
●OpenCV is an open source computer vision library. In the Linux system, you can enter in the terminal:
sudo apt-get install -y libopencv-dev python3-opencv
● In the windows system, you can install it by downloading the .whl file of opencv, or you can use the
following command in the terminal to install OpenCV:
pip3 install opencv-contrib-python
●NumPy is a basic software package for scientific calculations using Python. In Linux, install numpy by
typing sudo pip3 install numpy in the terminal.
● In Windows, install numpy by typing pip3 install numpy on the command line (cmd) (need to install
python3.x in advance).
●zmq and base64 are used for frame transmission and frame encoding and decoding respectively in this
project. In linux, enter sudo pip3 install zmq pybase64 to install, and in windows, enter pip3 install zmq
pybase64 to install.
●After installing the relevant libraries, let's explain the program of the video sending end. The RPiCam.py
python program is used to collect the pictures from the camera, and encode the collected pictures to the
receiving end of the video. So we put RPiCam.py into the Raspberry Pi and run it.
●RPiCam.py:
'''
First import the required libraries, the above has a specific introduction to these libraries
'''
import
cv2
import
zmq
import
base64
import
picamera
from
picamera.array
import
'''
Here we need to fill in the IP address of the video receiver (the IP address of the PC)
PiRGBArray

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AWR Adeept Wheeled Robot and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Picar-b

Table of Contents

Save PDF