Method, device and equipment for detecting wheel flange tread sample plate of rolling stock and medium
Through the object detection model and image classification model, the wheel rim tread model of rolling stock vehicle wheels is identified and classified, the reference plane straight lines are extracted and the measurement coordinate system is constructed, which solves the problems of low manual measurement efficiency and limited accuracy in the prior art, and realizes automated verification, improving efficiency and quality.
Patent Information
- Application Number
- CN202411927978.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-18
AI Technical Summary
In the prior art, the verification of the wheel rim tread model of the rolling stock vehicle wheels mainly relies on manual measurement, which leads to difficulty in identifying the origin of the coordinates, different specifications and models, resulting in large measurement differences, and the accuracy is affected by human factors and low efficiency.
The object detection model is used to identify and segment the wheel rim tread sample of the rolling stock vehicle in the source diagram, and the sample model is determined through the image classification model, the contour lines are identified and the reference plane straight lines are extracted, the coordinate origin is determined, and the measurement coordinate system is constructed, the pixel coordinates are calculated and the measurement data matrix and the measurement scheme matrix are compared to the automatic verification.
Automatic verification of the wheel rim tread model of the rolling stock vehicle wheels is realized, reducing human error, shortening measurement time, and improving verification efficiency and quality.
Smart Images

Figure CN119850919A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of wheel rim tread sample verification for locomotive and vehicle, and specifically relates to a method, device, equipment and medium for verifying the wheel rim tread sample for locomotive and vehicle. Background Art
[0002] Rolling stock wheel flange tread templates play a vital role in railway maintenance and inspection. They are used to ensure that the shape and size of the wheel tread meet the standards, thereby ensuring smooth operation of the vehicle on the track, reducing friction and wear, and extending the service life of the wheel.
[0003] At present, the verification of the wheel rim tread sample of locomotive and vehicle mainly relies on manual measurement. On the one hand, it is difficult to identify the coordinate origin of the wheel rim tread sample of locomotive and vehicle; on the other hand, the specifications and models of the wheel rim tread sample of locomotive and vehicle are different, and there will be differences in the measurement range, tolerance, and inspection points. The accuracy of the verification result is greatly affected by human factors, the verification time is long, and the efficiency is low. Summary of the invention
[0004] The object of the present invention is to provide a method, device, equipment and storage medium for calibrating a wheel rim tread sample of a locomotive vehicle, which can realize automatic calibration of the wheel rim tread sample of a locomotive vehicle and improve the calibration efficiency.
[0005] The first aspect of the present invention discloses a method for testing a wheel rim tread sample of a locomotive vehicle, comprising:
[0006] Based on a source image obtained by photographing a wheel rim tread sample of a locomotive vehicle, a target detection model is used to identify and segment the wheel rim tread sample of the locomotive vehicle on the source image to obtain a tread sample image;
[0007] Inputting the tread sample image into an image classification model, determining the model of the wheel rim tread sample of the locomotive vehicle, and obtaining a measurement scheme matrix from a measurement scheme library according to the model;
[0008] identifying the contour line of the tread template of the wheel rim of the locomotive vehicle in the tread template image;
[0009] Using a machine vision algorithm to extract a reference plane straight line on the contour line;
[0010] Calculate the distance from each pixel point on the contour line to the reference plane straight line, determine the coordinate origin based on all the distances and construct a measurement coordinate system;
[0011] Based on the measurement coordinate system, the coordinates of each pixel point on the contour line are calculated to obtain a measurement data matrix;
[0012] The measurement data matrix and the measurement scheme matrix are compared to obtain a verification result.
[0013] In some embodiments, the calculating the coordinates of each pixel point on the contour line based on the measurement coordinate system to obtain a measurement data matrix includes:
[0014] The image coordinates of the midpoint of the reference plane straight line are set as the midpoint coordinates;
[0015] Traversing the pixel points on the contour line, if the Y value of the image coordinates of the current pixel point is less than the Y value of the midpoint coordinates, determining that the current pixel point is a pixel point located on the working surface;
[0016] Based on the measurement coordinate system, calculating a first X coordinate and a first Y coordinate of each pixel point located on the working surface;
[0017] The first X coordinates and the first Y coordinates of all pixel points located on the working surface are combined to obtain the measurement data matrix.
[0018] In some embodiments, each element in the measurement scheme matrix includes a second X coordinate and a second Y coordinate of a pixel point and an allowable error, and comparing the measurement data matrix with the measurement scheme matrix to obtain a verification result includes:
[0019] Based on the same first X coordinate and second X coordinate, elements in the measurement data matrix and the measurement scheme matrix are connected to obtain a combined matrix, wherein the elements of the combined matrix at least include the first X coordinate, the first Y coordinate, the second X coordinate, the second Y coordinate, and the allowable error;
[0020] Traversing each element in the combined matrix, calculating the difference between the first Y coordinate and the second Y coordinate of the current element, and setting the difference as the comparison difference of the current element;
[0021] When the absolute values of the comparison differences of all elements in the combined matrix are less than the allowable error, the test result is set as qualified;
[0022] otherwise,
[0023] Calculate the upper maximum value and the lower maximum value of the excess tolerance according to the first Y coordinate, the second Y coordinate and the allowable error of the elements in the combined matrix;
[0024] When the upper excess tolerance maximum value and the lower excess tolerance maximum value are both less than or equal to 0, the verification result is set as qualified; when the upper excess tolerance maximum value is greater than 0, the lower excess tolerance maximum value is less than 0, and the upper excess tolerance maximum value is less than the absolute value of the lower excess tolerance maximum value, the verification result is set as qualified; when the upper excess tolerance maximum value is less than 0, the lower excess tolerance maximum value is greater than 0, and the lower excess tolerance maximum value is less than or equal to the absolute value of the upper excess tolerance maximum value, the verification result is set as qualified; otherwise, the verification result is set as unqualified.
[0025] In some embodiments, the calculating the upper maximum value and the lower maximum value of the excess tolerance according to the first Y coordinate, the second Y coordinate and the allowable error of the elements in the combined matrix includes:
[0026] For each element in the combined matrix whose absolute value of the comparison difference is greater than or equal to the allowable error, calculate the difference of the first Y coordinate with respect to the sum of the second Y coordinate and the allowable error to obtain an upper deviation, and calculate the difference between the second Y coordinate and the allowable error and the first Y coordinate to obtain a lower deviation;
[0027] Find the maximum values of all upper deviations to obtain the maximum value of the upper deviation; find the maximum values of all lower deviations to obtain the maximum value of the lower deviation.
[0028] In some embodiments, calculating the distance from each pixel point on the contour line to the reference plane straight line, determining the coordinate origin according to all the distances and constructing a measurement coordinate system includes:
[0029] Calculate the distance between each pixel point on the contour line and the reference plane straight line, and construct a distance matrix according to the pixel points and the corresponding distances;
[0030] Screening out all pixel points whose distances are equal to a preset value in the distance matrix to obtain a screened distance matrix;
[0031] Determine the pixel point located on the working surface in the filtered distance matrix, and determine the closest pixel point among all the pixel points on the working surface, wherein, among all the pixel points located on the working surface, the distance corresponding to the closest pixel point is closest to the preset value, and use the closest pixel point as the coordinate origin;
[0032] The direction passing through the coordinate origin and parallel to the reference plane straight line is set as the X-axis, and the direction passing through the coordinate origin and perpendicular to the reference plane straight line is set as the Y-axis to obtain the measurement coordinate system.
[0033] The second aspect of the present invention discloses a vehicle wheel rim tread sample testing device, comprising:
[0034] A recognition module, for recognizing and segmenting the wheel rim tread sample of the locomotive vehicle on the source image by using a target detection model based on the source image obtained by photographing the wheel rim tread sample of the locomotive vehicle, so as to obtain a tread sample image;
[0035] A model module, used for inputting the tread sample image into an image classification model, determining the model of the wheel rim tread sample of a locomotive vehicle, and obtaining a measurement scheme matrix from a measurement scheme library according to the model;
[0036] A contour line module, used for identifying the contour line of the tread template of the wheel rim of the locomotive vehicle in the tread template image;
[0037] A reference plane straight line module, used for extracting a reference plane straight line from the contour line by using a machine vision algorithm;
[0038] A measurement coordinate system module, used to calculate the distance from each pixel point on the contour line to the reference plane straight line, determine the coordinate origin based on all the distances and construct a measurement coordinate system;
[0039] A measurement module, used to calculate the coordinates of each pixel point on the contour line based on the measurement coordinate system to obtain a measurement data matrix;
[0040] The determination module is used to compare the measurement data matrix with the measurement scheme matrix to obtain a verification result.
[0041] In some embodiments, the measurement coordinate system module includes a distance matrix unit, a screening unit and a construction unit. The distance matrix unit is used to calculate the distance from each pixel point on the contour line to the reference plane straight line, and construct a distance matrix according to the pixel points and the corresponding distances. The screening unit is used to screen out all pixel points whose distances are equal to preset values in the distance matrix to obtain a screened distance matrix. The construction unit is used to determine the pixel points located on the working surface in the screened distance matrix, and determine the closest pixel point among all the pixel points on the working surface, wherein, among all the pixel points located on the working surface, the distance corresponding to the closest pixel point is closest to the preset value, and the closest pixel point is used as the coordinate origin, and the direction passing through the coordinate origin and parallel to the reference plane straight line is set as the X-axis, and the direction passing through the coordinate origin and perpendicular to the reference plane straight line is set as the Y-axis to obtain the measurement coordinate system.
[0042] In some embodiments, the measurement module includes a midpoint unit, a working surface unit and a measurement unit, wherein the midpoint unit is used to set the image coordinates of the midpoint of the reference plane straight line as the midpoint coordinates; the working surface unit is used to traverse the pixel points on the contour line, and if the Y value of the image coordinates of the current pixel point is less than the Y value of the midpoint coordinates, the current pixel point is determined to be a pixel point located on the working surface; the measurement unit is used to calculate the first X coordinate and the first Y coordinate of each pixel point located on the working surface based on the measurement coordinate system, and combine the first X coordinates and the first Y coordinates of all pixel points located on the working surface to obtain the measurement data matrix.
[0043] The third aspect of the present invention discloses an electronic device, comprising a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the locomotive vehicle wheel rim tread sample calibration method disclosed in the first aspect.
[0044] A fourth aspect of the present invention discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the method for calibrating a locomotive vehicle wheel rim tread sample disclosed in the first aspect.
[0045] The beneficial effects of the present invention are that the target detection model is used to identify and segment the locomotive vehicle wheel rim tread template in the source image, the image classification model is used to determine the model of the locomotive vehicle wheel rim tread template, the contour line of the locomotive vehicle wheel rim tread template is identified, the reference plane straight line is extracted from the contour line by the machine vision algorithm, the coordinate origin is determined by the reference plane straight line, the measurement coordinate system is constructed for measurement, and then the measurement data matrix is compared with the measurement scheme matrix corresponding to the model, and the verification result is automatically determined. Automated intelligent measurement and digital measurement are realized, which is helpful to reduce the human error in the measurement process of the locomotive vehicle wheel rim tread template, shorten the measurement time, and improve the verification efficiency and quality. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings herein show specific examples of the technical solutions described in the present invention, and together with the specific implementation methods, constitute a part of the specification, and are used to explain the technical solutions, principles and effects of the present invention.
[0047] Unless otherwise specified or defined, the same reference numerals in different drawings represent the same or similar technical features, and the same or similar technical features may also be represented by different reference numerals.
[0048] Figure 1 is a three-dimensional diagram of a vehicle wheel rim tread sample testing device according to an embodiment of the present invention;
[0049] Figure 2 It is a flow chart of a method for testing a wheel rim tread sample of a locomotive vehicle according to an embodiment of the present invention;
[0050] Figure 3 is a specific flow chart of step S500 in an embodiment of the present invention;
[0051] Figure 4 is a schematic diagram of a working surface and a measurement coordinate system according to an embodiment of the present invention;
[0052] Figure 5 is a specific flow chart of step S700 in an embodiment of the present invention;
[0053] Figure 6 2 is a schematic structural diagram of a vehicle wheel rim tread sample test device according to an embodiment of the present invention;
[0054] Figure 7 It is a structural schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0055] Unless otherwise specified or defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art. In the case of combining the technical solution of the present invention with realistic scenarios, all technical and scientific terms used herein may also have meanings corresponding to the purpose of implementing the technical solution of the present invention. The "first, second..." used herein is only used to distinguish the names and does not represent a specific quantity or order. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0056] It should be noted that when a component is considered to be "fixed to" another component, it can be directly fixed to the other component or there can be a central component; when an component is considered to be "connected to" another component, it can be directly connected to the other component or there can be a central component at the same time; when an component is considered to be "installed on" another component, it can be directly installed on the other component or there can be a central component at the same time. When an component is considered to be "set on" another component, it can be directly set on the other component or there can be a central component at the same time.
[0057] Unless otherwise specified or defined, the "said" and "the" used in this document refer to the technical features or technical contents mentioned or described before the corresponding position, and the technical features or technical contents may be the same as or similar to the technical features or technical contents mentioned therein. In addition, the terms "including" and "having" and any variations thereof used in this document are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0058] In order to improve the accuracy and efficiency of the verification of the wheel rim tread sample of the locomotive vehicle, the present invention combines the target detection model based on deep learning, the image classification model, the image segmentation model and the machine vision algorithm, identifies the wheel rim tread sample of the locomotive vehicle on the image and matches the measurement scheme, extracts the precise contour, determines the reference plane straight line and the coordinate origin, establishes the measurement coordinate system, and then calculates the position of the pixel points on the contour on the measurement coordinate system, establishes the measurement data matrix, and finally automatically determines the verification result according to the comparison between the measurement data matrix and the measurement scheme. The realization of automated intelligent measurement and digital measurement is helpful to reduce the human error in the measurement process of the wheel rim tread sample of the locomotive vehicle, shorten the measurement time, and improve the verification efficiency and quality.
[0059] The embodiment of the present invention discloses a method for calibrating a wheel rim tread sample of a locomotive vehicle. The execution subject of the method may be an electronic device such as a computer, a laptop computer, a tablet computer, or a control chip embedded in an electronic device, and the present invention does not limit this. After the image of the wheel rim tread sample of a locomotive vehicle is captured by a calibrating device for calibrating a wheel rim tread sample of a locomotive vehicle, the calibration method is then executed to realize automatic intelligent measurement and digital measurement. Figure 1 As shown, the vehicle wheel rim tread sample calibration device of this embodiment includes: a camera, a telecentric lens, an XY axis slide 11, a Z axis slide 12, an arc slide 13, a surface light source 14, an R axis rotary slide 15, a host computer and a grating ruler. Among them, the camera is installed on the combination mechanism of the Z axis slide 12, the R axis rotary slide 15 and the arc slide 13, and is connected and communicated with the host computer executing the calibration method through a USB or a network cable; the camera is installed with an industrial lens with a resolution of more than 2500W pixels, which is used to capture the image of the vehicle wheel rim tread sample; the surface light source 14 is installed on the XY axis slide 11.
[0060] In order to facilitate the understanding of the present invention, specific embodiments of the present invention will be described in more detail below with reference to the accompanying drawings.
[0061] like Figure 2 As shown, the method comprises the following steps:
[0062] Step S100: Based on a source image obtained by photographing a locomotive wheel rim tread sample, a target detection model is used to identify and segment the locomotive wheel rim tread sample on the source image to obtain a tread sample image;
[0063] Before photographing the wheel rim tread sample of a locomotive vehicle, use the calibration tool to level the camera and the plane light source by adjusting the arc slide, R-axis slide, and Z-axis slide, and obtain the camera field of view. Then, according to the size of the camera field of view, move the XY-axis slide to take pictures, and use the camera to take local images of the wheel rim tread sample of the locomotive vehicle frame by frame. 0-n (such as I1, I2, etc.), and finally image I 0-n Merge them in sequence to splice the entire locomotive wheel rim tread sample image to obtain the source image I source .
[0064] After obtaining the source image, we use the deep learning-based object detection model to identify the source image I source The locomotive vehicle wheel rim tread sample on the image is obtained, the position of the locomotive vehicle wheel rim tread sample on the image is obtained, and then the image I of the locomotive vehicle wheel rim tread sample is cropped. template ; The position of the wheel rim tread sample of the locomotive vehicle on the image is the upper left point (u min ,v min ), lower right point (u max ,v max ) bounding box representation, where u min ,v min ,u max ,v max are image coordinates relative to the upper left corner of the source image.
[0065] The target detection model for identifying the wheel rim tread sample of a locomotive vehicle may be a two-stage target detection model such as R-CNN and fasterR-CNN, or a single-stage target detection model such as YOLO and PYOLO.
[0066] In some embodiments, when cropping the sample image of the wheel rim tread of a locomotive vehicle, the bounding box may be extended, and the number of horizontal pixels of the extension σ is set to u , the number of vertical pixels σ v , that is, the pixel point in the upper left corner is (u min -σ u ,v min -σ v ), the pixel point in the lower right corner is (u max +σ u ,v max +σ v) so that the image classification model can better recognize and determine the model of the tread sample.
[0067] Step S200: inputting the tread sample image into the image classification model, determining the model of the wheel rim tread sample of the locomotive vehicle, and obtaining the measurement scheme matrix from the measurement scheme library according to the model;
[0068] Through the deep learning-based image classification model, the tread sample image is classified to obtain the model of the locomotive vehicle wheel rim tread sample. According to the model of the locomotive vehicle wheel rim tread sample, the corresponding measurement scheme is loaded from the measurement scheme library to obtain the measurement scheme matrix. Among them, the measurement scheme library is obtained by pre-entering the measurement scheme according to the national verification regulations. The measurement scheme library can be a database, an XML configuration file or a text file, etc. The data in the measurement scheme library at least includes the model name and the measurement scheme matrix. The measurement scheme matrix can be expressed as: Smeasure=(X i,Yi,MPEVy i), where Xi is the X coordinate of the origin of the relative coordinate system; Yi is the Y coordinate at the corresponding contour corresponding to the Xi coordinate; MPEVy i is the allowable error between Yi and the actual measurement value.
[0069] There is no specific limitation on the image classification model, which may be a MobileNet, PPLCNet or other model.
[0070] Step S300: identifying the contour line of the wheel rim tread template of the locomotive vehicle in the tread template image;
[0071] In this embodiment, the image segmentation model based on deep learning is used to identify the contour line of the wheel rim tread template of the locomotive vehicle in the tread template image, and the image coordinates of each pixel point on the contour line are obtained. The set of image coordinates of each pixel point on the contour line is represented as P List There is no specific restriction on the image segmentation model, and it can be a model such as HED, CASENet, DeepEdge, etc.
[0072] It should be noted that the image segmentation model is not limited to the present embodiment, and other image processing algorithms such as edge detection algorithms may also be used to identify the contour line of the wheel rim tread template of a locomotive vehicle.
[0073] Step S400: extracting a reference plane straight line from the contour line using a machine vision algorithm;
[0074] On the contour line, the machine vision algorithm is used to extract the reference plane straight line L base There is no specific limitation on the machine vision algorithm, and it may be a straight line detection algorithm such as Hough Line, LSD, FLD, ED Lines, LSWMS, or Canny Lines.
[0075] Specifically, we first extract straight line segments from the contour lines using a machine vision algorithm to form a straight line set L list , then for the line set L list Perform threshold segmentation to obtain the reference plane straight line L base The process of threshold segmentation is as follows: list Extract features from each straight line segment in L, such as length, angle, position, etc. Set one or more thresholds according to actual needs and data distribution, and then select the line set L according to the set thresholds. list The straight line segments that meet the threshold conditions are considered as reference plane straight lines.
[0076] Step S500: Calculate the distance from each pixel point on the contour line to the reference plane straight line, determine the coordinate origin based on all distances and construct a measurement coordinate system;
[0077] Calculate the distance from each pixel on the contour line to the reference plane line L base The distance is equal to the calibration procedure standard (for example: locomotive (rimless) wheel tread = 48mm, wear type = 70mm, wear type = 48mm) as the coordinate origin O, and then establish a measurement coordinate system XY. The Y axis of the measurement coordinate system passes through the origin and is parallel to the reference plane straight line, and the X axis passes through the origin and is perpendicular to the reference plane straight line.
[0078] In the present embodiment, the coordinate origin is limited to the working surface during calculation, so only the distance from each pixel point on the working surface to the reference surface straight line is calculated, and the coordinate origin is determined based on all distances and the measurement coordinate system is constructed. Figure 3 As shown, the specific steps include:
[0079] Step S510: Calculate the distance between each pixel point on the contour line and the reference plane straight line, and construct a distance matrix based on the pixel points and the corresponding distances;
[0080] Step S520: Filter out all pixel points whose distances are equal to a preset value in the distance matrix to obtain a filtered distance matrix;
[0081] Calculate the coordinate set P of all pixels on the contour line List To the reference plane straight line L base distance, generate an m x2 distance matrix D base =(P i ,D i ), where m is the number of pixels on the contour line, P i is the image coordinate of the pixel point on the contour line, D i is the distance from the pixel point on the contour line to the reference plane line. base In the distance matrix, the distances in the distance matrix elements are rounded to the integers to select the ones that meet the conditions [Di ]=d pixels, and obtain the distance matrix D after screening base_d , where d is the preset value. Figure 4 The pixel points in the distance matrix after screening include both multiple pixel points located on the working surface with a distance rounded to d, and multiple pixel points located on the horizontal line below the working surface with a distance rounded to d.
[0082] Step S530: Determine the pixel points located on the working surface in the filtered distance matrix, and determine the closest pixel point among all the pixel points on the working surface, wherein, among all the pixel points located on the working surface, the distance corresponding to the closest pixel point is closest to the preset value, and the closest pixel point is used as the coordinate origin;
[0083] Step S540: Set the direction passing through the coordinate origin and parallel to the reference plane straight line as the X-axis, and set the direction passing through the coordinate origin and perpendicular to the reference plane straight line as the Y-axis to obtain a measurement coordinate system.
[0084] The image coordinates of the midpoint of the reference plane line are used as the midpoint coordinates, and each pixel in the filtered distance matrix is traversed. If the Y value of the image coordinates of the current pixel is less than the Y value of the midpoint coordinates, the current pixel is determined to be a pixel located on the working surface. That is, using the reference plane line L base The midpoint coordinate of the pixel is taken as the threshold. When the Y coordinate of the pixel image coordinate Pi is less than the Y value of the midpoint coordinate, the pixel is considered to be on the working surface, thus base_d The distance matrix D corresponding to the working surface of the wheel rim tread sample of the locomotive vehicle is selected base_dw ; From the distance matrix D base_dw Filter out the pixel point closest to the preset value d as the origin O of the measurement coordinate system, that is, the distance matrix D base_dw The pixel point in the reference plane line L base The pixel point with the smallest difference between the distance between the coordinates and the preset value d is taken as the origin O of the measurement coordinate system. The direction passing through the origin of the coordinates and parallel to the reference plane straight line is set as the X-axis, and the direction passing through the origin of the coordinates and perpendicular to the reference plane straight line is set as the Y-axis. Figure 4 The measurement coordinate system shown.
[0085] Step S600: Calculate the coordinates of each pixel point on the contour line based on the measurement coordinate system to obtain a measurement data matrix;
[0086] Using the measurement coordinate system, the X-axis and Y-axis distances of the coordinates of each pixel point on the contour line to the measurement coordinate system are calculated to establish a measurement data matrix.
[0087] In order to speed up the calculation efficiency, this embodiment only selects the pixel points on the working surface to construct the measurement data matrix. The process of selecting the pixel points on the working surface is similar to the process of determining the pixel points located on the working surface in step S500. First, the image coordinates of the midpoint of the reference plane straight line are obtained to obtain the midpoint coordinates; then the pixel points on the contour line are traversed. If the Y value of the image coordinates of the current pixel point is less than the Y value of the midpoint coordinates, the current pixel point is determined to be a pixel point located on the working surface. Then, based on the measurement coordinate system, the first X coordinate and the first Y coordinate of each pixel point located on the working surface are calculated; the first X coordinates and the first Y coordinates of all the pixel points located on the working surface are combined to obtain the measurement data matrix.
[0088] Specifically, first use the reference plane straight line L base The midpoint coordinates of the contour line are taken as the threshold, and the pixel coordinate set P is selected from the contour line. List The pixel points on the working surface of the wheel rim tread sample of the locomotive vehicle are selected, and then the X-axis and Y-axis distances of these points to the measurement coordinate system are calculated using the measurement coordinate system to establish an m x 3 measurement data matrix D measure =(P i ,D xi ,D yi ), where m is the number of pixels, P i is the image coordinate of the pixel point, D xi is the first X coordinate, i.e. the distance to the X axis of the measurement coordinate system, D yi is the first Y coordinate, that is, the distance to the Y axis of the measurement coordinate system.
[0089] Step S700: Compare the measurement data matrix and the measurement scheme matrix to obtain the verification result.
[0090] According to the obtained measurement scheme matrix, the measurement data matrix is compared with the measurement scheme matrix to determine the measurement results. Among them, the measurement scheme matrix is Smeasure = (Xi, Yi, MPEVy i), Xi is the X coordinate relative to the origin of the measurement coordinate system, that is, the second X coordinate; Yi is the Y coordinate at the corresponding contour corresponding to the Xi coordinate, that is, the second Y coordinate, and MPEVy i is the allowable error between Yi and the actual measurement value.
[0091] like Figure 5 As shown, the comparison step specifically includes:
[0092] Step S710: Based on the same first X coordinate and second X coordinate, elements are connected in the measurement data matrix and the measurement scheme matrix to obtain a combined matrix, where the elements of the combined matrix at least include the first X coordinate, the first Y coordinate, the second X coordinate, the second Y coordinate, and the allowable error;
[0093] Step S720: traverse each element in the combined matrix, calculate the difference between the first Y coordinate and the second Y coordinate of the current element, and set the difference as the comparison difference of the current element;
[0094] The measurement data matrix D measure The first X coordinate D xi With the measurement scheme matrix S measure The second X coordinate X i The same elements are matched in pairs, and then the data is connected to generate the combined matrix R measure= (X i ,Y i ,MPEV yi, P i ,D xi ,D yi ,△ i ), where the comparison difference △ i is the difference between the first Y coordinate and the second Y coordinate, that is, △ i =D yi -Y i .
[0095] Step S730: When the absolute values of the comparison differences of all elements in the combined matrix are less than the allowable error, the test result is set as qualified;
[0096] When the absolute value of the comparison difference of all elements in the combined matrix is less than the allowable error, that is, the |△ i | <MPEV yi , the sample test result is determined to be qualified. It should be noted that the allowable error MPEV of each element in the combined matrix is yi It can be the same or different.
[0097] otherwise,
[0098] Step S740: Calculate the upper maximum value and the lower maximum value of the deviation according to the first Y coordinate, the second Y coordinate and the allowable error of the elements in the combined matrix;
[0099] For each element in the combined matrix whose absolute value of the comparison difference is greater than or equal to the allowable error, that is, |△ i |≥MPEV yi For each element of , calculate the difference between the first Y coordinate and the sum of the second Y coordinate and the allowable error to obtain the upper deviation, calculate the difference between the second Y coordinate and the allowable error and the first Y coordinate to obtain the lower deviation; find the maximum value of all upper deviations to obtain the maximum value of the upper deviation; find the maximum value of all lower deviations to obtain the maximum value of the lower deviation. max The calculation expression is: max =Max(Dyi -(Y i +MPEV yi )); Maximum value of the lower deviation B max The calculation expression is: max =Max((Y-MPEV yi )-D yi ).
[0100] Step S750: When the upper maximum value and the lower maximum value are both less than or equal to 0, the calibration result is set to be qualified; when the upper maximum value is greater than 0, the lower maximum value is less than 0, and the upper maximum value is less than the absolute value of the lower maximum value, the calibration result is set to be qualified; when the upper maximum value is less than 0, the lower maximum value is greater than 0, and the lower maximum value is less than or equal to the absolute value of the upper maximum value, the calibration result is set to be qualified; otherwise, the calibration result is set to be unqualified.
[0101] If the upper maximum value A max ≤0, maximum value of lower tolerance B max ≤0, the contour of the sample is qualified and the verification result is set as qualified; if the upper maximum value A max >0, lower tolerance maximum value B max <0, and A max <|B max |, it is equivalent to the coordinates moving upward, the contour of the sample is also qualified, and the test result is set as qualified; if the lower tolerance maximum value B max >0, the maximum value of the upper deviation A max <0, and B max ≤|A max |, it is equivalent to the coordinates moving downward, the contour of the template is still qualified, and the verification result is set to qualified; otherwise, the contour of the template is unqualified, and the verification result is set to unqualified.
[0102] In summary, this embodiment uses a target detection model to identify and segment the locomotive vehicle wheel rim tread template in the source image, uses an image classification model to determine the model of the locomotive vehicle wheel rim tread template, identifies the contour line of the locomotive vehicle wheel rim tread template, uses a machine vision algorithm to extract a reference plane line on the contour line, determines the coordinate origin through the reference plane line, constructs a measurement coordinate system for measurement, and then compares the measurement data matrix with the measurement scheme matrix corresponding to the model to automatically determine the verification result. Automated intelligent measurement and digital measurement are realized, which helps to reduce human errors in the measurement process of locomotive vehicle wheel rim tread templates, shorten measurement time, and improve verification efficiency and quality.
[0103] like Figure 6As shown, based on the above-mentioned locomotive vehicle wheel rim tread sample verification method, the embodiment of the present invention discloses a locomotive vehicle wheel rim tread sample verification device, comprising:
[0104] The recognition module 600 is used to recognize and segment the locomotive vehicle wheel rim tread sample on the source image by using a target detection model based on the source image obtained by photographing the locomotive vehicle wheel rim tread sample, so as to obtain a tread sample image;
[0105] A model module 610 is used to input the tread sample image into an image classification model, determine the model of the wheel rim tread sample of the locomotive vehicle, and obtain a measurement scheme matrix from a measurement scheme library according to the model;
[0106] A contour line module 620, for identifying a contour line of the tread template of the wheel rim of the locomotive vehicle in the tread template image;
[0107] A reference plane straight line module 630, for extracting a reference plane straight line on the contour line using a machine vision algorithm;
[0108] A measurement coordinate system module 640 is used to calculate the distance from each pixel point on the contour line to the reference plane straight line, determine the coordinate origin based on all the distances and construct a measurement coordinate system;
[0109] A measurement module 650, configured to calculate the coordinates of each pixel point on the contour line based on the measurement coordinate system to obtain a measurement data matrix;
[0110] The determination module 660 is used to compare the measurement data matrix and the measurement scheme matrix to obtain a verification result.
[0111] like Figure 7 As shown, an embodiment of the present invention discloses an electronic device, including a memory 401 storing executable program codes and a processor 402 coupled to the memory 401;
[0112] The processor 402 calls the executable program code stored in the memory 401 to execute the locomotive vehicle wheel rim tread sample verification method described in the above embodiments.
[0113] An embodiment of the present invention further discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute the locomotive vehicle wheel rim tread sample verification method described in the above embodiments.
[0114] The purpose of the above embodiments is to exemplarily reproduce and deduce the technical solution of the present invention, and to fully describe the technical solution, purpose and effect of the present invention. Its purpose is to make the public understand the disclosed content of the present invention more thoroughly and comprehensively, and it does not limit the protection scope of the present invention.
[0115] The above embodiments are not exhaustive enumerations of the present invention, and there may be multiple other implementations not listed. Any replacement and improvement made without violating the concept of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for testing a wheel rim tread sample of a rolling stock, characterized in that: include: Based on a source image obtained by photographing a wheel rim tread sample of a locomotive vehicle, a target detection model is used to identify and segment the wheel rim tread sample of the locomotive vehicle on the source image to obtain a tread sample image; Inputting the tread sample image into an image classification model, determining the model of the wheel rim tread sample of the locomotive vehicle, and obtaining a measurement scheme matrix from a measurement scheme library according to the model; identifying the contour line of the tread template of the wheel rim of the locomotive vehicle in the tread template image; Using a machine vision algorithm to extract a reference plane straight line on the contour line; Calculate the distance from each pixel point on the contour line to the reference plane straight line, determine the coordinate origin based on all the distances and construct a measurement coordinate system; Based on the measurement coordinate system, the coordinates of each pixel point on the contour line are calculated to obtain a measurement data matrix; The measurement data matrix and the measurement scheme matrix are compared to obtain a verification result.
2. The method for testing a wheel rim tread sample of a locomotive vehicle according to claim 1, characterized in that: The step of calculating the coordinates of each pixel point on the contour line based on the measurement coordinate system to obtain a measurement data matrix includes: The image coordinates of the midpoint of the reference plane straight line are set as the midpoint coordinates; Traversing the pixel points on the contour line, if the Y value of the image coordinates of the current pixel point is less than the Y value of the midpoint coordinates, determining that the current pixel point is a pixel point located on the working surface; Based on the measurement coordinate system, calculating a first X coordinate and a first Y coordinate of each pixel point located on the working surface; The first X coordinates and the first Y coordinates of all pixel points located on the working surface are combined to obtain the measurement data matrix.
3. The method for testing a wheel rim tread sample of a locomotive vehicle according to claim 2, characterized in that: Each element in the measurement scheme matrix includes a second X coordinate and a second Y coordinate of a pixel point and an allowable error, and the comparing the measurement data matrix with the measurement scheme matrix to obtain a verification result includes: Based on the same first X coordinate and second X coordinate, elements in the measurement data matrix and the measurement scheme matrix are connected to obtain a combined matrix, wherein the elements of the combined matrix at least include the first X coordinate, the first Y coordinate, the second X coordinate, the second Y coordinate, and the allowable error; Traversing each element in the combined matrix, calculating the difference between the first Y coordinate and the second Y coordinate of the current element, and setting the difference as the comparison difference of the current element; When the absolute values of the comparison differences of all elements in the combined matrix are less than the allowable error, the test result is set as qualified; otherwise, Calculate the upper maximum value and the lower maximum value of the excess tolerance according to the first Y coordinate, the second Y coordinate and the allowable error of the elements in the combined matrix; When the upper excess tolerance maximum value and the lower excess tolerance maximum value are both less than or equal to 0, the verification result is set as qualified; when the upper excess tolerance maximum value is greater than 0, the lower excess tolerance maximum value is less than 0, and the upper excess tolerance maximum value is less than the absolute value of the lower excess tolerance maximum value, the verification result is set as qualified; when the upper excess tolerance maximum value is less than 0, the lower excess tolerance maximum value is greater than 0, and the lower excess tolerance maximum value is less than or equal to the absolute value of the upper excess tolerance maximum value, the verification result is set as qualified; otherwise, the verification result is set as unqualified.
4. The method for testing a wheel rim tread sample of a locomotive vehicle according to claim 3, characterized in that: The calculating the upper maximum value and the lower maximum value of the excess tolerance according to the first Y coordinate, the second Y coordinate and the allowable error of the elements in the combined matrix includes: For each element in the combined matrix whose absolute value of the comparison difference is greater than or equal to the allowable error, calculate the difference of the first Y coordinate with respect to the sum of the second Y coordinate and the allowable error to obtain an upper deviation, and calculate the difference between the second Y coordinate and the allowable error and the first Y coordinate to obtain a lower deviation; Find the maximum values of all upper deviations to obtain the maximum value of the upper deviation; find the maximum values of all lower deviations to obtain the maximum value of the lower deviation.
5. The method for testing a wheel rim tread sample of a locomotive vehicle according to claim 1, characterized in that: The calculating the distance from each pixel point on the contour line to the reference plane straight line, determining the coordinate origin according to all the distances and constructing a measurement coordinate system includes: Calculate the distance between each pixel point on the contour line and the reference plane straight line, and construct a distance matrix according to the pixel points and the corresponding distances; Screening out all pixel points whose distances are equal to a preset value in the distance matrix to obtain a screened distance matrix; Determine the pixel point located on the working surface in the filtered distance matrix, and determine the closest pixel point among all the pixel points on the working surface, wherein, among all the pixel points located on the working surface, the distance corresponding to the closest pixel point is closest to the preset value, and use the closest pixel point as the coordinate origin; The direction passing through the coordinate origin and parallel to the reference plane straight line is set as the X-axis, and the direction passing through the coordinate origin and perpendicular to the reference plane straight line is set as the Y-axis to obtain the measurement coordinate system.
6. A vehicle wheel rim tread sample test device, characterized in that: include: A recognition module, for recognizing and segmenting the wheel rim tread sample of the locomotive vehicle on the source image by using a target detection model based on the source image obtained by photographing the wheel rim tread sample of the locomotive vehicle, so as to obtain a tread sample image; A model module, used for inputting the tread sample image into an image classification model, determining the model of the wheel rim tread sample of a locomotive vehicle, and obtaining a measurement scheme matrix from a measurement scheme library according to the model; A contour line module, used for identifying the contour line of the tread template of the wheel rim of the locomotive vehicle in the tread template image; A reference plane straight line module, used for extracting a reference plane straight line from the contour line by using a machine vision algorithm; A measurement coordinate system module, used to calculate the distance from each pixel point on the contour line to the reference plane straight line, determine the coordinate origin based on all the distances and construct a measurement coordinate system; A measurement module, used to calculate the coordinates of each pixel point on the contour line based on the measurement coordinate system to obtain a measurement data matrix; The determination module is used to compare the measurement data matrix with the measurement scheme matrix to obtain a verification result.
7. The vehicle wheel rim tread sample testing device according to claim 6, characterized in that: The measurement coordinate system module includes a distance matrix unit, a screening unit and a construction unit. The distance matrix unit is used to calculate the distance from each pixel point on the contour line to the reference plane straight line, and to construct a distance matrix according to the pixel points and the corresponding distances. The screening unit is used to screen out all pixel points whose distances are equal to preset values in the distance matrix to obtain a screened distance matrix. The construction unit is used to determine the pixel points located on the working surface in the screened distance matrix, and to determine the closest pixel point among all the pixel points on the working surface, wherein, among all the pixel points located on the working surface, the distance corresponding to the closest pixel point is closest to the preset value, and the closest pixel point is used as the coordinate origin, and the direction passing through the coordinate origin and parallel to the reference plane straight line is set as the X-axis, and the direction passing through the coordinate origin and perpendicular to the reference plane straight line is set as the Y-axis to obtain the measurement coordinate system.
8. The vehicle wheel rim tread sample testing device according to claim 6, characterized in that: The measurement module includes a midpoint unit, a working surface unit and a measurement unit. The midpoint unit is used to set the image coordinates of the midpoint of the reference plane straight line as the midpoint coordinates; the working surface unit is used to traverse the pixel points on the contour line, and if the Y value of the image coordinates of the current pixel point is less than the Y value of the midpoint coordinates, the current pixel point is determined to be a pixel point located on the working surface; the measurement unit is used to calculate the first X coordinate and the first Y coordinate of each pixel point located on the working surface based on the measurement coordinate system, and combine the first X coordinates and the first Y coordinates of all the pixel points located on the working surface to obtain the measurement data matrix.
9. An electronic device, characterized in that: It comprises a memory storing executable program code and a processor coupled to the memory; the processor calls the executable program code stored in the memory to execute the locomotive vehicle wheel rim tread sample verification method as described in any one of claims 1 to 5.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program enables a computer to execute the method for calibrating a wheel rim tread specimen of a locomotive vehicle according to any one of claims 1 to 5.