Subway door anti-pinch method and device based on video analysis and medium
By combining Gaussian mixture background model and optical flow method with background difference method through video analysis, the problems of false alarms and missed alarms in subway door anti-pinch technology have been solved, realizing accurate passenger door-breaking detection in complex environments and improving safety and reliability.
Patent Information
- Application Number
- CN202511329672.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2025-12-19
AI Technical Summary
Existing subway door anti-pinch technology suffers from frequent false alarms and missed alarms, and it is difficult to accurately detect passengers' attempts to force their way through the doors in complex environments, resulting in insufficient safety and reliability.
A video analysis-based method for preventing subway doors from being pinched is adopted. The pixel motion vector field is calculated by using a Gaussian mixture background model and optical flow method. The background difference method is combined to determine the target’s door-breaking behavior. The recursive update and adaptive contribution weight are used to distinguish between normal optical flow and abnormal optical flow, triggering the anti-pinch mechanism.
It improves the accuracy of anti-pinch technology for subway doors, reduces the false alarm rate, ensures passenger safety and the reliability of subway operation, and adapts to complex environmental changes.
Smart Images

Figure CN121170699A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a subway door anti-pinch method and device based on video analysis and a medium. BACKGROUND
[0002] The main task of the subway door anti-pinch algorithm is to detect whether a passenger is intruding into the door when the train is about to close the door at the platform. If a passenger is detected, the anti-pinch mechanism is triggered immediately to control the door to stop closing and reopen, thereby avoiding the passenger being pinched by the door and ensuring the safety of the passenger and the safety and reliability of the subway operation.
[0003] Traditional subway door anti-pinch technology has many defects. The early anti-pinch scheme of a simple contact switch can only work when the door directly touches a large obstacle. It cannot effectively detect some small foreign objects or objects at the edge of the door, and false negatives and false positives occur frequently. With the development of technology, the current detection method appears. This method detects whether there is an obstacle by monitoring the change of the motor current of the door. However, in actual operation, the motor current is easily disturbed by various factors, such as power supply voltage fluctuations, vehicle vibration caused by track unevenness, and motor performance changes caused by environmental temperature changes in different seasons. When the power supply voltage is unstable, the current value will fluctuate, which may cause misjudgment. Sensor-based technology also has limitations. Although infrared sensors have low cost and are easy to install, their detection range is limited and they are easily disturbed by light. In strong light or backlight conditions, the detection accuracy decreases significantly.
[0004] Patent application CN115657150A discloses a subway door gap anti-pinch system and a detection method thereof. Multiple image acquisition modules and linear light sources are arranged in the gap between the train door and the platform door, and image processing technology is used to determine whether there is a foreign object in the gap. However, this system has a complex structure, high requirements for image acquisition equipment and processor performance, and high cost. In addition, when the image acquisition equipment fails, it is difficult to widely promote and apply. Patent CN107191087B discloses a train door anti-pinch algorithm based on LSTM. This algorithm uses LSTM to model the current and door speed, and converts the train door anti-pinch judgment into a sequence labeling problem of machine learning. Although it captures the potential rules within the sequence and improves the accuracy, it still requires a large amount of sample data for training, and the model training time is relatively long. In practical applications, further optimization is still needed to adapt to complex and variable operating environments. SUMMARY
[0005] The purpose of the present application is to provide a subway door anti-pinch method and device based on video analysis that improves safety.
[0006] The purpose of the present application can be achieved by the following technical solutions:
[0007] A subway door anti-pinch method based on video analysis, comprising the following steps:
[0008] S1, real-time acquisition of continuous video stream when subway door is dynamically closed, taking current frame image as a to-be-detected image;
[0009] S2, using a Gaussian mixture background model based on a background image to process the to-be-detected image, judging whether there is a target, if not, returning to step S1, if yes, extracting the target and executing step S3, wherein the background image is an image when the subway door is in an open state;
[0010] S3, calculating a pixel motion vector field between the to-be-detected image and the previous frame image, wherein the pixel motion vector field is used to represent the motion speed of the target and the background in the displacement direction, the target including passengers and the background being the subway door;
[0011] S4, based on the pixel motion vector field, detecting normal optical flow generated by subway door movement and abnormal optical flow of the target, if abnormal optical flow is detected, combining a background difference method to determine the target door intrusion behavior and trigger the anti-pinch mechanism, if no abnormal optical flow is detected, returning to step S1.
[0012] Further, the expression of the Gaussian mixture background model is:
[0013]
[0014] In the formula, B (x,y) is a Gaussian mixture background model, representing the value of the background model value at pixel point (x, y), (x, y) is the pixel point coordinate of the background image, N represents the frame number of the background image, G σ represents a Gaussian kernel function, sigma is a hyperparameter, representing the standard deviation of the Gaussian kernel function, I (x,y) is the pixel value of the background image.
[0015] Further, in step S2, the step of extracting the target comprises:
[0016] Based on the Gaussian mixture background model, a recursive update method is used to extract the filtered motion feature of the to-be-detected image I t (x, y), wherein the filtered motion feature is represented as:
[0017] B t = alpha * (G σ * I t ) + (1-alpha) * B t-1
[0018] Wherein:
[0019]
[0020] where B t is the filtered motion feature of the image to be detected, a is a weighted average coefficient adjusted according to the scene dynamics, G σ is a Gaussian kernel function, I t is the pixel value of the image to be detected, B t-1 is the filtered motion feature of the previous frame image, i.e., the Gaussian mixture background model updated for the previous frame image;
[0021] The difference between the image I t to be detected and its filtered motion feature is calculated to generate an original difference map, on which the target is highlighted;
[0022] The original difference map is threshold segmented to obtain a binary difference map for highlighting the target, and morphological processing is performed to remove noise to obtain a purified binary difference map, denoted as:
[0023]
[0024] where D t is the purified binary difference map, with a value of 1 indicating the presence of a target and a value of 0 indicating the absence of a target, T high , T low are the maximum and minimum threshold values.
[0025] Further, the calculation process of the pixel motion vector field includes:
[0026] Based on the image to be detected containing the target and the previous frame image, the brightness constancy assumption and the spatiotemporal gradient constraint at each scale are constructed as the optical flow constraint, denoted as:
[0027] I x u+I y v+R t = 0
[0028] where I x , I y are the pixels of the image in the x and y directions, u and v are unknown quantities to be solved, representing the motion speed of the pixels in the x and y directions, and together constitute the pixel motion vector V t = [u, v] T R t is the temporal brightness change rate of a single pixel point;
[0029] A multi-scale algorithm is introduced to weight-sum the optical flow constraint to obtain a multi-scale equation group, from which the pixel motion vector field V t is solved, where the multi-scale equation group is denoted as:
[0030]
[0031] wherein, is the sum of squares of the x-direction pixel-related quantities weighted by the Gaussian weight, and x I y is the sum of products of the x-direction and y-direction pixel-related quantities weighted by the Gaussian weight, and w is the weight.
[0032] Further, the step of detecting the normal optical flow generated by the movement of the door itself and the abnormal optical flow of the target comprises:
[0033] According to the pixel gradient size, the adaptive contribution weight of the pixel gradient to the optical flow calculation is calculated.
[0034] According to the prior knowledge of the movement direction of the subway door, the optical flow angle constraint condition of the subway door is constructed and expressed as:
[0035] θ∈[θ door -15°,θ door +15°]
[0036] Based on the pixel motion vector field, the actual direction of each pixel is calculated, and the calculation expression is:
[0037] θ r =arctan(v / u)
[0038] wherein, θ r is the actual direction of the pixel, u and v are the movement speeds of the pixel in the x and y directions, respectively, and θ door is the expected movement direction of the subway door.
[0039] If the actual direction θ r of the pixel satisfies the optical flow angle constraint condition θ of the subway door, and the adaptive contribution weight is greater than the set threshold, it is determined as the optical flow generated by the movement of the subway door.
[0040] If the actual direction θ r of the pixel does not satisfy the optical flow angle constraint condition θ of the subway door, or the adaptive contribution weight is less than or equal to the set threshold, it is determined as the abnormal optical flow of the target.
[0041] Further, the calculation expression of the adaptive contribution weight is:
[0042] to prevent division by zero
[0043] wherein, ·(x,y) is the adaptive contribution weight, ΔI(x,y) is the image gradient at the pixel (x,y), is the maximum gradient energy in the entire image, and ε is a set constant.
[0044] Further, the step of determining the target intruding behavior includes:
[0045] According to the detected abnormal optical flow, the pixel coordinate range of the abnormal optical flow in the image to be detected is located as an abnormal optical flow region R flow ;
[0046] The background difference method is used to perform difference operation on the image to be detected and the background image without target, to obtain a foreground pixel region R bg ;
[0047] It is judged whether the abnormal optical flow region R flow and the foreground pixel region R bg have spatial overlap, if not, it is determined that there is no target intruding behavior,
[0048] if yes, it indicates that there is foreground change different from the background, and it is further verified whether the overlapping region meets the physical logic of the intruding behavior, if yes, it is determined that the target has intruding behavior, if not, it is determined that the target does not have intruding behavior.
[0049] Further, the physical logic of the intruding behavior includes the following conditions that need to be met simultaneously:
[0050] Subway door state: the subway door is in the closing process;
[0051] Motion conflict: the included angle between the motion direction of the overlapping region and the closing direction of the subway door is greater than a set included angle value, and the speed difference is greater than a set speed difference value;
[0052] Spatial matching: the overlapping region is located at a key position of the door motion path.
[0053] The application also provides an electronic device, comprising: one or more processors; a memory; and one or more programs stored in the memory, the one or more programs comprising instructions for performing the subway door anti-pinch method based on video analysis as described above.
[0054] The application also provides a computer-readable storage medium comprising one or more programs for execution by one or more processors of an electronic device, the one or more programs comprising instructions for performing the subway door anti-pinch method based on video analysis as described above.
[0055] Compared with the prior art, the application has the following beneficial effects:
[0056] (1) The present application is based on the Gaussian mixture background model constructed by the background image, which is used for subsequent judgment of whether a pixel point belongs to the "background", i.e. the state without moving objects, to provide a contrast benchmark for motion target detection, and through the calculation of the pixel motion vector field representing the motion speed of the target and the background in the displacement direction, the abnormal and normal optical flow are further distinguished, and finally the accurate target door intrusion behavior and anti-pinch mechanism are realized to improve the safety.
[0057] (2) The present application extracts the filtering features of the current video frame by using the recursive updating method, that is, the Gaussian mixture background model is recursively updated with new video frames to adapt to the gradual changes of the scene with light and other scenes, compared with the traditional static background difference, which leads to a large amount of noise and false positives, and the present application can learn to be a new background, thereby greatly suppressing false positives.
[0058] (3) The present application calculates the pixel motion vector field by using the optical flow method, which quantifies the pixel motion with a mathematical model, and the motion consistency allows the pixel motion to be associated with the macro displacement of the target / background, and the combination of the two realizes the representation of the pixel to the target / background motion, and the subsequent normal and abnormal optical flow distinction provides a good foundation.
[0059] (4) In the present application, when distinguishing normal and abnormal optical flow, the judgment is made through the optical flow angle constraint condition and the adaptive contribution weight, the adaptive contribution weight distinguishes whether the pixel belongs to the edge / surface of the door / target, that is, whether the pixel is important, and the optical flow angle constraint condition filters the motion through the direction priori, and through the two, the door itself optical flow and target abnormal optical flow can be accurately and effectively separated.
[0060] (5) In the process of determining the target door intrusion behavior by combining the background difference method, the present application avoids the misjudgment caused by single optical flow anomaly (such as light interference and door surface reflection) through the double conditions of optical flow anomaly and foreground change (background difference), reduces the misjudgment rate to a lower level, and realizes more accurate door intrusion behavior judgment. BRIEF DESCRIPTION OF DRAWINGS
[0061] Figure 1 is the flow chart of the method of the present application;
[0062] Figure 2 is the schematic diagram of the subway door of the present application;
[0063] Figure 3 is the Gaussian mixture background model diagram of the present application;
[0064] Figure 4 is the target area diagram of the present application;
[0065] Figure 5 is the passenger door intrusion detection schematic diagram of the present application. Detailed Implementation
[0066] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. These embodiments are based on the technical solution of the present invention and provide detailed implementation methods and specific operating procedures. However, the scope of protection of the present invention is not limited to the following embodiments.
[0067] This embodiment provides a method for preventing subway doors from being pinched based on video analysis, such as... Figure 1 As shown, the method includes the following steps:
[0068] Step 1: Obtain the image of the train with the doors open as the background image and establish a Gaussian mixture background model.
[0069] In this embodiment, an image of the train with its doors open, acquired by a high-definition rear-view camera installed at the train door, is used as the background image. Its main function is to serve as a reference point in the subsequent background subtraction process. Then, a Gaussian mixture background model is established. This model can effectively simulate the complex distribution of the background image, such as... Figure 3 As shown. The Gaussian mixture background model is denoted as B. (x,y) (x,y) represents the pixel coordinates of the image. The specific Gaussian mixture background model is represented as follows:
[0070]
[0071] In the formula, N represents the number of frames in the background image, and G σ Let I be the Gaussian kernel function, where σ is a hyperparameter and I is the standard deviation of the Gaussian kernel function. (x,y) These are the pixel values of the background image;
[0072] The Gaussian mixture background model built in this step can probabilistically determine whether each pixel in the subsequently acquired video frames belongs to the background, laying the foundation for moving target (e.g., passenger) detection.
[0073] Step 2: Real-time acquisition of continuous video streams as subway doors dynamically close, and acquisition of the current frame image as the image to be detected.
[0074] In this step, as the subway doors are about to close and are dynamically closing, the camera captures a video stream in real time at a set frame rate. From the captured video stream, images are extracted frame by frame in chronological order, and the currently extracted image is used as the image to be detected, denoted as I. t (x,y), where (x,y) represents the pixel coordinates of the image, such as... Figure 2 As shown.
[0075] Step 3, using the Gaussian mixture background model based on the background image to process the image to be detected, to determine whether there is a target, if not, return to step 2, if yes, the target is extracted, and step 4 is executed.
[0076] First, the Gaussian mixture background model in step 1 is used to extract the image to be detected I t (x,y) of the filtered motion feature, and the embodiment is extracted by recursive updating, and the expression is:
[0077] B t = a · (G σ · I t ) + (1-a) · B t-1
[0078] Wherein:
[0079]
[0080] In the formula, B t is the filtered motion feature of the image to be detected, a is the weighted average coefficient, which is adjusted according to the scene dynamics, G σ is expressed as a Gaussian kernel function, I t is the pixel value of the image to be detected, and B t-1 is the filtered motion feature of the previous frame image, that is, the Gaussian mixture background model updated for the previous frame image.
[0081] By comparing the characteristics of each pixel with the difference in the background model, using the probability distribution characteristics of the model, the pixel points whose difference with the background model exceeds a certain threshold are determined as motion pixel points. The set of these motion pixel points constitutes the motion feature in the image. The motion feature can directly reflect the target body (in this embodiment, the passenger) in the current image relative to the background (in this embodiment, the subway door) that moves, and provides key information for further analysis of the motion state of the target.
[0082] Secondly, the current image to be detected I t (x,y) and its filtered motion feature are used for difference operation, to generate an original difference image, to highlight the target area, as shown in Figure 4 .
[0083] Finally, the original difference image is threshold segmented to obtain a binary difference image for highlighting the target, and morphological processing is performed to remove noise to obtain a purified binary difference image, expressed as:
[0084]
[0085] In the formula, D t is the purified binary difference image, the value is 1, indicating that there is a target, and the value is 0, indicating that there is no target, and Thigh , T low are maximum and minimum threshold values.
[0086] Step 4, calculating a pixel motion vector field between the image to be detected and the previous frame image, wherein the pixel motion vector field is used to represent the motion speed of the target and the background in the displacement direction.
[0087] In this embodiment, the optical flow method is used to calculate the pixel motion vector field between the current image to be detected and the previous frame image, representing the motion speed of the target and the background in the displacement direction, denoted as V t =[u,v] T . The specific steps include the following:
[0088] First, based on the image to be detected containing the target and the previous frame image, the brightness constant assumption and the space-time gradient constraint in each scale are constructed as the optical flow constraint, denoted as:
[0089] I x u+I y v+R t =0
[0090] In the formula, I x , I y are the pixels of the image in the x and y directions, u and v are unknown quantities to be solved, representing the motion speed of the pixels in the x and y directions, and together constitute the pixel motion vector V t =[u,v] T , and R t is the time brightness change rate of a single pixel point.
[0091] Secondly, a multi-scale algorithm is introduced to weight and sum the optical flow constraint, to obtain a multi-scale equation group, and to solve the pixel motion vector field V t , wherein the multi-scale equation group is denoted as:
[0092]
[0093] In the formula, is the square sum of the x-direction pixel-related quantities after being weighted by the Gaussian weight, ∑I x I y is the product sum of the x-direction and y-direction pixel-related quantities after being weighted by the Gaussian weight, w is the weight, I x represents the pixel of the image in the x direction (usually the gradient information of the image in the x direction, etc.), and I y represents the pixel of the image in the y direction.
[0094] Step 5, based on the pixel motion vector field, detect the normal optical flow generated by the subway door itself movement and the abnormal optical flow of the target, if the abnormal optical flow is detected, determine the target intruding behavior and trigger the anti-pinch mechanism in combination with the background difference method, if the abnormal optical flow is not detected, return to step 2.
[0095] Firstly, according to the pixel gradient size, the adaptive contribution weight of the pixel gradient to the optical flow calculation is calculated:
[0096]
[0097] In the formula, w(x, y) is the adaptive contribution weight, ΔI(x, y) is the image gradient at the pixel (x, y), is the maximum gradient energy in the whole image, and ε is a constant set.
[0098] Secondly, in the process of opening and closing the subway door, the movement of the door itself will also generate optical flow, and this step constructs the optical flow angle constraint condition of the subway door according to the prior of the subway door movement direction, which is expressed as:
[0099] θ∈[θ door -15°,θ door +15°]
[0100] Thirdly, based on the pixel motion vector field, the actual direction of each pixel is calculated respectively, and the calculation expression is:
[0101] θ r =arctan(v / u)
[0102] In the formula, θ r is the actual direction of the pixel, u and v are the movement velocities of the pixel in x and y directions respectively, and θ door is the expected movement direction of the subway door.
[0103] Further optical flow distinction is carried out, which is specifically:
[0104] If the actual direction θ r of the pixel meets the optical flow angle constraint condition θ of the subway door, and the adaptive contribution weight is greater than the set threshold, it is determined that the optical flow is generated by the movement of the subway door;
[0105] If the actual direction θ r of the pixel does not meet the optical flow angle constraint condition θ of the subway door, or the adaptive contribution weight is less than or equal to the set threshold, it is determined that the abnormal optical flow of the target.
[0106] For the area with small angle difference, it indicates that the motion trend of the pixel point is similar to that of the door, and the optical flow is probably caused by the door motion, so the adaptive contribution weight comparison of these areas can more accurately determine whether the optical flow of the pixel point is caused by the door motion or the abnormal motion of the target, thereby realizing accurate optical flow distinction.
[0107] Finally, according to the detected abnormal optical flow, combined with the result of the background difference method, the passenger door intrusion behavior is determined and the anti-pinch mechanism is triggered. Specifically, the following steps are included:
[0108] According to the detected abnormal optical flow, the pixel coordinate range of the abnormal optical flow in the image to be detected is located as the abnormal optical flow region R flow ;
[0109] The background difference method is used to perform difference operation on the image to be detected and the target-free background image, to obtain the foreground pixel region R bg , which can further confirm the existence and state of the moving target;
[0110] It is judged whether the abnormal optical flow region R flow and the foreground pixel region R bg overlap in space, if not, it is determined that there is no target door intrusion behavior,
[0111] if yes, it indicates that there is a foreground change different from the background, and it is further verified whether the overlapping region meets the physical logic of the door intrusion behavior, if yes, it is determined that the target has the door intrusion behavior, the door is controlled to stop closing and reopen, to avoid the passenger being pinched by the door, and to ensure the safety of the passenger and the safety and reliability of the subway operation. If not, it is determined that the target does not have the door intrusion behavior. The physical logic of the door intrusion behavior includes the following conditions that need to be met simultaneously:
[0112] Subway door state: the subway door is in the closing process;
[0113] Motion conflict: the included angle between the motion direction of the overlapping region and the closing direction of the subway door is greater than a set included angle value, and the speed difference is greater than a set speed difference value;
[0114] Space matching: the overlapping region is located at a key position of the door motion path.
[0115] The finally detected passenger door intrusion behavior of the embodiment is shown in Figure 5 .
[0116] Embodiment 2
[0117] The embodiment provides an electronic device, comprising: one or more processors; a memory; and one or more programs stored in the memory, the one or more programs comprising instructions for performing the subway door anti-pinch method based on video analysis as described in the above embodiment 1.
[0118] If the above functions are realized in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or parts of the present application that essentially contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.
[0119] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of the present application can be implemented in various computer languages, such as object-oriented programming languages Java and interpreted scripting languages JavaScript.
[0120] The present application is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 The device that implements the functions specified in one flow or multiple flows and / or blocks.
[0121] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the Figure 1 function specified in the flow or flows and / or blocks Figure 1 of the block or blocks.
[0122] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions that are executed on the computer or other programmable apparatus provide steps for implementing the Figure 1 function specified in the flow or flows and / or blocks Figure 1 of the block or blocks.
[0123] While the preferred embodiments of the application have been described, additional variations and modifications can be made to the embodiments by those of skill in the art once they have the benefit of the present disclosure. Therefore, the appended claims are intended to encompass within their scope all possible variations and modifications of the preferred embodiments. 1
[0124] It is apparent that a person skilled in the art can make various changes and modifications to the application without departing from the spirit and scope thereof. Therefore, if these modifications and changes fall within the scope of the claims and their equivalents, it is intended to include them in the application.
Claims
1. A subway door anti-pinch method based on video analysis, characterized in that, The method comprises the following steps: S1, collecting a continuous video stream in real time when a subway door is dynamically closing, and taking a current frame image as a to-be-detected image; S2, processing the to-be-detected image by using a Gaussian mixed background model constructed based on a background image, judging whether there is a target, if not, returning to step S1, and if yes, extracting the target and executing step S3, wherein the background image is an image when the subway door is in an open state; S3, calculating a pixel motion vector field between the to-be-detected image and a previous frame image, wherein the pixel motion vector field is used to represent the motion speed of the target and the background in a displacement direction, and the target includes passengers and the background is the subway door; S4, detecting normal optical flow generated by the subway door itself and abnormal optical flow of the target based on the pixel motion vector field, if the abnormal optical flow is detected, determining a target door intrusion behavior in combination with a background difference method and triggering an anti-pinch mechanism, and if the abnormal optical flow is not detected, returning to step S1. 2.The subway door anti-pinch method based on video analysis of claim 1, wherein An expression of the Gaussian mixed background model is as follows: In the formula, B (x,y) is a Gaussian mixture background model, (x, y) is the pixel point coordinate of the background image, N represents the frame number of the background image, G σ represents a Gaussian kernel function, σ is a hyperparameter, and represents the standard deviation of the Gaussian kernel function, I (x,y) is the pixel value of the background image. 3.The subway door anti-pinch method based on video analysis of claim 1, wherein, In step S2, the step of extracting the target comprises: Based on the Gaussian mixture background model, a recursive updating method is used to extract the to-be-detected image I t a filtered motion feature of (x, y), wherein the filtered motion feature is expressed as: B t = a • (G σ • I t ) + (1 - a) • B t-1 Wherein: In the formula, B t is the filtered motion feature of the image to be detected, a is a weighted average coefficient, which is adjusted according to the scene dynamics, G σ is expressed as a Gaussian kernel function, I t is a pixel value of the image to be detected, B t-1 is the filtered motion feature of the previous frame image, that is, the Gaussian mixture background model updated for the previous frame image; computing the image I to be detected t (x,y) and its filtered motion features, generating a raw difference map on which the target is highlighted; The original difference image is subjected to threshold segmentation to obtain a binary difference image for highlighting the target, and is subjected to morphological processing to remove noise to obtain a purified binary difference image, denoted as: In the formula, D t is the purified binary difference image, and the value is 1, indicating that the target exists, and the value is 0, indicating that the target does not exist, T high , T low is the maximum and minimum threshold value. 4.The subway door anti-pinch method based on video analysis of claim 1, wherein The calculation process of the pixel motion vector field comprises: Based on the to-be-detected image containing the target and the previous frame image, a brightness constant hypothesis and a space-time gradient constraint in each scale are constructed as optical flow constraints, denoted as: I x u+I y v+R t =0 In the formula, I x , I y is the pixel of the image in the x and y directions, u, v are unknown quantities to be solved, representing the motion speed of the pixel in the x and y directions, and jointly constitute the pixel motion vector V t = [u, v] T , R t is the time brightness change rate of a single pixel point; A multi-scale algorithm is introduced to weight sum the optical flow constraints to obtain a multi-scale equation set, and a pixel motion vector field V is solved t where the multi-scale equation set is represented as: wherein is the sum of squares of the x-direction pixel-related quantities after Gaussian weight weighting, ∑I x I y is the sum of products of the x-direction and y-direction pixel-related quantities after Gaussian weight weighting, and w is the weight. 5.The subway door anti-pinch method based on video analysis of claim 1, wherein, The step of detecting the normal optical flow generated by the subway door itself and the abnormal optical flow of the target comprises: According to the pixel gradient size, an adaptive contribution weight of the pixel gradient to optical flow calculation is calculated; According to a subway door motion direction priori, an optical flow angle constraint condition of the subway door is constructed, denoted as: Θ∈ [Θ door -15°, Θ door +15°] Based on the pixel motion vector field, an actual direction of each pixel is calculated, wherein a calculation expression is as follows: θ r = arctan(v / u) where θ r is the actual direction of the pixel, u, v are the motion velocities of the pixel in x and y directions, respectively, and θ door is the expected motion direction of the metro door; If the actual direction θ of the pixel r If the light flow angle constraint condition θ of the subway door is met, and the adaptive contribution weight is greater than the set threshold, the light flow generated by the subway door movement is determined. If the actual direction θ of the pixel r If the optical flow angle constraint θ of the subway door is not satisfied, or the adaptive contribution weight is less than or equal to the set threshold, it is determined that the target is an abnormal optical flow. 6.The subway door anti-pinch method based on video analysis of claim 5, wherein, The calculation expression of the adaptive contribution weight is as follows: where w(x, y) is an adaptive contribution weight, ΔI(x, y) is an image gradient at pixel (x, y), is the maximum gradient energy in the whole image, and ε is a constant set. 7.The subway door anti-pinch method based on video analysis of claim 1, wherein The step of determining the target door intrusion behavior comprises: According to the detected abnormal optical flow, a pixel coordinate range of the abnormal optical flow in the image to be detected is located as an abnormal optical flow region R flow ; The background difference method is used to perform difference operation on the image to be detected and the background image without target, to obtain a foreground pixel region R bg ; determining whether the abnormal optical flow region R flow and the foreground pixel region R bg whether there is spatial overlap, and if not, determining that there is no target tailgating behavior, If yes, it indicates that there is a foreground change different from the background, and whether the overlapping area meets the physical logic of the door intrusion behavior is further verified, if yes, it is determined that the target has the door intrusion behavior, and if not, it is determined that the target does not have the door intrusion behavior. 8.The subway door anti-pinch method based on video analysis of claim 7, wherein, The physical logic of the door intrusion behavior comprises the following conditions which need to be met simultaneously: Subway door state: the subway door is in a closing process; Motion conflict: an included angle between a motion direction of the overlapping area and a closing direction of the subway door is greater than a set included angle value, and a speed difference is greater than a set speed difference value; Space matching: the overlapping area is located at a key position of a motion path of the subway door.
9. An electronic device, comprising: It comprises: One or more processors; Memory; And One or more programs stored in the memory, the one or more programs comprising instructions for performing the subway door anti-pinch method based on video analysis as claimed in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, It comprises one or more programs for an electronic device to execute, the one or more programs comprising instructions for performing the subway door anti-pinch method based on video analysis as claimed in any one of claims 1-8.
Citation Information
Patent Citations
An LSTM-based anti-pinch algorithm for train doors
CN107191087B
Cited By
Industrial door anti-pinch safety early warning method based on video stream moving target detection
CN121937487A