Method, device and medium for detecting locking of subway train door locks based on visual detection

Through the visual detection method, using neural network and homography transformation technology, real-time monitoring and detection of the lock status of subway train doors is achieved, solving the problems of inaccurate detection and safety hazards in the existing technology, and improving the reliability and safety of the system.

CN119540232BActive Publication Date: 2025-05-13WECO OPTOELECTRONICS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510090305.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-05-13
Estimated Expiration
2045-01-21

AI Technical Summary

Technical Problem

The existing subway train door lock detection system lacks a redundant detection mechanism, mechanical components are susceptible to wear and installation errors, and electrical detection circuits are susceptible to electromagnetic interference and component failures, resulting in inaccurate detection results and safety hazards.

Method used

Using a visual detection method, the image of the train door lock is acquired through the camera, the pre-trained neural network model is used to identify the target feature points, calculate the homography transformation matrix, image correction and feature point extraction, real-time monitoring and secondary judgment of the door lock status are realized.

Benefits of technology

It improves the reliability and safety of subway train door lock detection, avoids the failure of mechanical limit switches and electrical detection circuits, ensures the safety of door locks during train operation, and enhances the system's fault tolerance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119540232B_ABST
    Figure CN119540232B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device and medium for detecting the locking of subway train door locks based on visual detection, which relates to the field of image processing technology, and includes the steps of: obtaining a reference image of a door lock mechanism after the train door lock is normally locked after the camera is fixed, and identifying each target feature point; obtaining a homography transformation matrix according to the identified target feature points and the corresponding coordinates in the world coordinate system, and configuring the homography transformation matrix as the reference sampling point; obtaining a door lock mechanism acquisition image acquired by the camera after receiving a train door closing signal; converting the acquired acquisition image into a corresponding forward image through a homography transformation according to the reference sampling point configuration; extracting the target feature points in the forward image; and performing a secondary determination output of the door closing signal based on the target feature points. The present invention can detect whether the subway train door is correctly locked in a non-contact manner by introducing a visual detection algorithm, thereby avoiding the failure problem that is prone to occur in the traditional method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method, device and medium for detecting the locking of subway train door locks based on visual detection. Background Art

[0002] The automatic door locking device of subway vehicles is one of the important components to ensure the safety of passengers. Especially with the continuous increase in the passenger flow of urban rail transit, the safe locking of train doors is directly related to the personal safety and property safety of passengers. However, the existing subway train door lock detection system mainly relies on the mechanical and electrical devices of the door lock itself to ensure the door is locked. This traditional detection method has certain limitations and safety hazards.

[0003] First, the current system lacks a redundant detection mechanism. In actual applications, the locked state of the door lock is completely verified by the mechanical and electrical devices of the door lock itself. There is no additional detection device to confirm whether the door is actually locked, and there is no data retention mechanism for subsequent analysis. This makes it difficult to detect and handle a malfunction in a timely manner, increasing potential safety risks.

[0004] Secondly, the door lock mechanical parts may fail due to long-term use, wear or manufacturing defects, resulting in the door not being able to close or lock properly. This situation is particularly dangerous because if the door is accidentally opened while the train is in motion, it will pose a serious threat to passenger safety. In addition, the electrical system that controls the door locking device may also have a short circuit, open circuit or other electrical faults, so that the door locking device may not receive the correct control signal, thereby affecting the normal operation of the train.

[0005] The operating environment of subway trains is complex and changeable. Dust and dirt easily accumulate on mechanical parts, affecting the normal operation of the limit switch and reducing the reliability of the system. At the same time, the installation position and angle of the limit switch need to be very precise. Any slight error may cause the switch to fail to trigger accurately, resulting in misjudgment. In addition, the response speed of the mechanical limit switch is relatively slow. In some high-speed operation scenarios, it may not be able to feedback the status of the door in time, affecting the real-time performance of the system.

[0006] The electrical detection circuit also faces challenges. A large number of electrical equipment and track currents in the subway environment may generate strong electromagnetic interference, resulting in inaccurate detection results. In addition, components in the electrical detection circuit, such as resistors, capacitors, and relays, may fail due to aging, overheating, etc., affecting the reliability of detection. The existence of these problems highlights the shortcomings of existing technologies in ensuring the safety of train door locks. Summary of the invention

