In order to cater to and meet the modern market demand, we developed EasyCVR, a video platform that supports the access of multiple protocol devices. In the early stage, we laid the groundwork for EasyCVR in the video capability, including the pso control of the camera, voice intercom, alarm reporting and other functions. Now we step into the field of face recognition. At present, we are also testing the face recognition function of the video platform. If you are interested, you can read our previous blog to learn about it. Welcome to pay attention.
We use python AI recognition test, the specific way is real-time identification is the camera to the local computer, or directly to a picture of the pedestrian detection, based on the analysis of the data source code into the identification, see source = ‘0’, but this parameter is the local computer’s camera stream, and then to the pedestrian detection.
However, we need to modify this part. RTSP flow is used for AI pedestrian recognition. Next, we need to analyze the code to find the place that can be modified, or touch a parameter to modify the RTSP flow.
We have found where the video stream is sent in. The following is the code in the analysis to change it into RTSP stream and write the RTSP stream in order to achieve real-time analysis and realize the effect of pedestrian detection.
The source parameter is only used by LoadStreams and is passed in directly.
Source =[source] : =[source] : =[source] : =[source] : =[source] : =[source] : =[source] In traversal, OpencV is also used to open the camera stream of the local computer, and then open a thread for real-time pedestrian recognition.
The code used in OpencV cv2.VideoCapture function, from the Internet to find the use of this function that this function can be directly into the RTSP stream address, so the problem is much easier to solve. VideoCapture cv2.VideoCapture this function can pass RTSP address, so pass RTSP address try, find pass RTSP address is no problem.
As long as you modify the source parameter, the detection is finally realized: