Method for rapidly generating railway ballast numerical value file based on machine vision and geometric feature matching
Through the method based on machine vision and geometric feature matching, numerical ballast files that are close to the real shape are quickly generated, which solves the problems of poor model accuracy, complex operation and high cost in the prior art, and realizes efficient and accurate ballast numerical ballast files generation.
Patent Information
- Application Number
- CN202510070954.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2045-01-16
AI Technical Summary
The existing numerical simulation model of the dock is poor in accuracy, the scanning model is long, the operation is complex and expensive, making it difficult to quickly and accurately construct a representative dock is three-dimensional model.
Using a method based on machine vision and geometric feature matching, a three-dimensional model of the dock particles is obtained through a three-dimensional scanner, a projection profile geometric features of multiple surface angles are extracted, a two-dimensional information table of the dock model is established, and a real photo of the dock aggregate is segmented through the machine vision model to generate a numeric dock file close to the real shape.
It realizes the rapid and accurate generation of numerical ballast files close to the real shape, improves the authenticity and reliability of shape characteristics of discrete element simulation, and reduces operational complexity and cost.
Smart Images

Figure CN119989529A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a railway ballast digital simulation technology, and in particular to a ballast numerical file rapid generation method based on machine vision and geometric feature matching. Background Art
[0002] Ballast track is an important structural form commonly found in railways and urban rail transit. It has many advantages such as good elasticity, low price, and easy maintenance, especially in terms of track vibration noise, it has good noise absorption characteristics. As an important component of ballasted track, the ballast track bed plays an important role in transferring loads, fixing track shape and position, and preventing water accumulation. Relevant studies have shown that the above performance is closely related to the shape characteristics of the ballast that constitutes the track bed.
[0003] Numerical simulation is a common analytical method used to study the mechanical properties of ballasted trackbeds, especially the discrete element method (DEM). In order to make the DEM simulation results as close as possible to the actual test results, it is necessary to accurately simulate the characteristic shape of the numerical ballast. Numerical ballast is a ballast DEM model formed by filling spherical particles into a closed three-dimensional model and then bonding or inlaying them. The shape of the DEM model is closely related to the shape of the three-dimensional model. At present, the methods for constructing three-dimensional models are mainly divided into two categories. The first method is to use a simple polyhedron representation; the second method is to use CT layered scanning of the two-dimensional cross-section of the real particles, and then the cross-sections are superimposed to form a model. The former method mainly uses modeling software to draw a simple polyhedron, and then uses the polyhedron to simulate the ballast shape. This method is convenient, but the constructed discrete element model of ballast has the problem of poor model accuracy and cannot reflect the morphological characteristics of real particles; the latter method can accurately obtain the real ballast three-dimensional model for constructing discrete element ballast particles, but this method has the disadvantages of long scanning time, high cost, complex operation and high cost, and the particle model used to obtain is difficult to reuse, which easily causes waste of resources.
[0004] Therefore, how to quickly and accurately construct a representative three-dimensional model of ballast shape and provide particle units with real and reliable shape characteristics for discrete element simulation is still a difficult problem that needs to be solved urgently. Summary of the invention
[0005] In view of the problems of poor model accuracy, long model scanning time, complex operation and high cost in the existing numerical simulation ballast, the present invention provides a method for quickly generating ballast numerical files based on machine vision and geometric feature matching, aiming to fully consider the authenticity of the shape of ballast particles, quickly match or generate numerical ballast close to the real shape through simple two-dimensional projection, and provide real and reliable simulation materials for discrete element simulation. The specific technical scheme is as follows:
[0006] First, the present invention provides a method for quickly generating a ballast numerical file based on machine vision and geometric feature matching, comprising the following steps:
[0007] Step 1: Create a 2D information table of the ballast model
[0008] A certain number of ballast particles are scanned using a 3D scanner to obtain a 3D model of each ballast particle, and each model is named according to a certain naming rule to establish a 3D model library of ballast particles; multiple faces of the 3D model of each ballast particle are projected, and the geometric features of each projection contour are extracted to establish a 2D information table of the ballast model;
[0009] Step 2: Create a two-dimensional information table of ballast particles
[0010] Collect real photos of ballast aggregates, use machine vision models to segment the real photos of ballast aggregates, and convert them into binary images. Extract the geometric features of the contours of each ballast particle in the binary image and establish a two-dimensional information table of ballast particles.
[0011] Step 3: Ballast numerical file generation
[0012] The matching degree between the geometric features of each ballast particle in the actual photos of ballast aggregate and the geometric features of the three-dimensional model of each ballast particle in the three-dimensional model library of ballast particles is comprehensively considered, and the name is used as the index medium to select or calculate and generate the numerical file of each ballast particle in the actual photos of ballast aggregate.
[0013] The aforementioned method for quickly generating ballast numerical files based on machine vision and geometric feature matching, in step one, uses a three-dimensional scanner to scan a certain number of ballast particles to obtain a three-dimensional model of each ballast particle, specifically: randomly collect a number of ballast particles, whose particle size distribution range includes 16.5-22.5mm, 22.4-31.5mm, 31.5-40mm, 40-50mm, 50-63mm; the collected ballast particles are placed stably on the rotating table of the three-dimensional scanner respectively, and three-dimensional scanning is performed; after scanning for one week, the ballast particles are turned over and scanned again; the two scanning results are spliced to form a complete three-dimensional model of the ballast particles.
[0014] In the aforementioned method for quickly generating ballast numerical files based on machine vision and geometric feature matching, in step one, the naming rule is to obtain the major axis, middle axis and minor axis lengths of each collected ballast particle through a measuring tool, with "major axis length L-middle axis length I-minor axis length S" as the naming rule.
[0015] Preferably, in the aforementioned method for quickly generating ballast numerical files based on machine vision and geometric feature matching, in step one, the three-dimensional model of each ballast particle is projected on multiple surfaces, specifically, each three-dimensional model of the ballast particle is rotated 12 times around the X, Y, and Z axes, each rotation is 30°, to obtain projections of each three-dimensional model of the ballast particle at 12 different angles on the XY plane, XZ plane, and YZ plane.
[0016] In the aforementioned method for rapidly generating ballast numerical files based on machine vision and geometric feature matching, in step 2, the actual photographs of ballast aggregates are collected by photographing ballast aggregates on the railway track bed in real time, or by randomly selecting a number of ballast particles on the railway track bed for photographing; the photographs contain images of reference balls with known diameters, which are used to refer to and calculate the ratio of the ballast particle size in the photographs to the actual ballast particle size.
[0017] Preferably, in the aforementioned method for quickly generating ballast numerical files based on machine vision and geometric feature matching, in step 2, the use of a machine vision model to perform instance segmentation on the real-shot photos of ballast aggregates is to use a pre-trained MaskR-CNN model to segment the real-shot photos of ballast;
[0018] The MaskR-CNN model training process is as follows: using ballast particles with a particle size range of 50-63 mm, 40-50 mm, 31.5-40 mm, 22.4-31.5 mm, and 16.5-22.5 mm and actual photos of green balls with a diameter of 3 cm as a data set for model training; performing instance segmentation model training in the MMdetection deep learning framework; during the training process, the recognition categories of the model are set to 3 categories, including ballast particles, green balls, and background; the parameters for model performance evaluation are set to: mAp parameter is 55.1, AP50 parameter is 77.9, and AP75 parameter is 73.3; the ability of the MaskR-CNN model to accurately segment the ballast particles and green ball images in the actual photos of ballast aggregate is used as a basis for successful training.
[0019] In the aforementioned method for rapidly generating ballast numerical files based on machine vision and geometric feature matching, in step 2, the conversion into a binary image is to convert the sample mask image formed by instance segmentation into a binary image with a black background and a white projection.
[0020] In the aforementioned method for rapidly generating ballast numerical files based on machine vision and geometric feature matching, in step one and step two, the geometric features include contour features and shape features; the contour features are the projection contour of the three-dimensional model of the ballast particles or the first 8 Fourier descriptors of the contour of the ballast particles; the shape features include the aspect ratio, circularity, sphericity, roughness, convexity and equivalent ellipsoid volume of the projection contour of the three-dimensional model of the ballast particles or the contour of the ballast particles.
[0021] In the aforementioned method for rapidly generating ballast numerical files based on machine vision and geometric feature matching, in step 3, the specific steps of matching the geometric features of each ballast particle in the actual photograph of the ballast aggregate with the geometric features of each 3D model of the ballast particle in the 3D model library of the ballast particle are as follows:
[0022] 3-1) extracting the contour characteristics and shape characteristics of the ballast particles from the two-dimensional information table of the ballast particles in sequence;
[0023] 3-2) Using the "equivalent ellipsoid volume" of the ballast particle as an indicator, compare it with the "equivalent ellipsoid volume" of each ballast three-dimensional model in the ballast model two-dimensional information table, and obtain all ballast three-dimensional models whose "equivalent ellipsoid volume" deviation values are within ±15%, which are recorded as ballast model set 1;
[0024] 3-3) calculating the Euclidean distance between the geometrical characteristic values of the ballast particle other than the “equivalent ellipsoid volume” and the geometrical characteristic values corresponding to each ballast three-dimensional model in the ballast model set 1, and taking the numerical file of the ballast three-dimensional model with the smallest Euclidean distance as the numerical file A of the ballast particle;
[0025] 3-4) simultaneously calculating the Euclidean distance between the geometric characteristic values of the ballast particle except the "equivalent ellipsoid volume" and the geometric characteristic values corresponding to each ballast three-dimensional model in the complete ballast model two-dimensional information table; taking the numerical file of the ballast three-dimensional model with the smallest Euclidean distance as the numerical file B of the ballast particle, and starting from the numerical file B, taking the first 30% of the ballast three-dimensional models as the ballast model set 2;
[0026] 3-5) If the numerical file A falls in the ballast model set 2, the numerical file A is directly selected as the numerical file of the ballast particle; if the numerical file A is not in the ballast model set 2, the characteristic values in the numerical file B are scaled to the corresponding size of the characteristic values of the ballast particle according to the "equivalent ellipsoid volume", and the scaled numerical file is used as the numerical file of the ballast particle;
[0027] 3-6) and so on, repeat steps 3-1) to 3-5) until the numerical files of all ballast particles in the ballast particle two-dimensional information table are obtained.
[0028] In the aforementioned method for quickly generating ballast numerical files based on machine vision and geometric feature matching, the equivalent ellipsoid volume calculation formula is as follows:
[0029]
[0030] Where: Ve is the equivalent ellipsoid volume, b is the equivalent ellipsoid minor axis, and a is the equivalent ellipsoid major axis.
[0031] The beneficial effects of the present invention are as follows:
[0032] 1) The matching method of the present invention fully considers the authenticity of the shape of ballast particles. The model is completely obtained by scanning the real ballast with a three-dimensional scanner. The matched model can fully conform to the morphological characteristics of general ballast. The produced model is obtained by matching contour features. Compared with the randomly reconstructed three-dimensional model, the matching speed is faster and more accurate. The accuracy of the generated model will increase with the increase of data in the database.
[0033] 2) The method of the present invention uses a three-dimensional scanner to collect real ballast. In terms of operability, the method of the present invention is simple and feasible, and the obtained three-dimensional model can be reused according to the two-dimensional projection of the real ballast; the running speed is fast, and compared with other methods, there is no need for the tedious operation of temporarily generating ballast, which greatly optimizes the running time; the operation is convenient, and only the binary image of the target particle and the proportional relationship between the image and the real particle need to be obtained to complete the particle matching; in terms of practicality, the matching accuracy of the method of the present invention can continue to increase with the increase of data in the model library and the information library; due to the characteristics of the Fourier descriptor, the model of small-particle ballast can also be used to generate large-particle ballast, even if the amount of data in the library is not large enough, a good reconstruction effect can be achieved; in terms of complexity, the method of the present invention is simple and accurate in obtaining the ballast model and physical characteristics, and does not require professional operating knowledge compared to CT scanning, and the generated model occupies less memory.
[0034] In general, the matching method of the present invention is simple to operate, has a clear principle, a fast and more accurate matching speed, and can quickly generate a numerical ballast that is close to the real shape through simple two-dimensional projection, providing a more realistic and reliable simulation material for discrete element simulation, and has good practical value and promotion prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 Establishing a flow chart for the two-dimensional information table of the ballast model of the present invention;
[0036] Figure 2 It is a schematic diagram of projection results of different surface angles of the ballast model of the present invention;
[0037] Figure 3It is a trend diagram of the change of the average value of the minimum Euclidean distance between the ballast aggregate sample characteristics and the model characteristics of the present invention;
[0038] Figure 4 Establishing a flow chart for the two-dimensional information table of ballast particles of the present invention;
[0039] Figure 5 Taking real-life photos of ballast aggregate on the railway track bed for the present invention;
[0040] Figure 6 The sample mask image is formed by using a machine vision model to perform instance segmentation on the real photos of ballast aggregates;
[0041] Figure 7 This is the workflow diagram of the MaskR-CNN model of the present invention;
[0042] Figure 8 Use Python to process the sample masks formed by the MaskR-CNN model segmentation into binary images;
[0043] Fig. 9 A flow chart for generating a ballast numerical file of the present invention;
[0044] Fig.10 The photo collection result of ballast aggregate in Example 2 of the present invention;
[0045] Fig.11 is the result of binarization of the ballast aggregate photo in Example 2 of the present invention;
[0046] Fig.12 Schematic diagram of the contour of ballast particles extracted from the binary image in Example 2 of the present invention;
[0047] Fig.13 This is a comparison of model numerical files obtained by considering the equivalent ellipsoid volume in Example 2 of the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the embodiments and drawings to clearly and completely describe the technical solution of the present invention. Obviously, the described embodiments are only preferred embodiments of the present invention, not all embodiments, and are not intended to limit the present invention in other forms. Any technician familiar with the profession may use the disclosed technical content to make changes or modifications. However, any simple modification, equivalent change and modification made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention still belongs to the protection scope of the technical solution of the present invention.
[0049] Example 1
[0050] This embodiment is a method for quickly generating ballast numerical files based on machine vision and geometric feature matching. As mentioned above, for discrete element simulation, the existing numerical ballast creation method is mainly to use simple polyhedron representation or use CT layered scanning of real particle two-dimensional cross-sections, and then accumulate each other to form a model. Simple polyhedrons are too crude and the model accuracy is too poor; CT layered scanning is not only complicated to operate, but also causes waste of ballast resources, and it takes a long time and is difficult to operate in actual simulation work. In addition, the existing three-dimensional scanning modeling mostly manually selects ballast particles for simulation, and the results are not representative enough.
[0051] The method for quickly generating ballast numerical files based on machine vision and geometric feature matching provided in this embodiment is to establish a three-dimensional model library by scanning a certain number of ballast particles, and extract the geometric features of the projection contours of multiple faces of each ballast model to establish a two-dimensional information table of the ballast model; at the same time, the actual photos of ballast aggregates are segmented by instances through the machine vision model, and binarized to extract the geometric features of the contours of each ballast particle in the binary image to establish a two-dimensional information table of ballast particles; then the geometric features of the ballast particles in the actual photos are matched with the geometric features of each ballast model in the three-dimensional model library, and the similarity between the particle projection features and the model projection features is compared, and the numerical files of the ballast particles are selected or calculated to be generated. The details are as follows:
[0052] Step 1: Create a two-dimensional information table of the ballast model.
[0053] Process such as Figure 1 As shown, a certain number of ballast particles are scanned using a 3D scanner to obtain the 3D model of each ballast particle, and each model is named according to a certain naming rule to establish a 3D model library of ballast particles. The number of ballast particles scanned can be hundreds or thousands or more, and the particle size distribution range of ballast particles includes 16.5-22.5mm, 22.4-31.5mm, 31.5-40mm, 40-50mm, 50-63mm; for example, 1000 ballast particles are scanned, and the number of ballast particles in each particle range is 200. The more ballast particles are scanned, the more powerful the 3D model library is, and the closer the subsequent matching model is to the real ballast shape.
[0054] In this embodiment, the 3D scanner used is Einscan-SE. The scanning method of this scanner is different from the modeling method of layered scanning. Instead, it scans the complete surface of ballast particles to obtain the conformation of the entire ballast. Specifically, the ballast particles are placed stably on the self-rotating table of the 3D scanner for 3D scanning. Since the surface in contact with the turntable cannot be scanned, after the machine scans for one week, the ballast particles need to be turned over and scanned again. After the scanning is completed, the two scanning results are spliced together to form a complete 3D model of the ballast particles. The scanned ballast particles can still be used to avoid waste of resources, and it is simpler and faster than layered scanning.
[0055] The naming method described in this embodiment is to measure the length of the major axis, middle axis and minor axis of each ballast particle by a measuring tool, and name the model of each ballast particle scan using the naming rule of "major axis length L-middle axis length I-minor axis length S". The measurement method of the length of the major axis, middle axis and minor axis of the ballast particle is as follows: the major axis is the maximum distance between two points on the ballast; the middle axis is orthogonal to the major axis as the central axis, and the middle axis is the longest axis perpendicular to the central axis, and its length is second only to the major axis; the middle axis is the center, and the shortest minor axis is orthogonal to the major axis. In addition to measuring the axis length, physical information such as the mass of the ballast particles can also be measured. While scanning, information such as the surface area and volume of the ballast particles is obtained, which can provide more detailed parameter information such as density for subsequent simulations.
[0056] After the 3D model of the ballast particles is scanned and established, multiple faces of the 3D model of each ballast particle are projected, and the geometric features of each projection contour are extracted, that is, the "contour features" and "shape features" of each projection contour are extracted.
[0057] The 3D model of ballast particles is actually a collection of many 3D coordinate points (x, y, z). Projection is to return the value of one of the axes of the 3D coordinates X, Y, and Z to 0, and obtain the 2D coordinates of the projection contour curve on the three planes XY, YZ, and XZ. Figure 2 As shown; then the coordinate points of the ballast particle projection contour curve are imported into the fft.fft function in the Numpy module to obtain the first 8 Fourier descriptors corresponding to the contour, that is, to obtain the "contour features" of each projection contour.
[0058] The Fourier descriptor is a mathematical method used to describe the shape of a plane curve, and is used to compare the similarity of objects of different shapes. Assume that the two-dimensional contour points of a model projection are (x0, y0), (x1, y1), ..., (x N-1 ,y N-1 ), and its corresponding Fourier descriptor is:
[0059] Z n =x n +iy n (1);
[0060]
[0061] Where: Z n is the complex form of the contour point, i is the imaginary unit, Z k is the kth Fourier descriptor, N is the total number of points, k = 0, 1, ..., N-1.
[0062] The "shape features" of the projection profile include aspect ratio, circularity, sphericity, roughness, concavity and convexity, and equivalent ellipsoid volume, etc. The "equivalent ellipsoid volume" refers to the volume calculated based on the similar ellipse, and its formula is as follows.
[0063]
[0064] Where: V e is the volume of the ellipsoid, b is the equivalent ellipse minor axis, and a is the equivalent ellipse major axis.
[0065] The aspect ratio, circularity, sphericity, roughness, and concavity are mainly calculated using the Python third-party library OpenCV combined with relevant programming codes. The specific calculation formula is:
[0066] Aspect Ratio:
[0067]
[0068] Where: Dmax is the major axis of the equivalent ellipse, and Dmin is the minor axis of the equivalent ellipse.
[0069] Roundness:
[0070]
[0071] Where: A is the particle projection area, P is the particle projection contour circumference.
[0072] Sphericity:
[0073]
[0074] Where: Rinsc is the maximum inscribed circle radius of the particle projection, and Rcirc is the minimum circumscribed circle radius of the particle projection.
[0075] Roughness:
[0076]
[0077] Where: Pc is the perimeter of the circumscribed polygon of the particle projection, and Pe is the perimeter of the equivalent ellipse of the particle projection.
[0078] Convexity:
[0079]
[0080] Where: The area of the circumscribed polygon of the Sc particle projection.
[0081] The "contour features" and "shape features" of the above-mentioned projection contour are counted in a table, and "long axis length L-middle axis length I-minor axis length S" is used as a medium for subsequent matching indexes to establish a "ballast model two-dimensional information table", that is, there is a column in the table for the model name ("long axis length L-middle axis length I-minor axis length S"), and the remaining columns are the corresponding shape and contour information. After comparing the similarity between the ballast projection and the model projection shape information, the target ballast model can be found through the projection shape information. The established "ballast model two-dimensional information table" is shown in Table 1.
[0082] Table 1. Two-dimensional information table of ballast model (part)
[0083]
[0084] Since the projection profile of a ballast particle model is different due to the placement angle, in order to complete the comparison more accurately, it is necessary to perform contour projection of multiple surfaces, that is, after completing the first projection feature collection, the model is rotated around the X, Y, and Z axes respectively, and the feature profiles of the corresponding projection surfaces are repeatedly collected. However, considering that the rotation angle should not be too small or too large, if the number of rotations is too small, too few feature profiles will be collected, resulting in the problem that the generated model is not accurate enough; if the number of rotations is too large, the similarity of the collected profiles will be too large, and a large number of feature values will also bring additional calculation burdens, which will seriously reduce the calculation efficiency and occupy computer resources.
[0085] In this embodiment, the influence of the number of model rotations on the model generation accuracy is investigated, and the minimum Euclidean distance between the ballast aggregate sample characteristic value and the model characteristic value is calculated to determine the average similarity between the two, that is, the change trend of the average minimum Euclidean distance, such as Figure 4 As shown. The experiment found that when the number of rotations is 8 to 20 times, the oscillation is in a relatively stable state. Considering the effect of equal distribution of the rotating circle and the amount of calculated data, it is best to perform 12 data collections, that is, after the first data collection, the model is rotated 30° around the X, Y, and Z axes respectively, and then the contour features of the corresponding projection surface are obtained (for example, the features of the XY projection surface are collected when rotating around X). The contour features obtained after each rotation are indexed by the model name and counted in the "Ballast Model Two-Dimensional Information Table".
[0086] Euclidean distance is a calculation method used to measure the difference between corresponding feature values in an image. During image matching, Euclidean distance can be used to help find the best matching model. The calculation process of Euclidean distance is as follows:
[0087] In a two-dimensional plane, the Euclidean distance formula between two points A(x1, y1) and B(x2, y2) is:
[0088]
[0089] In the n-dimensional plane, for two points A(x1, y1, ..., n1) and B(x2, y2, ..., n2), the Euclidean distance formula between them is:
[0090]
[0091] For this embodiment, the two-dimensional contour feature values extracted from the ballast particle example photos are calculated, compared and matched with the two-dimensional contour feature values of multiple surface projections of the three-dimensional model of each ballast particle.
[0092] Step 2: Create a two-dimensional information table of ballast particles.
[0093] This step can be performed simultaneously with step 1. However, after the two-dimensional information table of the ballast model is established and improved, only this step is required to compare or calculate the numerical file of the target ballast in the three-dimensional model library of the ballast particles, which greatly saves the process of establishing the digital ballast and greatly improves the simulation accuracy. It is of great significance to the study of discrete element simulation and ballasted track bed performance.
[0094] In this embodiment, the process of establishing the two-dimensional information table of ballast particles is as follows: Figure 4 shown.
[0095] Take real-life photos of the ballast aggregate on the railway track bed, or randomly collect a number of ballast aggregates from the track bed for photography, such as Figure 5 As shown in the figure, the axial length of each ballast particle is measured by a measuring tool, and each ballast particle is named in the same way as the 3D ballast model: "long axis length L-medium axis length I-short axis length S". When shooting, a green reference ball with a known diameter is placed in the photo for reference in calculating the photo size and actual size of the ballast particle. The diameter of the reference ball is generally 3 to 5 cm. Then, the machine vision model is used to perform instance segmentation on the actual photos of the ballast aggregate to form a sample mask, as shown in the figure. Figure 6 In this embodiment, the machine vision model used is the MaskR-CNN model. In other embodiments, other machine vision models may also be used as long as they can segment and project the ballast aggregate in the real photo.
[0096] The MaskR-CNN model needs to be pre-trained before use. The training process is as follows:
[0097] Firstly, real-life photos of granite ballast with particle sizes ranging from 50 to 63 mm, 40 to 50 mm, 31.5 to 40 mm, 22.4 to 31.5 mm, and 16.5 to 22.5 mm and green balls with a diameter of 3 cm were used as annotation materials to create a data set for model training. Then, the Mask-RCNN instance segmentation model was trained in the MMdetection deep learning framework. In the model training, the recognition categories were set to three categories, including ballast, green balls with a diameter of 3 cm, and background.
[0098] During model training, the anchor point size is set to 8, 16, 32, 64, 128, the anchor boxes of each image is 256, img_scale is set to (1333, 640), and the model is optimized based on stochastic gradient descent (SGD). The initial learning rate is set to 0.001, the momentum factor is 0.9, the weight decay coefficient is 0.0001, and a total of 560 iterative Epochs are set. When the iterative Epochs reaches 160, the learning rate is reduced to 0.0001.
[0099] The MaskR-CNN model workflow is as follows: Figure 7 As shown in the figure, the incoming ballast particle image is processed into a feature image by the Resnext101 neural network. Next, this feature map will be input into the FPN to generate a series of feature maps of various scales. The candidate regions that are most likely to contain ballast particles are screened out by the RPN, and their positions and sizes are fine-tuned. The feature maps of different sizes and the candidate regions are input into ROI Align to output a set of accurately sampled fixed-size feature maps, which are used for positioning, classification, and pixel-level mask generation in the fully connected layer (FCN). Finally, the three are combined to output instance-level segmentation results.
[0100] In this embodiment, in the model performance evaluation, the mAp parameter is 55.1, the AP50 parameter is 77.9, and the AP75 parameter is 73.3; the ability of the Mask R-CNN model to accurately segment the ballast particles and green ball images in the actual photos of the ballast aggregate is used as the basis for successful training.
[0101] The mask obtained in the Mask-RCNN instance segmentation model is actually a two-dimensional matrix composed of "True" and "Fulse", each value represents a pixel coordinate, where the "True" value represents the area where the ballast particles or balls are located, and the "Fulse" value represents other areas. Binarizing the image is to use the language Python to process the sample mask formed by the MaskR-CNN model segmentation into a binary image, such as Figure 8 As shown,.
[0102] The specific binarization method is to set all the areas where the "True" value is located to 255 (255 is the RGB value of white), and set all the areas where the "Fulse" value is located to 0 (0 is the RGB value of black), so as to realize the binarization of the image mask. The formula is shown below:
[0103]
[0104] Where: det(x,y) is the pixel value of the binary image, and f(x,y) is the pixel point in the matrix on the x row and y column.
[0105] The binary image is then further processed by the findContours function in the Python third-party library OpenCV to obtain the projection contour corresponding to each ballast particle in the image. The contour is actually a set of curves surrounded by a set of coordinate points. The coordinate points of the ballast particle projection contour curve are then imported into the fft.fft function in the Numpy module to obtain the first 8 Fourier descriptors corresponding to the contour, which are the "contour features" of the ballast particles. At the same time, the Python third-party library OpenCV is also used in combination with relevant programming codes to calculate the aspect ratio, circularity, sphericity, roughness, concavity and equivalent ellipsoid volume of each ballast particle contour. The "contour features" and "shape features" of the above-mentioned contours are counted in a table, and the "long axis length L-mid axis length I-short axis length S" is used as a medium for subsequent matching indexes to establish a "ballast model two-dimensional information table".
[0106] Step 3: Generate ballast numerical file.
[0107] Comprehensively consider the matching degree between the geometric features of each ballast particle in the real-shot photos of ballast aggregate and the geometric features of each ballast particle 3D model in the ballast particle 3D model library, use the name as the index medium, select or calculate and generate the numerical file of each ballast particle in the real-shot photos of ballast aggregate, such as Fig. 9 As shown, the specific process is as follows:
[0108] 3-1) Extract the contour features and shape feature information of the ballast particles from the two-dimensional information table of the ballast particles in turn, and compare and match them with the corresponding feature information in the two-dimensional information table of the ballast model.
[0109] 3-2) Due to the different ways of placing ballast particles in natural placement, there will be countless projection shapes, which will inevitably affect the final three-dimensional model generation results. Therefore, in order to minimize the impact of the above situation, the equivalent ellipsoid volume is used for the first screening before similarity matching, that is, the "equivalent ellipsoid volume" of the ballast particle is first used as an indicator to compare with the "equivalent ellipsoid volume" of each ballast three-dimensional model in the ballast model two-dimensional information table, and all ballast three-dimensional models whose "equivalent ellipsoid volume" deviation values are within ±15% are obtained, which are recorded as ballast model set 1.
[0110] 3-3) Then, the Euclidean distance between the geometric characteristic values of the ballast particle except the "equivalent ellipsoid volume" and the geometric characteristic values corresponding to each ballast three-dimensional model in the ballast model set 1 is calculated, and the numerical file of the ballast three-dimensional model with the smallest Euclidean distance is taken as the numerical file A of the ballast particle.
[0111] 3-4) At the same time, the Euclidean distance between the geometric characteristic values of the ballast particle except the "equivalent ellipsoid volume" and the corresponding geometric characteristic values of each ballast three-dimensional model in the complete ballast model two-dimensional information table is calculated; the numerical file of the ballast three-dimensional model with the smallest Euclidean distance is taken as the numerical file B of the ballast particle, and starting from the numerical file B, the first 30% of the ballast three-dimensional models are taken as the ballast model set 2.
[0112] 3-5) Compare and select the best one. If the numerical file A falls in the ballast model set 2, the numerical file A is directly selected as the numerical file of the ballast particle. If the numerical file A is not in the ballast model set 2, the characteristic values in the numerical file B are scaled to the corresponding size of the characteristic values of the ballast particle according to the "equivalent ellipsoid volume", and the scaled numerical file is used as the numerical file of the ballast particle.
[0113] 3-6) and so on, repeat steps 3-1) to 3-5) until the numerical files of all ballast particles in the ballast particle two-dimensional information table are obtained.
[0114] Example 2
[0115] This embodiment uses the method for quickly generating ballast numerical files based on machine vision and geometric feature matching described in Example 1 to quickly generate files for establishing a digital ballast model in a discrete element simulation. The specific process is as follows:
[0116] First, take photos of the ballast aggregate, such as Fig.10 As shown in the figure, there are three ballast particles, with particle sizes of 7.1 cm, 6.4 cm, and 7.3 cm respectively. Before taking the photo, a reference ball with a diameter of 3 cm was placed in the ballast aggregate. After taking the photo, the diameter of the ball in the photo is 247 pixels long.
[0117] The trained MaskR-CNN model is used to perform instance segmentation on the photo to form a sample mask, which is then binarized to form a binary image with a black background and a white projection. Fig.11 shown.
[0118] The obtained binary image is further processed through the findContours function in the Python third-party library OpenCV to obtain the corresponding projection contour curve, such as Fig.12 shown.
[0119] The coordinate points are imported into the fft.fft function in the Numpy module to obtain the first 8 Fourier descriptors corresponding to the contour, and the “contour features” of the three ballast particles are obtained, as shown in Table 2.
[0120] Table 2. Ballast particle projection profile characteristics (partial)
[0121]
[0122] At the same time, the two-dimensional information of the projection of ballast particles is collected, including aspect ratio, circularity, sphericity, roughness, concavity and convexity, and equivalent ellipsoid volume, to obtain the “shape characteristics” of the three ballast particles, as shown in Table 3.
[0123] Table 3. Projection shape characteristics of ballast particles (partial)
[0124]
[0125] The three ballast particles were measured using a vernier caliper and an electronic scale. The results are as follows:
[0126] Ballast particle 1: the length of the major axis L is 109, the length of the middle axis I is 71, and the length of the minor axis S is 28; the weight is 307.1g;
[0127] Ballast particle 2: the length of the major axis L is 108, the length of the middle axis I is 67, the length of the minor axis S is 32; the weight is 310.6g;
[0128] Ballast particle 3: the length of the major axis L is 105, the length of the middle axis I is 73, the length of the minor axis S is 41; the weight is 384.4g;
[0129] The "contour features" and "shape features" of the three ballast particles in the live image are stored in the same table and the ballast particles are named, as shown in Table 4:
[0130] Table 4. Two-dimensional information table of ballast model (part)
[0131]
[0132] Then, the equivalent ellipsoid volume information is used as an indicator to perform feature matching from the ballast model 2D information library to obtain the 3D ballast model set corresponding to all model projections with a deviation value within ±15%. The equivalent ellipsoid volume of ballast particle 1 is 117219mm 3 Among the 1000 models constructed in Example 1, there are 82 models with deviation values within ±15%, which are referred to as set 1-1; the equivalent ellipsoid volume of ballast particle 2 is 117406mm 3 Among the 1000 models constructed in Example 1, there are 86 models with deviation values within ±15%, which are referred to as set 1-2; the equivalent ellipsoid volume of ballast particle 3 is 144469mm 3 Among the 1000 models constructed in Example 1, there are 47 models with deviation values within ±15%, which are referred to as Set 1-3.
[0133] Then, the minimum Euclidean distances between the aspect ratio, circularity, sphericity, roughness, and concavity of the projections of the three ballast particles and the aspect ratio, circularity, sphericity, roughness, and concavity corresponding to the projections of each model of set 1-1, set 1-2, and set 1-3 are calculated respectively, and the model with the smallest Euclidean distance is taken as the numerical files A1, A2, and A3 of the three ballast instances.
[0134] Then, the characteristic values of the aspect ratio, circularity, sphericity, roughness and concavity of the three ballasts are used with the minimum Euclidean distance of the aspect ratio, circularity, sphericity, roughness and concavity corresponding to the projections of each model in the complete three-dimensional model library. Starting from the numerical files B1, B2, and B3 corresponding to the minimum Euclidean distance, the sets of the first 30% models are taken forward to obtain sets 2-1, 2-2, and 2-3.
[0135] After comparison, the numerical file A1 is in the set 2-1, and the numerical file A3 is in the set 2-3, so the numerical file A1 is the numerical file of the ballast particle 1, and the numerical file A3 is the numerical file of the ballast particle 3.
[0136] However, the numerical file A2 is not in set 2-2, so the numerical file B2 is selected as the basis, and the numerical file B is scaled to the size of the equivalent ellipsoid volume corresponding to the ballast particle. The specific calculation is as follows:
[0137] The equivalent ellipsoid volume of ballast particle 2 is 117406mm 3 , the model volume of numerical file B2 is 86412mm 3 , the specific scaling calculation process is:
[0138]
[0139] V new =86412*k
[0140] Where: k is the proportional relationship between the volume of ballast particle 1 and the model volume of numerical file B2; V new is the volume of the scaled B2 model. The numerical file of ballast particle 2 can be obtained, such as Fig.13 As shown in the figure, it can be seen that the numerical file obtained by considering the ellipsoid volume is closer to the real ballast projection, and the generation result considering the ellipsoid volume is better than the generation result not considering the ellipsoid volume.
[0141] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be regarded as exemplary and non-restrictive from any point of view. In addition, it should be understood that although this specification is described in accordance with the embodiments, it does not contain only one technical solution. This narrative of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole, and the technical solutions in the embodiments can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A method for rapidly generating ballast numerical files based on machine vision and geometric feature matching, characterized in that: The following steps are involved: Step 1: Create a 2D information table of the ballast model A certain number of ballast particles are scanned using a 3D scanner to obtain a 3D model of each ballast particle, and each model is named according to a certain naming rule to establish a 3D model library of ballast particles; multiple faces of the 3D model of each ballast particle are projected, and the geometric features of each projection contour are extracted to establish a 2D information table of the ballast model; Step 2: Create a two-dimensional information table of ballast particles Collect real photos of ballast aggregates, use machine vision models to segment the real photos of ballast aggregates, and convert them into binary images. Extract the geometric features of the contours of each ballast particle in the binary image and establish a two-dimensional information table of ballast particles. Step 3: Ballast numerical file generation The matching degree between the geometric features of each ballast particle in the actual photos of ballast aggregate and the geometric features of the three-dimensional model of each ballast particle in the three-dimensional model library of ballast particles is comprehensively considered, and the name is used as the index medium to select or calculate and generate the numerical file of each ballast particle in the actual photos of ballast aggregate.
2. The method for rapidly generating ballast numerical files based on machine vision and geometric feature matching according to claim 1 is characterized in that: In step 1, a certain number of ballast particles are scanned using a 3D scanner to obtain a 3D model of each ballast particle, specifically: Several ballast particles were randomly collected, and the particle size distribution ranges included 16.5-22.5 mm, 22.4-31.5 mm, 31.5-40 mm, 40-50 mm, and 50-63 mm; The collected ballast particles are stably placed on the rotating table of the 3D scanner for 3D scanning; One week after scanning, the ballast particles were turned over and scanned again; The two scanning results are spliced together to form a complete three-dimensional model of ballast particles.
3. The method for rapidly generating ballast numerical files based on machine vision and geometric feature matching according to claim 2 is characterized in that: In step 1, the naming rule is to obtain the lengths of the major axis, the middle axis and the minor axis of each collected ballast particle by a measuring tool, with "major axis length L-middle axis length I-minor axis length S" as the naming rule.
4. The method for rapidly generating ballast numerical files based on machine vision and geometric feature matching according to claim 3 is characterized in that: In step 1, the three-dimensional model of each ballast particle is projected on multiple surfaces, specifically, each three-dimensional model of the ballast particle is rotated 12 times around the X, Y, and Z axes, each rotation is 30°, and 12 projections of each three-dimensional model of the ballast particle on the XY plane, XZ plane, and YZ plane at different angles are obtained.
5. The method for rapidly generating ballast numerical files based on machine vision and geometric feature matching according to claim 1 is characterized in that: In step 2, the actual photographs of ballast aggregates are collected by photographing the ballast aggregates on the railway track bed, or by randomly selecting a number of ballast particles on the railway track bed for photographing; the photographs contain images of reference balls with known diameters, which are used to refer to and calculate the ratio of the ballast particle size in the photographs to the actual ballast particle size.
6. The method for rapidly generating ballast numerical files based on machine vision and geometric feature matching according to claim 5 is characterized in that: In step 2, the machine vision model is used to perform instance segmentation on the real photos of ballast aggregate, which is to use a pre-trained MaskR-CNN model to segment the real photos of ballast; The MaskR-CNN model training process is as follows: using ballast particles with particle sizes ranging from 50 to 63 mm, 40 to 50 mm, 31.5 to 40 mm, 22.4 to 31.5 mm, and 16.5 to 22.5 mm and real-life photos of green balls with a diameter of 3 cm as a data set for model training; Train instance segmentation models in the MMdetection deep learning framework; During the training process, the model’s recognition categories were set to three categories, including ballast particles, green balls, and background; The parameters for model performance evaluation were set as follows: mAp parameter was 55.1, AP50 parameter was 77.9, and AP75 parameter was 73.
3. The ability of the Mask R-CNN model to accurately segment the ballast particles and green ball images in the real photos of ballast aggregates was used as the basis for successful training.
7. The method for rapidly generating ballast numerical files based on machine vision and geometric feature matching according to claim 6 is characterized in that: In step 2, the conversion into a binary image is to convert the sample mask image formed by instance segmentation into a binary image with a black background and a white projection.
8. The method for rapidly generating ballast numerical files based on machine vision and geometric feature matching according to claim 1 is characterized in that: In step 1 and step 2, the geometric features include contour features and shape features; The profile feature is a projection profile of a three-dimensional model of a ballast particle or the first eight Fourier descriptors of the ballast particle profile; The shape features include the projection contour of the 3D model of the ballast particles or the aspect ratio, circularity, sphericity, roughness, concavity and convexity, and equivalent ellipsoid volume of the contour of the ballast particles.
9. The method for rapidly generating ballast numerical files based on machine vision and geometric feature matching according to claim 1, characterized in that: In step 3, the specific steps of matching the geometric features of each ballast particle in the actual ballast aggregate photo with the geometric features of each ballast particle 3D model in the ballast particle 3D model library are as follows: 3-1) extracting the contour characteristics and shape characteristics of the ballast particles from the two-dimensional information table of the ballast particles in sequence; 3-2) Using the "equivalent ellipsoid volume" of the ballast particle as an indicator, compare it with the "equivalent ellipsoid volume" of each ballast three-dimensional model in the ballast model two-dimensional information table, and obtain all ballast three-dimensional models whose "equivalent ellipsoid volume" deviation values are within ±15%, which are recorded as ballast model set 1; 3-3) Calculate the Euclidean distance between the geometrical characteristic values of the ballast particle except the "equivalent ellipsoid volume" and the geometrical characteristic values corresponding to each ballast three-dimensional model in the ballast model set 1, and take the numerical file of the ballast three-dimensional model with the smallest Euclidean distance as the numerical file A of the ballast particle; 3-4) Simultaneously calculating the Euclidean distance between the geometrical characteristic values of the ballast particle except the "equivalent ellipsoid volume" and the geometrical characteristic values corresponding to each ballast three-dimensional model in the complete ballast model two-dimensional information table; taking the numerical file of the ballast three-dimensional model with the smallest Euclidean distance as the numerical file B of the ballast particle, and starting from the numerical file B, taking the first 30% of the ballast three-dimensional models as the ballast model set 2; 3-5) If the numerical file A falls in the ballast model set 2, the numerical file A is directly selected as the numerical file of the ballast particle; if the numerical file A is not in the ballast model set 2, the characteristic values in the numerical file B are scaled to the corresponding size of the characteristic values of the ballast particle according to the "equivalent ellipsoid volume", and the scaled numerical file is used as the numerical file of the ballast particle; 3-6) and so on, repeat steps 3-1) to 3-5) until the numerical files of all ballast particles in the ballast particle two-dimensional information table are obtained.
10. The method for quickly generating ballast numerical files based on machine vision and geometric feature matching according to claim 9, characterized in that: The equivalent ellipsoid volume calculation formula is as follows: Where: Ve is the equivalent ellipsoid volume, b is the equivalent ellipsoid minor axis, and a is the equivalent ellipsoid major axis.
Citation Information
Patent Citations
Tree crown porosity estimation method based on porous medium theory and computer graphics
CN114066966A
Intelligent detection method for qualification of dam material of earth and rockfill dam based on digital image processing
CN115147401A
Polyhedral unit construction method and system for holographic simulation of irregular ballast particles
CN115965757A
Non-contact rockfill grain composition detection method and device based on machine vision
CN117237303A
Method and system for the three-dimensional reconstruction of a human head from of a plurality of images
EP3657440A1
Cited By
Wide field depth out-of-focus particle size extraction method, system and equipment and storage medium
CN121564075A