[0007] In order to improve the reliability and safety of subway train door lock detection, it is necessary to develop a new detection scheme to overcome the shortcomings of the existing technology and provide a more solid safety guarantee for train operation. Based on such a demand, the present invention proposes a subway train door lock locking detection method based on visual detection, comprising the steps of:

[0008] S1: Obtain a reference image of the door lock mechanism after the train door lock is normally locked after the camera is fixed, and identify each target feature point through a pre-trained neural network model;

[0009] S2: According to the identified target feature points and the corresponding coordinates in the world coordinate system, a homography transformation matrix is ​​obtained and the homography transformation matrix is ​​used as a reference sampling point configuration;

[0010] S3: After receiving the signal that the train door is fully closed, obtain the door lock mechanism image captured by the camera;

[0011] S4: according to the reference sampling point configuration, converting the acquired acquisition image into a corresponding positive image through homography transformation;

[0012] S5: Extract target feature points in the positive image through the pre-trained neural network model;

[0013] S6: Perform secondary judgment and output of the door closing signal based on the target feature points.

[0014] Furthermore, the train door lock is an annular lock body structure that rotates around an axis.

[0015] Furthermore, the target characteristic points include a number of characteristic points on the annular lock body structure that rotate with the lock body, and a number of characteristic points outside the annular lock body structure that are fixed.

[0016] Furthermore, in step S6, the secondary determination output of the door closing signal specifically includes the following steps:

[0017] S61: Acquire the center coordinates of the door lock mechanism according to the target feature points on the annular lock body structure, and obtain the offset angle by connecting the center coordinates with any target feature point on the annular lock body structure;

[0018] S62: performing polar coordinate transformation on the forward image based on the coordinates of the circle center, and extracting each target feature point and the corresponding coordinates in the transformed image;

[0019] S63: If the offset angle is less than the preset offset angle and the coordinates of the feature point are within the preset range, it is determined that the door is fully closed, a door fully closed signal is output and the process returns to step S3; otherwise, it is determined that the door is not fully closed.

[0020] Furthermore, in the step S62, the polar coordinate transformation is expressed by the following formula:

[0021]

[0022] In the formula, is the number of rows after polar coordinate transformation, is the number of columns after polar coordinate transformation, The radius length of any pixel point on the ring lock structure in the forward image, is the preset standard step length in the radial direction, is the angle of any pixel point on the annular lock structure in the positive image, The preset standard step size in angle.

[0023] Furthermore, in step S2, the homography transformation matrix is ​​constructed by the following formula:

[0024]

[0025] In the formula, is the coordinate in the world coordinate system, is the coordinate after homography transformation, is a 2×2 matrix representing the rotation and translation transformation, is a 2×1 matrix representing the translation, is a 1×2 size vector representing the perspective transformation, is a scalar representing the scale factor, is the homography transformation matrix.

[0026] The present invention also proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the subway train door lock locking detection method based on visual detection are implemented.

[0027] Also included is a device for processing data, comprising:

[0028] a memory having a computer program stored thereon;

[0029] A processor is used to execute the computer program in the memory to implement the steps of the subway train door lock locking detection method based on visual detection.

[0030] Compared with the prior art, the present invention has at least the following beneficial effects:

[0031] (1) The present invention discloses a method, device and medium for detecting the locking of subway train door locks based on visual detection. By introducing a visual detection algorithm, the present invention can detect whether the subway train door is correctly locked in a non-contact manner, thereby avoiding the failure of traditional mechanical limit switches and electrical detection circuits due to wear, installation errors, electrical interference, etc., greatly enhancing the reliability and safety of the system, and ensuring that the safety of passengers will not be endangered due to door lock failure during the operation of the train;

[0032] (2) In the complex subway operation environment, the system can still accurately detect the door lock status, ensuring the stability and accuracy of the detection results. At the same time, the response judgment is based on visual detection, and the response speed is faster;

[0033] (3) Combining mechanical limit switches and electrical detection circuits as a redundant design, even if the visual inspection system fails, traditional mechanical and electrical detection methods can still play a role, ensuring double verification of the door lock status and enhancing the system's fault tolerance. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 A step diagram of a subway train door lock detection method based on visual detection;

