3) Video acquisition and processing program
Video collection program was designed based on the
OpenCV basic function, OpenCV encapsulates the V4L
related operation.[7] First the program calls
cvCaptureFromCAM (index) function that belongs to
OpenCV to initialize. The index parameters are index
number for USB webcam, when only one USB cameras in
the system, the index is 0. cvSetCaptureProperty function
sets the camera resolution. Video data collection uses
OpenCV video to capture related operations. Firstly captures
USB webcam video data into the video structures through
cvGrabFrame function, secondly extracts a frame video data
from video structures via cvRetrieveFrame function then
processes video data to data block in network connectivity at
the same time starts network video transmission. Video
acquisition flow chart is as shown in figure 5.