Motor train unit fault image baseline message generation system

By designing the baseline message generation system for EMU fault images, the problems of low efficiency and high cost of traditional methods are solved, and the automated baseline message generation is realized, which improves detection efficiency and reliability.

CN120144452APending Publication Date: 2025-06-13HARBIN KEJIA GENERAL MECHANICAL & ELECTRICAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510217244.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

Traditional methods generate baseline messages with low efficiency and high cost, resulting in limited detection efficiency and accuracy.

Method used

A baseline message generation system for fault image of EMUs is designed, including client, data loading and processing module, fault type judgment module, fault level judgment module and baseline message generation module to realize automated image reading, fault information acquisition and baseline message generation.

Benefits of technology

It improves the efficiency of baseline packet generation, reduces testing costs, increases the reliability of testing, can handle complex fault image scenarios, and is suitable for fault detection of single or multiple images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144452A_ABST
    Figure CN120144452A_ABST
Patent Text Reader

Abstract

The invention discloses a motor train unit fault image baseline message generation system, and belongs to the technical field of baseline message generation. According to the invention, the problems of low efficiency and high cost of the traditional baseline message generation method are solved. The method comprises the following steps: acquiring information of all test cases under a generated message path by utilizing a data loading and processing module, respectively loading images according to image names under the test cases, screening the test cases according to the loaded images, and acquiring information of the screened test cases and the images corresponding to the screened test cases; a fault type judgment module is used for judging the fault type of the image corresponding to each screened test case; a fault level judgment module is used for judging the fault level of the fault corresponding to each test case; a baseline message generation module is used for generating a baseline message according to the test case information and the fault position and the fault level in the image corresponding to the test case. The method can be applied to baseline message generation in a fault identification model test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of baseline message generation, and particularly relates to a baseline message generation system for EMU fault images. Background Art

[0002] Transportation is the economic lifeline of a country and plays a huge role in promoting economic development. As one of the main transportation modes in China, EMUs have many components, and any minor damage to a component may have a great impact on its safe operation. Therefore, its fault detection work is particularly important. Traditional manual detection methods not only have low detection efficiency and poor accuracy, but may also cause economic losses or even casualties due to human negligence. In recent years, fault detection methods based on image recognition have been rapidly applied, and a large number of image detection methods have been used for fault detection of railway freight cars.

[0003] The detection method based on image recognition completes the detection of different types of faults by training multiple image recognition models. The training and verification of the recognition models require a large number of fault images. In the case of insufficient real fault images, a large number of fault images need to be constructed, that is, the faultless images are PSed according to the real fault images to convert the faultless images into fault images. After constructing the fault image dataset, it is necessary to verify the accuracy rate of the recognition model. When calculating the detection accuracy rate of the recognition model for faults, the baseline message is required. The baseline message contains all the information of the faults in the image. The message output by the recognition model is also called the recognition message as the result message. Taking the baseline message as the benchmark, the calculation of the model detection accuracy rate is realized by calculating the consistency between the recognition message and the baseline message. In the process of testing the accuracy rate of the model, a huge amount of baseline messages need to be made, consuming a great deal of human cost. Moreover, the traditional method of manually generating baseline messages relies on the human eye to observe the fault positions in the images, manually fill in the corresponding fault information, and manually draw fault boxes. Therefore, the efficiency of generating baseline messages is relatively low.

[0004] In summary, there is an urgent need for an automated baseline message generation tool with low cost, high efficiency, and high reliability to achieve automated image reading and processing, fault information acquisition, fault form judgment, fault level judgment, and post-processing and saving of baseline messages, so as to help testers reduce repetitive and boring manual testing tasks, improve testing efficiency, reduce testing costs, and focus their energy on more complex testing tasks. Summary of the Invention

[0005] The purpose of the present invention is to propose a baseline message generation system for EMU fault images to solve the problems of low efficiency and high cost of the traditional method for generating baseline messages.

[0006] The technical solution adopted by the present invention to solve the above technical problems is:

[0007] A baseline message generation system for EMU fault images. The baseline message generation system includes a client, a data loading and processing module, a fault type judgment module, a fault level judgment module, and a baseline message generation module;

[0008] The client is used to implement human-computer interaction, and the user selects the path for generating the message through the client;

[0009] The data loading and processing module is used to obtain the information of all test cases under the message generation path. Each test case information includes the image name, fault code, EMU type, and EMU number corresponding to the test case; load the images respectively according to the image names under each test case, screen the test cases according to the loaded images, and obtain the information of the screened test cases and the images corresponding to the screened test cases;

[0010] The fault type judgment module is used to judge the fault type of the image corresponding to each screened test case;

[0011] The fault level judgment module is used to judge the fault level of the fault corresponding to each test case according to the fault type;

[0012] The baseline message generation module is used to generate a baseline message according to the test case information, the fault location in the image corresponding to the test case, and the fault level.

[0013] Furthermore, the client is also used to display the baseline message information in real time.

[0014] Furthermore, the working process of the data loading and processing module is as follows:

[0015] Step S11: Obtain all test case files under the message generation path. Each test case file corresponds to include the information of one test case. The information of the test case specifically includes the EMU model, EMU number, fault code, and image name;

[0016] Step S12: For any test case information, according to the image name in the test case information, read the original fault-free image corresponding to the image name and the fault image corresponding to the image name;

[0017] If both the original fault-free image and the fault image corresponding to the current image name exist, save the information of this test case and the image corresponding to this test case;