[0035] Figure 2 It is a schematic diagram of rotation transformation;

[0036] Figure 3 is a schematic diagram of translation transformation;

[0037] Figure 4 It is a schematic diagram of rigid body transformation;

[0038] Figure 5 Schematic diagram of affine transformation;

[0039] Figure 6 It is a schematic diagram of homography transformation;

[0040] Figure 7 Update the schematic for the camera matrix;

[0041] Figure 8 It is a schematic diagram of the ring-mounted lock body structure;

[0042] Fig. 9 Schematic diagram of polar coordinate transformation. DETAILED DESCRIPTION

[0043] The following are specific embodiments of the present invention and the accompanying drawings to further describe the technical solution of the present invention, but the present invention is not limited to these embodiments.

[0044] Traditional door lock detection methods mainly rely on a combination of mechanical and electrical structures to ensure the safe closing and locking of doors. Specifically, when the train door completes the closing action and enters the locked state, the built-in mechanical components will trigger one or more limit switches. These limit switches are key components of the door lock mechanism, and their working mechanism is based on physical contact: the limit switch will only be activated when the door is fully closed and the locking device is properly in place. Once the door fails to close or lock as expected, the corresponding limit switch will not be triggered, causing the system to immediately recognize this abnormal condition and may trigger an alarm or other safety response measures.

[0045] In addition to mechanical limit switches, traditional door lock detection is often supplemented by electrical detection circuits to further verify the status of the door lock. The core of this circuit design is to monitor the changes in current or voltage passing through the door lock mechanism. For example, during the process of door locking, certain specific resistance values ​​will change, which in turn affects the current or voltage level in the circuit. The system can be configured to monitor changes in these parameters in real time, and any readings that deviate from the normal range will be regarded as potential problem signals. If an anomaly is detected, the system can respond quickly to remind the operator to check the status of the door or take other necessary corrective measures.

[0046] Although the above methods have certain advantages in terms of cost-effectiveness because they do not require complex additional components or advanced technologies, their long-term stability and reliability are affected by many factors. First, mechanical parts may wear or be damaged after a long period of use, which may cause the limit switch to fail to work properly. For example, springs may lose their elasticity due to fatigue, and contacts may fail due to corrosion. Secondly, the operating environment of subway trains is complex and changeable, and pollutants such as dust and dirt can easily accumulate on mechanical parts, thereby interfering with the normal operation of the limit switch. In addition, the installation position and angle of the limit switch must be very precise, and any slight error may cause it to fail to trigger accurately, especially in scenarios with high speed and high frequency of use, this risk is more prominent. For this reason, if Figure 1 As shown, the present invention proposes a subway train door lock detection method based on visual detection, comprising the steps of:

[0047] S1: Obtain a reference image of the door lock mechanism after the train door lock is normally locked after the camera is fixed, and identify each target feature point through a pre-trained neural network model;

[0048] S2: According to the identified target feature points and the corresponding coordinates in the world coordinate system, a homography transformation matrix is ​​obtained and the homography transformation matrix is ​​used as a reference sampling point configuration;

[0049] S3: After receiving the signal that the train door is fully closed, obtain the door lock mechanism image captured by the camera;

[0050] S4: according to the reference sampling point configuration, converting the acquired acquisition image into a corresponding positive image through homography transformation;

[0051] S5: Extract target feature points in the positive image through the pre-trained neural network model;

[0052] S6: Perform secondary judgment and output of the door closing signal based on the target feature points.

[0053] In modern urban transportation systems, subway trains play a vital role. With the advancement of technology and the improvement of safety standards, higher requirements are placed on the detection of the status of train door locks. Taking into account the cost and complexity of comprehensively updating existing subway trains, the present invention proposes an innovative solution - a train door lock locking status monitoring system based on visual detection. This solution aims to achieve real-time monitoring of the door lock status by adding cameras without changing the existing train door structure. However, due to the limitations of the internal space of the train door and the complexity of the structure, the installation position of the camera is often unable to directly face the components that need to be detected, which leads to the inevitable angle deviation problem during image acquisition.

