Railway wagon loading state image distortion evaluation method and system
By automatically identifying and verifying distortions in railway freight car loading status images, and utilizing target detection and edge detection algorithms, the problem of low efficiency in manual evaluation is solved, achieving a more efficient and objective image quality evaluation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-03-24
AI Technical Summary
In existing technologies, the evaluation of distortion in railway freight car loading images mainly relies on manual marking and measurement of tilt angles, which is inefficient and prone to errors, affecting the accuracy of the evaluation results.
An automated method is used to acquire image sets and associated information. Object detection models and edge detection algorithms are used to identify tilted and distorted images. A list of line segments is extracted using the Hough transform algorithm. The least squares method is used to fit longitudinal approximate line segments to determine whether the image is tilted and distorted. The results are then verified and the proportion of distorted images is statistically analyzed.
This improves the efficiency of image quality evaluation of railway freight car loading status, reduces subjective human judgment, and achieves more standardized and objective evaluation results.
Smart Images

Figure CN121724934A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of railway freight technology, and in particular to a method and system for evaluating image distortion of railway freight car loading status. Background Technology
[0002] The railway freight car loading status image acquisition system uses line scan cameras installed alongside the tracks to capture images of the left, right, and top of freight cars in their loading status, enabling remote safety inspections and reducing the workload of on-site freight inspectors. The image quality of the freight car loading status is crucial for ensuring the effectiveness of remote safety inspections. To address the issue of inconsistent image quality from railway freight car loading status image acquisition systems from different manufacturers installed under varying station conditions, it is necessary to conduct image quality evaluations. This evaluation will encourage manufacturers to adjust substandard image acquisition equipment, improve image quality, and ensure the effectiveness of remote safety inspections of freight car loading status, thereby guaranteeing the safety of railway freight transportation.
[0003] In existing technologies, the image distortion evaluation of railway freight cars under loading conditions usually involves manual marking, measuring tilt angles, and judging whether there is tilt. Manual image quality evaluation is inefficient and may result in mismarking or incorrect angle measurement, affecting the accuracy of the evaluation results. Summary of the Invention
[0004] This invention provides a method and system for evaluating image distortion of railway freight car loading status, in order to overcome at least one of the above-mentioned technical problems existing in the prior art.
[0005] To achieve the above objectives, the embodiments of the present invention adopt the following technical solutions: In a first aspect, the present invention provides a method for evaluating image distortion of railway freight car loading status, comprising: Acquire the image set collected from railway freight car loading status image acquisition points and the image information set associated with the image set; Based on the image information set, extract a set of railway freight car loading status images from the image set; Each railway freight car loading status image in the railway freight car loading status image set is identified one by one. It is determined whether the railway freight car loading status image is a tilted and distorted image. If so, it is marked to obtain an initial version of the tilted and distorted image set and an initial version of the normal image set. The initial set of tilted and distorted images and the initial set of normal images are reviewed and verified to obtain the final set of tilted and distorted images. The percentage of the final version of the tilted and distorted image set in the total number of railway freight car loading status images is calculated, and the evaluation results are output.
[0006] In one possible implementation of the first aspect, the image information set includes vehicle type information, and the step of extracting a set of railway freight car loading status images from the image set according to the image information set includes: Based on the vehicle model information, determine one by one whether each image in the image set is a shunting image. If it is, delete the image; otherwise, record it as a railway freight car loading status image to obtain the railway freight car loading status image set.
[0007] In one possible implementation of the first aspect, the image information set includes vehicle type information and image-side information. The step of sequentially identifying each railway freight car loading status image in the image set and determining whether the railway freight car loading status image is a tilted or distorted image includes: Based on the vehicle model information and the image side information, each railway freight car loading status image in the railway freight car loading status image set is classified to obtain a tank car side image set and a freight car image set. The tank car side image set includes a tank car left side image and a tank car right side image, and the freight car image set includes a tank car top image, a freight car left side image, a freight car right side image, and a freight car top image. The tilted and distorted images in each of the railway freight car loading status images in the image set on both sides of the tanker are manually labeled; Using a preset target detection model, the rectangular region on the left side of each railway freight car loading status image in the freight car image set is located one by one. An edge detection algorithm and a Hough transform algorithm are used to obtain a list of straight line segments in the rectangular region on the left side of the freight car. The list of straight line segments records the start and end point coordinates, angle and polar radius of each straight line segment. Determine whether the railway freight car loading status image is a tilted and distorted image based on the list of straight line segments.
[0008] In one possible implementation of the first aspect, the step of using a preset target detection model to locate the rectangular region on the left side of each railway freight car loading status image in the freight car image set includes: The image of the railway freight car loading status is input into the target detection model to obtain a rectangular region on the left side of the freight car that includes the leftmost point of the freight car and the head area of the car body. The coordinates of the upper left and lower right corners of the rectangular region on the left side of the freight car are recorded.
[0009] In one possible implementation of the first aspect, obtaining the list of line segments in the rectangular region on the left side of the truck using the edge detection algorithm and the Hough transform algorithm includes: Extract the RGB image of the rectangular area on the left side of the truck and convert it to a grayscale image of the rectangular area on the left side of the truck; Using an edge detection algorithm based on the Canny operator, the edge binary image of the grayscale image of the rectangular region on the left side of the truck is obtained; The Hough transform algorithm is used to calculate the binary image of the edge to obtain a list of line segments.
[0010] In one possible implementation of the first aspect, determining whether the railway freight car loading status image is a tilted and distorted image based on the list of straight line segments includes: The line segments in the list of line segments that are approximately on the same straight line are merged into a single approximate line segment to obtain a list of approximate line segments, wherein the list of approximate line segments includes at least one longitudinal approximate line segment; Using the angle of the leftmost longitudinal approximate straight line segment as the tilt angle of the railway freight car, determine whether the railway freight car loading status image is a tilted and distorted image.
[0011] In one possible implementation of the first aspect, merging the line segments in the list that are approximately on the same straight line into a single approximate line segment includes: Step S301: Take the first line segment L1 in the line segment list L, and set the variable i=2; Step S302: Take the i-th line segment L from the line segment list L. i Calculate line segment L i The absolute value of the angle difference a with line segment L1, and the absolute value of the polar radius difference d; Step S303: Determine if the absolute value of the angle difference a ≤ angle threshold A and the absolute value of the polar radius difference d ≤ polar radius threshold D. If so, then set the straight line segment L... i Include in the list of similar line segments (SL); Step S304: Increment i by 1, and determine whether the variable i is greater than the number of line segments in the line segment list L. If yes, jump to step S305; otherwise, return to step S302. Step S305: Fit all similar line segments SL in the similar line segment list SL using the least squares method. k Where 1≤k≤num, and num is the number of similar line segments in the similar line segment list SL, an approximate line segment is obtained, added to the approximate line segment list RL, and all line segments L in the line segment list L that are included in the similar line segment list SL are deleted. i Clear the list of similar line segments SL; Step S306: Determine whether the number of line segments in the line segment list L is zero. If not, return to step S301. If yes, end the process and obtain the approximate line segment list RL.
[0012] In one possible implementation of the first aspect, determining whether the railway freight car loading status image is a tilted and distorted image by using the angle of the leftmost longitudinal approximate straight line segment as the tilt angle of the railway freight car includes: Take the line between the two focal points of the longitudinal approximate straight line segment and the rectangular boundary line of the rectangular region on the left side of the truck as the extension line of the longitudinal approximate straight line; The leftmost longitudinal approximate line segment is determined based on the average X-value of the coordinates of all points on the extension of the longitudinal approximate line. Determine whether the angle of the leftmost longitudinal approximate straight line segment is greater than a preset tilt distortion threshold. If so, it is a tilt distortion image.
[0013] In one possible implementation of the first aspect, the step of verifying and checking the initial version of the tilted distortion image set and the initial version of the normal image set to obtain the final version of the tilted distortion image set includes: Each image of the top of the tanker truck, the left side of the truck, the right side of the truck, and the top of the truck in the initial version of the tilted and distorted image set and the initial version of the normal image set was manually reviewed one by one. Normal images incorrectly classified into the initial set of tilted and distorted images, and tilted images incorrectly classified into the initial set of normal images; The final tilted image set is obtained by statistically analyzing the unlabeled tilted images in the initial tilted distortion image set and the labeled tilted images in the initial normal image set.
[0014] Compared with the prior art, the present invention has at least the following beneficial effects: The railway freight car loading status image distortion evaluation method provided by this invention acquires an image set collected by image acquisition points, quickly and accurately identifies distorted images in the image set, and calculates the proportion of distorted images. This improves the efficiency of railway freight car loading status image quality evaluation, while reducing subjective human judgment, making the evaluation more standardized, and thus more objective and fair.
[0015] Secondly, the present invention provides a system for evaluating image distortion of railway freight car loading status, comprising: The acquisition module is used to acquire the image set collected by the railway freight car loading status image acquisition point and the image information set associated with the image set; The selection module is used to extract a set of railway freight car loading status images from the image set based on the image information set; The identification module is used to identify each railway freight car loading status image in the railway freight car loading status image set one by one, determine whether the railway freight car loading status image is a tilted and distorted image, and if so, mark it to obtain an initial version of the tilted and distorted image set and an initial version of the normal image set. The verification module is used to verify the initial set of tilted and distorted images and the initial set of normal images to obtain the final set of tilted and distorted images. The evaluation module is used to calculate the proportion of the final version of the tilted and distorted image set in the railway freight car loading state image set and output the evaluation results.
[0016] Thirdly, the present invention provides an electronic device comprising: at least one processor and at least one memory, wherein the memory stores computer-readable instructions; the computer-readable instructions are executed by one or more of the processors, causing the electronic device to implement the railway freight car loading status image distortion evaluation method as in any implementation of the first aspect.
[0017] Fourthly, the present invention provides a storage medium having a computer-executable program stored thereon, the computer-executable program being used to cause a computer to execute the railway freight car loading status image distortion evaluation method as in any implementation of the first aspect.
[0018] Understandably, the beneficial effects achieved by the system of the second aspect, the electronic device of the third aspect, and the storage medium of the fourth aspect provided above can be referred to in light of the beneficial effects of the first aspect and any of its possible design embodiments, which will not be repeated here. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention; Figure 2 A flowchart of a method for evaluating image distortion of a railway freight car loading status provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of an edge binary image in an embodiment of the present invention; Figure 4 This is a flowchart of a method for obtaining an approximate list of line segments in an embodiment of the present invention; Figure 5 This is a schematic diagram of a longitudinal approximate straight line segment in an embodiment of the present invention; Figure 6 This is a schematic diagram of approximate straight line segments for different trucks in an embodiment of the present invention; Figure 7This is a structural block diagram of a railway freight car loading status image distortion evaluation system provided in an embodiment of the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be described below with reference to the accompanying drawings. In the description of the present invention, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can represent A or B. The "or" in the present invention is merely a description of the relationship between the related objects, indicating that three relationships can exist. For example, A or B can represent: A alone, A and B simultaneously, and B alone. A and B can be singular or plural. Furthermore, in the description of the present invention, unless otherwise stated, "multiple" refers to two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items.
[0022] Furthermore, to facilitate a clear description of the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.
[0023] In this embodiment of the invention, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" or "for example" in this embodiment of the invention should not be construed as superior or more advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner for ease of understanding.
[0024] The railway freight car loading status image acquisition system uses line scan cameras installed alongside the tracks to capture images of the left, right, and top of freight cars in their loading status, enabling remote safety inspections and reducing the workload of on-site freight inspectors. The image quality of the freight car loading status is crucial for ensuring the effectiveness of remote safety inspections. To address the issue of inconsistent image quality from railway freight car loading status image acquisition systems from different manufacturers installed under varying station conditions, it is necessary to conduct image quality evaluations. This evaluation will encourage manufacturers to adjust substandard image acquisition equipment, improve image quality, and ensure the effectiveness of remote safety inspections of freight car loading status, thereby guaranteeing the safety of railway freight transportation.
[0025] In existing technologies, the image distortion evaluation of railway freight cars under loading conditions usually involves manual marking, measuring tilt angles, and judging whether there is tilt. Manual image quality evaluation is inefficient and may result in mismarking or incorrect angle measurement, affecting the accuracy of the evaluation results.
[0026] In view of this, on the one hand, embodiments of the present invention provide a method for evaluating the distortion of railway freight car loading status images, including acquiring an image set collected by railway freight car loading status image acquisition points and an image information set associated with the image set; extracting a railway freight car loading status image set from the image set according to the image information set; identifying each railway freight car loading status image in the image set one by one, determining whether the railway freight car loading status image is a tilted distortion image, and if so, marking it to obtain an initial tilted distortion image set and an initial normal image set; verifying the initial tilted distortion image set and the initial normal image set to obtain a final tilted distortion image set; calculating the proportion of the final tilted distortion image set in the railway freight car loading status image set, and outputting the evaluation result.
[0027] The image distortion evaluation method for railway freight car loading status provided in this embodiment of the invention improves the efficiency of railway freight car loading status image quality evaluation by acquiring an image set collected by image acquisition points, quickly and accurately identifying distorted images in the image set, and calculating the proportion of distorted images. At the same time, it reduces subjective human judgment, making the evaluation more standardized and thus more objective and fair.
[0028] In some embodiments, the image distortion evaluation method for the loading status of railway freight cars provided in this invention can be executed by any electronic device 20 with data processing capabilities, such as a general-purpose computer, personal computer, laptop computer, switch, or tablet computer. The specific implementation of the electronic device 20 is not limited here.
[0029] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention is shown. The electronic device 20 includes a processor 210, a memory 220, and a communication interface 230.
[0030] Processor 210 may include one or more processing cores. Processor 210 connects to various parts within electronic device 20 using various interfaces and lines, and performs various functions and processes data of electronic device 20 by running or executing instructions, programs, code sets, or instruction sets stored in memory 220, and by calling data stored in memory 220. Optionally, processor 210 may be implemented using at least one of the following hardware forms: Central Processing Unit (CPU), Graphics Processing Unit (GPU), Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA).
[0031] The memory 220 may include random access memory (RAI) or read-only memory (ROI). Optionally, the memory 220 may include non-transitory computer-readable storage ledger. The memory 220 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 220 may include a stored program area. The stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as data processing functions, data storage functions, and display push functions), and instructions for implementing the various method embodiments described above.
[0032] Communication interface 230 is used to communicate with other devices, equipment or communication networks, such as data storage devices, image processing devices or Ethernet, wireless access network (RAN), wireless local area network (WLAN), etc.
[0033] In terms of physical implementation, the aforementioned devices (such as processor 210, memory 220, and communication interface 230) can each be devices within the same device (such as a laptop computer). Alternatively, at least two of these devices can be located within the same device, i.e., as different devices within the same device, similar to the deployment of devices or components in a distributed system.
[0034] It is understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 20. In other embodiments of the present invention, the electronic device 20 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0035] The following description, in conjunction with the accompanying drawings, illustrates a method for evaluating image distortion in the loading state of railway freight cars according to an embodiment of the present invention.
[0036] like Figure 2 As shown, this embodiment of the invention provides a method for evaluating image distortion of railway freight car loading status, which may include, but is not limited to: Step S1: Obtain the image set collected by the railway freight car loading status image acquisition point and the image information set associated with the image set.
[0037] In specific implementation, the image set in this embodiment of the invention includes at least the left, right, and top images of the train passing through the railway freight car loading status image acquisition point. Each railway freight car loading status image acquisition point in this embodiment of the invention includes at least line array cameras erected on both sides of the railway freight car passage line and a line array camera erected on the top of the line via a gantry frame. The left, right, and top images of the train passing through the railway freight car loading status image acquisition point are acquired simultaneously by the line array cameras on both sides and the line array camera on the top.
[0038] In specific implementation, embodiments of the present invention can acquire image sets and image information sets associated with railway freight car loading status image acquisition points according to the train train. The train train includes a train train and a shunting train, which is a set of all shunting locomotives (referred to as shunting locomotives) and freight cars (referred to as freight cars) that continuously pass through a railway freight car loading status image acquisition point.
[0039] The embodiments of the present invention may, but are not limited to, obtaining the image set and the image information set associated with the image set through network transmission or copying to a storage medium.
[0040] It should be noted that the image information set in the embodiments of the present invention may include, but is not limited to, image information such as vehicle number, train number, position, vehicle type, and image side. The image information may be stored in a storage file, and the format of the storage file may include, but is not limited to, TXT, JSON, DAT, CSV, etc. Of course, the image information may also be stored in the image file name or the image set folder name, which is not limited here.
[0041] Step S2: Extract a set of railway freight car loading status images from the image set based on the image information set.
[0042] In one feasible implementation, the image information set in this embodiment of the invention includes vehicle type information, and the step of extracting a set of railway freight car loading status images from the image set according to the image information set includes: Based on the vehicle model information, determine one by one whether each image in the image set is a shunting image. If it is, delete the image; otherwise, record it as a railway freight car loading status image to obtain the railway freight car loading status image set.
[0043] In practice, shunting locomotives are railway locomotives used within stations or depots to disassemble and reassemble carriages and train sets to meet transportation demands. This invention's embodiment filters and deletes shunting locomotive images based on vehicle type information, reducing the amount of subsequent image processing and improving processing efficiency.
[0044] In the specific implementation process, after deleting the shunting locomotive image, the embodiments of the present invention may, but are not limited to, rename each railway freight car loading status image. The image name contains unique number information, which may, but is not limited to, include time, train number information, car number information, position, image side, etc., and is not limited here.
[0045] In practical implementation, after deleting and renaming the shunting images, this embodiment of the invention can further classify and store railway freight car loading status images according to different train numbers by establishing storage directories. For example, train number information can be written into the folder name of each train. The file directory, from top to bottom, can be station name, measuring point name, and train number name. The folder named after the train number contains left, right, and top images of all freight cars in the entire train. When encountering a situation where there is no train number or car number, a unique number can be automatically generated to distinguish different trains or freight cars.
[0046] Step S3: Identify each railway freight car loading status image in the railway freight car loading status image set one by one, and determine whether the railway freight car loading status image is a tilted and distorted image. If so, mark it to obtain the initial tilted and distorted image set and the initial normal image set.
[0047] In practical implementation, railway freight cars come in a variety of types and carry a wide range of goods. For example, the types of cars include flatcars, tank cars, boxcars, and open wagons, and the goods carried include coal, containers, tarpaulin-covered goods, or empty wagons. In view of the diversity of railway freight car types and carried goods, the embodiments of the present invention have made the following improvements: In one feasible implementation, the image information set in this embodiment of the invention includes vehicle type information and image side information. The step of identifying each railway freight car loading status image in the image set one by one, and determining whether the railway freight car loading status image is a tilted or distorted image, may include, but is not limited to: Based on the vehicle model information and the image side information, each railway freight car loading status image in the railway freight car loading status image set is classified to obtain a tank car side image set and a freight car image set. The tank car side image set includes a tank car left side image and a tank car right side image, and the freight car image set includes a tank car top image, a freight car left side image, a freight car right side image, and a freight car top image. The tilted and distorted images in each of the railway freight car loading status images in the image set on both sides of the tanker are manually labeled; Using a preset target detection model, the rectangular region on the left side of each railway freight car loading status image in the freight car image set is located one by one. An edge detection algorithm and a Hough transform algorithm are used to obtain a list of straight line segments in the rectangular region on the left side of the freight car. The list of straight line segments records the start and end point coordinates, angle and polar radius of each straight line segment. Determine whether the railway freight car loading status image is a tilted and distorted image based on the list of straight line segments.
[0048] It should be noted that, in this embodiment of the invention, each image can be traversed to first identify all images of the sides of the tanker truck and the truck itself. Then, all images of the sides of the tanker truck are packaged and sent to a manual identification end, where a human identifies whether each image is tilted or distorted. Similarly, all images of the truck are packaged and sent to a preset target detection model, where the model identifies whether each image is tilted or distorted. Alternatively, a one-by-one identification and transmission mode can be used: when an image is identified as a tanker truck image, it is immediately sent to a manual identification end for manual identification; when an image is identified as a truck image, it is immediately sent to a preset target detection model for tilt and distortion identification. No limitation is made here.
[0049] In this embodiment of the invention, the method of manually marking tilted and distorted images can be, but is not limited to, clicking the left mouse button, clicking the right mouse button, dragging the image, etc., and is not limited here.
[0050] In the specific implementation process, the target detection model in this embodiment of the invention is a pre-trained model. Various types of trucks are collected in advance in various environments during the day and night, including left, right, and top images. The training set and test set are divided according to the ratio of 80% and 20% of the total number of images. The training set is input into the target detection model for model training. After training, it is applied to the test set to verify the recognition accuracy of the target detection model. If the accuracy does not meet the requirements, the training parameters are modified or the number of images in the training set is increased, the model is retrained and tested until the recognition accuracy meets the requirements.
[0051] In one feasible implementation, the method of using a preset target detection model to locate the left rectangular region of each railway freight car loading status image in the freight car image set may include, but is not limited to: The image of the railway freight car loading status is input into the target detection model to obtain a rectangular region on the left side of the freight car that includes the leftmost point of the freight car and the head area of the car body. The coordinates of the upper left and lower right corners of the rectangular region on the left side of the freight car are recorded.
[0052] In one feasible implementation, the method of obtaining the list of line segments in the rectangular region on the left side of the truck using the edge detection algorithm and the Hough transform algorithm in this embodiment of the invention may include, but is not limited to: Extract the RGB image of the rectangular area on the left side of the truck and convert it to a grayscale image of the rectangular area on the left side of the truck; Using an edge detection algorithm based on the Canny operator, the edge binary image of the rectangular region on the left side of the truck is obtained, as shown below. Figure 3 As shown; The Hough transform algorithm is used to calculate the binary image of the edge to obtain a list of line segments.
[0053] In specific implementation, the list of line segments in the embodiments of the present invention may, but is not limited to, recording the coordinates of the start and end points, angles, and polar radius of each line segment, and is not limited here.
[0054] In one feasible implementation, the step of determining whether the railway freight car loading status image is a tilted and distorted image based on the list of straight lines in this embodiment of the invention may include, but is not limited to: The line segments in the list of line segments that are approximately on the same straight line are merged into a single approximate line segment to obtain a list of approximate line segments, wherein the list of approximate line segments includes at least one longitudinal approximate line segment; Using the angle of the leftmost longitudinal approximate straight line segment as the tilt angle of the railway freight car, determine whether the railway freight car loading status image is a tilted and distorted image.
[0055] In the specific implementation process, such as Figure 4 As shown in the embodiment of the present invention, merging the line segments in the list of line segments that are approximately on the same straight line into a single approximate line segment to obtain a list of approximate line segments includes: Step S301: Take the first line segment L1 in the line segment list L, and set the variable i=2; Step S302: Take the i-th line segment L from the line segment list L. i Calculate line segment L i The absolute value of the angle difference a with line segment L1, and the absolute value of the polar radius difference d; Step S303: Determine if the absolute value of the angle difference a ≤ angle threshold A and the absolute value of the polar radius difference d ≤ polar radius threshold D. If so, then set the straight line segment L... i Include in the list of similar line segments (SL); Step S304: Increment i by 1, and determine whether the variable i is greater than the number of line segments in the line segment list L. If yes, jump to step S305; otherwise, return to step S302. Step S305: Fit all similar line segments SL in the similar line segment list SL using the least squares method. k Where 1≤k≤num, and num is the number of similar line segments in the similar line segment list SL, an approximate line segment is obtained, added to the approximate line segment list RL, and all line segments L in the line segment list L that are included in the similar line segment list SL are deleted. i Clear the list of similar line segments SL; Step S306: Determine whether the number of line segments in the line segment list L is zero. If not, return to step S301. If yes, end the process and obtain the approximate line segment list RL.
[0056] It should be noted that in the line segment list L of the present invention embodiment, there may be only one line segment L1. When there is only one line segment L1, the present invention embodiment directly includes line segment L1 in the similar line segment list SL, and then executes step S305.
[0057] In specific implementation, the angle threshold A in the embodiments of the present invention can be set to 1, and the polar radius threshold D can be set to 2. Of course, other thresholds can also be used, which are not limited here.
[0058] In the specific implementation process, since the embodiment of the present invention uses the angle of the leftmost longitudinal approximate straight line segment as the tilt angle of the railway freight car to determine whether the railway freight car loading state image is a tilted and distorted image, the least squares method is used to fit all similar straight line segments SL in the list of similar line segments. kAfter obtaining an approximate straight line segment, this embodiment of the invention can further determine whether it is a horizontal or vertical approximate straight line segment by identifying the absolute value of the angle of the approximate straight line. When the approximate straight line is a horizontal approximate straight line segment, it is discarded; when the approximate straight line is a vertical approximate straight line segment, it is retained and displayed in bold. Figure 5 As shown, the final result is a list of approximate line segments consisting only of longitudinal approximate line segments.
[0059] In one feasible implementation, the method of using the angle of the leftmost longitudinal approximate straight line segment as the tilt angle of the railway freight car to determine whether the railway freight car loading state image is a tilted and distorted image may include, but is not limited to: Take the line between the two focal points of the longitudinal approximate straight line segment and the rectangular boundary line of the rectangular region on the left side of the truck as the extension line of the longitudinal approximate straight line; The leftmost longitudinal approximate line segment is determined based on the average X-value of the coordinates of all points on the extension of the longitudinal approximate line. Determine whether the angle of the leftmost longitudinal approximate straight line segment is greater than a preset tilt distortion threshold. If so, it is a tilt distortion image.
[0060] In specific implementation, the tilt distortion threshold in the embodiments of the present invention can be, but is not limited to, any value between 1.5° and 10.2°, and is not limited here.
[0061] Step S4: Verify the initial set of tilted and distorted images and the initial set of normal images to obtain the final set of tilted and distorted images.
[0062] In one feasible implementation, the verification and validation of the initial tilted distortion image set and the initial normal image set to obtain the final tilted distortion image set in this embodiment of the invention may include, but is not limited to: Each image of the top of the tanker truck, the left side of the truck, the right side of the truck, and the top of the truck in the initial version of the tilted and distorted image set and the initial version of the normal image set was manually reviewed one by one. Normal images incorrectly classified into the initial set of tilted and distorted images, and tilted images incorrectly classified into the initial set of normal images; The final tilted image set is obtained by statistically analyzing the unlabeled tilted images in the initial tilted distortion image set and the labeled tilted images in the initial normal image set.
[0063] It should be noted that the marking methods in the embodiments of the present invention may include, but are not limited to, actions such as clicking the left mouse button, clicking the right mouse button, and dragging the image, and are not limited here.
[0064] Step S5: Calculate the proportion of the tilted distortion image set in the railway freight car loading state image set, and output the evaluation result.
[0065] In specific implementation, embodiments of the present invention can also perform multi-dimensional comprehensive evaluation of the tilt distortion evaluation results together with other image evaluation indicators such as sharpness, color distortion, and three-sided alignment, without limitation.
[0066] The railway freight car loading status image distortion evaluation method provided by this invention acquires an image set collected by image acquisition points, quickly and accurately identifies distorted images in the image set, and calculates the proportion of distorted images. This improves the efficiency of railway freight car loading status image quality evaluation, while reducing subjective human judgment, making the evaluation more standardized, and thus more objective and fair.
[0067] Furthermore, this embodiment of the invention utilizes edge detection algorithms and Hough transform algorithms to obtain a list of straight line segments in the rectangular region on the left side of the freight car. Straight line segments approximately on the same straight line are merged into a single approximate straight line, effectively avoiding interference from Gaussian, Poisson, and salt-and-pepper noise. This is suitable for special cases such as protrusions in the railway freight car canopy layout and circular holes on flatcars and empty cars, automatically and accurately finding the leftmost longitudinal approximate straight line of the freight car to obtain the precise tilt angle of the freight car. Figure 6 As shown, Figure 6 The images, in order, show the top views of an empty flatcar, a tank car, a tarpaulin-covered open wagon, and the side view of a boxcar. The markings on the near-straight lines in the images are accurate.
[0068] Based on the above-mentioned method for evaluating image distortion of railway freight car loading status provided in the first aspect, embodiments of the present invention provide a system for evaluating image distortion of railway freight car loading status, such as... Figure 7 As shown, the railway freight car loading status image distortion evaluation system includes: The acquisition module 110 is used to acquire the image set collected by the railway freight car loading status image acquisition point and the image information set associated with the image set; The selection module 120 is used to extract a set of railway freight car loading status images from the image set based on the image information set; The identification module 130 is used to identify each railway freight car loading status image in the railway freight car loading status image set one by one, determine whether the railway freight car loading status image is a tilted and distorted image, and if so, mark it to obtain an initial version of the tilted and distorted image set and an initial version of the normal image set. The verification module 140 is used to verify the initial set of tilted and distorted images and the initial set of normal images to obtain the final set of tilted and distorted images. Evaluation module 150 is used to calculate the proportion of the final version of the tilted distortion image set in the railway freight car loading state image set and output the evaluation result.
[0069] Based on the above-described method for evaluating image distortion of a railway freight car loading status provided in the first aspect, this embodiment of the invention also provides a storage medium storing a computer-executable program. The computer-executable program is used to cause a computer to execute the method for evaluating image distortion of a railway freight car loading status as described in any implementation of the first aspect. Explanations of the relevant content and descriptions of the beneficial effects of any of the computer-readable storage media provided above can be found in the corresponding embodiments described above, and will not be repeated here.
[0070] Those skilled in the art will understand that the program for implementing all or part of the steps of the above embodiments, which can be executed by a program instructing related hardware, can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The processing unit or processor mentioned above can be a central processing unit, a general-purpose processor, an application-specific integrated circuit (ASIC), a microprocessor (DSP), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.
[0071] This invention also provides a computer program product containing instructions that, when executed on a computer, cause the computer to perform any of the methods described in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this invention is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., SSD), etc.
[0072] It should be noted that the devices for storing computer instructions or computer programs provided in the embodiments of the present invention, such as, but not limited to, the aforementioned memory, computer-readable storage medium, and communication chip, are all non-transitory. Those skilled in the art should recognize that the functions described in the embodiments of the present invention in one or more of the above examples can be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable storage medium or transmitted as one or more instructions or code on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein communication media include any medium that facilitates the transmission of computer programs from one place to another. Storage media can be any available medium accessible to general-purpose or special-purpose computers.
[0073] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for evaluating image distortion of railway freight car loading status, characterized in that, include: Acquire the image set collected from railway freight car loading status image acquisition points and the image information set associated with the image set; Based on the image information set, extract a set of railway freight car loading status images from the image set; Each railway freight car loading status image in the railway freight car loading status image set is identified one by one. It is determined whether the railway freight car loading status image is a tilted and distorted image. If so, it is marked to obtain an initial version of the tilted and distorted image set and an initial version of the normal image set. The initial version of the tilted and distorted image set and the initial version of the normal image set are reviewed and verified to obtain the final version of the tilted and distorted image set; Calculate the proportion of the final version of the tilted distortion image set in the railway freight car loading state image set, and output the evaluation results.
2. The method for evaluating image distortion of railway freight car loading status according to claim 1, characterized in that, The image information set includes vehicle type information. Extracting a set of railway freight car loading status images from the image set based on the image information set includes: Based on the vehicle model information, determine one by one whether each image in the image set is a shunting image. If it is, delete the image; otherwise, record it as a railway freight car loading status image to obtain the railway freight car loading status image set.
3. The method for evaluating image distortion of railway freight car loading status according to claim 1, characterized in that, The image information set includes vehicle type information and image side information. The step of identifying each railway freight car loading status image in the image set one by one, and determining whether the railway freight car loading status image is a tilted or distorted image, includes: Based on the vehicle model information and the image side information, each railway freight car loading status image in the railway freight car loading status image set is classified to obtain a tank car side image set and a freight car image set. The tank car side image set includes a tank car left side image and a tank car right side image, and the freight car image set includes a tank car top image, a freight car left side image, a freight car right side image, and a freight car top image. The tilted and distorted images in each of the railway freight car loading status images in the image set on both sides of the tanker are manually labeled; Using a preset target detection model, the rectangular region on the left side of each railway freight car loading status image in the freight car image set is located one by one. An edge detection algorithm and a Hough transform algorithm are used to obtain a list of straight line segments in the rectangular region on the left side of the freight car. The list of straight line segments records the start and end point coordinates, angle and polar radius of each straight line segment. Determine whether the railway freight car loading status image is a tilted and distorted image based on the list of straight line segments.
4. The method for evaluating image distortion of railway freight car loading status according to claim 3, characterized in that, The step of using a preset target detection model to locate the rectangular region on the left side of each railway freight car loading status image in the freight car image set includes: The image of the railway freight car loading status is input into the target detection model to obtain a rectangular region on the left side of the freight car that includes the leftmost point of the freight car and the head area of the car body. The coordinates of the upper left and lower right corners of the rectangular region on the left side of the freight car are recorded.
5. The method for evaluating image distortion of railway freight car loading status according to claim 3, characterized in that, The process of obtaining a list of line segments in the rectangular region on the left side of the truck using edge detection and Hough transform algorithms includes: Extract the RGB image of the rectangular area on the left side of the truck and convert it to a grayscale image of the rectangular area on the left side of the truck; Using an edge detection algorithm based on the Canny operator, the edge binary image of the grayscale image of the rectangular region on the left side of the truck is obtained; The Hough transform algorithm is used to calculate the binary image of the edge to obtain a list of line segments.
6. The method for evaluating image distortion of railway freight car loading status according to claim 3, characterized in that, The step of determining whether the railway freight car loading status image is a tilted and distorted image based on the list of straight line segments includes: The line segments in the list of line segments that are approximately on the same straight line are merged into a single approximate line segment to obtain a list of approximate line segments, wherein the list of approximate line segments includes at least one longitudinal approximate line segment; Using the angle of the leftmost longitudinal approximate straight line segment as the tilt angle of the railway freight car, determine whether the railway freight car loading status image is a tilted and distorted image.
7. The method for evaluating image distortion of railway freight car loading status according to claim 6, characterized in that, The step of merging the line segments in the list that are approximately on the same straight line into a single approximate line segment to obtain a list of approximate line segments includes: Step S301: Take the first line segment L1 in the line segment list L, and set the variable i=2; Step S302: Take the i-th line segment L from the line segment list L. i Calculate line segment L i The absolute value of the angle difference a with line segment L1, and the absolute value of the polar radius difference d; Step S303: Determine if the absolute value of the angle difference a ≤ angle threshold A and the absolute value of the polar radius difference d ≤ polar radius threshold D. If so, then set the straight line segment L... i Include in the list of similar line segments (SL); Step S304: Increment i by 1, and determine whether the variable i is greater than the number of line segments in the line segment list L. If yes, jump to step S305; otherwise, return to step S302. Step S305: Fit all similar line segments SL in the similar line segment list SL using the least squares method. k Where 1≤k≤num, and num is the number of similar line segments in the similar line segment list SL, an approximate line segment is obtained, added to the approximate line segment list RL, and all line segments L in the line segment list L that are included in the similar line segment list SL are deleted. i Clear the list of similar line segments SL; Step S306: Determine whether the number of line segments in the line segment list L is zero. If not, return to step S301. If yes, end the process and obtain the approximate line segment list RL.
8. The method for evaluating image distortion of railway freight car loading status according to claim 6, characterized in that, The step of using the angle of the leftmost longitudinal approximate straight line segment as the tilt angle of the railway freight car to determine whether the railway freight car loading status image is a tilted and distorted image includes: Take the line between the two focal points of the longitudinal approximate straight line segment and the rectangular boundary line of the rectangular region on the left side of the truck as the extension line of the longitudinal approximate straight line; The leftmost longitudinal approximate line segment is determined based on the average X-value of the coordinates of all points on the extension of the longitudinal approximate line. Determine whether the angle of the leftmost longitudinal approximate straight line segment is greater than a preset tilt distortion threshold. If so, it is a tilt distortion image.
9. The method for evaluating image distortion of railway freight car loading status according to claim 3, characterized in that, The step of reviewing and verifying the initial version of the tilted and distorted image set and the initial version of the normal image set to obtain the final version of the tilted and distorted image set includes: Each image of the top of the tanker truck, the left side of the truck, the right side of the truck, and the top of the truck in the initial version of the tilted and distorted image set and the initial version of the normal image set was manually reviewed one by one. Normal images incorrectly classified into the initial set of tilted and distorted images, and tilted images incorrectly classified into the initial set of normal images; The final tilted image set is obtained by statistically analyzing the unlabeled tilted images in the initial tilted distortion image set and the labeled tilted images in the initial normal image set.
10. A system for evaluating image distortion of railway freight car loading status, characterized in that, include: The acquisition module is used to acquire the image set collected by the railway freight car loading status image acquisition point and the image information set associated with the image set; The selection module is used to extract a set of railway freight car loading status images from the image set based on the image information set; The identification module is used to identify each railway freight car loading status image in the railway freight car loading status image set one by one, determine whether the railway freight car loading status image is a tilted and distorted image, and if so, mark it to obtain an initial version of the tilted and distorted image set and an initial version of the normal image set. The verification module is used to verify the initial set of tilted and distorted images and the initial set of normal images to obtain the final set of tilted and distorted images. The evaluation module is used to calculate the proportion of the final version of the tilted distortion image set in the railway freight car loading state image set and output the evaluation results.