Train positioning method, device, electronic equipment and storage medium
Through image acquisition and processing technology, train positioning is achieved using the advertising screen on the inner side of the tunnel, which solves the problem of high equipment costs in the existing technology and achieves low-cost and accurate train positioning.
Patent Information
- Application Number
- CN202311567795.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-22
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2043-11-22
AI Technical Summary
In the prior art, train positioning equipment is costly, especially multiple beacons need to be arranged in the station interval, which increases equipment cost and failure risk.
During the train entering the station, the image acquisition equipment is used to collect the image to be processed on the inner side of the tunnel and convert it into a binary image. The positioning detection status is determined based on the proportion of the target pixel points and all pixel points in the center vertical line direction, and the front of the vehicle is determined. The ad screen boundary is used to calculate the train's position information and size.
It realizes low-cost train positioning, reduces equipment costs, simplifies the system structure, avoids the use of beacon equipment, and improves the accuracy and reliability of positioning.
Smart Images

Figure CN117818704B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of rail transit technology, and in particular to a train positioning method, device, electronic equipment and storage medium. Background Art
[0002] Accurate parking of trains when entering a station is a necessary condition for ensuring safe operation of trains and improving operating efficiency. Especially for subway trains, the positioning accuracy when entering a station plays an important role in ensuring the safety of passengers getting on and off the train.
[0003] In the related technology, the "speed pulse sensor + beacon" method is used to locate the train. Specifically, the angular velocity of the axle can be measured by the speed pulse sensor, and the displacement of the train can be obtained in combination with the wheel diameter; the beacon can include a transponder installed under the track or an induction loop beside the track and other equipment. When the train passes the beacon, the position data corresponding to the beacon device can be obtained, and the positioning information of the train can be determined based on the displacement of the train and the position data of the beacon. For the section within the station, because precise parking requires high positioning accuracy, it is necessary to deploy multiple beacons with a spacing much smaller than the length of the platform section in the section within the station. In this way, the large number of deployed beacons and related trackside equipment will significantly increase the equipment cost. Summary of the invention
[0004] The invention provides a train positioning method, device, electronic equipment and storage medium, which are used to solve the problem of high equipment cost of train positioning in the prior art.
[0005] The present invention provides a train positioning method, comprising:
[0006] During the process of the train entering the station, an image to be processed of the same inner side of the tunnel acquired by the image acquisition device on the train is obtained, and the image to be processed is converted into a binary image; the same inner side is provided with an advertising screen;
[0007] Determining a current positioning detection state of the image to be processed based on a ratio of the number of target pixel points in the direction of a center vertical line in the binary image to the number of all pixel points in the direction of the center vertical line;
[0008] In the case where it is determined that the current positioning detection state has changed relative to the positioning detection state corresponding to the previous frame of the image to be processed, determining a target boundary of the target advertising screen that the front of the train passes by;
[0009] The target positioning information of the train is determined based on the advertising screen position information, size and the target boundary of the target advertising screen.
[0010] According to a train positioning method provided by the present invention, the target positioning information of the train is determined based on the advertising screen position information, size and target boundary of the target advertising screen, including:
[0011] Based on the advertising screen position information and size of the target advertising screen and the target boundary, determining first positioning information when the front of the train passes through the target boundary;
[0012] The second positioning information of the train determined based on inertial navigation is obtained, and the positioning information corresponding to the target time in the second positioning information is corrected based on the first positioning information to obtain the target positioning information; the target time is the time when the front of the train passes the target boundary.
[0013] According to a train positioning method provided by the present invention, the target pixel point is a white pixel point; the current positioning detection state of the image to be processed is determined based on the ratio of the number of target pixel points in the center vertical line direction of the binary image to the number of all pixel points in the center vertical line direction, including:
[0014] Determine the number of white pixels based on the grayscale values of all pixels in the direction of the center perpendicular line in the binary image, and determine the proportion of the number of white pixels to the number of all pixels;
[0015] When the proportion is greater than or equal to a preset proportion threshold, determining that the current positioning detection state of the image to be processed is a first state; the first state is used to indicate that the central vertical line of the image to be processed is in the advertising screen area of the image to be processed;
[0016] When the proportion is less than the preset proportion threshold, the current positioning detection state of the image to be processed is determined to be a second state; the second state is used to characterize that the central vertical line of the image to be processed is in the non-advertising screen area of the image to be processed.
[0017] According to a train positioning method provided by the present invention, when it is determined that the current positioning detection state has changed relative to the positioning detection state corresponding to the previous frame image of the image to be processed, determining the target boundary of the target advertising screen passed by the head of the train includes:
[0018] When it is determined that the current positioning detection state relative to the positioning detection state corresponding to the previous frame image of the image to be processed changes from the first state to the second state, the current advertising screen driven out by the front of the train is determined as the target advertising screen, and the end boundary of the target advertising screen is determined as the target boundary;
[0019] When it is determined that the current positioning detection state relative to the positioning detection state corresponding to the previous frame image of the image to be processed has changed from the second state to the first state, the new advertising screen that the front of the train enters is determined as the target advertising screen, and the starting boundary of the target advertising screen is determined as the target boundary.
[0020] A train positioning method provided by the present invention also includes:
[0021] When the current positioning detection state is the second state and the starting position of the next advertising screen is still not detected when the train travels to the first target position, or when the current positioning detection state is the first state and the ending position of the target advertising screen is still not detected when the train travels to the second target position, the advertising screen count value is increased by 1; the advertising screen count value is used to identify the advertising screen;
[0022] Among them, the first target position is determined based on the first preset error coefficient and the starting position information of the next advertising screen; the second target position is determined based on the first preset error coefficient and the ending position information of the target advertising screen.
[0023] According to a train positioning method provided by the present invention, when it is determined that the current positioning detection state has changed relative to the positioning detection state corresponding to the previous frame image of the image to be processed, determining the target boundary of the target advertising screen passed by the head of the train includes:
[0024] When it is determined that the current positioning detection state has changed relative to the positioning detection state corresponding to the previous frame of the image to be processed, and the train has traveled to at least a third target position, determining a target boundary of the target advertising screen that the front of the train has passed;
[0025] The third target position is determined based on the change type of the current positioning detection state relative to the positioning detection state corresponding to the previous frame image, the second preset error coefficient and the position information of the target boundary.
[0026] According to a train positioning method provided by the present invention, converting the image to be processed into a binary image comprises:
[0027] Filtering the image to be processed to obtain a first image;
[0028] Converting the first image into a grayscale image, and binarizing the grayscale image based on a preset grayscale threshold to obtain a second image;
[0029] Performing morphological closing operation on the second image to obtain the binary image.
[0030] The present invention also provides a train positioning device, comprising:
[0031] An image acquisition module, used for acquiring the image to be processed of the same inner side surface of the tunnel acquired by the image acquisition device on the train during the train entering the station; the same inner side surface is provided with an advertising screen;
[0032] An image binarization module, used for converting the image to be processed into a binary image;
[0033] A state determination module, used to determine the current positioning detection state of the image to be processed based on the ratio of the number of target pixels in the direction of the central vertical line in the binary image to the number of all pixels in the direction of the central vertical line;
[0034] A boundary determination module, used to determine a target boundary of a target advertising screen that the head of the train passes by when the current positioning detection state changes relative to the positioning detection state corresponding to the previous frame of the image to be processed;
[0035] The positioning information determination module is used to determine the target positioning information of the train based on the advertising screen position information, size and target boundary of the target advertising screen.
[0036] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any of the train positioning methods described above is implemented.
[0037] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the train positioning method described in any one of the above is implemented.
[0038] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the train positioning method described in any one of the above is implemented.
[0039] The train positioning method, device, electronic device and storage medium provided by the present invention use an image acquisition device on the train to acquire an image to be processed of the same inner side of a tunnel where an advertising screen is arranged during the process of the train entering the station, convert the image to be processed into a binary image, and determine the current positioning detection state of the image to be processed based on the ratio of the number of target pixel points in the center vertical line direction to the number of all pixel points in the center vertical line direction in the binary image, and determine the target boundary of the target advertising screen passed by the front of the train when the current positioning detection state changes relative to the positioning detection state corresponding to the previous frame of the image to be processed, and then determine the target positioning information of the train based on the advertising screen position information, size and target boundary of the target advertising screen, and realize the positioning of the train entering the station by means of the advertising screen arranged on the same inner side of the train tunnel, without the need for additional beacons and related trackside equipment, and can realize the positioning of the train entering the station by only using simple image acquisition and processing, so that the system is simple and the equipment cost is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0041] Figure 1 is a flow chart of a train positioning method provided by an embodiment of the present invention;
[0042] Figure 2 is one of the schematic diagrams of an image to be processed acquired by an image acquisition device in an embodiment of the present invention;
[0043] Figure 3 is a second schematic diagram of an image to be processed acquired by the image acquisition device in an embodiment of the present invention;
[0044] Figure 4 is a third schematic diagram of an image to be processed acquired by the image acquisition device in an embodiment of the present invention;
[0045] Figure 5 It is one of the schematic diagrams of the principle of determining the current positioning detection state of the image to be processed in the embodiment of the present invention;
[0046] Figure 6 This is the second schematic diagram of the principle of determining the current positioning detection state of the image to be processed in the embodiment of the present invention;
[0047] Figure 7 This is one of the principle schematic diagrams of the train positioning method provided by an embodiment of the present invention;
[0048] Figure 8 This is the second principle schematic diagram of the train positioning method provided by the embodiment of the present invention;
[0049] Fig. 9 is a structural schematic diagram of a train positioning device provided by an embodiment of the present invention;
[0050] Fig.10 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] It should be noted that the serial numbers assigned to the objects described in the present invention, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning.
[0053] The precise stopping of trains when entering a station is a necessary condition for ensuring safe operation of trains and improving operating efficiency, and plays an important role in ensuring the safety of passengers getting on and off the train. With the development of autonomous driving technology, in the autonomous driving mode, the Automatic Train Operation (ATO) system can generate a speed curve based on the real-time speed of the train and the position data of the running line, and use the speed curve to control the actual running speed of the train in real time to achieve the purpose of slowing down and stopping when entering a station.
[0054] In the related technology, the positioning of the train entering the station can be achieved by relying on the coordinated cooperation of track signal equipment and train auxiliary equipment. For example, the speed pulse sensor installed on the train wheel and the beacon arranged beside the track can be used to locate the train. For the section within the station, since the positioning accuracy is required for precise parking, it is necessary to arrange multiple beacons and related trackside equipment with a spacing much smaller than the length of the section within the station, which will significantly increase the equipment cost. Moreover, in emergency situations such as partial failure or failure of these devices, it will affect the precise parking of the train within the station.
[0055] In related technologies, laser radar can also be used to create a three-dimensional point cloud map and process the map to create a structured feature map, which is then matched with the real-time scanning point cloud data of the laser radar deployed on the train to calculate the train's location information. This method requires processing a large amount of point cloud data and requires a high level of computing power for the system.
[0056] Based on this, an embodiment of the present invention provides a new low-cost train positioning method, which uses the advertising screens arranged on the inner side of the tunnel to realize the positioning of the train when it enters the station in the train entry section. Specifically, during the train entry process, the image acquisition device on the train can be used to collect the image to be processed of the same inner side of the tunnel where the advertising screen is arranged, and the image to be processed is converted into a binary image, and then based on the ratio of the number of target pixel points in the center vertical direction of the binary image to the number of all pixel points in the center vertical direction, the current positioning detection state of the image to be processed is determined. When the current positioning detection state changes relative to the positioning detection state corresponding to the previous frame of the image to be processed, the target boundary of the target advertising screen that the train head passes by is determined, and then the target positioning information of the train is determined based on the advertising screen position information, size and target boundary of the target advertising screen. This process does not require additional equipment and facilities such as beacons and related trackside equipment. It only requires the deployment of image acquisition equipment on the train that can capture side images of the tunnel. The train's positioning information can be obtained through simple image processing, which reduces equipment costs. The method is simple and easy to implement. It can not only be applied to conventional train entry control scenarios, but can also be independently applied to emergency situations when related subsystems of the train control system fail, which can help the train enter the station safely.
[0057] Combine the following Figure 1-Figure 8 The train positioning method of the present invention is described. The train positioning method can be applied to an electronic device, which can be an embedded device or a server, etc. The electronic device can be connected to the on-board computer of the train, such as through an on-board switch. The train positioning method can also be applied to a train positioning device set in the electronic device, and the train positioning device can be implemented by software, hardware or a combination of both.
[0058] Figure 1 The flow chart of the train positioning method provided by the embodiment of the present invention is exemplarily shown. Figure 1 As shown, the train positioning method may include the following steps 110 to 140.
[0059] Step 110: When the train enters the station, an image to be processed of the same inner side of the tunnel captured by an image acquisition device on the train is obtained, and the image to be processed is converted into a binary image, wherein the same inner side of the tunnel is provided with an advertising screen.
[0060] In an embodiment of the present invention, an image acquisition device may be installed on the front of the train, and the optical axis of the image acquisition device is perpendicular to the advertising screen arranged on the inner side of the tunnel wall. The image acquisition device includes a camera.
[0061] Exemplarily, the field of view of the image acquisition device can be adjusted to be smaller than a preset field of view angle threshold, so that the image acquisition device has a smaller field of view, wherein the preset field of view angle threshold can be determined based on experiments. When the field of view of the image acquisition device is smaller than the preset field of view angle threshold, the advertisement screen in each frame of the acquired image is an incomplete advertisement screen, that is, a complete advertisement screen will not appear in each frame of the acquired image to be processed.
[0062] It is understandable that in a train tunnel, the brightness of the advertising screen is much higher than that of the tunnel wall due to the advertising, and the advertising screen area and the non-advertising screen area can be distinguished according to the different brightness areas in the image. Figure 2 to Figure 4 The schematic diagram of the image to be processed collected by the image acquisition device is shown as an example. Figure 2 In , the blank area on the left side of the image to be processed is the captured advertising screen, and the shadow area on the right side is the captured tunnel wall screen (i.e., the non-advertising screen area), in which the advertising screen only shows a boundary of the advertising screen, which is a partial area screen of the advertising screen; Figure 3 In , the advertisement screen occupies the entire image screen, and there is no border of the advertisement screen, which is the middle area image of the advertisement screen; in Figure 4 In the figure, the image to be processed is an image of the junction of two adjacent advertising screens, the blank areas on the left and right ends of the image are partial areas of the two adjacent advertising screens, and the shadow area is the tunnel wall image between the two advertising screens.
[0063] For example, the speed of the train entering the station can be adapted by selecting an image acquisition device with a suitable frame rate to avoid the situation where the advertisement image in the acquired image to be processed is blurred due to the excessive speed of the train.
[0064] During the train entry process, the image acquisition device can be used to continuously acquire and process images of the same inner side of the tunnel, and the continuously acquired images to be processed are a series of time-series images. For each frame of the image to be processed acquired, the image to be processed can be binarized to obtain a binary image. It is understandable that in the train entry section of the tunnel, multiple advertising screens can be arranged on the inner side of the tunnel on the non-platform side, and the image acquisition device can be used to continuously acquire and process images of the inner side.
[0065] Specifically, the image to be processed may be converted into a grayscale image first, and the grayscale image may be binarized to obtain a corresponding binary image. Alternatively, before converting the image to be processed into a grayscale image, the image to be processed may be filtered to remove noise in the image. Alternatively, after binarizing the grayscale image, the binarized image may be subjected to a morphological closing operation to prevent a small number of black pixels in the advertising screen area of the image to be processed from affecting subsequent image processing due to noise or brightness problems, thereby improving the binarization effect of the binary image.
[0066] Exemplarily, converting the image to be processed into a binary image may include: filtering the image to be processed to obtain a first image; converting the first image into a grayscale image, and binarizing the grayscale image based on a preset grayscale threshold to obtain a second image; performing a morphological closing operation on the second image to obtain a binary image.
[0067] The filtering of the image to be processed may be median filtering, and the noise in the image to be processed may be removed by median filtering to obtain a first image after the noise is removed. After obtaining the first image, the first image may be converted into a grayscale image using the following expression (1):
[0068] X=0.299*R+0.587*G +0.114*B (1)
[0069] Wherein, X represents the grayscale value of the converted grayscale image, R represents the brightness value of the red channel in the first image, G represents the brightness value of the green channel in the first image, and B represents the brightness value of the blue channel in the first image.
[0070] Since subway trains run in underground environments, the brightness environment of the trains remains stable during operation and is not affected by changing lighting conditions. Moreover, since there is no lighting system inside the station tunnel, the advertising screens installed on the sides of the tunnel have their own constant backlighting effect. Therefore, no matter how the color and content of the advertising screens change, their brightness values can always be guaranteed to be significantly different from the dark tunnel environment. Based on this, the grayscale image can be converted into a binary image, and the binary image can be used to quickly identify the advertising screen.
[0071] Specifically, after obtaining the grayscale image corresponding to the first image, the grayscale image can be binarized based on a preset grayscale threshold, and the grayscale values of the pixels in the grayscale image that are greater than or equal to the preset grayscale threshold are set to a white grayscale value of 255, and the grayscale values of the pixels that are less than the preset grayscale threshold are set to a black grayscale value of 0, so that the second image can be obtained. In this way, after the grayscale image is binarized, the pixels in the advertising screen area will be displayed as white, and the pixels in the non-advertising screen area will be displayed as black.
[0072] Among them, the preset grayscale threshold can be determined by conducting experiments in the field environment of the train running tunnel. Specifically, when the advertising screen lighting system in the tunnel provides normal lighting brightness, an image acquisition device can be used to capture the image of the advertising screen in the tunnel to obtain the brightness value of the advertising screen image, and the preset grayscale threshold is determined based on the brightness value. For example, the average value of the brightness values obtained multiple times can be taken to obtain the average brightness value, and the average brightness value can be converted into a grayscale value to obtain the preset grayscale threshold. Alternatively, the grayscale value corresponding to the minimum brightness value among the brightness values obtained multiple times is determined as the preset grayscale threshold. In this way, through multiple experiments on site, the accuracy and robustness of the image processing results can be guaranteed.
[0073] After binarizing the grayscale image based on the preset grayscale threshold to obtain the second image, the second image can be further subjected to morphological closing operation processing to fill or close small black holes or broken white edges in the white advertising screen area of the second image through morphological closing operation processing, so as to prevent a small number of black pixels in the advertising screen area of the image due to noise or brightness problems, thereby improving the binarization effect. Specifically, the process of performing morphological closing operation processing on the second image can be expressed as the following expressions (2) and (3):
[0074]
[0075] C=E⊕B (3)
[0076] Where D represents the second image, B represents the structuring element used in the morphological closing operation, and C represents the image obtained after the morphological closing operation. represents the corrosion operation, and ⊕ represents the expansion operation.
[0077] For example, after performing morphological closing operation on the second image, all black pixels in the white advertising screen area in the image obtained by the morphological closing operation can be further detected, and the grayscale values of the detected black pixels can be updated to the white grayscale value of 255 to further prevent the existence of a small number of black pixels in the advertising screen area of the image, thereby further improving the binarization effect.
[0078] For example, step 110 may be triggered before the train is about to enter the station, for example, at a preset distance from the station entry mark.
[0079] Step 120: Determine the positioning detection state of the image to be processed based on the ratio of the number of target pixels in the direction of the center perpendicular line in the binary image to the number of all pixels in the direction of the center perpendicular line.
[0080] Due to the presence of continuous advertising screens on the side of the tunnel when the train enters the station, the center vertical line of the image to be processed is in the advertising screen area or the non-advertising screen area at any time, and the current positioning detection state of the image to be processed is the first state or the second state. Among them, the first state is used to represent that the center vertical line of the image to be processed is in the advertising screen area of the image to be processed, and the second state is used to represent that the center vertical line of the image to be processed is in the non-advertising screen area of the image to be processed.
[0081] Among them, the target pixel points include white pixel points or black pixel points. After the image to be processed is converted into a binary image, the grayscale value of the pixel points in the direction of the central vertical line in the binary image can be obtained. According to the grayscale value, it can be determined whether each pixel point is a white pixel point or a black pixel point, and then the current positioning detection state of the image to be processed can be determined by the proportion of the number of white pixels or black pixels in these pixels. If the proportion of the number of white pixels is greater than or equal to the set first threshold, it is determined to be the first state, otherwise it is determined to be the second state. Alternatively, if the proportion of the number of black pixels is greater than or equal to the set second threshold, it is determined to be the second state, otherwise it is determined to be the first state. The first threshold and the second threshold can be equal or different.
[0082] In an optional embodiment, the target pixel point may be a white pixel point. Accordingly, based on the ratio of the number of target pixel points in the center vertical direction of the binary image to the number of all pixel points in the center vertical direction, determining the current positioning detection state of the image to be processed may include: determining the number of white pixel points based on the grayscale values of all pixel points in the center vertical direction of the binary image, and determining the ratio of the number of white pixel points to the number of all pixel points; when the ratio is greater than or equal to a preset ratio threshold, determining the current positioning detection state of the image to be processed to be the first state; when the ratio is less than the preset ratio threshold, determining the current positioning detection state of the image to be processed to be the second state.
[0083] The width of the central vertical line may be preset, for example, it may be one column, two columns, or three columns of pixels at the location of the central vertical line in the binary image.
[0084] For example, Figure 5 One of the schematic diagrams of the determination principle of the current positioning detection state of the image to be processed is shown as an example, referring to Figure 5, which is the case where the central vertical line is in the advertising screen area in the image, the blank area represents the advertising screen area, and the shaded area represents the tunnel wall area, that is, the non-advertising screen area. In the process of determining the current positioning detection state, the number S0 of all pixels in the direction of the central vertical line O1 in the binary image A1 of the image to be processed can be counted, and the number S1 of white pixels with a grayscale value of 255 in these pixels can be counted. At this time, the ratio S1 / S0 of S1 to S0 is greater than the preset ratio threshold of 80%, then it can be determined that the central vertical line is in the advertising screen area in the image, and accordingly, it can be determined that the current positioning detection state of the image to be processed is the first state.
[0085] Figure 6 The second schematic diagram of the determination principle of the current positioning detection state of the image to be processed is exemplified, which is the case where the central vertical line is in the non-advertising screen area in the image, the blank area represents the advertising screen area, and the shaded area represents the non-advertising screen area. In the process of determining the current positioning detection state, the number S0 of all pixels in the direction of the central vertical line O2 in the binary image A2 of the image to be processed can be counted, and the number S1 of white pixels with a grayscale value of 255 in these pixels can be counted. At this time, the ratio S1 / S0 of S1 to S0 is less than the preset ratio threshold of 80%, then it can be determined that the central vertical line is in the non-advertising screen area in the image, and accordingly, it can be determined that the current positioning detection state of the image to be processed is the second state.
[0086] In an optional embodiment, the target pixel point may be a black pixel point. Accordingly, based on the ratio of the number of target pixel points in the center vertical line direction of the binary image to the number of all pixel points in the center vertical line direction, determining the current positioning detection state of the image to be processed may include: determining the number of black pixel points based on the grayscale values of all pixel points in the center vertical line direction of the binary image, and determining the ratio of the number of black pixel points to the number of all pixel points; when the ratio is greater than or equal to a preset ratio threshold, determining the current positioning detection state of the image to be processed to be the second state; when the ratio is less than the preset ratio threshold, determining the current positioning detection state of the image to be processed to be the first state.
[0087] For example, the number S0 of all pixels in the direction of the central vertical line in the binary image of the image to be processed can be counted, and the number S2 of black pixels with a grayscale value of 0 among these pixels can be counted. If the ratio S2 / S0 of S2 to S0 is greater than or equal to the preset ratio threshold of 80%, it can be determined that the central vertical line is in the non-advertising screen area in the image, and accordingly, it can be determined that the current positioning detection state of the image to be processed is the second state; otherwise, it is determined that the current positioning detection state of the image to be processed is the first state.
[0088] Step 130: When it is determined that the current positioning detection state has changed relative to the positioning detection state corresponding to the previous frame of the image to be processed, determine the target boundary of the target advertising screen that the front of the train passes by.
[0089] If the current positioning detection state changes relative to the positioning detection state corresponding to the previous frame of the image to be processed, for example, changes from the first state to the second state, or from the second state to the first state, it means that the train has passed the intersection of the advertising screen and the tunnel wall, and must have passed the boundary of the advertising screen in the image. The target boundary of the target advertising screen passed by the front of the train can be determined based on the type of change in the current positioning detection state relative to the positioning detection state corresponding to the previous frame, that is, determine the target boundary of the target advertising screen passed by the front of the train when the current positioning detection state changes relative to the positioning detection state corresponding to the previous frame.
[0090] The target boundary includes the starting boundary or the ending boundary of the target advertising screen along the direction of the train. The change type of the current positioning detection state relative to the positioning detection state corresponding to the previous frame image includes changing from the first state to the second state and from the second state to the first state.
[0091] Specifically, if the type of change of the current positioning detection state relative to the positioning detection state corresponding to the previous frame image is from the first state to the second state, that is, the positioning detection state is changed from the previous white to black, it means that the train has just exited the advertising screen, then the advertising screen that the train exits is the target advertising screen, and its ending boundary is the target boundary; if the type of change of the current positioning detection state relative to the positioning detection state corresponding to the previous frame image is from the second state to the first state, that is, the positioning detection state is changed from the previous black to white, it means that the train has just entered an advertising screen of a new advertising screen, then the new advertising screen that the train enters is the target advertising screen, and its starting boundary is the target boundary. Correspondingly, when it is determined that the current positioning detection state has changed relative to the positioning detection state corresponding to the previous frame image of the image to be processed, determining the target boundary of the target advertising screen that the front of the train has passed can include: when it is determined that the current positioning detection state has changed from a first state to a second state relative to the positioning detection state corresponding to the previous frame image of the image to be processed, determining the current advertising screen that the front of the train has driven out of as the target advertising screen, and determining the ending boundary of the target advertising screen as the target boundary; when it is determined that the current positioning detection state has changed from the second state to the first state relative to the positioning detection state corresponding to the previous frame image of the image to be processed, determining the new advertising screen that the front of the train has driven into as the target advertising screen, and determining the starting boundary of the target advertising screen as the target boundary.
[0092] It can be understood that the change of the positioning detection state from the first state to the second state indicates that the train has driven out of an advertising screen, and the change of the positioning detection state from the second state to the first state indicates that the train has driven into a new advertising screen, that is, the change of the positioning detection state indicates that the train has passed the intersection of the advertising screen and the tunnel wall. Therefore, starting from the train entering the station, the advertising screens passed by the train can be counted based on the change of the positioning detection state, and the target advertising screen can be determined by the count value. For example, if the count value is 3, it can be determined that the target advertising screen is the advertising screen numbered 3. In this way, the size and advertising screen location information of the matching target advertising screen can be found from the advertising screen information library using the count value and the station identification. The corresponding relationship between the station identification, the advertising screen number, the size of the advertising screen and the advertising screen location information can be saved in the advertising screen information library.
[0093] Step 140: Determine the target positioning information of the train based on the advertising screen position information, size and target boundary of the target advertising screen.
[0094] For the advertising screens arranged on the inner side of the tunnel, the size and location information of each advertising screen can be obtained in advance through field measurements, or can be obtained through a three-dimensional building model of the subway station, and the three-dimensional building model can be a building information model (Building Information Modeling, BIM).
[0095] Among them, the size of the advertising screen refers to the width of the advertising screen, and its position is the relative position of the advertising screen relative to the entrance position of the station. For example, the position information of the starting boundary of the advertising screen along the direction of the train running can be determined as the advertising screen position information of the advertising screen, or the position information of the ending boundary of the advertising screen along the direction of the train running can be determined as the advertising screen position information of the advertising screen, or the position information of the center position of the advertising screen can be determined as the advertising screen position information.
[0096] After obtaining the size and location information of each advertising screen through field measurement or using the three-dimensional architectural model of the subway station, the size and location information of each advertising screen are saved in the advertising screen information library. The advertising screen information library can save the correspondence between the station logo, advertising screen number, size of the advertising screen and the advertising screen location information. Different advertising screens at different stations can be distinguished by the station logo and advertising screen number.
[0097] After obtaining the advertising screen position information, size and target boundary of the target advertising screen, the first positioning information when the front of the train passes the target boundary can be determined based on the advertising screen position information, size and target boundary, and the first positioning information can be determined as the target positioning information of the train. Alternatively, the first positioning information when the front of the train passes the target boundary can be determined based on the advertising screen position information, size and target boundary, and the second positioning information of the train determined by the inertial measurement unit (IMU) of the train based on inertial navigation technology can be obtained at the same time, and then the first positioning information at the target moment when the front of the train passes the target boundary is used to correct the positioning information corresponding to the target moment in the second positioning information, and the corrected second positioning information is determined as the target positioning information, so that the continuous positioning information of the train can be obtained.
[0098] For example, Figure 7 One of the schematic diagrams of the principle of the train positioning method provided by an embodiment of the present invention is exemplarily shown, referring to Figure 7 As shown in the figure, suppose that N advertising screens are arranged on the same inner side of a tunnel in a station section, which can be numbered from 1 to N in sequence starting from the entrance position. Let i represent the count value of the advertising screens passed by the train, then i∈[1, N], where P i_start represents the starting boundary position of the i-th advertising screen, P i_end Indicates the end boundary position of the i-th advertising screen. For example, Figure 7 In the example, the starting boundary position of the first advertising screen is P 1_start , the end boundary position is P 1_end ; The starting boundary position of the second advertising screen is P 2_start , the end boundary position is P 2_end ; The starting boundary position of the Nth advertising screen is P N_start , the end boundary position is P N_end .
[0099] When the train enters the station, the changes in the positioning detection status have the following rules:
[0100] 1. If the positioning detection state of the central vertical line is recognized to change from the previous black state (i.e., the second state) to the white state (i.e., the first state), it means that the train has just entered the i-th advertising screen. Then, the position of the starting boundary of the i-th advertising screen along the train travel direction can be determined. That is, at P i_start location;
[0101] 2. If the positioning detection state of the central vertical line changes from the previous white state to the black state, it means that the train has just driven out of the i-th advertising screen. Then, the position of the end boundary of the i-th advertising screen along the train travel direction can be determined. That is, at P i_endlocation.
[0102] Based on this, the advertising screens that the train passes through the station section can be counted according to the change of the current positioning detection state of the image to be processed relative to the positioning detection state corresponding to the previous frame of the image to be processed, that is, the above-mentioned i value can be determined. The i value can correspond to the number of the advertising screens arranged on the same inner side of the tunnel in the station section, and the target advertising screen corresponding to the i value can be determined accordingly. At the same time, the target boundary of the target advertising screen that the train head passes by can be determined according to the type of change of the current positioning detection state of the image to be processed relative to the positioning detection state corresponding to the previous frame of the image to be processed. Furthermore, based on the i value and the station logo of the current station, the size and location information of the corresponding target advertising screen can be found from the pre-established advertising screen information database, and then combined with P i_start or P i_end The real-time position information of the train when the positioning detection state changes can be obtained, that is, the first positioning information.
[0103] For example, when the positioning detection state changes, the train passes the starting position P of the second advertising screen. 2_start For example, assuming that the advertising screen position information of the advertising screen is the position information P of its starting position 21 , then the train currently passes the starting position P 2_start The first positioning information P = P 2_start =P 21 ; Assume that the advertising screen position information of the advertising screen is the position information P of its end position 22 , then the train currently passes the starting position P 2_start The first positioning information P = P 2_start =P 22 -L2; Assume that the advertising screen position information of the advertising screen is the position information of its center position P 23 , then the train currently passes the starting position P 2_start The first positioning information P = P 2_start =P 23 -L2 / 2. L2 represents the size of the second advertising screen, that is, the width of the advertising screen.
[0104] For example, the advertising screen information library can also directly store the position information of the starting boundary and the ending boundary of each advertising screen. In this way, when the train passes through the starting boundary or the ending boundary of the target advertising screen, the position information of the corresponding boundary can be directly queried, thereby improving the efficiency of determining the train positioning information.
[0105] The train positioning method provided by the embodiment of the present invention uses an image acquisition device on the train to collect the image to be processed of the same inner side of the tunnel where the advertising screen is arranged during the train entering the station, converts the image to be processed into a binary image, and determines the current positioning detection state of the image to be processed based on the ratio of the number of target pixels in the center vertical line direction of the binary image to the number of all pixels in the center vertical line direction, and determines the target boundary of the target advertising screen passed by the head of the train when the current positioning detection state changes relative to the positioning detection state corresponding to the previous frame of the image to be processed, and then determines the target positioning information of the train based on the advertising screen position information, size and target boundary of the target advertising screen, and realizes the positioning of the train entering the station by means of the advertising screen arranged on the same inner side of the train tunnel, does not require additional beacons and related trackside equipment, and can realize the positioning of the train entering the station by using only simple image acquisition and processing, the system is simple, and the equipment cost is reduced. Moreover, the algorithm for identifying the advertising screen based on the ratio of the number of target pixels in the center vertical line direction of the binary image to the number of all pixels in the center vertical line direction is simple and easy, does not require strong computing power support, has a reliable principle, is simple to implement, and can quickly locate the source of the error when the relevant error occurs.
[0106] In the above-mentioned embodiment method, when the positioning detection state changes, the first positioning information determined based on the target boundary and the size of the target advertising screen and the advertising screen position information can only reflect the positioning information of the position of the train when it just enters or exits the target advertising screen, so the positioning information is discrete. In order to further obtain continuous train positioning information and train travel speed information, in an exemplary embodiment, the train's IMU module can be combined to use inertial navigation technology to calculate the train's travel speed and position information to obtain the train's continuous position information, and the first positioning information is used to continuously correct the continuous position information to obtain the train's continuous positioning information.
[0107] Specifically, determining the target positioning information of the train based on the advertising screen position information, size and target boundary of the target advertising screen may include: determining the first positioning information when the front of the train passes the target boundary based on the advertising screen position information, size and target boundary of the target advertising screen; obtaining the second positioning information of the train determined based on inertial navigation, and correcting the positioning information corresponding to the target time in the second positioning information based on the first positioning information to obtain the target positioning information. The target time is the time when the front of the train passes the target boundary.
[0108] For example, combined with Figure 7, starting from the train entering the station, the IMU module performs inertial navigation calculations based on the initial train running status data at the time of entry, such as initialization operations and kinematic calculation steps, etc. The calculation results can include the displacement, velocity vector and spatial posture of the train in three-dimensional coordinates at each moment. Based on this inertial navigation calculation, continuous second positioning information can be obtained. When it is detected at time t1 that the current positioning detection state changes from the second state to the first state relative to the positioning detection state corresponding to the previous frame image, based on the change in the positioning detection state, the position P of the starting boundary of the train entering the first advertising screen can be determined. 1_start , P can be determined based on the advertising screen position information, size and starting boundary of the first advertising screen. 1_start The position information of the position can be used to obtain the precise positioning information of the train at time t1. The positioning information can be used to correct the position information of the inertial navigation calculation at time t1. The IMU module reinitializes the inertial navigation calculation according to the corrected positioning information. Then, when it is detected at time t2 that the current positioning detection state changes from the first state to the second state relative to the positioning detection state corresponding to the previous frame image, the position P of the end boundary of the train leaving the first advertising screen can be determined. 1_end At this time, the precise positioning information of the train at time t2 can also be obtained, and the position information at time t2 calculated by the inertial navigation can be corrected with the positioning information. The IMU module continues to reinitialize the inertial navigation calculation based on the corrected positioning information. Similarly, the discrete positioning information determined based on the advertising screen can be used to continuously correct the calculation results of the inertial navigation, that is, each time it reaches P i_start or P i_end When the train is located, the corrected position information is used to reinitialize the inertial navigation calculation, so that continuous positioning information of the train can be obtained, which makes up for the discontinuity of positioning information determined only based on the advertising screen. Among them, the real-time speed of the train can be obtained through inertial navigation calculation.
[0109] Based on this, Figure 8 The second schematic diagram of the principle of the train positioning method provided by the embodiment of the present invention is exemplarily shown, referring to Figure 8As shown, when the train enters the station, the electronic device can use the image acquisition device to continuously acquire and process the same inner side of the tunnel where the advertising screen is arranged to determine the positioning detection state of each frame image; at the same time, the IMU module of the train can independently calculate the real-time speed and displacement of the train based on inertial navigation, and the displacement can be determined as the second positioning information. The electronic device can use the finite state machine principle to detect whether the positioning detection state has changed, and then can determine the first positioning information at the time of change according to the change type when the change is detected, and use the first positioning information to correct the positioning information at this moment in the second positioning information calculated by the IMU module, so as to obtain the target positioning information of the train. Accordingly, the image processing module and the IMU module can be integrated in the electronic device, and the image acquisition device can be installed on the train, and the image acquisition device can be used to acquire the image of the inner side of the tunnel, and the acquired image is transmitted to the image processing module for processing. The image processing module and the IMU module can work together to achieve continuous positioning of the train.
[0110] The train positioning method provided by the embodiment of the present invention, during the process of the train entering the station, performs image acquisition on the same inner side surface of the tunnel where the advertising screen is arranged, and determines the target boundary of the target advertising screen passed by the front of the train based on the change of the current positioning detection state of the acquired image to be processed relative to the positioning detection state corresponding to the previous frame image, and then determines the absolute position of the train in the section within the station based on the advertising screen position information, size and target boundary of the target advertising screen, and uses the absolute position to correct the displacement of the train in the section within the station calculated by inertial navigation, and integrates inertial navigation calculation to realize train positioning in a continuous state.
[0111] For the advertising screens arranged on the inner side of the tunnel, considering that the size and position of each advertising screen are unchanged and known, the distance the train travels from one advertising screen to another and the distance from the starting boundary of one advertising screen to the ending boundary of the advertising screen are known. Accordingly, the train's travel distance can be predicted within the interval when the positioning detection state switches from the first state to the second state, or from the second state to the first state. Moreover, considering that inertial navigation can independently calculate the displacement of the train, the change state of the positioning detection state can be checked based on this to prevent misdetection or omission of advertising screens, thereby improving the accuracy of train positioning.
[0112] Correspondingly, based on the train positioning method of the above-mentioned embodiments, in an exemplary embodiment, the train positioning method may also include: when the current positioning detection state is the second state and the starting position of the next advertising screen is not detected when the train travels to the first target position, or when the current positioning detection state is the first state and the ending position of the target advertising screen is not detected when the train travels to the second target position, adding 1 to the advertising screen count value; the advertising screen count value is used to identify the advertising screen; wherein the first target position is determined based on the first preset error coefficient and the starting position information of the next advertising screen; the second target position is determined based on the first preset error coefficient and the ending position information of the target advertising screen.
[0113] Specifically, two new states, suspected missed detection white and suspected missed detection black, can be set additionally, namely suspected missed detection first state and suspected missed detection second state. If the positioning detection state is currently in the black state, namely the second state, it means that the train has left the current i-th advertising screen, and the distance between the i-th advertising screen and the i+1-th advertising screen is known, then the positioning detection state changes from the current black state to the white state, namely the first state, and should travel at least a certain distance to reach the first target position, which can be expressed as (1+γ1)*P i+1_start That is, if the positioning detection state is currently in the black state and the vehicle travels to (1+γ1)*P i+1_start The starting position P of the new advertising screen has not been detected yet. i+1_start , then it enters the suspected missed detection white state. The positioning detection state returns to the black state from the suspected missed detection white state. It is necessary to confirm that the train has at least passed the end position P of the i+1th advertising screen. i+1_end At this time, the i value needs to be updated, and the i value is increased by 1 to correct the missed detection of the advertising screen. Among them, γ1 is the first preset error coefficient, which can be determined based on the inertial navigation error.
[0114] Similarly, if the positioning detection state is currently in the white state, that is, the first state, it means that the train is currently traveling to the i-th advertising screen. The size of the i-th advertising screen is known, then the positioning state should be transformed from the current white state to the black state. It should travel at least a certain distance to reach the second target position. The second target position can be expressed as (1+γ1)*P i_end That is, if the positioning detection state is currently in the white state and the vehicle travels to (1+γ1)*P i_end The end position P of the current i-th advertising screen has not been detected yet i_end , then it enters the suspected missed detection black state. The positioning detection state returns to the white state from the suspected missed detection black state. It is necessary to confirm that the train has at least entered the starting position P of the i+1th advertising screen. i+1_startAt this time, it is also necessary to update the i value and add 1 to correct the missed detection of the advertising screen.
[0115] Based on the train positioning method of the above-mentioned embodiments, in an exemplary embodiment, when it is determined that the current positioning detection state has changed relative to the positioning detection state corresponding to the previous frame image of the image to be processed, determining the target boundary of the target advertising screen that the front of the train has passed may include: when it is determined that the current positioning detection state has changed relative to the positioning detection state corresponding to the previous frame image of the image to be processed, and the train has traveled to at least a third target position, determining the target boundary of the target advertising screen that the front of the train has passed; wherein the third target position is determined based on the type of change of the current positioning detection state relative to the positioning detection state corresponding to the previous frame image, a second preset error coefficient and the position information of the target boundary.
[0116] For the change rules of the positioning detection state described in the above step 140, both change rules of the positioning detection state need to ensure that the train has traveled a corresponding distance, and only then is it considered that the train has passed the boundary of the advertising screen. That is, when the positioning detection state is determined to be converted from the previous black state (i.e., the second state) to the current white state (i.e., the first state) based on the collected image to be processed of the same inner side of the tunnel, it means that the train may have entered the i+1th advertising screen. At this time, it is also necessary to confirm whether the train has traveled to at least (1-γ2)*P i+1_start If the position is , it means that the train has indeed entered the i+1th advertising screen, and the switching of the positioning detection state is valid. At this time, the target boundary of the target advertising screen that the front of the train passes when the positioning detection state changes is determined. In this scenario, the target boundary can be determined as the starting boundary of the i+1th advertising screen. Among them, γ2 is the second preset error coefficient, which can be determined based on the inertial navigation error. For example, γ2 and γ1 can be the same or different.
[0117] Similarly, when the positioning detection state is determined to be changed from the previous white state (i.e., the first state) to the black state (i.e., the second state) based on the collected image to be processed of the inner side of the tunnel, it means that the train may have driven out of the i-th advertising screen. At this time, it is also necessary to confirm whether the train has traveled to at least (1-γ2)*P i_end If the position is correct, it means that the train has indeed driven out of the i-th advertising screen, and the switching of the positioning detection state is valid. At this time, the target boundary of the target advertising screen that the front of the train passes when the positioning detection state changes is determined. In this scenario, the target boundary can be determined as the end boundary of the i-th advertising screen.
[0118] The train positioning method provided by the embodiment of the present invention, on the one hand, can use image acquisition equipment, with the help of advertising screens arranged on the same inner side of the tunnel in the station section to realize the positioning of the train in the station station, and can realize the positioning of the train without any trackside equipment, which effectively reduces the equipment cost, and the method is simple and easy to implement; moreover, in the image processing process, the algorithm for identifying the advertising screen based on the pixel points in the vertical direction of the center of the binary image is simple and easy, does not require strong computing power support, is reliable in principle, and is simple to implement. When relevant errors occur, the source of the error can be quickly located. On the other hand, inertial navigation can be integrated, and the displacement of the train in the station section calculated by inertial navigation can be corrected by using the absolute position of the train determined based on the advertising screen, thereby realizing the positioning of the train in a continuous state. Furthermore, the independent displacement calculation of inertial navigation can be used to further realize the monitoring of the false detection or missed detection of the advertising screen, improve the robustness of image processing, and ensure the reliability of positioning when the train enters the station.
[0119] The train locating device provided by the present invention is described below. The train locating device described below and the train locating method described above can be referenced to each other.
[0120] Fig. 9 The structural diagram of the train positioning device provided by the embodiment of the present invention is exemplarily shown. Fig. 9 As shown, the train positioning device may include: an image acquisition module 910, which is used to acquire the image to be processed of the same inner side of the tunnel acquired by the image acquisition device on the train during the train entering the station, and the same inner side of the tunnel is arranged with an advertising screen; an image binarization module 920, which is used to convert the image to be processed into a binary image; a state determination module 930, which is used to determine the current positioning detection state of the image to be processed based on the ratio of the number of target pixel points in the center vertical direction of the binary image to the number of all pixel points in the center vertical direction; a boundary determination module 940, which is used to determine the target boundary of the target advertising screen passed by the front of the train when it is determined that the current positioning detection state has changed relative to the positioning detection state corresponding to the previous frame of the image to be processed; a positioning information determination module 950, which is used to determine the target positioning information of the train based on the advertising screen position information, size and target boundary of the target advertising screen.
[0121] In an exemplary embodiment, the positioning information determination module 950 may include: a first determination unit, used to determine the first positioning information when the front of the train passes through the target boundary based on the advertising screen position information, size and target boundary of the target advertising screen; a correction unit, used to obtain the second positioning information of the train determined based on inertial navigation, and based on the first positioning information, correct the positioning information corresponding to the target time in the second positioning information to obtain the target positioning information; wherein the target time is the time when the front of the train passes through the target boundary.
[0122] In an exemplary embodiment, the target pixel point may be a white pixel point. Accordingly, the state determination module 930 may include: a second determination unit, which is used to determine the number of white pixels based on the grayscale values of all pixels in the direction of the central vertical line in the binary image, and determine the proportion of the number of white pixels to the number of all pixels; a third determination unit, which is used to determine that the current positioning detection state of the image to be processed is a first state when the proportion is greater than or equal to a preset proportion threshold, wherein the first state is used to characterize that the central vertical line of the image to be processed is in the advertising screen area of the image to be processed; a fourth determination unit, which is used to determine that the current positioning detection state corresponding to the image to be processed is a second state when the proportion is less than a preset proportion threshold, wherein the second state is used to characterize that the central vertical line of the image to be processed is in the non-advertising screen area of the image to be processed.
[0123] In an exemplary embodiment, the boundary determination module 940 may include: a fifth determination unit, for determining the current advertising screen that the front of the train drives out of as the target advertising screen, and determining the end boundary of the target advertising screen as the target boundary, when it is determined that the current positioning detection state relative to the positioning detection state corresponding to the previous frame image of the image to be processed has changed from the first state to the second state; a sixth determination unit, for determining the new advertising screen that the front of the train drives into as the target advertising screen, and determining the starting boundary of the target advertising screen as the target boundary, when it is determined that the current positioning detection state relative to the positioning detection state corresponding to the previous frame image of the image to be processed has changed from the second state to the first state.
[0124] In an exemplary embodiment, the train positioning device may further include: a counting module, used to add 1 to the advertising screen count value when the current positioning detection state is the second state and the starting position of the next advertising screen is not detected when the train travels to the first target position, or when the current positioning detection state is the first state and the ending position of the target advertising screen is not detected when the train travels to the second target position; wherein the first target position is determined based on a first preset error coefficient and the starting position information of the next advertising screen; the second target position is determined based on the first preset error coefficient and the ending position information of the target advertising screen; the advertising screen count value is used to identify the advertising screen.
[0125] In an exemplary embodiment, the boundary determination module 940 may be specifically used to determine the target boundary of the target advertising screen passed by the front of the train when it is determined that the current positioning detection state has changed relative to the positioning detection state corresponding to the previous frame image of the image to be processed, and the train has traveled to at least the third target position; wherein the third target position is determined based on the type of change of the current positioning detection state relative to the positioning detection state corresponding to the previous frame image, the second preset error coefficient and the position information of the target boundary.
[0126] In an exemplary embodiment, the image binarization module 920 may include: a filtering unit, used to filter the image to be processed to obtain a first image; a binarization unit, used to convert the first image into a grayscale image, and binarize the grayscale image based on a preset grayscale threshold to obtain a second image; and a processing unit, used to perform a morphological closing operation on the second image to obtain a binary image.
[0127] Fig.10 An example of a structural diagram of an electronic device is shown in FIG. Fig.10 As shown, the electronic device may include: a processor 1010, a communication interface 1020, a memory 1030 and a communication bus 1040, wherein the processor 1010, the communication interface 1020 and the memory 1030 communicate with each other through the communication bus 1040. The processor 1010 may call the logic instructions in the memory 1030 to execute the train positioning method provided by any of the above method embodiments.
[0128] Exemplarily, the processor 1010 may include a central processing unit (CPU), a microprocessor, a network processor (NP), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0129] Exemplarily, the communication bus 1040 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus.
[0130] In addition, the logic instructions in the above-mentioned memory 1030 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0131] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the train positioning method provided by any of the above method embodiments.
[0132] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the train positioning method provided by any of the above method embodiments is implemented.
[0133] Illustratively, the computer-readable storage medium comprises a non-transitory computer-readable storage medium.
[0134] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0135] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A train positioning method, characterized in that: include: During the process of the train entering the station, an image to be processed of the same inner side of the tunnel acquired by the image acquisition device on the train is obtained, and the image to be processed is converted into a binary image; the same inner side is provided with an advertising screen; Based on the ratio of the number of target pixel points in the direction of the central vertical line in the binary image to the number of all pixel points in the direction of the central vertical line, determining the current positioning detection state of the image to be processed; the current positioning detection state is a first state or a second state; the first state is used to characterize that the central vertical line of the image to be processed is in the advertising screen area of the image to be processed; The second state is used to indicate that the central vertical line of the image to be processed is in the non-advertisement screen area of the image to be processed; In the case where it is determined that the current positioning detection state has changed relative to the positioning detection state corresponding to the previous frame of the image to be processed, determining a target boundary of the target advertising screen that the front of the train passes by; the target boundary includes a starting boundary or an ending boundary of the target advertising screen along the travel direction of the train; The target positioning information of the train is determined based on the advertising screen position information, size and the target boundary of the target advertising screen.
2. The train positioning method according to claim 1, characterized in that: The determining the target positioning information of the train based on the advertising screen position information, size and the target boundary of the target advertising screen includes: Based on the advertising screen position information and size of the target advertising screen and the target boundary, determining first positioning information when the front of the train passes through the target boundary; The second positioning information of the train determined based on inertial navigation is obtained, and the positioning information corresponding to the target time in the second positioning information is corrected based on the first positioning information to obtain the target positioning information; the target time is the time when the front of the train passes the target boundary.
3. The train positioning method according to claim 1 or 2, characterized in that: The target pixel is a white pixel; and determining the current positioning detection state of the image to be processed based on the ratio of the number of target pixels in the direction of the central vertical line in the binary image to the number of all pixels in the direction of the central vertical line includes: Determine the number of white pixels based on the grayscale values of all pixels in the direction of the center perpendicular line in the binary image, and determine the proportion of the number of white pixels to the number of all pixels; When the proportion is greater than or equal to a preset proportion threshold, determining that the current positioning detection state of the image to be processed is a first state; When the proportion is less than the preset proportion threshold, it is determined that the current positioning detection state of the image to be processed is the second state.
4. The train positioning method according to claim 3, characterized in that: The step of determining a target boundary of a target advertising screen that the head of the train passes by when it is determined that the current positioning detection state has changed relative to a positioning detection state corresponding to a previous frame of the image to be processed comprises: When it is determined that the current positioning detection state relative to the positioning detection state corresponding to the previous frame image of the image to be processed changes from the first state to the second state, the current advertising screen driven out by the front of the train is determined as the target advertising screen, and the end boundary of the target advertising screen is determined as the target boundary; When it is determined that the current positioning detection state relative to the positioning detection state corresponding to the previous frame image of the image to be processed has changed from the second state to the first state, the new advertising screen that the front of the train enters is determined as the target advertising screen, and the starting boundary of the target advertising screen is determined as the target boundary.
5. The train positioning method according to claim 3, characterized in that: Also includes: When the current positioning detection state is the second state and the starting position of the next advertising screen is still not detected when the train travels to the first target position, or when the current positioning detection state is the first state and the ending position of the target advertising screen is still not detected when the train travels to the second target position, the advertising screen count value is increased by 1; the advertising screen count value is used to identify the advertising screen; Among them, the first target position is determined based on the first preset error coefficient and the starting position information of the next advertising screen; the second target position is determined based on the first preset error coefficient and the ending position information of the target advertising screen.
6. The train positioning method according to claim 1 or 2, characterized in that: The step of determining a target boundary of a target advertising screen that the head of the train passes by when it is determined that the current positioning detection state has changed relative to a positioning detection state corresponding to a previous frame of the image to be processed comprises: When it is determined that the current positioning detection state has changed relative to the positioning detection state corresponding to the previous frame of the image to be processed, and the train has traveled to at least a third target position, determining a target boundary of the target advertising screen that the front of the train has passed; The third target position is determined based on the change type of the current positioning detection state relative to the positioning detection state corresponding to the previous frame image, the second preset error coefficient and the position information of the target boundary.
7. The train positioning method according to claim 1 or 2, characterized in that: The step of converting the image to be processed into a binary image comprises: Filtering the image to be processed to obtain a first image; Converting the first image into a grayscale image, and binarizing the grayscale image based on a preset grayscale threshold to obtain a second image; Performing morphological closing operation on the second image to obtain the binary image.
8. A train positioning device, characterized in that: include: An image acquisition module, used for acquiring the image to be processed of the same inner side surface of the tunnel acquired by the image acquisition device on the train during the train entering the station; the same inner side surface is provided with an advertising screen; An image binarization module, used for converting the image to be processed into a binary image; A state determination module, used to determine the current positioning detection state of the image to be processed based on the ratio of the number of target pixel points in the direction of the central vertical line in the binary image to the number of all pixel points in the direction of the central vertical line; the current positioning detection state is a first state or a second state; the first state is used to characterize that the central vertical line of the image to be processed is in the advertising screen area of the image to be processed; The second state is used to indicate that the central vertical line of the image to be processed is in the non-advertisement screen area of the image to be processed; A boundary determination module, for determining a target boundary of a target advertising screen that the head of the train passes by, when it is determined that the current positioning detection state has changed relative to the positioning detection state corresponding to the previous frame of the image to be processed; the target boundary includes a starting boundary or an ending boundary of the target advertising screen along the travel direction of the train; The positioning information determination module is used to determine the target positioning information of the train based on the advertising screen position information, size and target boundary of the target advertising screen.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the train positioning method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the train positioning method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Vehicle positioning method and device based on screen optical communication and server
CN111862208A
Train position detection system using image processing, and train position and environmental change detection system using image processing
JP2017001638A