[0054] To overcome this challenge, the present invention introduces a series of advanced image processing techniques and algorithms. First, by carefully selecting the installation position and angle of the camera, the inevitable initial viewing angle deviation is minimized. Then, computer vision technology is used to pre-process the collected images, including but not limited to denoising, contrast enhancement, etc., to ensure the best image quality. Next, a geometric transformation method is used to transform the image with angle deviation into an effect as if it were taken from the front, thereby accurately reflecting the real spatial state of the component to be inspected.

[0055] Image transformation techniques are an integral part of computer vision and image processing. They are used to perform various geometric operations on images to meet different application requirements. These transformations can be divided into two categories: linear and nonlinear. The most common and basic linear transformations include rotation and translation. Below we will discuss the two basic image transformations, rotation and translation, in detail.

[0056] Rotation refers to rotating all pixels in an image clockwise or counterclockwise around a specified center point at a certain angle. In two-dimensional space, rotation can be achieved through a rotation matrix, which defines the new coordinate position of each pixel. Figure 2 As shown, the acquired image is rotated counterclockwise around the origin (0,0) The schematic diagram of the angle is as follows:

[0057]

[0058] Written in matrix multiplication form:

[0059]

[0060] In the formula, is the rotated coordinate, is the original coordinate in the acquired image, is the rotation angle, is the rotation transformation matrix.

[0061] Translation is the process of moving all pixels in an image by a fixed distance horizontally and / or vertically. This is equivalent to changing the position of the image without changing its size or shape. Mathematically, translation can be achieved by adding an offset vector to the coordinates of each pixel. Figure 3 As shown, it is a schematic diagram of translation transformation, and its analytical expression is as follows:

[0062]

[0063] Written in matrix form:

[0064]

[0065] In the formula, is the translation vector.

[0066] However, since translation involves a linear shift in position rather than a change in angle or scale, translation transformation cannot be directly expressed in the form of matrix multiplication in the traditional two-dimensional coordinate system. In order to unify translation and other linear transformations (such as rotation, scaling, and shearing) into the same mathematical framework, we introduce the concept of homogeneous coordinates.

[0067] Homogeneous coordinates are a mathematical tool that adds an extra dimension to represent the position of a point so that translation transformations can be included in matrix operations. , we can do this by adding an extra coordinate To convert it into homogeneous coordinate form Typically, The value of is set to 1, so the original point In homogeneous coordinate system, it is expressed as .

[0068] The advantage of using homogeneous coordinates is that it allows us to use a unified 3×3 matrix to represent all geometric transformations, including translation. Specifically, for a two-dimensional translation transformation, we can construct a 3×3 transformation matrix in the following form:

[0069]

[0070] In the formula, Represents the translation distance along the x-axis and y-axis respectively. When we transform the homogeneous coordinates of a point When multiplied by this transformation matrix, the result is:

[0071]

[0072] In the formula, represents the identity matrix, represents a 2×1 translation vector, represents a 2×1 zero vector [0,0], which is an upper triangular matrix and can be understood as One is filled with 1 and the others are filled with 0.

[0073] By introducing homogeneous coordinates, we can now construct a comprehensive 3x3 transformation matrix that can simultaneously include multiple operations such as rotation, translation, scaling, etc. In this way, any complex geometric transformation can be implemented through a series of simple matrix multiplications, greatly simplifying the design of algorithms in image processing and computer graphics. Homogeneous coordinates not only make translation transformations simple and easy, but also provide a more general and flexible mathematical foundation for other types of transformations.

[0074] By introducing homogeneous coordinates, we can unify the two basic geometric transformations of rotation and translation into a matrix multiplication formula, which is the so-called rigid transformation. Figure 4 The figure shows a schematic diagram of rigid body transformation. Rigid body transformation refers to operations such as rotation and translation of an object while keeping its shape and size unchanged.

[0075] In two-dimensional space, rigid body transformation can be represented by a 3×3 transformation matrix, which contains information about rotation and translation. Suppose we have a point , we want to rotate it around the origin first Angle, and then translate along the x-axis and y-axis respectively and Using homogeneous coordinates, this point can be represented as Then, the rigid body transformation matrix M can be written as:

[0076]

[0077] When we point When multiplied by this transformation matrix, the resulting matrix multiplication form is as follows:

[0078]

[0079] In the formula, the rotation matrix is an orthogonal matrix.