[0018] If the original fault-free image or the fault image corresponding to the current image name does not exist, skip the information of this test case and the image corresponding to this test case;

[0019] Step S13: Execute the process of Step S12 according to each test case information, and associate each piece of saved test case information with the corresponding image.

[0020] Further, the fault types include independent faults and combined faults.

[0021] Further, the working process of the fault type judgment module is as follows:

[0022] Step S21: Read the associated image list and determine whether there are fault images with consecutive numbers;

[0023] If there are no fault images with consecutive numbers, mark each fault image as an independent fault image;

[0024] If there are fault images with consecutive numbers, mark the fault images with non - consecutive numbers as independent fault images, and respectively execute Step S22 to Step S24 for each group of fault images with consecutive numbers;

[0025] Step S22: For any group of fault images with consecutive numbers, respectively obtain the binary image corresponding to each number in this group of fault images; specifically:

[0026] Step S221: Denote the numbers corresponding to this group of fault images as i, i + 1, …, j respectively; initialize the fault image number n = i;

[0027] Step S222: Read the original fault - free image A corresponding to the fault image A` with number n, calculate the difference between image A and image A`, that is, calculate A - A`, and denote the difference image obtained by A - A` as A``;

[0028] Then, perform grayscale processing on the difference image A``, and perform binary processing on the obtained grayscale image to obtain the binary image Bin(A) corresponding to number n;

[0029] Step S223: Judge whether n = j is satisfied;

[0030] If it is satisfied, continue to execute Step S23 for the binary images corresponding to numbers i, i + 1, …, j;

[0031] If it is not satisfied, let n = n + 1, and return to execute Step S222;

[0032] Step S23: Calculate the maximum circumscribed rectangles of the faults in the binary images corresponding to numbers i, i + 1, …, j respectively;

[0033] Step S24: Determine the fault type corresponding to this group of images according to the maximum circumscribed rectangles of the faults in the binary images corresponding to numbers i, i + 1, …, j.

[0034] Further, the specific process of step S23 is as follows:

[0035] Step S231: Initialize the image number n = i;

[0036] Step S232: Obtain all the pixel points with pixel value 1 in the binary image corresponding to the number n, and store the coordinates of all the obtained pixel points;

[0037] Record the stored minimum abscissa value as A_Xmin, the stored minimum ordinate value as A_Ymin, the stored maximum abscissa value as A_Xmax, the stored maximum ordinate value as A_Ymax, and record the maximum circumscribed rectangle of the fault in the binary image corresponding to the number n as Rect(A);

[0038] Among them, the coordinates of the lower left vertex of the rectangle Rect(A) are (A_Xmin, A_Ymin), the coordinates of the upper left vertex of the rectangle Rect(A) are (A_Xmin, A_Ymax), the coordinates of the lower right vertex of the rectangle Rect(A) are (A_Xmax, A_Ymin), the coordinates of the upper right vertex of the rectangle Rect(A) are (A_Xmax, A_Ymax), the width of the rectangle Rect(A) is (A_Xmax - A_Xmin), and the height of the rectangle Rect(A) is (A_Ymax - A_Ymin);

[0039] Step S233: Determine whether n = j is satisfied;

[0040] If satisfied, obtain the maximum circumscribed rectangles of the faults in the binary images corresponding to the numbers i, i + 1,..., j;

[0041] If not satisfied, let n = n + 1, and return to execute step S232.

[0042] Further, the specific process of step S24 is as follows:

