A gate traffic behavior recognition and control method combining target detection and binocular vision
By integrating target detection and binocular vision technology on the gate, the height of passengers and luggage can be accurately identified, which solves the problem of insufficient traffic behavior recognition in the existing technology, improves the intelligence and safety of the gate, and prevents people from being pinched. Property accident.
Patent Information
- Application Number
- CN202111030993.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2020-12-14
- Filing Date
- 2021-09-03
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2041-09-03
AI Technical Summary
Existing gate traffic control technology is difficult to accurately identify passenger traffic behaviors, especially distinguishing between adults and children, baggage and passengers, and cannot effectively prevent accidents involving people and objects.
Combining target detection and binocular vision technology, by installing a binocular camera on the top of the gate, using the calibration toolbox to obtain camera parameters, perform stereo matching and target detection, calculate parallax information to determine the target height, analyze traffic behavior and control the gate.
It improves the intelligence level and traffic safety of the gate, accurately identifies passengers and luggage, prevents people and objects from being pinched, and improves the passenger experience and the safe operation of rail transit.
Smart Images

Figure CN113870356B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent urban rail transit, and in particular to a gate passage behavior recognition and control method combining target detection and binocular vision. Background Art
[0002] With the development of urban rail transit, more and more urban people choose to travel by subway. As a necessary access control channel, the gate plays an important role in rail transit. In the existing gate access control technology, 16 pairs of infrared sensors are mainly used to judge the passenger's passage behavior, and the passenger's passage status is judged by the occlusion of the infrared sensors. This passage logic judgment method cannot effectively identify some passage logics, such as the difference between adults carrying children and tailgating, the behavior of drilling down and jumping up, and the difference between luggage and passengers. In order to more accurately identify the behavior of passengers passing, target detection technology can be introduced to accurately identify passengers and luggage targets, and binocular vision technology can be used to accurately calculate the height of passengers and the size of luggage. According to the results of target detection and binocular vision, the passenger's passage logic can be judged, which can effectively improve the intelligence level of gates and improve passage efficiency and safety. Summary of the invention
[0003] The purpose of the present invention is to provide a gate machine traffic behavior recognition and control method combining target detection and binocular vision to solve the problem that the current gate machine cannot fully recognize the passenger traffic behavior.
[0004] The technical solution to achieve the purpose of the present invention is: a gate machine traffic behavior recognition and control method combining target detection and binocular vision, comprising the following steps:
[0005] Step 1: Install a binocular camera on the top of the gate;
[0006] Step 2: Make a calibration plate and use a binocular camera to collect pictures of the calibration plate from multiple angles. Use the MATLAB calibration toolbox to perform single-target calibration on the pictures collected by the left and right cameras to obtain the intrinsic parameter matrices of the left and right cameras.
[0007] Step 3: For the intrinsic parameter matrix results obtained by single-target calibration of the left and right cameras in step 2, use the MATLAB calibration toolbox to perform stereo calibration and alignment to obtain the camera's extrinsic parameter matrix;
[0008] Step 4: Use the stereo matching algorithm to match the left and right images captured by the camera to generate the corresponding disparity map;
[0009] Step 5: Collect multiple pictures of pedestrians and luggage from a bird's-eye view, annotate them and make them into a data set. Use the target detection model for training. Use the trained target detection model to detect targets in the area captured by the camera to obtain the location information of all pedestrians and luggage targets in the area.
[0010] Step 6: Pass the detected target center point coordinates into the disparity map to obtain the corresponding disparity information, and use the disparity information and distance conversion formula to convert the disparity information into the distance between the target and the camera, and subtract the distance between the target and the camera from the height of the camera to obtain the actual height of the target;
[0011] Step 7: Continuously acquire multiple frames using the target position information obtained in step 5 and the target height information obtained in step 6, analyze the position information of each target, the position relationship between targets, and the height information of pedestrians, and identify the pedestrian's passing behavior;
[0012] Step 8: Send the result of the traffic behavior judgment to the gate machine, which will generate corresponding control. For normal traffic behavior, the real-time coordinate positions of pedestrians and objects are used to prevent pedestrians or luggage from being clamped. For abnormal traffic behavior, the corresponding sound and light alarm information is played.
[0013] Furthermore, in step 1, the binocular cameras to be installed must be facing the gate, and the binocular cameras must be parallel to each other and on the same horizontal line.
[0014] Furthermore, in step 2, the calibration board used is a black and white chessboard. When the binocular camera collects the calibration board images from multiple angles, the binocular camera is required to be fixed and the camera cannot be rotated at will after the images are collected.
[0015] Furthermore, in step 4, the stereo matching algorithm used is the BM local stereo matching algorithm.
[0016] Furthermore, in step 5, the deep learning framework used for training is Caffe, and the target detection model used is modified based on the mobilenet-yolov3 target detection model as follows:
[0017] The final output branch is reduced from 3 feature map outputs (52×52, 26×26, 13×13) to a feature map output of only 13×13, and BN layer and Scale layer are added after each layer of convolution and separable convolution. For the network structure of the modified target detection model, the network input first passes through a structure of one convolution + BN layer + Scale layer + ReLu layer, and then passes through a 14-layer deep separable convolution + BN layer + Scale layer + ReLu layer structure, and finally connects a full convolution layer to obtain the network output.
[0018] Furthermore, in step 6, the disparity information is converted into the distance between the target and the camera, and the calculation formula is:
[0019] depth = (f*baseline) / disp
[0020] Among them, depth represents distance, f represents normalized focal length, baseline is the distance between the optical centers of the two cameras, called baseline distance, which is determined by the physical position of the camera installation, and disp is the pixel value of the corresponding coordinate point in the disparity map, that is, the disparity information.
[0021] Furthermore, the pedestrian traffic behavior judgment logic in step 7 is shown in Table 1:
[0022] Table 1 Pedestrian traffic behavior judgment logic table
[0023]
[0024]
[0025] The binocular ranging module of the determination method in Table 1 obtains the disparity information of the corresponding position by passing the center point of the detected pedestrian position, that is, the pedestrian's head position coordinates, into the corresponding disparity map, and obtains the distance between the pedestrian's head and the camera according to the conversion formula between the disparity information and the distance. Then, the height of the pedestrian is obtained by subtracting the distance between the pedestrian's head and the camera from the installation height of the camera, and the height is used to distinguish whether the pedestrian is an adult or a child.
[0026] A gate machine traffic behavior recognition and control system combining target detection and binocular vision, based on any of the methods described in one of the items, completes the gate machine traffic behavior recognition and control combining target detection and binocular vision.
[0027] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any of the methods described in one of the above methods is implemented to complete gate passage behavior recognition and control combining target detection with binocular vision.
[0028] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements any of the methods described above, completing gate passage behavior recognition and control combining target detection with binocular vision.
[0029] Compared with the prior art, the present invention has the following significant advantages: by adding target detection and binocular vision equipment to the existing gate, the target detection algorithm can be used to accurately identify the attributes of the target and determine the position information, and binocular vision can be used to judge the height of pedestrians. Combining the target detection and binocular vision methods, the logic of passengers passing through the gate can be effectively judged, and then whether the passage behavior is normal, so as to control the gate to prevent people and objects from being pinched, and generate sound and light alarms for abnormal passage behavior to remind passengers and staff, which is beneficial to improving the safety of the gate and the passengers' passage experience, and is beneficial to assisting the safe operation and management of rail transit. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a schematic diagram of the device structure of the present invention.
[0031] Figure 2 It is a flow chart of the target detection and recognition method in the present invention. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0033] A method for gate traffic behavior recognition and control combining target detection and binocular vision, comprising the following steps:
[0034] Step 1: Install binocular vision equipment on the top of the gate.
[0035] The binocular cameras must be installed facing the gate and parallel to each other and on the same horizontal line.
[0036] Step 2: Make a calibration plate and use a binocular camera to collect images of the calibration plate from multiple angles. Use the MATLAB calibration toolbox to perform single-target calibration on the images collected by the left and right cameras to obtain the intrinsic parameter matrices of the left and right cameras.
[0037] The calibration board used is a black and white chessboard. When the binocular camera collects images of the calibration board from multiple angles, the binocular camera is required to be fixed and cannot be rotated at will after the images are collected.
[0038] Step 3: For the intrinsic parameter matrix results obtained by single-target calibration of the left and right cameras in step 2, use the MATLAB calibration toolbox to perform stereo calibration and alignment to obtain the camera's extrinsic parameter matrix.
[0039] Step 4: Use a stereo matching algorithm to match the left and right images captured by the camera to generate a corresponding disparity map.
[0040] The stereo matching algorithm used is the BM local stereo matching algorithm.
[0041] Step 5: Collect multiple target images containing pedestrians and luggage from a bird's-eye view, annotate them and make them into a data set. Use the improved target detection model for training. Use the trained improved target detection model to perform target detection in the area captured by the camera, and detect and obtain the target location information of all pedestrians and luggage in the area.
[0042] After collecting multiple target images containing pedestrians and luggage from a bird's-eye view, a data set was created with a ratio of 8:2 between the training set and the test set. The deep learning framework used for training was Caffe, and the target detection model used was modified based on the mobilenet-yolov3 target detection model. The modifications are as follows:
[0043] The final output branch is reduced from 3 feature map outputs (52×52, 26×26, 13×13) to only 13×13 feature map output, and BN layer and Scale layer are added after each convolution and separable convolution layer. The network structure of the modified target detection model is that the input of the network first passes through a layer of convolution + BN layer + Scale layer + ReLu layer structure, then passes through 14 layers of deep separable convolution + BN layer + Scale layer + ReLu layer structure, and finally connects a full convolution layer to get the network output.
[0044] Step 6: Pass the detected target center point coordinates into the disparity map to obtain the corresponding disparity information, and use the disparity information and distance conversion formula to convert the disparity information into the distance between the target and the camera. Subtract the distance between the target and the camera from the height of the camera to get the actual height of the target.
[0045] The parallax information is converted into the distance between the target and the camera. The calculation formula is:
[0046] depth = (f*baseline) / disp
[0047] Among them, depth represents distance, f represents normalized focal length, baseline is the distance between the optical centers of the two cameras, called baseline distance, which is determined by the physical position of the camera installation, and disp is the pixel value of the corresponding coordinate point in the disparity map, that is, the disparity information.
[0048] Step 7: Continuously obtain multiple frames using the target position information obtained in step 5 and the target height information obtained in step 6, analyze the position information of each target, the position relationship between targets, and the height information of pedestrians, and determine the pedestrian's passing behavior.
[0049] The pedestrian behavior judgment logic is shown in Table 1.
[0050] Table 1 Pedestrian traffic behavior judgment logic table
[0051]
[0052] The binocular ranging module of the determination method in Table 1 obtains the disparity information of the corresponding position by passing the center point of the detected pedestrian position, that is, the pedestrian's head position coordinates, into the corresponding disparity map, and obtains the distance between the pedestrian's head and the camera according to the conversion formula between the disparity information and the distance. Then, the height of the pedestrian can be obtained by subtracting the distance between the pedestrian's head and the camera from the installation height of the camera, and the height is used to distinguish whether the pedestrian is an adult or a child.
[0053] Step 8: Send the result of the traffic behavior judgment to the gate machine, which will generate corresponding control. For normal traffic behavior, the real-time coordinate positions of pedestrians and objects are used to prevent pedestrians or luggage from being clamped. For abnormal traffic behavior, the corresponding sound and light alarm information is played.
[0054] The present invention also proposes a gate machine traffic behavior recognition and control system that combines target detection and binocular vision. Based on any of the methods described in one of the items, the gate machine traffic behavior recognition and control that combines target detection and binocular vision are completed.
[0055] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, any of the methods described in one of the above methods is implemented to complete gate passage behavior recognition and control combining target detection with binocular vision.
[0056] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements any of the methods described above, completing gate passage behavior recognition and control combining target detection with binocular vision.
[0057] Example
[0058] In order to verify the effectiveness of the solution of the present invention, the following simulation experiment is carried out.
[0059] A gate traffic behavior recognition and control method combining target detection and binocular vision is proposed. A binocular vision device is installed on the top of the gate, and the calibration plate image collected by the binocular camera is calibrated through the matlab toolbox to obtain the internal parameter matrix and external parameter matrix required for binocular ranging. Then, the disparity map is obtained through the binocular vision stereo matching algorithm. The trained target detection model is used to detect pedestrians and baggage targets within the field of view. Then, the corresponding disparity information is obtained by passing the center point coordinates of the detected target position into the disparity map, and then the target distance camera is obtained according to the conversion formula between the disparity information and the distance. The actual height of the target can be obtained by subtracting the distance of the target from the camera from the installation height of the camera. The height of the pedestrian is used to distinguish whether it is an adult or a child, and the height of the luggage is used to distinguish whether it is a large piece of luggage or a small piece of luggage. The actual position relationship between the targets is calculated according to the corresponding proportion using the target frame detected by the camera and the size of the field of view captured by the camera. The pedestrian passage logic is determined by combining the coordinate position relationship and attribute information of multiple consecutive frames of pedestrians and luggage targets, and the gate door or scissor door is controlled according to the passage behavior, and sound and light alarm information is generated for abnormal passage behavior. The specific steps are as follows:
[0060] Step 1: Install the binocular vision device on the top of the gate. The installation method is as follows: Figure 1 As shown. Add a metal bracket next to the gate, install the binocular vision device just above the gate, and ensure that the two cameras of the binocular camera are parallel to each other. In this embodiment, the binocular vision device has a built-in HiSilicon 3559C chip as a binocular vision and target detection computing chip.
[0061] Step 2: Use the black and white checkerboard calibration plate to collect calibration images at multiple angles, and use the MATLAB calibration toolbox to perform single-target calibration on the left and right cameras respectively to obtain the intrinsic parameter matrices of the left and right cameras.
[0062] Step 3: After calibrating the left and right cameras, the intrinsic parameter matrix results are obtained and then stereo calibration and alignment are performed using the MATLAB calibration toolbox to obtain the camera's extrinsic parameter matrix.
[0063] Step 4: Use a stereo matching algorithm to match the left and right images captured by the binocular camera to generate a disparity map corresponding to each frame. This embodiment uses the DPU module built into the HiSilicon 3559C chip to perform binocular vision matching to obtain a disparity map.
[0064] Step 5: Collect multiple target images containing pedestrians and luggage from top view angles, annotate them to form a data set, use the improved target detection model for training, use the trained improved target detection model to detect the target area in the area photographed by the camera, and detect and obtain the target position information of all pedestrians and luggage in the area. In this embodiment, the collected images are used to make a data set in a ratio of 8:2 for training set: verification set, and trained in the deep learning framework caffe.
[0065] Step 6: Perform target detection on each frame of the image, obtain the coordinate information of the detected target area, and pass the coordinates of the center point of the detected target into the disparity map to obtain the corresponding disparity information, and use the conversion formula between disparity information and distance to convert the disparity information into the distance of the target from the camera. The distance calculation formula is:
[0066] depth = (f*baseline) / disp
[0067] Among them, depth represents distance, f represents normalized focal length, baseline is the distance between the optical centers of the two cameras, called baseline distance, which is determined by the physical position of the camera installation, and disp is the pixel value of each coordinate point in the disparity map, that is, the disparity information.
[0068] Step 7: Subtract the distance between the target and the camera obtained in step 6 from the height of the camera installation to get the height of the target. The height of the pedestrian is used to determine whether the pedestrian is an adult or a child. The height of the luggage is used to distinguish whether it is a large piece of luggage or a small piece of luggage. The target position information obtained by the target detection module in step 5 is used to determine the positional relationship between pedestrians and pedestrians, and pedestrians and luggage. The pedestrian's passing behavior is determined by combining multiple frames of information.
[0069] Step 8: Send the result of the traffic behavior judgment to the gate, and the gate will generate corresponding control. For normal traffic behavior, the real-time coordinate positions of pedestrians and objects are used to prevent pedestrians or luggage from being clamped. For abnormal traffic behavior, the corresponding sound and light alarm information is played. In this embodiment, the binocular vision device and the gate adopt RS232 serial port communication.
[0070] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0071] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A gate traffic behavior recognition and control method combining target detection and binocular vision, It is characterized in that The following steps are involved: Step 1: Install a binocular camera on the top of the gate; Step 2: Make a calibration plate and use a binocular camera to collect pictures of the calibration plate from multiple angles. Use the MATLAB calibration toolbox to perform single-target calibration on the pictures collected by the left and right cameras to obtain the intrinsic parameter matrices of the left and right cameras. Step 3: For the intrinsic parameter matrix results obtained by single-target calibration of the left and right cameras in step 2, use the MATLAB calibration toolbox to perform stereo calibration and alignment to obtain the extrinsic parameter matrix of the camera; Step 4: Use the stereo matching algorithm to match the left and right images captured by the camera to generate the corresponding disparity map; Step 5: Collect multiple pictures of pedestrians and luggage from a bird's-eye view, annotate them and make them into a data set. Use the target detection model for training. Use the trained target detection model to perform target detection in the area captured by the camera to obtain the location information of all pedestrians and luggage in the area. Step 6: The detected target center point coordinates are passed into the disparity map to obtain the corresponding disparity information, and the disparity information is converted into the distance of the target from the camera using the conversion formula of disparity information and distance, and the actual height of the target is obtained by subtracting the distance of the target from the camera from the height of the camera; Step 7: Continuously acquire multiple frames using the target position information obtained in step 5 and the target height information obtained in step 6, analyze the position information of each target, the position relationship between targets, and the height information of pedestrians, and identify the pedestrian's passing behavior; Step 8: Send the result of the traffic behavior judgment to the gate machine, which will generate corresponding control. For normal traffic behavior, the real-time coordinate positions of pedestrians and objects are used to prevent pedestrians or luggage from being clamped. For abnormal traffic behavior, the corresponding sound and light alarm information is played.
2. The method for identifying and controlling gate traffic behavior by combining target detection and binocular vision as claimed in claim 1, It is characterized in that In step 1, the binocular cameras to be installed must be facing the gate, and the binocular cameras must be parallel to each other and on the same horizontal line.
3. The method for gate traffic behavior recognition and control combining target detection and binocular vision as claimed in claim 1, It is characterized in that In step 2, the calibration board used is a black and white chessboard. When the binocular camera collects images of the calibration board from multiple angles, the binocular camera is required to be fixed and cannot be rotated at will after the image is collected.
4. The method for gate traffic behavior recognition and control combining target detection and binocular vision as claimed in claim 1, It is characterized in that In step 4, the stereo matching algorithm used is the BM local stereo matching algorithm.
5. The method for gate traffic behavior recognition and control combining target detection and binocular vision as claimed in claim 1, It is characterized in that In step 5, the deep learning framework used for training is Caffe, and the target detection model used is modified based on the mobilenet-yolov3 target detection model as follows: The final output branch is reduced from 3 feature map outputs (52×52, 26×26, 13×13) to a feature map output of only 13×13, and BN layer and Scale layer are added after each layer of convolution and separable convolution. For the network structure of the modified target detection model, the network input first passes through a structure of one convolution + BN layer + Scale layer + ReLu layer, and then passes through a 14-layer deep separable convolution + BN layer + Scale layer + ReLu layer structure, and finally connects a full convolution layer to obtain the network output.
6. The method for gate traffic behavior recognition and control combining target detection and binocular vision as claimed in claim 1, It is characterized in that In step 6, the disparity information is converted into the distance between the target and the camera, and the calculation formula is: depth = (f*baseline) / disp Among them, depth represents distance, f represents normalized focal length, baseline is the distance between the optical centers of the two cameras, called baseline distance, which is determined by the physical position of the camera installation, and disp is the pixel value of the corresponding coordinate point in the disparity map, that is, the disparity information.
7. The method for identifying and controlling gate traffic behavior by combining target detection and binocular vision as claimed in claim 1, It is characterized in that The pedestrian traffic behavior judgment logic in step 7 is shown in Table 1: Table 1 Pedestrian traffic behavior judgment logic table The binocular ranging module of the determination method in Table 1 obtains the disparity information of the corresponding position by passing the center point of the detected pedestrian position, that is, the pedestrian's head position coordinates, into the corresponding disparity map, and obtains the distance between the pedestrian's head and the camera according to the conversion formula between the disparity information and the distance. Then, the height of the pedestrian is obtained by subtracting the distance between the pedestrian's head and the camera from the installation height of the camera, and the height is used to distinguish whether the pedestrian is an adult or a child.
8. A gate traffic behavior recognition and control system combining target detection and binocular vision, It is characterized in that Based on the method described in any one of claims 1 to 7, gate passage behavior recognition and control combining target detection and binocular vision are completed.
9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in any one of claims 1 to 7 when executing the computer program, and completes gate passage behavior recognition and control combining target detection with binocular vision.
10. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in any one of claims 1 to 7, and completes gate passage behavior recognition and control combining target detection and binocular vision.