[0080] From the results, we can see that the new coordinates , which is exactly equal to the original coordinates The effect after rotation and translation. This shows that the rigid body transformation matrix M realizes the rotation and translation operations at the same time, and they occur in the specified order.

[0081] There is another one, such as Figure 5 As shown in the figure, it is an affine transformation, which preserves the "straightness" and "parallelism" of points, that is, straight lines remain straight lines before and after the transformation, and parallel lines remain parallel. Affine transformation is more general than rigid body transformation because it includes not only rotation, translation, and scaling, but also shearing, but does not include perspective transformation. Therefore, affine transformation can be used to describe a wider range of changes in objects in a plane.

[0082] In two-dimensional space, an affine transformation can be represented by a 3×3 matrix that acts on the homogeneous coordinates of a point. Suppose we have a point , whose homogeneous coordinates are Then, the affine transformation matrix A can be written as:

[0083]

[0084] In the formula, For controlling rotation, scaling and shearing, Used to control translation.

[0085] We will point Multiplying with this transformation matrix, the matrix multiplication form is as follows:

[0086]

[0087] In the formula, Used to indicate , Used to indicate , Used to indicate .

[0088] From the results, we can see that the new coordinates , which is exactly equal to the original coordinates The result after affine transformation.

[0089] Compared with rigid body transformation, affine transformation can not only change the position of the target, but also change the shape and size of the target, but still maintain the "straightness" of the object, that is, the parallel lines in the original image remain parallel after transformation. This feature makes affine transformation particularly useful when dealing with regular geometric shapes such as rectangles and polygons.

[0090] However, affine transformation is only a simple two-dimensional space transformation. Although it has been widely used in image processing and computer vision, it obviously has limitations when dealing with complex problems in three-dimensional space, such as determining the locking status of train door locks.

[0091] First, affine transformation is essentially a two-dimensional transformation model, which can only handle operations such as rotation, translation, scaling and shearing within a plane. However, the train door lock system is a three-dimensional entity, and its locking state involves multi-dimensional spatial relationships and complex mechanical structures.

[0092] Second, affine transformation does not contain depth information (i.e., changes in the z-axis direction), so it cannot handle changes in objects at different depths. For train door locks, the locking process involves not only the planar position relationship between the door panel and the door frame, but also the movement of the lock's internal components in the depth direction. This depth information is crucial for accurately determining whether the door lock is fully locked.

[0093] Third, although the affine transformation maintains parallel lines and straightness, it cannot guarantee other important geometric constraints, such as angle invariance and distance invariance. In the train door lock system, there may be specific angle or distance relationships between certain key components, which are very important to ensure the safety and reliability of the door lock. The affine transformation cannot meet these stricter geometric constraints.

[0094] In order to more accurately describe and solve problems in three-dimensional space, we need to introduce more complex transformation methods and additional technical means. To this end, the present invention uses homography transformation to restore the image. Homography transformation is a powerful geometric transformation technology that can establish a mapping relationship between two-dimensional images, and is particularly suitable for processing the projection changes of planar objects under different viewing angles. In this way, we can effectively correct the image deformation caused by the camera installation angle or position deviation, so as to more accurately capture the actual state of the train door lock.

[0095] In the detection of the locking status of train door locks, the camera is usually installed in a limited space, which may cause the collected image to have a certain angle deviation or partial occlusion. For example, when the camera shoots the door lock from the side, the lock parts in the image may be perspectively deformed, making the originally parallel lines no longer parallel and the shape distorted. This deformation will seriously affect the subsequent feature extraction and status judgment, so effective image correction is required. Based on this, we use homography transformation for image correction.

[0096] The homography transformation is based on a 3×3 non-singular matrix H, such as Figure 6 As shown, it can map a point on a plane from one perspective to another. Specifically, if there is a point The homogeneous coordinates in the original image are expressed as , then the point after homography transformation It can be expressed in the following matrix multiplication form:

[0097]

[0098] In the formula, is the coordinate in the world coordinate system, is the coordinate after homography transformation, is a 1×2 size vector representing the perspective transformation, is a scalar representing the scale factor, is the homography transformation matrix.

[0099] The homography transform switches from one view of the same scene to another by multiplying points in one view to find their relative positions in another view. The formula is as follows:

[0100]