[0043] Step S241: Respectively determine whether the maximum circumscribed rectangles of the faults in the binary images corresponding to the numbers i, i + 1,..., j are located on the boundary of the fault image A`;

[0044] Step S242: Initialize the number n = i;

[0045] Step S243: If the maximum circumscribed rectangle of the fault in the binary image corresponding to the number n is not located on the image boundary, then the fault in the binary image corresponding to the number n and the fault in the binary image corresponding to the number n - 1 are not combined faults, and continue to execute step S245;

[0046] If the maximum circumscribed rectangle of the fault in the binary image corresponding to the number n is located on the image boundary, then determine whether ①, ②, ③, or ④ is satisfied:

[0047] ① Continuously capture images from bottom to top. The fault in the binary image corresponding to number n - 1 is located at the upper boundary of the image, and the fault in the binary image corresponding to number n is located at the lower boundary of the image;

[0048] ② Continuously capture images from top to bottom. The fault in the binary image corresponding to number n - 1 is located at the lower boundary of the image, and the fault in the binary image corresponding to number n is located at the upper boundary of the image;

[0049] ③ Continuously capture images from right to left. The fault in the binary image corresponding to number n - 1 is located at the left boundary of the image, and the fault in the binary image corresponding to number n is located at the right boundary of the image;

[0050] ④ Continuously capture images from left to right. The fault in the binary image corresponding to number n - 1 is located at the right boundary of the image, and the fault in the binary image corresponding to number n is located at the left boundary of the image;

[0051] If ①, ②, ③, or ④ is satisfied, then execute step S244;

[0052] If ①, ②, ③, or ④ is not satisfied, then the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n - 1 are not combined faults, and continue to execute step S245;

[0053] Step S244: When the shooting direction is to continuously capture images from bottom to top, if the number of pixel points of the fault in the binary image corresponding to number n - 1 located at the upper boundary of the image is greater than the threshold or the number of pixel points of the fault in the binary image corresponding to number n located at the lower boundary of the image is greater than the threshold, then the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n - 1 are combined faults; then execute step S245. Otherwise, the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n - 1 are not combined faults, and continue to execute step S245;

[0054] When the shooting direction is to continuously capture images from top to bottom, if the number of pixel points of the fault in the binary image corresponding to number n - 1 located at the lower boundary of the image is greater than the threshold or the number of pixel points of the fault in the binary image corresponding to number n located at the upper boundary of the image is greater than the threshold, then the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n - 1 are combined faults; then execute step S245. Otherwise, the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n - 1 are not combined faults, and continue to execute step S245;

[0055] When the shooting direction is to continuously shoot images from right to left, if the number of pixel points of the fault in the binary image corresponding to the number n - 1 located at the left boundary of the image is greater than the threshold or the number of pixel points of the fault in the binary image corresponding to the number n located at the right boundary of the image is greater than the threshold, then the fault in the binary image corresponding to the number n and the fault in the binary image corresponding to the number n - 1 are joint faults; then step S245 is executed. Otherwise, the fault in the binary image corresponding to the number n and the fault in the binary image corresponding to the number n - 1 are not joint faults, and step S245 is continued to be executed;

[0056] When the shooting direction is to continuously shoot images from left to right, if the number of pixel points of the fault in the binary image corresponding to the number n - 1 located at the right boundary of the image is greater than the threshold or the number of pixel points of the fault in the binary image corresponding to the number n located at the left boundary of the image is greater than the threshold, then the fault in the binary image corresponding to the number n and the fault in the binary image corresponding to the number n - 1 are joint faults; then step S245 is executed. Otherwise, the fault in the binary image corresponding to the number n and the fault in the binary image corresponding to the number n - 1 are not joint faults, and step S245 is continued to be executed;

[0057] Step S245: Determine whether n = j is satisfied;

[0058] If it is satisfied, the determination of the fault type of this group of fault images is ended;

[0059] If it is not satisfied, let n = n + 1, and return to execute step S243.

[0060] Furthermore, the working process of the fault level judgment module is as follows:

[0061] (1) For independent faults, respectively count the number of pixel points included in each independent fault;

[0062] When the number of pixel points P included in the independent fault satisfies P ≤ 25, the fault level is determined to be a minor fault;

[0063] When the number of pixel points P included in the independent fault satisfies 25 < P ≤ 100, the fault level is determined to be a general fault;

[0064] When the number of pixel points P included in the independent fault satisfies 100 < P ≤ 400, the fault level is determined to be a serious fault;

[0065] (2) For joint faults, respectively count the number of pixel points included in each joint fault;

[0066] When the number of pixel points P included in the joint fault satisfies P ≤ 100, the fault level is determined to be a minor fault;

[0067] When the number of pixel points P included in the combined fault satisfies: 100 < P ≤ 400, the fault level is determined to be a general fault;

[0068] When the number of pixel points P included in the combined fault is P > 400, the fault level is determined to be a serious fault.

[0069] Furthermore, the baseline message generation system further includes a baseline message post - processing module, which is used to amplify the fault location in the generated baseline message to obtain the final baseline message.

[0070] Even further, the working process of the baseline message post - processing module is as follows:

[0071] Step S31: Set the amplification coefficient Ampf for minor faults to 2 pixels, the amplification coefficient Ampf for general faults to 5 pixels, and the amplification coefficient Ampf for key faults to 8 pixels;

[0072] Step S32: For independent faults, expand the maximum circumscribed rectangle of the independent fault to (A’_Xmin, A’_Xmax, A’_Ymin, A’_Ymax);

[0073] Among them, A’_Xmin is the larger value between A_Xmin - Ampf and 0, A’_Xmax is the smaller value between A_Xma + Ampf and A_w, A’_Ymin is the larger value between A_Ymin - Ampf and 0, and A’_Ymax is the smaller value between A_Ymax + Ampf and A_h;

[0074] Step S33: For combined faults

[0075] Stitch the images corresponding to the combined faults, obtain the maximum circumscribed rectangle of the faults in the stitched image, and then amplify the maximum circumscribed rectangle.

[0076] The beneficial effects of the present invention are:

[0077] Aiming at the scenario of making baseline messages for EMU images, the present invention proposes a method for automatically generating baseline messages. Through data pre - processing, fault form judgment, fault level judgment, and baseline message post - processing, the existing method of manually generating baseline messages is converted into an automatic generation method, which can improve the efficiency of baseline message generation, reduce the test cost, and increase the test reliability.

[0078] The method of the present invention has strong adaptability. Aiming at the complex scenario where faults may be located in a single image or multiple images simultaneously when generating baseline messages, through the detection, calculation, and logical judgment of the fault location, the fault forms are divided into independent faults and combined faults, realizing the unified message production for single - fault images and multi - fault images.

[0079] The present invention proposes a fault level judgment method for the different baseline message production requirements corresponding to different faults. By combining the size and form of the faults, the faults are classified into levels to meet different message production requirements.

[0080] The method of the present invention has strong scalability. Since different precision test requirements need to produce baseline messages with different precisions, the present invention proposes a method for amplifying baseline messages, which combines the form of faults and the fault level to produce baseline messages with different precisions to meet various test scenarios. Description of the Drawings

[0081] Figure 1 is an architecture diagram of a system for generating baseline messages of EMU fault images according to the present invention. Detailed Embodiments

[0082] It should be specifically noted that, without conflict, the various embodiments disclosed in the present application can be combined with each other.

[0083] Detailed Embodiment 1: Combine Figure 1 This embodiment is described. A system for generating baseline messages of EMU fault images in this embodiment, the baseline message generation system includes a client, a data loading and processing module, a fault type judgment module, a fault level judgment module, and a baseline message generation module;

[0084] The client is used to realize human-computer interaction, and the user selects the path for generating the message through the client;

[0085] The data loading and processing module is used to obtain the information of all test cases under the path for generating the message. Each piece of test case information includes the image name, fault code, EMU type, and EMU number corresponding to the test case; the images are respectively loaded according to the image names under each test case, and it is also used to screen the test cases according to the loaded images to obtain the information of the screened test cases and the images corresponding to the screened test cases;

[0086] The fault type judgment module is used to judge the fault type of the image corresponding to each screened test case;

[0087] The fault level judgment module is used to respectively judge the fault level of the fault corresponding to each test case (the fault type corresponding to each test case may be an independent fault or a combined fault);

[0088] The baseline message generation module is used to generate a baseline message according to the test case information, the fault position in the image corresponding to the test case (i.e., the maximum circumscribed rectangle of the fault position in the image), and the fault level.

[0089] For combined faults, generate a set of baseline messages for the images involved in the combined faults.

[0090] Embodiment 2: The difference between this embodiment and Embodiment 1 is that the client is also used to display the baseline message information in real time.

[0091] Other steps and parameters are the same as those in Embodiment 1.

[0092] The desktop client is implemented based on the C / S architecture. It is mainly developed using PyQt and OpenCV to achieve human-computer interaction. The selection of the message-making path is realized by clicking buttons, and the message information and other relevant information automatically made currently are displayed in real time through a display window.

[0093] Embodiment 3: The difference between this embodiment and Embodiment 1 or 2 is that the working process of the data loading and processing module is as follows:

[0094] Step S11: Obtain all test case files (the format of the test case files is xlsx format or other formats) under the generated message path. Each test case file correspondingly includes the information of one test case. The information of the test case specifically includes the EMU model, EMU number, fault code (the unique identifier describing the fault), and image name.

[0095] Step S12: For any test case information, according to the image name in the test case information, read the original fault-free image corresponding to the image name and the fault image corresponding to the image name (the fault image can be the actually collected fault image or the fault image obtained by PS and stored in the database. The pixels in the fault image and the original fault-free image correspond one by one, and the angle of the fault image is exactly the same as that of the original fault-free image. The image is from the EMU model and EMU number in the test case information).

[0096] If both the original fault-free image and the fault image corresponding to the current image name exist, save the information of this test case and the image corresponding to this test case.

[0097] If either the original fault-free image or the fault image corresponding to the current image name does not exist, skip the information of this test case and the image corresponding to this test case.

[0098] Step S13: Execute the process of Step S12 according to each test case information, and associate the saved information of each test case with the corresponding image.

[0099] Through the association, it can be ensured that the image information of each image to be generated with a message is complete for subsequent message generation.

[0100] Other steps and parameters are the same as those in the first or second specific implementation manner.

[0101] Specific implementation manner four: The difference between this implementation manner and one of the first to third specific implementation manners is that the fault types include independent faults and combined faults.

[0102] Other steps and parameters are the same as those in one of the first to third specific implementation manners.

[0103] Specific implementation manner five: The difference between this implementation manner and one of the first to fourth specific implementation manners is that the working process of the fault type judgment module is as follows:

[0104] Step S21: Read the associated image list and determine whether there are consecutively numbered fault images (the image capture process is continuous acquisition in one direction, and the numbers are the sequential numbers of the continuously acquired images to facilitate detecting whether there are combined faults in adjacent position images);

[0105] If there are no consecutively numbered fault images, mark each fault image as an independent fault image;

[0106] If there are consecutively numbered fault images, mark the fault images with non - consecutive numbers as independent fault images, and respectively execute steps S22 to S24 for each group of consecutively numbered fault images;

[0107] Step S22: For any group of consecutively numbered fault images, respectively obtain the binary image corresponding to each number in this group of fault images; specifically:

[0108] Step S221: Denote the numbers corresponding to this group of fault images as i, i + 1,..., j; initialize the fault image number n = i;

[0109] Step S222: Read the original fault - free image A corresponding to the fault image A` with number n, calculate the difference between image A and image A`, that is, calculate A - A`, and denote the difference image obtained by A - A` as A``; it should be noted that the difference calculation refers to subtracting the pixel values at the corresponding positions of the two images;

[0110] Then perform grayscale processing on the difference image A``, and perform binary processing on the obtained grayscale image to obtain the binary image Bin(A) corresponding to number n;

[0111] Step S223: Determine whether n = j is satisfied;

[0112] If satisfied, continue to execute step S23 for the binary images corresponding to numbers i, i + 1,..., j;

[0113] If not satisfied, let n = n + 1, and return to execute step S222;

[0114] Step S23: Calculate the maximum circumscribed rectangles of faults in the binary images corresponding to the numbers i, i + 1, …, j respectively.

[0115] Step S24: Determine the fault type corresponding to this group of images according to the maximum circumscribed rectangles of faults in the binary images corresponding to the numbers i, i + 1, …, j.

[0116] Other steps and parameters are the same as those in any one of the first to fourth specific embodiments.

[0117] Specific Embodiment Six: The difference between this embodiment and any one of the first to fifth specific embodiments is that the specific process of Step S23 is as follows:

[0118] Step S231: Initialize the image number n = i.

[0119] Step S232: Obtain all the pixel points with pixel value 1 in the binary image corresponding to the number n, and store the coordinates of all the obtained pixel points.

[0120] Denote the stored minimum abscissa value as A_Xmin, the stored minimum ordinate value as A_Ymin, the stored maximum abscissa value as A_Xmax, the stored maximum ordinate value as A_Ymax, and denote the maximum circumscribed rectangle of the fault in the binary image corresponding to the number n as Rect(A).

[0121] Among them, the coordinates of the lower left vertex of the rectangle Rect(A) are (A_Xmin, A_Ymin), the coordinates of the upper left vertex of the rectangle Rect(A) are (A_Xmin, A_Ymax), the coordinates of the lower right vertex of the rectangle Rect(A) are (A_Xmax, A_Ymin), the coordinates of the upper right vertex of the rectangle Rect(A) are (A_Xmax, A_Ymax), the width of the rectangle Rect(A) is (A_Xmax - A_Xmin), and the height of the rectangle Rect(A) is (A_Ymax - A_Ymin);

[0122] Step S233: Determine whether n = j is satisfied.

[0123] If it is satisfied, obtain the maximum circumscribed rectangles of faults in the binary images corresponding to the numbers i, i + 1, …, j.

[0124] If it is not satisfied, let n = n + 1, and return to execute Step S232.

[0125] Other steps and parameters are the same as those in any one of the first to fifth specific embodiments.

[0126] Specific Embodiment Seven: The difference between this embodiment and any one of the first to sixth specific embodiments is that the specific process of Step S24 is as follows:

[0127] Step S241: Determine respectively whether the maximum circumscribed rectangles of the faults in the binary images corresponding to the numbers i, i + 1, …, j are located on the boundary of the fault image A` (that is, whether there are pixels with abscissa value of 0, abscissa value of A_w (A_w is the maximum abscissa of the pixels in the fault image A`), ordinate value of 0 or ordinate value of A_h (A_h is the maximum ordinate of the pixels in the fault image A`) in the maximum circumscribed rectangles of the faults; when there are pixels with abscissa value of 0 in the maximum circumscribed rectangle of the fault, there are pixels in the maximum circumscribed rectangle of the fault on the left boundary of the fault image A`; when there are pixels with abscissa value of A_w in the maximum circumscribed rectangle of the fault, there are pixels in the maximum circumscribed rectangle of the fault on the right boundary of the fault image A`; when there are pixels with ordinate value of 0 in the maximum circumscribed rectangle of the fault, there are pixels in the maximum circumscribed rectangle of the fault on the lower boundary of the fault image A`; when there are pixels with ordinate value of A_h in the maximum circumscribed rectangle of the fault, there are pixels in the maximum circumscribed rectangle of the fault on the upper boundary of the fault image A`. In the present invention, both the minimum abscissa and the minimum ordinate of the pixels in the fault image A` are recorded as 0).

[0128] Step S242: Initialize the number n = i.

[0129] Step S243: If the maximum circumscribed rectangle of the fault in the binary image corresponding to the number n is not located on the image boundary, then the fault in the binary image corresponding to the number n and the fault in the binary image corresponding to the number n - 1 are not combined faults, and continue to execute Step S245.

[0130] If the maximum circumscribed rectangle of the fault in the binary image corresponding to the number n is located on the image boundary, then determine whether conditions ①, ②, ③ or ④ are satisfied:

[0131] ① When the images are continuously captured from bottom to top, the fault in the binary image corresponding to the number n - 1 is located on the upper boundary of the image and the fault in the binary image corresponding to the number n is located on the lower boundary of the image;

[0132] ② When the images are continuously captured from top to bottom, the fault in the binary image corresponding to the number n - 1 is located on the lower boundary of the image and the fault in the binary image corresponding to the number n is located on the upper boundary of the image;

[0133] ③ When the images are continuously captured from right to left, the fault in the binary image corresponding to the number n - 1 is located on the left boundary of the image and the fault in the binary image corresponding to the number n is located on the right boundary of the image;

[0134] ④ When the images are continuously captured from left to right, the fault in the binary image corresponding to the number n - 1 is located on the right boundary of the image and the fault in the binary image corresponding to the number n is located on the left boundary of the image;

[0135] If conditions ①, ②, ③ or ④ are satisfied, then execute Step S244.

[0136] If ①, ②, ③, or ④ is not satisfied, the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n - 1 are not combined faults, and step S245 is continued;

[0137] Step S244: When continuously capturing images from bottom to top, if the number of pixel points of the fault in the binary image corresponding to number n - 1 located at the upper boundary of the image is greater than the threshold or the number of pixel points of the fault in the binary image corresponding to number n located at the lower boundary of the image is greater than the threshold, then the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n - 1 are combined faults; then step S245 is executed. Otherwise, the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n - 1 are not combined faults, and step S245 is continued;

[0138] When continuously capturing images from top to bottom, if the number of pixel points of the fault in the binary image corresponding to number n - 1 located at the lower boundary of the image is greater than the threshold or the number of pixel points of the fault in the binary image corresponding to number n located at the upper boundary of the image is greater than the threshold, then the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n - 1 are combined faults; then step S245 is executed. Otherwise, the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n - 1 are not combined faults, and step S245 is continued;

[0139] When continuously capturing images from right to left, if the number of pixel points of the fault in the binary image corresponding to number n - 1 located at the left boundary of the image is greater than the threshold or the number of pixel points of the fault in the binary image corresponding to number n located at the right boundary of the image is greater than the threshold, then the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n - 1 are combined faults; then step S245 is executed. Otherwise, the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n - 1 are not combined faults, and step S245 is continued;

[0140] When continuously capturing images from left to right, if the number of pixel points of the fault in the binary image corresponding to number n - 1 located at the right boundary of the image is greater than the threshold or the number of pixel points of the fault in the binary image corresponding to number n located at the left boundary of the image is greater than the threshold, then the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n - 1 are combined faults; then step S245 is executed. Otherwise, the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n - 1 are not combined faults, and step S245 is continued;

[0141] Step S245: Determine whether n = j is satisfied;

[0142] If it is satisfied, the determination of the fault type of this group of fault images is ended;

[0143] If not satisfied, let n = n + 1, and return to execute step S243.

[0144] Other steps and parameters are the same as those in any one of the first to sixth specific embodiments.

[0145] This embodiment can solve the problem that it is complex and difficult to produce message images when there are single images or multiple images with faults in the message images to be produced. Define the faults that only exist in a single image as independent faults, and the faults that exist in multiple images at the same time as combined faults. For combined faults, it is necessary to splice multiple images in different ways to ensure the integrity of the faults, and realize the unified production of single-image messages and multi-image messages. It should be noted that this embodiment is only used to determine whether adjacent-numbered images belong to combined faults. If the first image and the second image belong to combined faults, and assuming the shooting direction is from top to bottom, then

[0146] (1) The fault area in the first image is located at the lower boundary of the image, the fault area in the second image is located at the upper boundary of the image, and the fault area in the second image runs through the second image in the up-down direction, that is, the fault area is also located at the lower boundary of the second image. At the same time, the fault area in the third image is also located at the upper boundary of the image, and the pixel number requirement on the boundary is met. Then the first image, the second image, and the third image belong to combined faults.

[0147] (2) The fault area in the second image does not run through the second image in the up-down direction, but there is a fault at the lower boundary of the second image, and there is also a fault at the upper boundary of the third image, and the fault pixel requirement on the boundary is met. Then the second image and the third image belong to combined faults, but the first image, the second image, and the third image do not belong to combined faults.

[0148] Specific embodiment eight: The difference between this embodiment and any one of the first to seventh specific embodiments is that the working process of the fault level judgment module is as follows:

[0149] (1) For independent faults, respectively count the number of pixel points included in each independent fault (only including the number of fault pixels in a single image);

[0150] When the number of pixel points P included in the independent fault satisfies P ≤ 25, the fault level is determined to be a minor fault;

[0151] When the number of pixel points P included in the independent fault satisfies 25 < P ≤ 100, the fault level is determined to be a general fault;

[0152] When the number of pixel points P included in the independent fault satisfies 100 < P ≤ 400, the fault level is determined to be a serious fault;

[0153] (2) For combined faults, count the number of pixel points included in each combined fault (the sum of the faulty pixel points in the image involved in the combined fault);

[0154] When the number of pixel points P included in the combined fault satisfies P ≤ 100, the fault level is determined to be a minor fault;

[0155] When the number of pixel points P included in the combined fault satisfies: 100 < P ≤ 400, the fault level is determined to be a general fault;

[0156] When the number of pixel points P included in the combined fault is P > 400, the fault level is determined to be a severe fault.

[0157] Other steps and parameters are the same as those in one of the specific embodiments one to seven.

[0158] This embodiment calculates the fault level according to different fault forms and the number of pixel points included in the fault. The number of fault levels can be modified according to actual requirements later to meet the message making requirements for different faults.

[0159] Specific embodiment nine: The difference between this embodiment and one of the specific embodiments one to eight is that: the baseline message generation system further includes a baseline message post-processing module, and the baseline message post-processing module is used to amplify the fault location in the generated baseline message to obtain the final baseline message.

[0160] Other steps and parameters are the same as those in one of the specific embodiments one to eight.

[0161] Specific embodiment ten: The difference between this embodiment and one of the specific embodiments one to nine is that: the working process of the baseline message post-processing module is as follows:

[0162] Step S31: Set the amplification coefficient Ampf for minor faults to 2 pixels, the amplification coefficient Ampf for general faults to 5 pixels, and the amplification coefficient Ampf for key faults to 8 pixels;

[0163] A baseline message amplification method is proposed for different test accuracy requirements. Different levels of faults use different amplification coefficients Ampf. The amplification coefficient Ampf is used to expand the area of the maximum circumscribed rectangle of the fault. The larger the area, the lower the accuracy requirement for detection. When the test accuracy requirement is high, the amplification coefficient can be set to 0 pixels, and the specific value can be set according to actual test requirements. Different post-processing is performed on the above different forms of faults and different levels of faults, and other information required for the message is supplemented to generate different message information.

[0164] Step S32: For an independent fault, expand the maximum circumscribed rectangle of the independent fault to (A’_Xmin, A’_Xmax, A’_Ymin, A’_Ymax);

[0165] Among them, A’_Xmin is the larger value between A_Xmin - Ampf and 0, A’_Xmax is the smaller value between A_Xma + Ampf and A_w, A’_Ymin is the larger value between A_Ymin - Ampf and 0, and A’_Ymax is the smaller value between A_Ymax + Ampf and A_h;

[0166] Step S33: For a combined fault

[0167] Stitch the images corresponding to the combined fault, obtain the maximum circumscribed rectangle of the fault in the stitched image, and then expand the maximum circumscribed rectangle (the specific method refers to the expansion process of the independent fault).

[0168] Other steps and parameters are the same as those in any one of the specific embodiments one to nine.

[0169] This embodiment proposes a baseline message amplification method, which performs different fault amplification processes for different fault levels to meet different test accuracy requirements. The message information includes the absolute path of the image, the image name, the fault code, the type of motor car, the number of the motor car, and the coordinates of the maximum circumscribed rectangle of the amplified fault. After splicing all the above information into a string, it is saved in txt format to the corresponding path to ensure the integrity of the message information and save it as a baseline message file.

[0170] The above examples of the present invention are only for explaining in detail the calculation model and calculation process of the present invention, rather than limiting the embodiments of the present invention. For those of ordinary skill in the art, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the embodiments here. Any obvious changes or modifications derived from the technical solutions of the present invention still fall within the protection scope of the present invention.

Claims

1. A system for generating fault image baseline messages of a train set, characterized in that: The baseline message generation system includes a client, a data loading and processing module, a fault type judgment module, a fault level judgment module and a baseline message generation module; The client is used to realize human-computer interaction. The user selects the path to generate the message through the client. The data loading and processing module is used to obtain the information of all test cases under the generated message path. Each test case information includes the image name, fault code, motor vehicle type and motor vehicle number corresponding to the test case; load images according to the image names under each test case, filter test cases according to the loaded images, and obtain the information of the filtered test cases and the images corresponding to the filtered test cases; The fault type judgment module is used to judge the fault type of the image corresponding to each screened test case; The fault level judgment module is used to judge the fault level of each test case according to the fault type; The baseline message generation module is used to generate a baseline message according to the test case information, the fault location in the image corresponding to the test case, and the fault level.

2. The EMU fault image baseline message generation system according to claim 1 is characterized in that: The client is also used to display baseline message information in real time.

3. A system for generating fault image baseline messages for EMUs according to claim 2, characterized in that: The working process of the data loading and processing module is as follows: Step S11, obtaining all test case files under the generated message path, each test case file correspondingly includes a test case information, and the test case information specifically includes the motor vehicle model, motor vehicle number, fault code and image name; Step S12: for any piece of test case information, according to the image name in the test case information, read the original fault-free image corresponding to the image name and the faulty image corresponding to the image name; If both the original fault-free image and the faulty image corresponding to the current image name exist, then the information of the test case and the image corresponding to the test case are saved; If the original fault-free image or faulty image corresponding to the current image name does not exist, the information of the test case and the image corresponding to the test case are skipped; Step S13: Execute the process of step S12 according to each piece of test case information, and associate each piece of stored test case information with the corresponding image.

4. A train fault image baseline message generation system according to claim 3, characterized in that: The fault types include independent faults and combined faults.

5. A system for generating fault image baseline messages of a train set according to claim 4, characterized in that: The working process of the fault type judgment module is as follows: Step S21, read the associated image list to determine whether there are fault images with consecutive numbers; If there are no fault images with consecutive numbers, each fault image is marked as an independent fault image; If there are faulty images with consecutive numbers, the faulty images with discontinuous numbers are marked as independent faulty images, and steps S22 to S24 are performed on each group of faulty images with consecutive numbers; Step S22: for any group of fault images with consecutive numbers, obtain the binary images corresponding to each number in the group of fault images; specifically: Step S221, record the numbers corresponding to the group of fault images as i, i+1, ..., j respectively; initialize the fault image number n=i; Step S222, read the original fault-free image A corresponding to the faulty image A' with number n, make a difference between image A and image A', that is, calculate AA', and record the difference image obtained by AA' as A''; Then the difference image A`` is grayed out, and the obtained gray image is binarized to obtain the binary image Bin(A) corresponding to the number n; Step S223, determine whether n=j is satisfied; If satisfied, then continue to execute step S23 for the binary images corresponding to numbers i, i+1, ..., j; If not satisfied, set n=n+1 and return to step S222; Step S23, respectively calculating the maximum circumscribed rectangle of the fault in the binary image corresponding to the numbers i, i+1, ..., j; Step S24: Determine the fault type corresponding to the group of images according to the maximum circumscribed rectangle of the fault in the binary image corresponding to the number i, i+1, ..., j.

6. A train fault image baseline message generation system according to claim 5, characterized in that: The specific process of step S23 is as follows: Step S231, initializing the image number n=i; Step S232, obtaining all pixel points whose pixel values ​​are 1 in the binary image corresponding to the number n, and storing the coordinates of all the obtained pixel points; The stored minimum abscissa value is recorded as A_Xmin, the stored minimum ordinate value is recorded as A_Ymin, the stored maximum abscissa value is recorded as A_Xmax, the stored maximum ordinate value is recorded as A_Ymax, and the maximum circumscribed rectangle of the fault in the binary image corresponding to the number n is recorded as Rect(A); Among them, the coordinates of the lower left corner vertex of the rectangle Rect(A) are (A_Xmin, A_Ymin), the coordinates of the upper left corner vertex of the rectangle Rect(A) are (A_Xmin, A_Ymax), the coordinates of the lower right corner vertex of the rectangle Rect(A) are (A_Xmax, A_Ymin), the coordinates of the upper right corner vertex of the rectangle Rect(A) are (A_Xmax, A_Ymax), the width of the rectangle Rect(A) is (A_Xmax-A_Xmin), and the height of the rectangle Rect(A) is (A_Ymax-A_Ymin); Step S233, determine whether n=j is satisfied; If it is satisfied, the maximum bounding rectangle of the fault in the binary image corresponding to number i, i+1,…, j is obtained; If not satisfied, set n=n+1 and return to step S232.

7. A system for generating fault image baseline messages for EMUs according to claim 6, characterized in that: The specific process of step S24 is as follows: Step S241, respectively determine whether the maximum circumscribed rectangle of the fault in the binary image corresponding to the number i, i+1, ..., j is located at the boundary of the fault image A'; Step S242, initialization number n=i; Step S243: if the maximum circumscribed rectangle of the fault in the binary image corresponding to number n is not located at the image boundary, the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n-1 are not joint faults, and step S245 is continued; If the maximum bounding rectangle of the fault in the binary image corresponding to number n is located at the image boundary, determine whether ①, ②, ③ or ④ is satisfied: ① Continuously take images from bottom to top, the fault numbered n-1 corresponds to the binary image located at the upper boundary of the image and the fault numbered n corresponds to the binary image located at the lower boundary of the image; ② Continuously take images from top to bottom, the fault numbered n-1 corresponds to the binary image located at the lower boundary of the image and the fault numbered n corresponds to the binary image located at the upper boundary of the image; ③ Continuously shoot images from right to left, the fault numbered n-1 corresponds to the binary image located at the left edge of the image and the fault numbered n corresponds to the binary image located at the right edge of the image; ④ Continuously shoot images from left to right, the fault numbered n-1 corresponds to the binary image located at the right edge of the image and the fault numbered n corresponds to the binary image located at the left edge of the image; If ①, ②, ③ or ④ are satisfied, execute step S244; If ①, ②, ③ or ④ are not satisfied, the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n-1 are not a joint fault, and step S245 is continued; Step S244, when the shooting direction is to shoot images continuously from bottom to top, if the number of pixel points of the fault in the binary image corresponding to number n-1 located at the upper boundary of the image is greater than the threshold or the number of pixel points of the fault in the binary image corresponding to number n located at the lower boundary of the image is greater than the threshold, then the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n-1 are a joint fault; then execute step S245, otherwise the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n-1 are not a joint fault, and continue to execute step S245; When the shooting direction is to shoot images continuously from top to bottom, if the number of pixel points of the fault in the binary image corresponding to number n-1 located at the lower boundary of the image is greater than the threshold or the number of pixel points of the fault in the binary image corresponding to number n located at the upper boundary of the image is greater than the threshold, then the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n-1 are a joint fault; then execute step S245; otherwise, the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n-1 are not a joint fault, and continue to execute step S245; When the shooting direction is to shoot images continuously from right to left, if the number of pixel points of the fault in the binary image corresponding to number n-1 located at the left boundary of the image is greater than the threshold or the number of pixel points of the fault in the binary image corresponding to number n located at the right boundary of the image is greater than the threshold, then the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n-1 are a joint fault; then execute step S245; otherwise, the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n-1 are not a joint fault, and continue to execute step S245; When the shooting direction is to shoot images continuously from left to right, if the number of pixel points of the fault in the binary image corresponding to number n-1 located at the right boundary of the image is greater than the threshold or the number of pixel points of the fault in the binary image corresponding to number n located at the left boundary of the image is greater than the threshold, then the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n-1 are a joint fault; then execute step S245; otherwise, the fault in the binary image corresponding to number n and the fault in the binary image corresponding to number n-1 are not a joint fault, and continue to execute step S245; Step S245, determine whether n=j is satisfied; If the condition is satisfied, the determination of the fault type of this group of fault images is ended; If the condition is not satisfied, let n = n + 1, and return to execute step S243.

8. The EMU fault image baseline message generation system according to claim 7, characterized in that: The working process of the fault level determination module is as follows: (1) For independent faults, count the number of pixel points included in each independent fault respectively; When the number of pixel points P included in an independent fault satisfies P ≤ 25, the fault level is determined to be a minor fault; When the number of pixel points P included in an independent fault satisfies 25 < P ≤ 100, the fault level is determined to be a general fault; When the number of pixel points P included in an independent fault satisfies 100 < P ≤ 400, the fault level is determined to be a serious fault; (2) For combined faults, count the number of pixel points included in each combined fault respectively; When the number of pixel points P included in a combined fault satisfies P ≤ 100, the fault level is determined to be a minor fault; When the number of pixel points P included in a combined fault satisfies 100 < P ≤ 400, the fault level is determined to be a general fault; When the number of pixel points P included in a combined fault satisfies P > 400, the fault level is determined to be a serious fault.

9. A system for generating fault image baseline messages of a train set according to claim 8, characterized in that: The baseline message generation system further includes a baseline message post-processing module, which is used to amplify the fault positions in the generated baseline message to obtain the final baseline message.

10. A system for generating fault image baseline messages of a train set according to claim 9, characterized in that: The working process of the baseline message post-processing module is as follows: Step S31: Set the amplification factor Ampf for minor faults to 2 pixels, the amplification factor Ampf for general faults to 5 pixels, and the amplification factor Ampf for key faults to 8 pixels; Step S32: For independent faults, expand the maximum circumscribed rectangle of the independent fault to (A’_Xmin, A’_Xmax, A’_Ymin, A’_Ymax); Among them, A’_Xmin is the larger value between A_Xmin - Ampf and 0, A’_Xmax is the smaller value between A_Xma + Ampf and A_w, A’_Ymin is the larger value between A_Ymin - Ampf and 0, and A’_Ymax is the smaller value between A_Ymax + Ampf and A_h; Step S33: For combined faults Stitch the images corresponding to the combined faults, obtain the maximum circumscribed rectangle of the faults in the stitched image, and then amplify the maximum circumscribed rectangle.