Real-time video capture based on USB camera of Dragonboard 410c development board

Video capture and display is the basis of many applications, especially in the process of DIY's own creativity, if you add real-time video capture and display, you can make your DIY become more advanced, before using C language and PC machine to make video When collecting, using C language or Java language, you need a lot of code to realize the whole acquisition and recording process. If you use the Dragonbaord 410c development board for development, your development will become very simple, even your own. I don't dare to think about sex. We only need a few simple codes to easily implement the entire video capture function.

First connect our dragonboard 410c development board according to the previous USB camera image acquisition mode, then we can prepare to develop and write code. The code language chosen here is still Python, which is the magic Python we used before. Python can make our code simpler. Of course, the performance is slightly inferior to C language, but relying on the powerful processing functions provided by our dragonbaord 410c, this performance is completely used when using simple video capture. I don't feel it, we will see that the live video we have collected can still be kept at a smooth speed.

Then we are ready to write the code:

At the beginning of the code, we import the cv2 library through the import statement. If the import fails, please install the cv2 library. The specific steps are as follows:

{

Sudo apt-get update -y

Sudo apt-get upgrade -y

Sudo apt-get install python-OpenCV -y

}/// Installation steps are not part of the code

Import cv2, sys

# Meanwhile we designed a small function here, write some text markup video information on the acquired video, here we define a container to describe the font

# Constants

DEVICE_NUMBER = 0

FONT_FACES = [

cv2.FONT_HERSHEY_SIMPLEX,

cv2.FONT_HERSHEY_PLAIN,

cv2.FONT_HERSHEY_DUPLEX,

cv2.FONT_HERSHEY_COMPLEX,

cv2.FONT_HERSHEY_TRIPLEX,

cv2.FONT_HERSHEY_COMPLEX_SMALL,

cv2.FONT_HERSHEY_SCRIPT_SIMPLEX,

cv2.FONT_HERSHEY_SCRIPT_COMPLEX

]

#initialize web camera

# Init webcam

Vc = cv2.VideoCapture(DEVICE_NUMBER)

# Check if the webcam init was successful

If vc.isOpened(): # try to get the first frame

Retval, frame = vc.read()

Else:

Sys.exit(1)

#Read camera data display

# If webcam read successful, loop indefinitely

While retval:

# Write some text onto the frame

Font_typeface = FONT_FACES[5]

Font_scale = 2

Font_color = (0,0,255)

Font_weight = 5

x = 0

y = 50

cv2.putText(frame, "[LIVE]", (x,y), font_typeface, font_scale, font_color, font_weight)

# Show the image on the screen

# http://docs.opencv.org/2.4/modules/highgui/doc/user_interface.html#imshow

Cv2.imshow("DB410c Workshop #3: Show Video", frame)

# Grab next frame from webcam

Retval, frame = vc.read()

# Set a wait for exit button, press this button to exit monitoring

# http://docs.opencv.org/2.4/modules/highgui/doc/user_interface.html#waitkey

If cv2.waitKey(1) == 27:

Break

The above is the entire python code that implements video capture. Here we save the code as vedio.py, and then run python vedio.py in the code file directory to start the USB camera to capture images in real time on the dragonbaord 410c. The effect is as follows: :

Smart board

The smart board is a teaching/conference equipment specially designed for school teaching, training school, high-efficiency meetings and other scenes. This smart tablet integrates large-screen high-definition display, windows system, Android system, TV system, electronic Interactive Whiteboard, audio equipment, cast screen. smart board for Education and Business are A multimedia teaching demonstration and operation platform with multiple functions.



Smart board series products have 55 inches, 65 inches, 70 inches, 75 inches, 86 inches, 98 inches, 100 inches, 110 inches and other sizes for users to choose from.

smart whiteboard,smat tablet,Smart touch screen,Smart interactive tablet,multi-media equipment,smart board cost,smart board with projector,smart board interactive

Jumei Video(Shenzhen)Co.,Ltd , https://www.jmsxdisplay.com