[0101] In the formula, is a point in a view, is the relative position in another view, is the homography transformation matrix, is the homography transformation matrix As for the matrix How is the matrix formed and estimated? entries, you need to understand three basic concepts first: homogeneous coordinates, projection space, and pinhole camera model.

[0102] Homogeneous coordinates are the coordinate system used in projective space, which can be thought of as a plane in 3D space at Z=1. Lines that pass through the origin of 3D space and intersect the Z=1 plane form points in projective space. Also, in projective space, lines are formed when planes in 3D space pass through the origin and intersect the Z=1 plane. In computer graphics and computer vision, homogeneous coordinates in projective space have certain advantages over the Cartesian coordinate system in Euclidean space. One of these advantages is that it allows us to combine image transformations such as rotation and scaling with translation as one matrix multiplication, rather than matrix multiplication followed by vector addition. This means that we can chain complex matrices into a single transformation matrix, which helps the computer perform fewer calculations.

[0103] Homogeneous coordinates and projective space play an important role in deriving the pinhole camera model. This model explains how a scene in 3D space is projected onto an image plane (2D image). The equation below relates points in 3D space to their corresponding positions in the image plane. Note that both the generated 2D points and the source 3D scene points are in homogeneous coordinates, as follows:

[0104]

[0105] In the formula, is the point projected onto the image plane The coordinates of is the point projected onto the image plane The coordinates of Usually 1, used for homogeneous coordinate representation; For the camera The focal length in the direction, For the camera focal length in direction; The image center is The coordinates in the direction, The image center is Coordinates in direction; is the element of the rotation matrix, which describes the rotation of the camera relative to the world coordinate system; The elements of the translation vector describe the translation of the camera relative to the world coordinate system; is the midpoint of the 3D space coordinate, is the midpoint of the 3D space coordinate, is the midpoint of the 3D space coordinate.

[0106] This relationship consists of two transformations. The first transformation matrix is ​​called the camera extrinsic matrix. It tells us where the camera is in 3D space. The second transformation is the camera intrinsic matrix, which transforms the image plane into pixels. First, it scales the image plane from units (such as meters) to pixels. Then, it moves the origin of the image plane to match the pixel coordinates starting at (0,0) in the upper left corner, using the following formula:

[0107]

[0108] is the camera matrix, is the camera matrix We can combine these two transformations into the camera matrix by matrix multiplication. To obtain the values ​​of the entries of this matrix, we perform a process called camera calibration.

[0109] Once we know what the camera matrix is ​​from the pinhole camera model, we can derive the homography matrix. We know that the pinhole camera model maps points in 3D space to the image plane. Assume that our scene is a plane and is located at Then we can Figure 7 Update the camera matrix in the same way.

[0110] The resulting matrix is ​​the homography matrix. It tells us that the transformation of the same scene from one view to another is essentially a transformation from one projection plane to another. Note that the matrix No value, as we can assume it is 1.

[0111] Similar to the camera matrix, we can find the value of the homography transformation matrix by performing a calibration process. Since the homography transformation matrix has 8 degrees of freedom, we need at least four pairs of corresponding points to solve the value of the homography transformation matrix. Then we can combine the relationship between all four points.

[0112] After understanding the homography transformation matrix, the solution of the present invention will be described.

[0113] Since the train door lock adopts a ring lock body structure that rotates around the axis (such as Figure 8), with a hexagonal through hole in the center (the annular lock body structure is fixed by a hexagonal column, and the annular lock body structure is driven to rotate with the shaft), and one edge of the annular lock body structure has a latch tooth, and there are two red target feature points on the latch tooth. When the annular lock body structure rotates around the shaft, the latch tooth also rotates, and after rotating a certain angle, it is limited with the corresponding component, thereby realizing the locking operation of the train door. Therefore, the entire locking process can be judged by obtaining the rotation angle of the annular lock body structure 1 to determine whether the door is closed in place. It should be noted that, in fact, the overall structure of the annular lock body is more complicated, and its locking principle is only explained in a simplified form here.

[0114] Based on this, we only need to identify several feature points on the ring-shaped lock body structure 1 to obtain the rotation angle. At the same time, we also need to combine several fixed feature points outside the ring-shaped lock body structure to obtain the homography transformation matrix.

[0115] First, we need to obtain the baseline state information of the train door lock in the normal locked state after the camera is installed. To this end, we need to first obtain the baseline image of the train door lock when it is normally locked through the installed camera, and identify several target feature points set by ourselves through the pre-trained neural network model. Among them, the neural network model can be any one of the convolutional neural network, feature pyramid network, YOLO series model, etc., and based on the images collected during the daily operation of the train door lock as the training data set, several target feature points are pre-trained for recognition in a supervised or unsupervised manner.

[0116] Then, a homography transformation can be performed based on the identified target feature points and their corresponding coordinates in the world coordinate system, so that the homography transformation matrix obtained in the normal locking state is used as the reference sampling configuration.

[0117] Then, after the system receives the signal that the train door is fully closed, the camera is used to obtain the captured image of the door lock mechanism, and the captured image is converted into the corresponding forward position image (the image that the camera can capture when facing the annular lock body structure) according to the homography transformation matrix.

[0118] According to the positive image obtained after the transformation, each target feature point is extracted again through the pre-trained neural network model.

[0119] Based on the obtained target feature points (here mainly based on the ring lock body structure), we use two judgment methods of "logic and" to perform secondary judgment output of the door closing signal, including:

[0120] (1) Obtain the coordinates of the center of the circle based on several characteristic points on the annular lock body structure. Then connect the center of the circle with any target characteristic point on the annular lock body structure, and obtain the offset angle of the line connecting the center of the circle and the target characteristic point in the normal locking state;

[0121] (2) Based on the coordinates of the center of the circle, the forward image is transformed into polar coordinates, and the target feature points and corresponding coordinates in the transformed image are extracted.

[0122] When the offset angle is less than the preset offset angle and the feature point coordinates after polar coordinate transformation are within the preset range (a certain range of the corresponding coordinates of the target feature point after polar coordinate transformation in the normal locking state), the door is judged to be fully closed, and a door-closed signal is output and the process returns to step S3; otherwise, the door is judged to be not fully closed. This cycle is repeated to monitor the locking state of the train door throughout the entire process to avoid locking failure during operation.

[0123] Among them, Fig. 9 As shown, the key to realizing polar coordinate transformation is to find any point on the circle graph. , the corresponding point on the square graph , and then the interpolation algorithm is used to assign values ​​to all pixels on the circular image.

[0124] On the square graph, the number of rows and columns are , each column on the square graph corresponds to each radius on the circular graph, and there is a length scaling factor in the radial direction ( is the radius of the circle), the circumference is divided into N equal parts, that is, the angle scaling factor is .

[0125] On the circular graph, the image coordinates and world coordinates There is the following transformation relationship: .

[0126] Then, the midpoint of the square diagram Radius length ,angle .

[0127] Point on the circle The corresponding number of rows on the square graph is , the corresponding number of columns .

[0128] Here, the homography transformation can not only handle simple translation, rotation and scaling, but also cope with complex perspective deformation, and is suitable for a variety of shooting angles and environmental conditions. Compared with other complex 3D reconstruction methods, the computational complexity of the homography transformation is low, and it can be quickly executed in a real-time system to meet the real-time requirements of train door lock detection. Through precise feature point matching and robust matrix calculation, the homography transformation can effectively correct image deformation, provide high-quality correction results, and help improve the accuracy of state judgment. In addition, the homography transformation can be adjusted according to specific scenarios and needs, such as selecting different feature point detection algorithms or optimizing parameter settings to adapt to different types of door lock structures and installation environments.

[0129] Therefore, by introducing homography transformation, the present invention can not only effectively correct image deformation caused by camera installation angle or position deviation, but also more accurately capture the actual state of train door locks, providing strong technical support for safe and reliable door lock detection. This method combines the advantages of computer vision and geometric transformation, and can achieve high-precision state monitoring in complex three-dimensional environments, further improving the safety and operational efficiency of trains.

[0130] In addition, the present invention also proposes a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the subway train door lock locking detection method based on visual detection are implemented.

[0131] Also included is a device for processing data, comprising:

[0132] a memory having a computer program stored thereon;

[0133] A processor is used to execute the computer program in the memory to implement the steps of the subway train door lock locking detection method based on visual detection.

[0134] In summary, the present invention proposes a subway train door lock detection method, device and medium based on visual detection. By introducing a visual detection algorithm, the present invention can detect whether the subway train door is correctly locked in a non-contact manner, avoiding the failure problems of traditional mechanical limit switches and electrical detection circuits due to wear, installation errors, electrical interference, etc., greatly enhancing the reliability and safety of the system, and ensuring that the safety of passengers will not be endangered due to door lock failure during the travel of the train.

[0135] In the complex subway operating environment, the system can still accurately detect the door lock status, ensuring the stability and accuracy of the detection results. At the same time, it makes response judgments based on visual detection, with a faster response speed.

[0136] Combining mechanical limit switches and electrical detection circuits as a redundant design, even if the visual inspection system fails, traditional mechanical and electrical detection methods can still play a role, ensuring double verification of the door lock status and enhancing the system's fault tolerance.

[0137] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0138] In addition, in the present invention, descriptions such as "first", "second", "one", etc. are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0139] In the present invention, unless otherwise clearly specified and limited, the terms "connection", "fixation", etc. should be understood in a broad sense. For example, "fixation" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0140] In addition, the technical solutions between the various embodiments of the present invention can be combined with each other, but it must be based on the fact that ordinary technicians in the field can implement it. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by the present invention.

Claims

1. A subway train door lock detection method based on visual detection, characterized in that: Includes steps: S1: Obtain a reference image of the door lock mechanism after the train door lock is normally locked after the camera is fixed, and identify each target feature point through a pre-trained neural network model; S2: According to the identified target feature points and the corresponding coordinates in the world coordinate system, a homography transformation matrix is ​​obtained and the homography transformation matrix is ​​used as a reference sampling point configuration; S3: After receiving the signal that the train door is fully closed, obtain the door lock mechanism image captured by the camera; S4: according to the reference sampling point configuration, converting the acquired acquisition image into a corresponding positive image through homography transformation; S5: Extract target feature points in the positive image through the pre-trained neural network model; S6: Perform secondary determination and output of the door closing signal based on the target feature points; Step S6 specifically includes the following steps: S61: Acquire the center coordinates of the door lock mechanism according to the target feature points on the annular lock body structure, and obtain the offset angle by connecting the center coordinates with any target feature point on the annular lock body structure; S62: performing polar coordinate transformation on the forward image based on the coordinates of the circle center, and extracting each target feature point and the corresponding coordinates in the transformed image; S63: If the offset angle is less than the preset offset angle and the coordinates of the feature point are within the preset range, it is determined that the door is fully closed, a door fully closed signal is output and the process returns to step S3; otherwise, it is determined that the door is not fully closed.

2. A subway train door lock detection method based on visual detection as claimed in claim 1, characterized in that: The train door lock is an annular lock body structure that rotates around an axis.

3. A subway train door lock detection method based on visual detection as claimed in claim 2, characterized in that: The target characteristic points include a number of characteristic points on the annular lock body structure that rotate with the lock body, and a number of characteristic points outside the annular lock body structure that are fixed.

4. A subway train door lock detection method based on visual detection as claimed in claim 3, characterized in that: In the step S62, the polar coordinate transformation is expressed by the following formula: m=r / Δr n=θ / Δθ Wherein, m is the number of rows after polar coordinate transformation, n is the number of columns after polar coordinate transformation, r is the radius length of any pixel point on the annular lock body structure in the forward image, Δr is the preset standard step length in the radial direction, θ is the angle of any pixel point on the annular lock body structure in the forward image, and Δθ is the preset standard step length in angle.

5. The method for detecting the locking of subway train door locks based on visual detection as claimed in claim 1, characterized in that: In the step S2, the homography transformation matrix is ​​constructed by the following formula: In the formula, is the coordinate in the world coordinate system, is the coordinate after homography transformation, A 2×2 is a 2×2 matrix representing the rotation and translation transformation, T 2×1 V is a 2×1 matrix representing the translation. T is a 1×2 size vector representing the perspective transformation, s is a scalar representing the scale factor, and H 3×3 is the homography transformation matrix.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the detection method described in any one of claims 1 to 5 are implemented.

7. A device for processing data, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the detection method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Railway vehicle square hole lock abnormity identification method and system

    CN114972736A

  • Image-based cabinet door lock state detection method, system, equipment and medium

    CN117649637A