WO2025129443A1 - 钢轨断面轮廓测量方法及系统 - Google Patents
钢轨断面轮廓测量方法及系统 Download PDFInfo
- Publication number
- WO2025129443A1 WO2025129443A1 PCT/CN2023/139807 CN2023139807W WO2025129443A1 WO 2025129443 A1 WO2025129443 A1 WO 2025129443A1 CN 2023139807 W CN2023139807 W CN 2023139807W WO 2025129443 A1 WO2025129443 A1 WO 2025129443A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- light
- rail
- center
- image
- laser
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/24—Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures
Definitions
- the present application relates to the technical field of rail profile detection, and in particular to a rail cross-sectional profile measurement method and system.
- the rail profile size detection method used by most rail production departments in my country is for workers to use mechanical calipers or gauges for contact measurement.
- the worker places the mechanical ruler against the rail and then uses a plug gauge of the corresponding size for contact measurement.
- the different strengths of the workers against the ruler and the randomness of the selection of the plug gauge measurement point will lead to differences in the measurement results and poor consistency of the measurement results.
- the measurement process has high labor repetition and high labor intensity. Long-term measurement not only consumes a lot of manpower, but the contact measurement method also increases the risk of surface defects on the rail.
- the present application provides a rail cross-section profile measurement method, comprising:
- the camera is calibrated according to Zhang Zhengyou's calibration method to obtain the camera's intrinsic and extrinsic parameter matrices;
- An image of the measured rail is obtained by taking an image of the measured rail at a shooting position by the first camera, and an image of the measured rail is obtained by taking an image of the measured rail at a shooting position by the second camera, to obtain a set of target images; when taking images, a laser is controlled to emit at least one single-line laser to the surface of the measured rail, and the irradiation direction of each single-line laser is perpendicular to the surface of the measured rail, and the first camera and the second camera are respectively arranged on both sides of the measured rail;
- the shooting position of the first camera and the shooting position of the second camera are synchronously moved to obtain another set of target images; when the shooting position of the first camera and the shooting position of the second camera are synchronously moved, the angle between the shooting direction of the first camera and the irradiation direction of each single-line laser remains unchanged, the angle between the shooting direction of the second camera and the irradiation direction of each single-line laser remains unchanged, and the angle between the shooting direction of the first camera and the shooting direction of the second camera remains unchanged;
- N is a positive integer and is greater than 1;
- each light strip center image Based on each light strip center image, obtaining the three-dimensional coordinates of each light strip center point contained in the light strip center part of each light strip center image to form a light strip center point set of each light strip center image;
- the camera coordinate system of any target image in the group of target images is defined as a common coordinate system, and the three-dimensional coordinate system of the center point of the light strip of another target image in the group of target images is converted to the common coordinate system to obtain the common coordinates of each center point of the light strip in each center image of the light strip;
- the common coordinates of the center point of each light strip are calibrated to obtain the calibrated common coordinates of the center point of each light strip;
- the initial value of the ICP algorithm is obtained by coarse matching of the coordinates of the double center of the circle and the position of the double center of the standard contour.
- the common coordinates of the center point of each light strip in the calibrated target image group are precisely aligned with the end face contour of the standard rail according to the ICP algorithm.
- the shadow marking line is set according to the standard regulations.
- the intersection of the extracted fitting marking line and the measured contour is located at the measuring point to obtain the rail contour measurement result.
- a rail end face profile error detection model is constructed based on multiple groups of target images, the light strip center image corresponding to each target image, the common coordinates of each light strip center point of each light strip center image, the calibrated common coordinates of each light strip center point of each light strip center image, the standard rail end face profile, and the comparison error image between each corrected rail end face profile and the standard rail end face profile.
- the present application also provides a rail cross-section profile measurement system, the rail cross-section profile measurement system comprising:
- a collection device is used to collect images of the tested rail at different shooting angles;
- the collection device includes a light source emitting device and an image collection device;
- the processing device is connected to the acquisition device for communication, and the processing device is used to execute the rail section profile measurement method mentioned above.
- the present application relates to a method for measuring the profile of a rail section, which collects target images from multiple angles, reconstructs the collected target images into the profile of a rail at the current camera viewing angle through an algorithm, then corrects the obtained profile of the rail at the current camera viewing angle into the profile of the current rail section, and finally compares the profile of the current rail section with the profile of a standard rail section, and displays the error results between the profiles;
- an ROI automatic extraction algorithm based on light plane calibration parameters is designed to increase the speed of extracting the center of a light strip by 3 times, and a center positioning spline interpolation method is proposed to remove the bending and distortion problems in the cross-region, thereby realizing fast and accurate extraction of the center of the light strip;
- a cross laser light strip center extraction algorithm based on the RANSAC algorithm is used to remove background interference and classify the light strips, thereby realizing efficient transformation of the light strip feature point coordinates of the rail laser image to three-dimensional spatial coordinates.
- FIG1 is a flow chart of a rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG2 is a schematic diagram of the arrangement of the cross-line laser components in the rail profile measurement method provided in an embodiment of the present application.
- FIG3 is a schematic diagram of a calibration method based on a chessboard in a rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 4 is a schematic diagram of the deformation of light strip center extraction in a black and white chessboard image in a rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 5 is a diagram showing a customized checkerboard calibration plate and a checkerboard diagram containing laser stripes in a rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 6 is a diagram showing the positioning results of the intersection area of three light planes in the target image in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 7 is a schematic diagram of the results of determining the left and right boundaries and the upper boundary of ROI1 in the target image of the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG8 is a schematic diagram of the results of determining the left and right boundaries and the lower boundary of ROI1 in the target image of the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 9 is a schematic diagram of the result of determining ROI2 in a target image of a rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 10 is a diagram showing the extraction results of the ROI in the target image of the rail cross-section profile measurement method provided in one embodiment of the present application.
- FIG. 11 is a diagram showing the precise positioning results of intersections in a target image of a rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 12 is a diagram showing the screening and differentiation results of the left and right contours of the rail head in the target image of the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG13 is a schematic diagram of noise removal and spline interpolation at the center of light strips in a target image of a rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 14 is a comparison diagram of the center of the light strip in the target image before and after correction of the rail cross-section profile measurement method provided in one embodiment of the present application.
- FIG. 15 is a diagram showing the results of extracting the center of the target image light strip in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 16 is a diagram showing the results of extracting the center of the original light stripe of the cross laser calibration image in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 17 is a straight line diagram of a cross laser calibration image fitted according to the RANSAC algorithm in a rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 18 is a straight line graph extracted by the RANSAC algorithm in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 19 is a comparison diagram of the results of extracting the center of a cross-calibrated laser image light stripe in a rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 20 is a diagram showing the light plane fitting results of the left and right cross structured lights in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 21 is a diagram showing the result of the dual-target coordinate conversion of the target image in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 22 is a diagram showing the coordinate transformation results after correction of the common vector of the target image in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 23 is a diagram showing characteristic points of a rail profile in a rail cross-sectional profile measurement method provided in an embodiment of the present application.
- FIG. 24 is a schematic diagram of target image feature points in a rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 25 is a schematic diagram of calibration of the longitudinal vector of the rail in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 26 is a schematic diagram of the Douglas-Peucker algorithm in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 27 is a graph showing the result of extracting feature points using the Douglas-Peucker algorithm in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 28 is a schematic diagram of the projection results of feature points extracted from a target image in a rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 29 is a schematic diagram of the calculation results of the longitudinal vector of the rail in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG30 is a schematic diagram of a distortion profile corrected by auxiliary plane projection in a rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG31 is a diagram showing the correction results of the distorted profile of rail measurement in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 32 is a diagram showing the rough alignment results of the straight line segments on the side of the rail head in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 33 is a diagram showing the positioning results of the endpoints of large and small arcs in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 34 is a diagram showing the result of obtaining the center of a small circle fitting in a rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 35 is a diagram showing the results of dual-center coordinate fitting and registration in a rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG36 is a comparison error diagram between the corrected rail end face profile and the standard rail end face profile in the rail cross-section profile measurement method provided in an embodiment of the present application.
- FIG. 37 is a diagram showing the measurement point marking results in a rail cross-section profile measurement method provided in an embodiment of the present application.
- the rail cross-section profile measurement method includes: S100 to S800:
- the posture of the checkerboard calibration plate is adjusted so that the light plane intersects with the checkerboard calibration plate to form a straight line of light stripes, and the intersection line of the checkerboard and the light stripes appears within the camera field of view, and a set of image pairs of a checkerboard image containing laser stripes and a checkerboard image without laser stripes are respectively taken at the same posture.
- the camera and the line laser are kept fixed, the posture of the checkerboard calibration plate is changed, and the above operation is repeated to obtain multiple sets of image pairs.
- checkerboard image without laser stripes its role is to calibrate the image group for camera calibration to obtain the camera intrinsic parameter K and the external parameter matrix [R t] relative to the world coordinate system defined by the current checkerboard calibration plate posture.
- the checkerboard image with laser stripes is mainly used to extract the pixel coordinates (u, v) of the center point of the light stripe, and then the corresponding three-dimensional coordinates of the center point of the light stripe in the world coordinate system are calculated by the external parameter matrix, and then the center point of the light stripe on the calibration plate is transformed to the camera coordinate system through the camera imaging model.
- the laser is controlled to emit at least one single-line laser to the surface of the measured rail, and the irradiation direction of each single-line laser is perpendicular to the surface of the measured rail, and the first camera and the second camera are respectively set on both sides of the measured rail.
- a cross laser is used in combination with two single-line lasers arranged on both sides.
- the cross laser is installed directly above the rail head.
- the cross laser supplements the number of light stripes at the rail head, and multi-line structured light can be used to extract feature points such as the rail jaw, and the geometric relationship of the rail profile can be combined to perform distortion correction on the measured profile of the installation offset or direction offset.
- the rail head area is within the common field of view of the industrial cameras on both sides.
- the common point cloud in the coordinate system of the bilateral cameras can be supplemented as the registration basis, which can further improve the binocular registration accuracy.
- the first camera and the second camera are arranged on both sides of the length extension direction of the rail, and the first camera and the second camera are respectively at a fixed angle to the rail.
- the first camera and the second camera can both capture images of the rail head and the rail waist, and the relative positions between the first camera and the second camera and each single-line laser are fixed.
- multiple groups of images containing chess and card grids and laser stripes at different positions of the rails are obtained by repeatedly performing synchronous movement of the shooting position of the first camera and the shooting position of the second camera.
- each target image is extracted by a light stripe center extraction method to obtain a light stripe center image corresponding to each image, and the target image and the light stripe center image of the target image are stored correspondingly.
- the three-dimensional coordinates of the light strip center image corresponding to each target image are converted, and then the three-dimensional coordinates of the light strip center image are converted to coordinates in the camera coordinate system using the intrinsic and extrinsic parameter matrices of the calibrated camera.
- the camera coordinate system of any target image in the group of target images is defined as a common coordinate system, and the three-dimensional coordinate system of the center point of the light strip of another target image in the group of target images is transformed into the common coordinate system to obtain the common coordinates of each center point of the light strip in each light strip center image.
- the common coordinates of the center point of each light strip are corrected to obtain the calibrated common coordinates of the center point of each light strip.
- the initial value of the ICP algorithm is obtained by coarse matching of the dual-center coordinates and the dual-center positions of the standard contour.
- the common coordinates of the center point of each light strip in the calibrated target image group are precisely aligned with the standard rail end face contour according to the ICP algorithm.
- the shadow marking line is set based on the standard regulations, and the intersection of the fitted marking line and the measured contour is extracted to locate the measuring point to obtain the rail contour measurement result.
- a camera coordinate system in a set of target images is set as a common coordinate system
- the three-dimensional coordinates of the light bar center of another image are converted into the common coordinates
- the three-dimensional coordinates of the light bar center in a common coordinate system are corrected by the distortion profile projection correction method, and then the corrected three-dimensional coordinates of the light bar center obtained after correction are registered with the standard rail section profile using the ICP algorithm to obtain the registered measured rail section profile and the standard rail section profile.
- the error between the measured rail section profile and the standard rail section profile is calculated.
- S800 builds a rail end face profile error detection model based on multiple groups of target images, the light bar center image corresponding to each target image, the common coordinates of each light bar center point of each light bar center image, the calibrated common coordinates of each light bar center point of each light bar center image, the standard rail end face profile, and the comparison error image between each corrected rail end face profile and the standard rail end face profile.
- multiple groups of target images, the light strip center image of each image, the three-dimensional coordinate parameters of the light strip center point of each image, the three-dimensional coordinate parameters after the fusion of the three-dimensional coordinate parameters of the light strip center points of a group of images, the three-dimensional coordinate parameters after the fusion of the three-dimensional coordinate parameters of the light strip center points of a group of images after calibration, the standard rail end face profile, and the error image comparing the corrected rail end face profile with the standard rail end face profile are used as training data to train a model based on the rail end face profile error detection, and a trained model based on the rail end face profile error detection is obtained.
- a plurality of groups of target images, the light strip center image of each image, the three-dimensional coordinate parameters of the light strip center point of each image, the three-dimensional coordinate parameters after the fusion of the three-dimensional coordinate parameters of the light strip center points of a group of images, the three-dimensional coordinate parameters after the fusion of the three-dimensional coordinate parameters of the light strip center points of a group of images after calibration, the standard rail end face profile, and the error image of the comparison between the corrected rail end face profile and the standard rail end face profile are used as training data to train the constructed model based on the rail end face profile error detection, so that the model based on the rail end face profile error detection has the function of comparing the error of the detected rail cross-sectional profile with the standard rail cross-sectional profile.
- the controlling laser to emit at least one single line of laser light to the surface of the rail to be measured includes the following steps S201 to S204:
- S201 controlling a first laser disposed above the rail to emit two single-line lasers to the rail head of the rail to be measured, and light planes formed by the two single-line lasers are perpendicular to each other.
- a light plane formed by the single-line laser emitted by the second laser and a light plane formed by the single-line laser emitted by the third laser are coplanar.
- the light source module can be composed of two line laser emitters (the laser emitter is hereinafter referred to as laser) and a cross laser.
- the single-line laser needs to be arranged in conjunction with the industrial cameras on both sides, and the light emission planes of the two line lasers should be installed to overlap as much as possible to ensure that the light stripe curves intersecting the laser planes on both sides and the rail surface are coplanar, so as to truly reflect the contour data of the same section of the rail.
- this paper proposes a solution of using a cross laser with two single-line lasers arranged on both sides. As shown in Figure 2, the cross laser is installed just above the rail head of the rail to be measured.
- the cross laser supplements the number of light stripes at the rail head, and can use multi-line structured light to extract feature points such as the rail jaw, and combine the geometric relationship of the rail profile to perform distortion correction on the measured profile of installation offset or direction offset.
- the rail head area is within the public field of view of the industrial cameras on both sides.
- the public point cloud under the coordinate system of the two cameras can be supplemented as the basis for alignment, which can further improve the accuracy of binocular alignment.
- the method further includes calibrating the light plane, and the calibrating the light plane includes the following S101 to S111:
- Each checkerboard image pair includes a checkerboard image without laser stripes and a checkerboard image including laser stripes.
- FIG. 3 a schematic diagram of the calibration method based on the checkerboard is shown in FIG3.
- the checkerboard image without laser stripes its role is to calibrate the image group for camera calibration to obtain the camera intrinsic parameter K and the external parameter matrix [Rt] relative to the world coordinate system defined by the current checkerboard calibration plate posture.
- the checkerboard image containing laser stripes is mainly used to extract the pixel coordinates (u, v) of the center point of the light stripe. Then, the corresponding three-dimensional coordinates of the center point of the light stripe in the world coordinate system are calculated by the external parameter matrix, and then the center point of the light stripe on the calibration plate is transformed to the camera coordinate system through the camera imaging model.
- the light plane equation in the camera coordinate system can be solved by plane fitting of the transformed multiple groups of light stripe center points.
- the complete light plane calibration process is shown in FIG4.
- the checkerboard calibration plane is used as the OXwYz plane of the world coordinate system, and the world coordinate system OXwYwZw is established .
- the pixel coordinates of the center point of the light strip on the checkerboard calibration plate are set to (u,v).
- K the camera intrinsic parameter matrix
- [Rt] the extrinsic parameter matrix
- the transformation relationship between pixel coordinates and the world coordinate system is:
- the rotation matrix R and translation vector t obtained by camera calibration at this time are:
- the coordinates of the center point of the light strip in the camera coordinate system can be obtained by performing coordinate system conversion using Formula 1.
- the camera exposure time should be set longer to ensure that the chessboard corners can be accurately extracted.
- the chessboard calibration plate position should be fixed, the camera exposure time should be reduced, the overall chessboard area should be darkened, and the contrast between the light stripes and other non-light stripe areas should be increased to better extract the light stripe center.
- a checkerboard calibration plate as shown in Figure 6 was designed.
- the blank area around the calibration plate was enlarged.
- the light plane was intersected with the blank area outside the calibration plate so that the light bar fell within the blank area of the calibration plate.
- the grayscale distribution of the straight light bar was maintained to avoid distortion of the light bar center extraction result.
- the light stripe center image of each target image in each group of target images is obtained according to the light stripe center extraction method, and the light stripe center image corresponding to each target image includes the following S501 to S509:
- S502 extracting a precise light stripe region image of the target image according to a ROI algorithm.
- the pixel coordinates of the center points of all light stripes of the target image in the pixel coordinate system are obtained by using the Hessian algorithm.
- the intersection line of the light plane formed by two single-line lasers emitted by the first laser is projected to obtain the first light plane projection line
- the intersection line of the light plane formed by the single-line laser emitted by the second laser and the light plane formed by one single-line laser emitted by the first laser is projected to obtain the second light plane projection line.
- S504 extract the intersection points between all the light bar center points, the first light plane projection lines and the second light plane projection lines as light bar intersection points.
- the number of the light bar intersection points is 2.
- the input target image is first preprocessed, and the threshold is adaptively determined using the OTSU method and the target image is binarized to separate the light strip pixel points and the background. Then, a straight line passing through the intersection of the rail head light strip can be determined based on the calibrated camera intrinsic parameter matrix and the two light plane parameter matrices, thereby assisting in the positioning of the intersection area.
- the following is the derivation process for determining the straight line equation:
- the intersection point of the two light stripes in the image is the same point when converted to the target image coordinate system, that is, it satisfies the following equation:
- a straight line passing through the intersection point can be determined in the pixel coordinate system.
- the physical meaning of this straight line is the projection of the intersection line of two intersecting light planes in space in the pixel coordinate system.
- the rail head light strip in the rail target image is formed by the intersection of three light planes to form two intersection points.
- Two straight lines calculated according to the calibration parameters are drawn in the target image.
- a certain distance threshold is set, and the intersection area is screened and located. The positioning result is shown in Figure 7.
- a point is randomly selected from each of the left and right intersection areas, and the area to be selected is expanded 500 pixels horizontally and 200 pixels vertically to ensure that all the pixels on the horizontal light strip of the rail head in the target image can be selected.
- 50 pixel values are expanded outward as the left and right boundaries X00, X01 and the upper boundary y00 of the rail head ROI1. The positioning result is shown in Figure 8.
- the lower boundary can be determined by locating the mutation point.
- a point is randomly selected from the intersection area above the rail waist light strips of the target image, and the candidate box is determined by expanding 100 and 800 pixels downward and 300 pixels to the left and right.
- the distance between adjacent points is calculated to locate the mutation point in the gap.
- the median of the longitudinal coordinates of the two mutation points is used as the lower boundary y01 of ROI1 and the upper boundary y10 of ROI2. The positioning result is shown in Figure 9.
- the new candidate area is determined by expanding 200 pixels to the left and right together with the upper boundary and the lowest end of the image.
- the left and right boundaries of the candidate area are used as the left and right boundaries x10 and x11 of ROI2.
- the geometric shape of the waist light strip in the target image is basically a continuous curve. If there is interference from background light strips below the waist light strip in the target image in the candidate area, the mutation point can also be located to find the lowest point of the light strip, thereby determining the lower boundary y10 of ROI2. The positioning result is shown in Figure 10.
- the final ROI extraction result is shown in Figure 11. It can be seen from the figure that for rail images with different light strip distribution positions and different backgrounds, the area can be automatically located and distinguished, and the algorithm has good robustness and reliability. Only the light strip center of the ROI area is extracted and the average time consumption is calculated. The running time is reduced from 311.4ms to 90.7ms, and the running speed is increased by 3 times.
- this paper proposes a center positioning spline interpolation method to correct the problems of bending, twisting and breakage in the intersection area.
- the aliasing enhanced light strips increase the light strip width and normal direction, the local light strip center extraction results still contain valid information, and the intersection location of the extraction results is relatively accurate.
- the straight line passing through the light strip intersection can be determined based on the camera intrinsic parameter matrix and the two light plane parameter matrices. Based on the above information, the intersection point of the straight line and the originally extracted light strip center curve can be determined as the intersection point. The positioning result is shown in Figure 12.
- the horizontal light strips of the rail head in the target image are basically distributed along the longitudinal direction of the rail, the light strips in the target image are mostly straight-line shapes. After successfully locating the coordinates of the two intersection points, a straight line passing through the two intersection points can be constructed, which is basically consistent with the horizontal light strips of the rail head.
- the points with a distance less than a certain threshold are screened out as the center points of the horizontal light strips of the rail head and the bending points of the intersection area.
- the horizontal coordinate centers of the two intersection points can be set as the horizontal boundary to distinguish the center points of the left and right contour light strips of the rail head in the target image.
- S100g Use the RANSAC algorithm to select the cross light bar center point that matches the first best matching line as the first type of cross light bar center point.
- the laser image captured in the camera field of view often has background interference.
- the center can be extracted by only intercepting the light strips in the fixed pixel coordinate area, which can simply and efficiently eliminate the interference of the background area.
- the captured cross laser calibration image also has the problem of background interference, but unlike the calibration image of the single-line laser, the cross laser calibration image also has the problem of bending of the cross area and distinguishing the corresponding light strips.
- the cross light bars falling on the calibration board are basically in the shape of crossed straight lines.
- the directions of the light bars in the calibration image are basically distributed within a certain range.
- the number of valid points falling on the calibration board is larger than the number of interference points.
- a light stripe center extraction algorithm for cross laser calibration image based on RANSAC (Random Sample Consensus) algorithm is proposed.
- the basic idea is to give a mathematical model to be fitted and to estimate the parameters of the mathematical model from a set of observation data containing outliers in an iterative way.
- the RANSAC algorithm is a non-deterministic algorithm. When the number of iterations is large enough, it can produce the result with the highest probability of satisfying the conditions and excluding outliers. Therefore, it is suitable for extracting the center point of the light stripes on the calibration plate while removing the influence of background interference outliers.
- the corresponding mathematical model is the straight line equation. The flow chart of using the RANSAC algorithm for straight line extraction is shown in Figure 18.
- a light stripe center extraction algorithm for cross laser calibration images based on RANSAC algorithm is proposed.
- the Hessian matrix method is used to directly extract the center point set of the light stripe from the cross-calibrated laser image. Since the valid points are basically distributed in a straight line, while the interference points are irregularly distributed and there are more valid points that conform to the straight line distribution, the RANSAC algorithm can be directly used to extract the straight line point set with more internal points and remove it from the original point set. The remaining point set contains the second straight line point set and the interference outlier points. The RANSAC algorithm is used again to fit the second straight line parameters. The extracted outlier points belong to the background interference points and can be directly removed. The results of the two RANSAC extractions are shown in Figure 19.
- the two groups of classified light bar center points were calibrated according to the single-line laser light plane calibration process.
- the final quantitative results and visualization results of the left and right light plane parameter calibration are shown in Table 1 and Figure 21, respectively.
- the distance mean and variance of the light plane fitting results have increased.
- the calculated angles of the two light planes have errors of 0.28° and 0.17° from the ideal angle, respectively.
- the role of the cross laser is to supplement the contour feature points to assist in calculating the rail normal, and is not used as rail profile measurement data, this result can meet the measurement requirements.
- the camera coordinate system of any one target image in the group of target images is defined as a common coordinate system
- the three-dimensional coordinate system of the center point of the light strip of another target image in the group of target images is converted to the common coordinate system to obtain the common coordinates of each center point of the light strip in each light strip center image, including the following steps: S701 to S706:
- S702 Define the camera coordinate system of any target image in the group of target images as a common coordinate system.
- the coordinates of the left and right rail contours in their respective camera coordinate systems are obtained through coordinate transformation.
- the left camera coordinate system is defined as a common coordinate system.
- the contour coordinates of the right camera coordinate system are transformed to the left camera coordinate system, realizing the global unification of the coordinate system and the data fusion of the complete cross-section contour.
- the conversion result of coordinate system 1 is shown in Figure 22.
- a light source design combining single-line and cross lasers was proposed to increase the common feature points of the rail head contour point cloud in the target image under the binocular perspective.
- the common vector is used to perform precise matching based on the binocular positioning transformation results.
- the matching process is simple and efficient. From the matching results shown in Figure 23, it can be seen that compared with the results of coordinate system transformation using binocular positioning parameters, the common parts of the rail head contour in the target image basically overlap, and the error of global unification of the coordinate system is significantly reduced.
- the common coordinates of the center point of each light strip are calibrated according to the distortion profile projection correction method to obtain the calibrated common coordinates of the center point of each light strip, including the following steps: S707 to S715:
- the distortion of the rail measurement profile caused by vibration and directional deviation in the dynamic measurement of the rail will introduce a large error to the rail index measurement.
- an auxiliary plane perpendicular to the longitudinal direction of the rail is constructed, and then the distorted profile is projected onto the auxiliary plane to achieve correction.
- the standard cross-sectional profile of the 60kg/m rail shown in Figure 2.1 is analyzed. There are some easy-to-extract feature points in the cross-sectional profile of the rail, and the specific positions are marked in Figure 24.
- the complete rail is divided into three parts: (1) The rail head part, where point A is the midpoint of the rail top, segment BC is a straight line with a slope of 1:20 on the side of the rail head, and point C is the rail jaw point. (2) The rail waist part, where segment DE is an R400 arc, segment EF is an R20 arc, point K is the center of the R20 arc, and the two arcs are tangent at point E. (3) The rail bottom part, where segment FG is a straight line with a slope of 1:3, and segment GH is a straight line with a slope of 1:9. The two straight lines intersect at point G.
- the single-line contour distortion correction method based on affine transformation obtains the affine transformation parameters between the distorted contour and the standard contour, and then performs an inverse transformation to achieve the purpose of contour correction.
- ⁇ is the rotation angle.
- Sx and Sy are the expansion coefficients.
- Tx and Ty are the translation coefficients.
- this method has the following problems: since the R400 arc and the R20 arc are distorted and transformed into elliptical arcs after affine transformation, when the arc segment that can be fitted is short, the tangent point of the two elliptical arcs and the endpoint of the transformed R20 elliptical arc are difficult to locate, the arc segment positioning is inaccurate, and the fitting accuracy is low. It is difficult to guarantee its accuracy and robustness in practical applications.
- the light plane is set at a certain angle to the rail section to simulate the distortion, and a set of rail laser images are taken as shown in Figure 25.
- the measured profile reflected by the intersection of the light stripes on the rail surface is distorted compared to the standard profile, no matter how the light plane is tilted, the light stripe curve at the rail head always contains three pairs of feature point information.
- the positions of the feature points are marked in Figure 25, corresponding to the Bl1 and Br1 points on the rail head profile on each side of the rail by the double-sided single-line laser, the Bl2 and Br2 points on the left and right rail head profiles of the cross laser, and the Cl1 and Cr1 points on the left and right rail jaws of the single-line laser.
- this paper proposes a rail longitudinal vector calibration method based on symmetry plane fitting.
- the midpoint Bm1 point can be calculated, and the midpoint Cm1 point can be calculated using the left and right rail jaw points Cl1 and Cr1.
- the midpoint Bm2 of the Bl2 and Br2 points of the cross laser rail head profile can be extracted.
- the parameters of the symmetrical mid-vertical plane can be calculated, and the intersection of the symmetrical plane and the two sections of the rail head profile can be calculated.
- the midpoints A1 and A2 of the rail head profile of the single-line laser and the cross laser are located respectively.
- the vector XX formed by the midpoints of the two rail tops is the longitudinal vector of the rail.
- the feature points need to be located first.
- the left and right contour point clouds are projected onto their respective light planes, and the processing of three-dimensional points is reduced to two dimensions, which can reduce the amount of data processing and improve the efficiency of the algorithm.
- L [A B C D]
- the Douglas-Peucker algorithm was proposed by David Douglas and Thomas Peucker in 1973 for curve downsampling.
- the basic idea is to use multiple polylines to approximate the curve, and use the Hausdorff distance (i.e., the maximum distance) between a point on the curve and the polyline to measure the similarity between the polyline and the approximated curve. Points with a Hausdorff distance less than a set threshold are retained, and those with a Hausdorff distance greater than a threshold are taken as the new endpoints.
- the curve is further subdivided and approximated.
- this paper sets the distance threshold ⁇ to 0.6 mm.
- the segmentation results of the left and right projected rail head contours using the Douglas-Peucker algorithm are shown in Figure 28.
- the ends of the rail head contour curve segments of the cross laser in the target image are taken as feature points B l2 and B r2 .
- the extracted feature points are back-projected into the laser image with increased contrast.
- the visualization results shown in Figure 29 verify that the feature point extraction results are relatively accurate.
- the coordinates of the midpoints of the three pairs of feature points are calculated as reference points for obtaining the parameters of the symmetry plane.
- the two midpoints of the rail tops along the longitudinal direction of the rail are obtained by locating the intersection of the symmetry plane and the contours of the two rail heads.
- the longitudinal vector of the rail can be calculated by connecting the two points. The extraction result is shown in Figure 30.
- the coordinates of the midpoints of the three pairs of feature points are calculated as reference points for obtaining the parameters of the symmetry plane.
- the two midpoints of the rail tops along the longitudinal direction of the rail are obtained by locating the intersection of the symmetry plane and the contours of the two rail heads.
- the longitudinal vector of the rail can be calculated by connecting the two points. The extraction result is shown in Figure 30.
- the rail longitudinal vector can be used to construct an auxiliary plane for projection correction.
- the calculated rail longitudinal vector is: The coordinates of the middle point of the rail top where the single-line laser forms the profile are A(x 0 ,y 0 ,z 0 ).
- An auxiliary plane perpendicular to the longitudinal vector of the rail is constructed through point A, and the distorted profile is projected onto the auxiliary plane, finally achieving the measured profile correction. Take a point p(x,y,z) where the distorted profile points are concentrated, and let the projection point of point p on the auxiliary plane be p'(x',y',z'). According to the properties of the plane, we can get
- the coordinates of the projection point can be obtained, and the measured contour point set is subjected to projection correction.
- the result of distortion correction is shown in Figure 32.
- the two-dimensional feature point positioning of each light strip center point in the group of target images according to the Douglas-Peucker algorithm to obtain the symmetry plane includes the following S709a to S709c:
- two-dimensional feature point positioning is performed on each center point of the light strip in the target image group according to the Douglas-Peucker algorithm to obtain three pairs of feature points.
- the three pairs of feature points are BL1 and BR1 points on the rail head contour on each side of the rail by the double-sided single-line laser, BL2 and BR2 points on the left and right rail head contours by the cross laser, and CL1 and CR1 points on the left and right rail jaws by the single-line laser.
- the light plane is set at a certain angle to the rail section to simulate distortion, and a group of rail laser target images as shown in FIG. 25 are captured.
- the light stripe curve at the rail head always contains three pairs of feature point information.
- the positions of the feature points are marked in Figure 25, corresponding to the Bl1 and Br1 points on the rail head profile on each side of the rail by the double-sided single-line laser, the Bl2 and Br2 points on the rail head profile on the left and right sides of the rail by the cross laser, and the Cl1 and Cr1 points on the rail jaws on the left and right sides by the single-line laser.
- the midpoint Bm1 can be calculated by locating the Bl1 and Br1 points of the single-line laser rail head contour, and the midpoint Cm1 can be calculated using the left and right side rail jaw points Cl1 and Cr1. Similarly, the midpoint Bm2 of the Bl2 and Br2 points of the cross laser rail head contour is extracted.
- the coordinates of the three points Bm1, Bm2, and Cm1 are known, and the parameters of the symmetrical mid-vertical plane can be calculated.
- the intersection of the symmetrical plane and the two rail head contours can be calculated, and the rail head contours of the single-line laser and the cross laser can be located respectively.
- the midpoints of the two rail tops form a vector. It is the longitudinal vector of the rail.
- the initial value of the ICP algorithm is obtained by coarse matching of the dual-center coordinates and the dual-center positions of the standard profile, and the common coordinates of the center points of each light strip in the calibrated group of target images are precisely aligned with the standard rail end profile according to the ICP algorithm.
- the shadow marking line is set based on the standard regulations, and the intersection of the fitting marking line and the measured profile is extracted to locate the measuring point, and the rail profile measurement result is obtained, including the following S716 to S725:
- a marking line is established to obtain the dual-circle-center coordinate fitting registration result with the marking line and the precise registration result of the standard contour.
- this paper adopts the dual-center coordinate fitting method as the pre-step of ICP registration, and performs rough matching through the matching relationship between the dual-center coordinates and the dual-center positions of the standard contour to provide initial values for ICP registration.
- the straight line endpoint coordinates are transformed with the standard profile BC straight line segment coordinates, and the left side contour straight line segment of the rail head is used as the matching reference, and the rail jaw point C is used as the base point for rough alignment.
- the measured contour point B is p B (x B , y B )
- the rail jaw point is p C (x C , y C )
- the corresponding points of the standard contour are p' B (x' B , y' B ) and p' C (x' C , y' C ).
- p(x, y) its corresponding point p'(x', y') after rough registration is:
- ⁇ is the angle between the measured profile and the standard profile straight line
- xx is the translation of the two profile rail jaw points, which is calculated as follows:
- the measured contour posture after rough alignment of the straight line segment is basically consistent with the standard contour, and the rail waist segment contour can be intercepted within the set height range.
- the double-center coordinate fitting method is used to further roughly align the contour.
- the left rail waist contour is used as the matching reference.
- the Douglas-Peucker algorithm is used to locate the two arc endpoints and the tangent point of the intercepted rail waist area, corresponding to points D, E and F in Figure 24.
- the distance threshold is set to 0.6mm
- the first sampling point and the third sampling point are the large arc endpoints
- the third sampling point and the sixth sampling point are the small arc endpoints.
- the positioning results are shown in Figure 34.
- R is the arc radius specified in the standard.
- the arc segment point set is N is the number of point sets.
- the coordinates of the center point to be determined are (x 0 ,y 0 ), and the known arc radius is used as a constraint condition.
- the objective function to be optimized is:
- the rigid body transformation coefficient from the measured contour to the standard contour is calculated using the double center coordinate vector with the center of the small circle as the base point.
- the transformation process is the same as formula 10.
- the angle ⁇ and the translation [t x t y ] T are calculated as follows:
- the profile is aligned according to the circle center fitting result, and the alignment result is shown in Figure 36.
- the ICP algorithm is used to further complete the fine alignment of the rail profile after rough alignment, and the error between the measured profile and the standard profile is calculated. The result is shown in Figure 37.
- the measuring points are located according to the corresponding marking lines for different measurement indicators.
- the setting method of the marking lines and the corresponding dimension standards are shown in Table 2.
- the measurement point positioning of asymmetry is calculated by the rail head width and rail bottom width measurement points.
- the measurement point is positioned according to the marking line, and the measurement index is calculated according to the positioning result.
- the result of the marking positioning is shown in Figure 38.
- the points on the measured contour cannot be kept strictly consistent with the corresponding coordinates of the marking line. Therefore, this paper selects the five measurement points closest to the marking line.
- the contour segment can be differentiated into small straight line segments.
- the extracted measurement point coordinates are fitted using the least squares method to obtain the straight line parameters, and then the measurement points are interpolated according to the corresponding coordinates of the marking line. At this time, the obtained measurement point coordinates are consistent with the corresponding coordinates of the marking line.
- the various measurement indicators of the rail are calculated based on the comparison of the measurement points, and the results are shown in Table 3.
- a rail cross-section profile measurement system in one embodiment of the present application, includes a collection device and a processing device.
- the acquisition device is used to acquire images of the tested rail at different shooting angles.
- the acquisition device includes a light source emitting device and an image acquisition device.
- the processing device is in communication connection with the acquisition device, and the processing device is used to execute the rail cross-section profile measurement method as described in any of the above embodiments.
- the hardware facilities of the data backend processing module are mainly processing equipment.
- the light source emitting device illuminates the laser planes on both sides of the rails and the light stripe curves intersecting the rail surface are coplanar.
- the cross laser is installed just above the rail head.
- the cross laser supplements the number of light stripes at the rail head, and multi-line structured light can be used to extract feature points such as the rail jaw, and the geometric relationship of the rail profile can be combined to perform distortion correction on the measured profile of the installation offset or direction offset.
- the rail head area is within the public field of view of the industrial cameras on both sides.
- the public point cloud under the coordinate system of the bilateral cameras can be supplemented as the registration basis, which can further improve the binocular registration accuracy.
- the digital image collected by the image acquisition device is transmitted to the processing equipment for a series of data processing tasks such as image processing, feature extraction, measurement point positioning and index analysis and calculation, and realizes automatic control of other modules.
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
本申请涉及一种钢轨断面轮廓测量方法及系统,通过多角度采集目标图像,之后通过算法将采集的目标图像重建为当前相机视角的钢轨轮廓,接着将得到的当前相机视角的钢轨轮廓校正成当前钢轨断面的轮廓,最后通过当前钢轨断面的轮廓与标准的钢轨断面轮廓进行比对,并显示轮廓之间的误差结果;分别设计了基于光平面标定参数的ROI自动提取算法,将光条中心提取速度提高至3倍,同时提出中心定位样条插值法去除交叉区域弯折扭曲问题,实现光条中心快速准确提取;基于RANSAC算法的十字激光光条中心提取算法以去除背景干扰并进行光条归类,实现了钢轨激光图像的光条特征点坐标到空间三维坐标的高效变换。
Description
本申请涉及钢轨轮廓检测技术领域,特别是涉及一种钢轨断面轮廓测量方法及系统。
随着我国铁路不断发展,铁路安全以及铁路智能化制造受到越来越大的重视。钢轨的轮廓几何尺寸不达标将导致轮轨接触表面磨损加剧、滚动接触疲劳破坏、机车运行振动大等一系列安全问题。
目前,我国大部分钢轨生产部门使用的钢轨轮廓尺寸检测方式是由工人使用机械卡尺或量规进行接触式测量。在测量时,需要交替启停钢轨传送装置,使生产线上钢轨待测段固定在测量工位上,由工人将机械量尺贴靠在钢轨上,再使用对应尺寸的塞规进行接触式测量。在测量过程中,工人贴靠量尺的力度不同以及塞规测量点选取的随机性,将导致测量结果存在差异,测量结果的一致性较差。此外,测量过程劳动重复度高,劳动强度大,长时间的测量不但需要消耗大量人力,而且接触测量方式增大了造成钢轨表面缺陷的风险。
发明内容
基于此,有必要针对传统测量过程劳动重复度高,劳动强度大,长时间的测量不但需要消耗大量人力,而且接触测量方式增大了造成钢轨表面缺陷的风险的问题,提供一种钢轨断面轮廓测量方法及系统。
本申请提供一种钢轨断面轮廓测量方法,包括:
依据张正友标定法对相机进行标定,得到相机的内参与外参矩阵;
获取第一相机在一个拍摄位置下拍摄被测钢轨的图像,以及获取第二相机在一个拍摄位置下拍摄被测钢轨的图像,得到一组目标图像;在拍摄图像时,控制激光器射出至少一道单线激光至被测钢轨的表面,每一道单线激光的照射方向均与被测钢轨的表面的垂直,第一相机和第二相机分别设置于被测钢轨的两侧;
同步移动第一相机的拍摄位置和第二相机的拍摄位置,获取另一组目标图像;在同步移动第一相机的拍摄位置和第二相机的拍摄位置时,第一相机的拍摄方向和每一道单线激光的照射方向之间的夹角保持不变,第二相机的拍摄方向和每一道单线激光的照射方向之间的夹角保持不变,第一相机的拍摄方向和第二相机的拍摄方向之间的夹角保持不变;
反复执行所述同步移动第一相机的拍摄位置和第二相机的拍摄位置,获取另一组目标图像,直至得到N组目标图像;N为正整数且N大于1;
依据光条中心提取法获取每组目标图像中每张目标图像的光条中心图像,得到与每张目标图像对应的光条中心图像;
基于每张光条中心图像,获取每张光条中心图像的光条中心部分包含的每一个光条中心点的三维坐标,以形成每一张光条中心图像的光条中心点集;
选取一组目标图像;
定义该组目标图像中任意一个目标图像的相机坐标系为公共坐标系,将该组目标图像中另一个目标图像的光条中心点的三维坐标系转换到公共坐标系,以得到每张光条中心图像中每一个光条中心点的公共坐标;
依据失真轮廓投影校正法,将每一个光条中心点的公共坐标进行校准,得到每一个光条中心点校准后的公共坐标;
采用双圆心坐标与标准轮廓的双圆心位置的匹配关系进行粗匹配得到ICP算法的初值,依据ICP算法将校准后的该组目标图像中每一个光条中心点的公共坐标与标准钢轨端面轮廓精配准,基于标准规定设置形影的标示线,将提取拟合标示线与测量轮廓的交点定位测点,得到钢轨轮廓测量结果;
返回所述选取一组目标图像,直至所有目标图像均被选取完毕;
基于多组目标图像、每一张目标图像对应的光条中心图像、每一张光条中心图像每一个光条中心点的公共坐标、每一张光条中心图像每一个光条中心点校准后的公共坐标、标准的钢轨端面轮廓以及每一张校正后的钢轨端面轮廓与标准的钢轨端面轮廓之间的对比误差图像,构建基于钢轨端面轮廓误差检测模型。
另一方面,本申请还提供一种钢轨断面轮廓测量系统,所述的钢轨断面轮廓测量系统包括:
采集设备,用于采集被测钢轨在不同拍摄角度下的图像;所述采集装置包括光源发射装置和图像采集装置;
处理设备,与采集装置通信连接,所述处理设备用于执行如前述内容所提及的钢轨断面轮廓测量方法。
本申请涉及一种钢轨断面轮廓测量方法,通过多角度采集目标图像,之后通过算法将采集的目标图像重建为当前相机视角的钢轨轮廓,接着将得到的当前相机视角的钢轨轮廓校正成当前钢轨断面的轮廓,最后通过当前钢轨断面的轮廓与标准的钢轨断面轮廓进行比对,并显示轮廓之间的误差结果;分别设计了基于光平面标定参数的ROI自动提取算法,将光条中心提取速度提高至3倍,同时提出中心定位样条插值法去除交叉区域弯折扭曲问题,实现光条中心快速准确提取;基于RANSAC算法的十字激光光条中心提取算法以去除背景干扰并进行光条归类,实现了钢轨激光图像的光条特征点坐标到空间三维坐标的高效变换。
图1为本申请一实施例提供的钢轨断面轮廓测量方法的流程图。
图2为本申请一实施例提供的钢轨断面轮廓测量方法中十字线激光器组件布置示意图。
图3为本申请一实施例提供的钢轨断面轮廓测量方法中基于棋盘格的标定方法的示意图。
图4为本申请一实施例提供的钢轨断面轮廓测量方法中黑白棋盘格图像中光条中心提取变形示意图。
图5为本申请一实施例提供的钢轨断面轮廓测量方法中定制棋盘格标定板及含激光条纹的棋盘格图。
图6为本申请一实施例提供的钢轨断面轮廓测量方法中目标图像中三个光平面交叉区域定位结果图。
图7为本申请一实施例提供的钢轨断面轮廓测量方法的目标图像中ROI1左右边界与上边界确定结果示意图。
图8为本申请一实施例提供的钢轨断面轮廓测量方法的目标图像中ROI1左右边界与下边界确定结果示意图。
图9为本申请一实施例提供的钢轨断面轮廓测量方法的目标图像中ROI2确定结果示意图。
图10为本申请一实施例提供的钢轨断面轮廓测量方法的目标图像中ROI的提取结果图。
图11为本申请一实施例提供的钢轨断面轮廓测量方法的目标图像中交叉点精定位结果图。
图12为本申请一实施例提供的钢轨断面轮廓测量方法的目标图像中轨头左右轮廓筛选与区分结果图。
图13为本申请一实施例提供的钢轨断面轮廓测量方法的目标图像中光条中心的筛除噪点与样条插值示意图。
图14为本申请一实施例提供的钢轨断面轮廓测量方法的目标图像中光条中心的修正前后对比图。
图15为本申请一实施例提供的钢轨断面轮廓测量方法中目标图像光条中心提取结果图。
图16为本申请一实施例提供的钢轨断面轮廓测量方法中十字激光标定图像原始光条中心提取结果图。
图17为本申请一实施例提供的钢轨断面轮廓测量方法中十字激光标定图像依据RANSAC算法拟合直线图。
图18为本申请一实施例提供的钢轨断面轮廓测量方法中RANSAC算法提取直线图。
图19为本申请一实施例提供的钢轨断面轮廓测量方法中十字标定激光图像光条中心提取结果对比图。
图20为本申请一实施例提供的钢轨断面轮廓测量方法中左右十字结构光的光平面拟合结果图。
图21为本申请一实施例提供的钢轨断面轮廓测量方法中目标图像双目标定坐标转换结果图。
图22为本申请一实施例提供的钢轨断面轮廓测量方法中目标图像公共向量校正后的坐标转换结果图。
图23为本申请一实施例提供的钢轨断面轮廓测量方法中钢轨轮廓特征点标示图。
图24为本申请一实施例提供的钢轨断面轮廓测量方法中目标图像特征点示意图。
图25为本申请一实施例提供的钢轨断面轮廓测量方法中钢轨纵向向量标定示意图。
图26为本申请一实施例提供的钢轨断面轮廓测量方法中道格拉斯-普克演算法示意图。
图27为本申请一实施例提供的钢轨断面轮廓测量方法中道格拉斯-普克算法提取特征点结果图。
图28为本申请一实施例提供的钢轨断面轮廓测量方法中目标图像提取特征点投影结果示意图。
图29为本申请一实施例提供的钢轨断面轮廓测量方法中钢轨纵向向量计算结果示意图。
图30为本申请一实施例提供的钢轨断面轮廓测量方法中辅助平面投影校正失真轮廓示意图。
图31为本申请一实施例提供的钢轨断面轮廓测量方法中钢轨测量失真轮廓校正结果图。
图32为本申请一实施例提供的钢轨断面轮廓测量方法中轨头侧面直线段粗配准结果图。
图33为本申请一实施例提供的钢轨断面轮廓测量方法中大小圆弧端点定位结果图。
图34为本申请一实施例提供的钢轨断面轮廓测量方法中小圆拟合圆心求取结果图。
图35为本申请一实施例提供的钢轨断面轮廓测量方法中双圆心坐标拟合配准结果图。
图36为本申请一实施例提供的钢轨断面轮廓测量方法中校正后的钢轨端面轮廓与标准的钢轨端面轮廓之间的对比误差图。
图37为本申请一实施例提供的钢轨断面轮廓测量方法中测点标示结果图。
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
如图1所示,在本申请的一实施例中,所述钢轨断面轮廓测量方法包括:S100至S800:
S100,依据张正友标定法对相机进行标定,得到相机的内参与外参矩阵。
在本实施例中,通过安装固定线激光器和相机间的相对位置,调整棋盘格标定板位姿,使得光平面与棋盘格标定板相交形成光条纹直线,并让棋盘格与光条交线出现在相机视场范围内,分别拍摄同一位姿下的含激光条纹的棋盘格图像以及无激光条纹棋盘格图像的一组图像对。之后保持相机与线激光器固定,更换棋盘格标定板位姿,重复以上操作获取多组图像对。对于无激光条纹的棋盘格图像,其作用是作为相机标定的图像组标定获取相机内参K以及相对于以当前棋盘格标定板位姿定义的世界坐标系的外参矩阵[R t]。含激光条纹的棋盘格图像主要用于提取光条中心点的像素坐标(u,v),然后通过外参矩阵计算得到光条中心点在世界坐标系下的对应三维坐标,再通过相机成像模型将标定板上的光条中心点变换到相机坐标系。
S200,获取第一相机在一个拍摄位置下拍摄被测钢轨的图像,以及获取第二相机在一个拍摄位置下拍摄被测钢轨的图像,得到一组目标图像。在拍摄图像时,控制激光器射出至少一道单线激光至被测钢轨的表面,每一道单线激光的照射方向均与被测钢轨的表面的垂直,第一相机和第二相机分别设置于被测钢轨的两侧。
在本实施例中,使用一个十字激光器搭配两个两侧布置的单线激光器方案。如图2所示,十字激光器安装在钢轨轨头正上方,使用十字激光器的优点主要有两个:一是十字激光在轨头处补充了光条纹数量,可利用多线结构光提取到轨颚等特征点,结合钢轨轮廓存在的几何关系对安装偏移或方向偏移的测量轮廓进行失真校正。二是轨头区域是两侧工业相机的公共视场范围内,在后续的轮廓拼接与配准算法中可补充双侧相机坐标系下的公共点云作为配准依据,可进一步提高双目配准精度。
S300,同步移动第一相机的拍摄位置和第二相机的拍摄位置,获取另一组目标图像。在同步移动第一相机的拍摄位置和第二相机的拍摄位置时,第一相机的拍摄方向和每一道单线激光的照射方向之间的夹角保持不变,第二相机的拍摄方向和每一道单线激光的照射方向之间的夹角保持不变,第一相机的拍摄方向和第二相机的拍摄方向之间的夹角保持不变。
在本实施例中,第一相机与第二相机设置在钢轨长度延伸方向的两侧,且第一相机与第二相机分别与钢轨成固定的角度,第一相机与第二相机均可以拍摄到钢轨头部与钢轨腰部的图像,第一相机与第二相机与每一个单线激光之间的相对位置固定。
S400,反复执行所述同步移动第一相机的拍摄位置和第二相机的拍摄位置,获取另一组目标图像,直至得到N组目标图像。N为正整数且N大于1。
在本实施例中,通过反复执行同步移动第一相机的拍摄位置和第二相机的拍摄位置,得到多组的钢轨不同位置含有棋牌格和激光条纹的图像。
S500,依据光条中心提取法获取每组目标图像中每张目标图像的光条中心图像,得到与每张目标图像对应的光条中心图像。
在本实施例中,通过光条中心提取法对每张目标图像进行提取,获得每张图像对应的光条中心图像,并将目标图像与该目标图像的光条中心图像相对应的存储。
S600,基于每张光条中心图像,获取每张光条中心图像的光条中心部分包含的每一个光条中心点的三维坐标,以形成每一张光条中心图像的光条中心点集。
在本实施例中,基于已经进行过标定的相机获取的目标图像,对每张目标图像对应的光条中心图像进行三维坐标的转换,再利用标定相机的内参与外参矩阵,将光条中心图像的三维坐标转换到相机坐标系下的坐标。
S700,选取一组目标图像。
定义该组目标图像中任意一个目标图像的相机坐标系为公共坐标系,将该组目标图像中另一个目标图像的光条中心点的三维坐标系转换到公共坐标系,以得到每张光条中心图像中每一个光条中心点的公共坐标。
依据失真轮廓投影校正法,将每一个光条中心点的公共坐标进行校正,得到每一个光条中心点校准后的公共坐标。
采用双圆心坐标与标准轮廓的双圆心位置的匹配关系进行粗匹配得到ICP算法的初值,依据ICP算法将校准后的该组目标图像中每一个光条中心点的公共坐标与标准钢轨端面轮廓精配准,基于标准规定设置形影的标示线,将提取拟合标示线与测量轮廓的交点定位测点,得到钢轨轮廓测量结果。
返回所述选取一组目标图像,直至所有目标图像均被选取完毕。
在本实施例中,将一组目标图像中的一个相机坐标系为公共坐标系,将另一张图像的光条中心的三维坐标转换到该公共坐标中,并通过失真轮廓投影校正法将得到的处于一个公共坐标系的光条中心的三维坐标进行校正,接着利用ICP算法将校正后得到的校正后的光条中心的三维坐标与标准的钢轨断面轮廓进行配准,得到配准后的测量钢轨断面轮廓与标准的钢轨断面轮廓。并计算测量钢轨断面轮廓与标准的钢轨断面轮廓之间的误差。
S800,基于多组目标图像、每一张目标图像对应的光条中心图像、每一张光条中心图像每一个光条中心点的公共坐标、每一张光条中心图像每一个光条中心点校准后的公共坐标、标准的钢轨端面轮廓以及每一张校正后的钢轨端面轮廓与标准的钢轨端面轮廓之间的对比误差图像,构建基于钢轨端面轮廓误差检测模型。
具体的,将多组目标图像、每张图像的光条中心图像、每张图像光条中心点的三维坐标参数、一组图像光条中心点的三维坐标参数融合后的三维坐标参数、校准后的一组图像光条中心点的三维坐标参数融合后的三维坐标参数、标准的钢轨端面轮廓以及校正后的钢轨端面轮廓与标准的钢轨端面轮廓对比误差图像作为训练数据对基于钢轨端面轮廓误差检测模型进行训练,得到训练后的基于钢轨端面轮廓误差检测模型。
在本实施例中,将多组目标图像、每张图像的光条中心图像、每张图像光条中心点的三维坐标参数、一组图像光条中心点的三维坐标参数融合后的三维坐标参数、校准后的一组图像光条中心点的三维坐标参数融合后的三维坐标参数、标准的钢轨端面轮廓以及校正后的钢轨端面轮廓与标准的钢轨端面轮廓对比误差图像作为用于训练的数据对构建的基于钢轨端面轮廓误差检测模型进行训练,以使得基于钢轨端面轮廓误差检测模型具有将检测钢轨断面轮廓与标准钢轨断面轮廓误差比较的功能。
如图2所示,在本申请的一实施例中,所述控制激光器射出至少一道单线激光至被测钢轨的表面,包括如下S201至S204:
S201,控制设置在钢轨上方的第一激光器射出两道单线激光至被测钢轨的轨头,两道单线激光各自形成的光平面相互垂直。
S202,控制设置在钢轨一侧的第二激光器射出一道单线激光至被测钢轨。
S203,控制设置在钢轨另一侧的第三激光器射出一道单线激光至被测钢轨。
S204,所述第二激光器射出的单线激光所形成的光平面和所述第三激光器射出的单线激光所形成的光平面为共平面。
在本实施例中,光源模块可以由两个线激光发射器(激光发射器后文简称为激光器)和一个十字激光器组成,同样由于遮挡的缘故,单线激光器需配合两侧的工业相机进行布置,且两个线激光器发射光平面应尽可能安装重合,保证两侧激光平面与钢轨表面相交光条纹曲线共面,才能真实地反映钢轨同一断面的轮廓数据。
为了解决廓形失真问题,尽可能地减少钢轨测段方向偏移引入的测量误差,本文提出了使用一个十字激光器搭配两个两侧布置的单线激光器的方案。如图2所示,十字激光器安装在被测钢轨的轨头的正上方。
使用十字激光器的优点主要有两个:
(一)十字激光器在轨头处补充了光条纹数量,可利用多线结构光提取到轨颚等特征点,结合钢轨轮廓存在的几何关系对安装偏移或方向偏移的测量轮廓进行失真校正。
(二)是轨头区域是两侧工业相机的公共视场范围内,在后续的S700中可补充双侧相机坐标系下的公共点云作为配准依据,可进一步提高双目配准精度。
如图3到图5所示,在本申请的一实施例中,在所述依据张正友标定法对相机进行标定之后,所述方法还包括,对光平面进行标定,所述对光平面进行标定包括如下S101至S111:
S101,固定设置标定用激光器和相机之间的相对位置。
S102,调整棋盘格标定板的位姿,使得标定用激光器射出的单线激光所形成的光平面与棋盘格标定板相交形成光条纹直线,且同时控制光条纹直线和棋盘格标定板出现在相机的拍摄范围内。
S103,保持棋盘格标定板的位姿不变,拍摄一张无激光条纹的棋盘格图像与一张包含激光条纹的棋盘格图像,作为一个棋盘格图像对。
S104,更换棋盘格标定板的位姿,返回所述保持棋盘格标定板的位姿不变,拍摄一张无激光条纹的棋盘格图像与一张包含激光条纹的棋盘格图像,作为一个棋盘格图像对,直至得到M个棋盘格图像对。M为正整数且大于1。
S105,获取M个棋盘格图像对。每一个棋盘格图像对包括一张无激光条纹的棋盘格图像与一张包含激光条纹的棋盘格图像。
S106,提取每一个棋盘格图像对中无激光条纹的棋盘格图像。
S107,依据张正友标定法,从无激光条纹的棋盘格图像中得到相机内参矩阵、以及相对棋盘格外参矩阵。
S108,依据光条中心提取法,提取每一个棋盘格图像对中包含激光条纹的棋盘格图像的光条中心点的像素坐标。
S109,依据相对棋盘格外参矩阵,计算每一个棋盘格图像对中包含激光条纹的棋盘格图像的光条中心点在世界坐标系下的三维坐标。
S110,依据每一个棋盘格图像对中包含激光条纹的棋盘格图像的光条中心点的像素坐标、一个棋盘格图像对中包含激光条纹的棋盘格图像的光条中心点在世界坐标系下的三维坐标,得到每一个棋盘格图像对中包含激光条纹的棋盘格图像的光条中心点在相机坐标系下的三维坐标。
S111,对得到的所有棋盘格图像对中包含有激光条纹图像的光条中心点在相机坐标系下进行拟合得到光平面标定方程。
在本实施例中,基于棋盘格的标定方法的示意图如图3所示。对于无激光条纹的棋盘格图像,其作用是作为相机标定的图像组标定获取相机内参K以及相对于以当前棋盘格标定板位姿定义的世界坐标系的外参矩阵[Rt]。含激光条纹的棋盘格图像主要用于提取光条中心点的像素坐标(u,v)。然后通过外参矩阵计算得到光条中心点在世界坐标系下的对应三维坐标,再通过相机成像模型将标定板上的光条中心点变换到相机坐标系,对变换后的多组光条中心点进行平面拟合即可求解得到相机坐标系下的光平面方程。完整光平面标定流程如图4所示。
详细的来说,以棋盘格标定板平面作为世界坐标系的O-XwYz平面,建立世界坐标系O-XwYwZw,设棋盘格标定板上的光条中心点像素坐标为(u,v),给定相机内参矩阵K以及世界坐标系转换到相机坐标系的外参矩阵[R t],求取光条中心点在相机坐标系下的对应坐标(xc,yc,zc)。以下给出计算过程的推导:
根据相机成像模型可知像素坐标与世界坐标系之间的变换关系为:
记此时相机标定得到的旋转矩阵R和平移向量t为:
带入公式1可得:
zc=R31xw+R32yw+R33zw+t3 公式2
zc=R31xw+R32yw+R33zw+t3 公式2
公式1左右两边同时左乘R-1K-1可得:
令M=R-1K-1,由于zc为标量,可移到前面,上式可改写为:
由于光条特征点都位于棋盘格标定板的O-XwZw平面内,则对于所有的光条特征点都有Zw=0,代入公式2和公式3,联立两式可得:
由于旋转矩阵R的正交特性,存在R-1=RT,则上式可改写成
取公式3。前两项,并记m1=M11u+M12v+M13,m2=M21u+M22v+M23可得
最终求解得到:
完成光条特征点从像素坐标系到世界坐标系的坐标映射后,后续通过公式1进行坐标系转换即可获得光条中心点在相机坐标系下的坐标。
当拍摄无激光条纹的棋盘格图像时,为保证能精确提取到棋盘格角点,相机曝光时间应设置较长。当拍摄含激光条纹的棋盘格图像时,应固定棋盘格标定板位姿,减少相机曝光时间,使棋盘格区域整体变暗,增大光条纹与其他非光条区域的对比度,以便更好地进行光条中心提取。
此外,如图5所示,由于棋盘格区域黑白格对于光条的反射效果不同,当光条落入棋盘格区域时,光条的灰度分布会因背景颜色不同而发生变化,从而使得直线光条的中心提取结果发生变形。
为了解决黑白棋盘格背景对光条中心提取的干扰问题,设计了如图6所示的棋盘格标定板,扩大了标定板周边的空白区域,标定时让光平面与标定板外围的空白区域相交,使光条落在标定板的空白区域内,保持直线光条的灰度分布,避免光条中心提取结果发生扭曲变形。
如图6至图16所示,在本申请的一实施例中,所述依据光条中心提取法获取每组目标图像中每张目标图像的光条中心图像,得到与每张目标图像对应的光条中心图像包括如下S501至S509:
S501,选取一张目标图像。
S502,依据ROI算法提取该目标图像的精准光条区域图像。
S503,基于该目标图像的精准光条区域图像,利用Hessian算法得到该目标图像的所有光条中心点在像素坐标系下的像素坐标。基于标定参数投影第一激光器射出两道单线激光形成的光平面的交线,得到第一光平面投影线,以及基于标定参数投影第二激光器射出的单线激光形成的光平面与第一激光器射出一道单线激光形成的光平面的交线,得到第二光平面投影线。
S504,提取所有光条中心点、第一光平面投影线和第二光平面投影线之间的交点,作为光条交叉点。所述光条交叉点的数量为2。
S505,基于两个光条交叉点的像素坐标,得到一条过两个光条交叉点直线的直线方程和该直线的中点的像素坐标。
S506,计算每一个光条中心点与过两个光条交叉点的直线之间的直线距离,将直线距离小于直线距离阈值的光条中心点删除,得到去噪后的光条中心点。
S507,计算每相邻两个去噪后的光条中心点的直线距离,作为相邻直线距离,将相邻直线距离大于相邻直线距离阈值的噪后的光条中心删除,以去除噪音段。
S508,依据Spline样条插值补全法将噪音段补全,得到补全后的光条中心点的像素坐标点集并将补全后的光条中心点的坐标点集和该目标图像相对应地存储。
S509,返回所述选取一张目标图像,直至所有目标图像均被选取一次。
在本实施例中,首先对输入目标图像进行目标图像预处理,使用OTSU法(大津法)自适应确定阈值并对目标图像进行二值化,从而分离光条像素点和背景。之后根据标定的相机内参矩阵及两个光平面参数矩阵可以确定一条经过轨头光条交叉点的直线,从而辅助交叉区域定位。以下是确定直线方程的推导过程:
令根据可得:
记在同一相机坐标系下,空间相交的两个光平面的光平面参数矩阵分别为,L1=[A1 B1 C1 D1],L2=[A2 B2 C2 D2]图像中两光条纹的交点转换到目标图像坐标系中是同一点,即满足以下等式:
上式可改写成
根据式可得:
上式可进一步改写成:
式中根据该式可知,在像素坐标系中可确定一条经过交叉点的直线,该直线的物理意义是空间中两相交光平面交线在像素坐标系下的投影。在完成相机内参矩阵及两光平面参数矩阵的标定工作后,该直线参数便可通过上式确定。
钢轨目标图像中轨头光条由三个光平面交汇形成两个交叉点,在目标图像中画出根据标定参数计算得到的两条直线,通过计算所有光条像素点与该直线的距离,设置一定的距离阈值,筛选定位得到交叉区域,定位结果如图7所示。
左右的交叉区域各自随机选取一点,横向左右向外扩展500个像素点,纵向上下向外扩展200个像素点确定待选的区域范围,确保能框选得到目标图像中轨头的横向光条上的所有像素点,再以横向光条左右边界点以及目标图像中轨头轮廓的上边界点为依据,向外扩展50个像素值作为轨头ROI1的左右边界X00,X01和上边界y00。定位结果如图8所示。
从目标图像中的轮廓光条几何形状可知,目标图像的轨头光条与轨腰光条之间出现间隔,可通过定位突变点来确定下边界。首先,从目标图像的轨腰光条上方的交叉区域随机选取一点,向下拓展100和800个像素以及向左右扩展300个像素确定候选框,框选光条点后通过计算相邻点的距离定位处于间隔出的突变点,两突变点的纵向坐标中值作为ROI1的下边界y01和ROI2的上边界y10。定位结果如图9所示。
此时目标图像中轨腰光条的上边界已经确定,基于突变点位置,向左右拓展200个像素连同上边界及图像最低端确定新的待选区域,将待选区域的左右边界作为ROI2的左右边界x10,x11。目标图像中轨腰光条的几何形状基本是连续曲线,如果目标图像中轨腰光条下方在待选区域内存在背景光条的干扰,同样可通过定位突变点以寻找光条最低点,从而确定ROI2的下边界y10。定位结果如图10所示。
最终ROI的提取结果如图11所示,从图中可知,对于光条分布位置不同及背景各异的钢轨图像,皆可实现区域的自动定位与区分,算法的鲁棒性和可靠性较好。只对ROI区域进行光条中心提取并统计平均耗时,运行时间从311.4ms缩减到90.7ms,运行速度提高至3倍。
针对交叉区域弯折扭曲及断线的问题,为了对提取的轨头光条中心点进行区分,本文提出了中心定位样条插值法进行校正。
虽然混叠增强的光条增大了光条宽度及法线方向,但局部的光条中心提取结果仍然包含有效信息,提取结果交叉点定位相对准确。根据相机内参矩阵和两光平面参数矩阵可确定经过光条交叉点的直线。基于上述信息,可将直线与原先提取到的光条中心曲线的交点确定为交叉点。定位结果如图12所示。
由于目标图像中轨头横向光条基本沿着钢轨纵向分布,反映在目标图像中光条多呈现直线形状。在成功定位到两交叉点坐标之后,可构造一条通过两交点的直线,该直线基本与轨头横向光条保持一致。
通过计算所有光条中心点到该直线的距离,将距离小于一定阈值的点作为轨头横向光条中心点和交叉区域弯折点进行筛除。此外,可将两交叉点的横向坐标中心设置为横向分界用于区分目标图像中轨头左右轮廓光条中心点。定位筛除与区分的结果如图13所示。
从图13结果来看,由于钢轨表面较为粗糙,激光发生多重漫反射导致光条中心的提取结果存在噪点。因此,针对目标图像中轮廓光条中心点计算其相邻点的距离,将距离偏差较大的点集作为噪点去除。之后以剩余点为参考依据,通过Spline样条插值补全被筛除的交叉区域缺失段。筛除噪点与样条插值补全的过程如图14所示。
将直接进行光条中心提取与使用中心定位样条插值法进行修正的结果进行对比,对比结果如图15所示。由此可见,修正后的消除了交叉区域的弯折扭曲及断线情况的出现,目标图像中提取到的轮廓光条中心曲线更加平滑。
在成功提取目标图像中轨头轮廓关键光条测点的同时,能够排除不参与计算的轨头横向光条中心点。此外轮廓光条附近的提取到的一些噪点也会被筛除。从如图16所示的钢轨图像光条中心的提取结果可得,本文提出的光条中心提取算法能较好地处理带背景干扰及多交叉光条的左右视角下的钢轨图像。
如图17至图21所示,在本申请的一实施例中,在所述依据张正友标定法对相机进行标定,得到相机的内参与外参矩阵后还包括如下,S100a至S100k:
S100a,固定设置第一激光器和相机之间的相对位置。
S100b,调整棋盘格标定板的位姿,使得第一激光器射出的两道单线激光所形成的两个相交的光平面落在棋盘格标定板上,与棋盘格标定板相交形成十字光条,且同时控制十字光条和棋盘格标定板出现在相机的拍摄范围内。
S100c,保持棋盘格标定板的位姿不变,拍摄一张无十字光条的棋盘格图像与一张包含十字光条的棋盘格图像,作为一个十字光条棋盘格图像对。
S100d,更换棋盘格标定板的位姿,返回所述保持棋盘格标定板的位姿不变,拍摄一张无十字光条的棋盘格图像与一张包含十字光条的棋盘格图像,作为一个十字光条棋盘格图像对,直至得到K个棋盘格图像对。K为正整数且大于1。
S100e,选取一张包含十字光条的棋盘格图像。
S100f,执行Hessian算法提取该包含十字光条的棋盘格图像中所有十字光条中心点在像素坐标系下的像素坐标。
S100g,利用RANSAC算法筛选与第一最佳匹配直线匹配的十字光条中心点,作为第一类十字光条中心点。
S100h,利用RANSAC算法筛选除第一十字光条中心点之外剩余的十字光条中心点中与第二最佳匹配直线匹配的十字光条中心点,作为第二类十字光条中心点。
S100i,计算第一最佳匹配直线和第二最佳匹配直线的交点,去除与交点直线距离大于第一预设距离的第一类十字光条中心点,以及去除与交点直线距离大于第二预设距离的第二类十字光条中心点。
S100j,返回所述选取一张包含十字光条的棋盘格图像,直至包含十字光条的棋盘格图像均被选取一次,得到每一张包含十字光条的棋盘格图像的第一类十字光条中心点和第二类十字光条中心点。
S100k,依据每一张包含十字光条的棋盘格图像的第一类十字光条中心点和第二类十字光条中心点,对光平面标定方程进行修正。
在本实施例中,在实际的标定过程中,由于激光条纹不能保证完全落在棋盘格平面上,相机视场内捕获得到的激光图像往往存在背景干扰。
对于单线激光标定而言,由于线结构光测量模组的相机与激光器位置固定,变换棋盘格的位姿进行图像采集时,标定板上激光条纹在图像中的位置变化范围较小,因此可通过只截取固定的像素坐标区域内的光条进行中心提取,简单高效地排除背景区域的干扰。
对于十字激光标定而言,如图17所示,拍摄的十字激光标定图像同样存在背景干扰的问题,但与单线激光的标定图像不同的是十字激光标定图像还存在交叉区域弯折和对应光条区分问题。
在钢轨光条图像提取中心时交叉点的精定位是建立在光平面参数标定完成的基础上,在十字激光的标定过程中并不适用。
通过对多组十字激光标定图像进行观察分析,总结得出以下结论:(1)落在标定板上的十字光条基本呈交叉直线的形状。(2)由于标定时线结构光测量模块位置固定,标定图像中的光条直线方向基本分布在一定区间范围内。(3)落在标定板上的有效点数量相比干扰点占比更大。
提出了一种基于RANSAC(Random Sample Consensus,随机采样一致性)算法的十字激光标定图像的光条中心提取算法其基本思想是给定一个待拟合的数学模型,采用迭代的方式从一组包含离群的观测数据中估算出该数学模型的参数。
RANSAC算法属于非确定性算法,当迭代次数足够多时能产生最大概率满足条件并排除离群点的结果,因此适用于提取标定板上的光条纹中心点同时去除背景干扰离群点的影响。对于十字激光在棋盘格标定板上的光条纹而言,其对应的数学模型为直线方程,对此使用RANSAC算法进行直线提取的流程示意图如图18所示。
其算法步骤如下:
(1)在完整点集中随机选取两点,根据两点计算直线l的参数。
(2)设置阈值δ,对与直线l的几何距离小于δ的数据点集S(l)进行归类,作为直线l的一致集。
(3)重复n次随机选择,求解直线l1,l2,...,ln的参数和其对应的一致集S(l1),S(l2),...,S(ln)。
(4)整合所有随机选择结果,选取最大一致集对应的拟合直线作为完整点集的最佳匹配直线,其参数结果即为最终的拟合结果。
提出的基于RANSAC算法的十字激光标定图像的光条中心提取算法。
首先直接对十字标定激光图像使用Hessian矩阵法提取光条中心点集,由于有效点基本呈直线分布,而干扰点呈不规则分布且符合直线分布的有效点数量较多,此时直接使用RANSAC算法可以提取内点较多的直线点集,并将其从原始点集中去除,剩余点集中包含第二条直线点集以及干扰离群点,再次使用RANSAC算法拟合第二条直线参数,提取的离群点属于背景干扰点,可直接去除。两次RANSAC提取结果如图19所示。
对于交叉区域弯折扭曲问题,在获取两直线参数的基础上,可以求直线交点后,设置一定的距离阈值,将提取的两直线点集中与交点距离小于阈值的点去除,避免交叉区域弯折对光平面参数标定造成影响。
此外,为由于光条直线末端由于成像质量不佳而引入误差,将直线光条两端一定数量的提取点去除。最后根据得到的直线参数,设置一定的斜率阈值,可以将两个光平面对应的直线点集区分开。最终十字激光图像的光条中心提取结果如图20所示。
之后对归类好的两组光条中心点分别依照单线激光光平面标定流程进行标定。最终左右两侧光平面参数标定的量化结果和可视化结果分别如表1和图21所示。光平面拟合的结果相比单线激光而言距离均值与方差都有所增加,计算两光平面的夹角与理想夹角误差分别为0.28°和0.17°。考虑到十字激光的作用是补充轮廓特征点辅助计算钢轨法向,并不作为钢轨轮廓测量数据,该结果可满足测量要求。
表1
如图22至图23所示,在本申请的一实施例中,所述定义该组目标图像中任意一个目标图像的相机坐标系为公共坐标系,将该组目标图像中另一个目标图像的光条中心点的三维坐标系转换到公共坐标系,以得到每张光条中心图像中每一个光条中心点的公共坐标包括如下步骤:S701至S706:
S701,选取一组目标图像。
S702,定义该组目标图像中任意一个目标图像的相机坐标系为公共坐标系。
S703,获取一个目标图像在公共坐标系中的两个光条交叉点的公共坐标,另一个目标图像在公共坐标系中的两个光条交叉点的公共坐标。
S704,基于一个目标图像在公共坐标系中的两个光条交叉点的公共坐标得到一个公共向量,基于另一个目标图像在公共坐标系中的两个光条交叉点的公共坐标得到另一个公共向量。
S705,利用两个公共向量,将该组目标图像中两个目标图像的光条中心点的三维坐标系转换到公共坐标系,以得到每张光条中心图像中每一个光条中心点的公共坐标。
S706,返回所述选取一组目标图像,直至每一组目标图像均被选取一次。
在本实施例中,通过坐标变换后获取了左右侧钢轨轮廓在各自相机坐标系下坐标,基于左右侧相机双目标定的结果,将左侧相机坐标系定义成公共坐标系,根据标定的结果将右侧相机坐标系的轮廓坐标变换到左侧相机坐标系下,实现坐标系的全局统一和完整断面轮廓的数据融合。坐标系统一的转换结果如图22所示。
提出了单线与十字激光器组合的光源设计,增加目标图像中轨头轮廓点云的双目视角下的公共特征点,通过精确提取钢轨目标图像中十字激光自身交点以及单线激光与十字激光的交点对应的三维坐标,在空间中形成左右视角下的公共向量。
利用该公共向量在双目标定转换结果的基础上进行精匹配,匹配过程既简单又高效,由如图23所示的匹配结果可知,相比利用双目标定参数进行坐标系变换的结果,目标图像中轨头轮廓的公共部分基本重合,坐标系全局统一的误差明显减小。
如图24至图32所示,在本申请的一实施例中,所述依据失真轮廓投影校正法,将每一个光条中心点的公共坐标进行校准,得到每一个光条中心点校准后的公共坐标包括如下步骤:S707至S715:
S707,选取一组目标图像。
S708,将该组目标图像中每一个光条中心点的公共坐标向第二激光器射出的单线激光所形成的光平面投影,得到该组目标图像中每一个光条中心点的二维坐标。
S709,依据道格拉斯-普克算法对该组目标图像中每一个光条中心点进行二维特征点定位,以得到对称面。
S710,获取对称面与该组目标图像中每一个光条中心点的交点,以得到两个交点,求取两个交点的坐标。
S711,将两个交点连接,得到钢轨纵向向量。
S712,基于钢轨纵向向量,构建与钢轨断面平行的辅助平面。
S713,将该组目标图像中每一个光条中心点向辅助平面投影,得到校准后的该组目标图像中每一个光条中心点的公共坐标。
S714,输出校准后的该组目标图像中每一个光条中心点的公共坐标,并将校准后的该组目标图像中每一个光条中心点的公共坐标与该组目标图像相对应地存储。
S715,返回所述选取一组目标图像,直至每一组目标图像均被选取一次。
在本实施例中,钢轨动态测量中由于振动及方向偏移等原因引起的钢轨测量轮廓失真将给钢轨指标测量引入较大误差,采用标定钢轨纵向向量后构建垂直于钢轨纵向的辅助平面,之后将失真轮廓投影到辅助平面实现校正的方法。对如图2.1所示的60kg/m钢轨标准断面轮廓进行分析,钢轨断面轮廓存在部分易于提取的特征点,具体位置在图24标示。
完整的钢轨共分为三部分:(1)轨头部分,其中A点为轨顶中点,BC段为轨头侧面斜率为1:20的直线,C点为轨颚点。(2)轨腰部分,DE段为R400圆弧,EF段为R20圆弧,K点为R20圆弧圆心,两段圆弧相切于E点。(3)轨底部分,FG段为斜率1:3直线,GH段是斜率1:9直线,两直线相交于G点。
当发生振动或放置方向偏移,光平面与钢轨纵向向量不满足垂直关系时,测量得到的失真轮廓与标准轮廓间的变化形式可以通过仿射变换进行描述。
基于仿射变换的单线轮廓失真校正法通过获取失真轮廓与标准轮廓间的仿射变换参数,之后进行反变换以达到轮廓校正的目的。
任取失真轮廓上一点p(x,y)其标准轮廓对应点为p'(x',y'),两者的仿射变换关系为:
式中,θ为旋转角度。Sx和Sy为伸缩系数。Tx和Ty为平移系数。在进入单线轮廓失真校正时,仿射变换参数[θ Sx Sy Tx TY]通过轨腰区域的失真轮廓与标准轮廓的R400圆弧和R20圆弧匹配段进行拟合计算。
但该方法存在以下问题:由于R400圆弧以及R20圆弧经过仿射变换后,弧段失真变形成了椭圆弧,在可拟合的弧段较短的情况下,两椭圆弧的切点以及变换后的R20椭圆弧端点难以定位,弧段定位不准,拟合精度较低,在实际应用中难以保证其准确性和鲁棒性。
此外,仿射变换共5个参数需要获取,因此至少需要3对失真轮廓与标准轮廓点对才能求解。点对匹配的正确与否对参数求解的影响较大,难以保证拟合精度。针对钢轨轮廓特征点以及表面存在的几何关系约束,设计了一种基于多线结构光失真轮廓投影校正方法。
将光平面与钢轨断面成一定角度模拟失真情况,拍摄如图25所示的一组钢轨激光图像。尽管此时钢轨表面光条纹交线所反映的测量轮廓相比标准轮廓发生了失真,但不论光平面如何偏斜,轨头处的光条纹曲线始终包含3对特征点信息,特征点位置标示在图25中,分别对应双侧单线激光在钢轨各自一侧轨头轮廓上的Bl1点和Br1点、十字激光分别在钢轨左右侧轨头轮廓上的Bl2点和Br2点以及单线激光分别在左右侧的轨颚点Cl1点和Cr1点。
通过分析钢轨外形存在的几何约束关系,可以得知向量和向量方向都与钢轨纵向一致,且无论钢轨方向偏斜程度如何,这3对特征点只会沿着钢轨纵向在对应直线上移动。
根据钢轨断面轮廓存在的左右对称关系,每对特征点的中点都落在垂直于轨距方向的对称平面上,因此本文提出了基于对称面拟合的钢轨纵向向量标定法。
如图26所示,对于一次测量所能得到的钢轨轮廓点云而言,通过定位单线激光钢轨轨头轮廓的Bl1点和Br1点,可计算其中点Bm1点,利用左右侧轨颚点Cl1点和Cr1点计算其中点Cm1点,同样提取十字激光钢轨轨头轮廓的Bl2点和Br2点的中点Bm2。已知Bm1,Bm2,Cm1三点坐标,可计算得到对称中垂面参数,计算对称面与两段轨头轮廓交点,分别定位单线激光与十字激光的轨头轮廓轨顶中点A1,A2点,两轨顶中点组成向量XX即为钢轨纵向向量。
为利用特征点拟合对称面,首先需要定位特征点,在流程中,对左右侧轮廓点云向各自光平面投影,将对三维点的处理降维成二维,可减少数据处理量,提高算法运算效率。已知光平面参数矩阵L=[A B C D],对于轮廓点集中一点p(x,y,z),其在光平面上的投影点为p'(x',y',z'),根据点到平面的投影性质有:
求解上式得到投影点的坐标,完成轨头轮廓向光平面投影后使用道格拉斯-普克算法对投影后的二维点进行特征点定位。
道格拉斯-普克算法(Douglas–Peuckeralgorithm)是1973年由大卫·道格拉斯和托马斯·普克提出的用于曲线降采样的算法,其基本思想是使用多折线近似拟合曲线,并用曲线上的点与折线的Hausdorff距离(即最大距离)衡量折线与逼近曲线的相似度,Hausdorff距离小于设定阈值的保留,大于的以最大距离所在点为新端点,对曲线继续细分后逼近。
对于如图27所示的曲线,该算法的执行过程分为以下步骤:
1)确定曲线的端点A、B,连接A、B两点作为曲线的弦lAB。
2)计算曲线上A、B两点间所有离散点到直线lAB的距离,定位距离最大的点C,记录C点对应的Hausdorff距离d。
3)比较d与设定阈值δ的大小,若距离d小于阈值δ,则lAB可作为该曲线段的近似折线。
4)若大于阈值δ,则将点C补充为新的端点,连接AC,BC并继续分割,重复上述流程直至没有新的端点产生,依次连接所有端点完成该曲线段的多折线逼近。
根据经验与实验结果,本文设置距离阈值δ为0.6mm,对左右侧投影的轨头轮廓使用道格拉斯-普克算法的分割结果如图28所示。
取目标图像中十字激光的钢轨轨头轮廓曲线段末端作为特征点Bl2和Br2点。将提取到的特征点反投影到增加对比度的激光图像中,如图29所示可视化结果验证了特征点的提取结果较为准确。
之后计算三对特征点的中点坐标作为求取对称面参数的参考点,通过定位对称面与两段钢轨轨头轮廓的交点得到沿着钢轨纵向的两个轨顶中点,两点连线即能计算出钢轨的纵向向量。提取结果如图30所示。
之后计算三对特征点的中点坐标作为求取对称面参数的参考点,通过定位对称面与两段钢轨轨头轮廓的交点得到沿着钢轨纵向的两个轨顶中点,两点连线即能计算出钢轨纵向向量。提取结果如图30所示。
在获取钢轨纵向向量后,如图31所示,可利用钢轨纵向向量构建辅助平面进行投影校正。设计算得到的钢轨纵向向量为单线激光形成轮廓的轨顶中点坐标为A(x0,y0,z0),过A点构建与钢轨纵向向量垂直的辅助平面,将失真轮廓向辅助平面投影,最终实现测量轮廓校正。取失真轮廓点集中一点p(x,y,z),记p点在辅助平面上的投影点为p'(x',y',z'),根据平面性质可得
根据上式可求得投影点坐标,将测量轮廓点集进行投影校正,失真校正的结果如图32所示。
如图25至图26所示,在本申请的一实施例中,所述依据道格拉斯-普克算法对该组目标图像中每一个光条中心点进行二维特征点定位,以得到对称面包括如下S709a至S709c:
S709a,依据道格拉斯-普克算法对该组目标图像中每一个光条中心点进行二维特征点定位,得到三对特征点。三对特征点分别为双侧单线激光在钢轨各自一侧轨头轮廓上的BL1点和BR1点、十字激光分别在钢轨左右侧轨头轮廓上的BL2点和BR2点以及单线激光分别在左右侧的轨颚点CL1点和CR1点。
S709b,计算BL1点和BR1点的中点坐标BM1,计算BL2点和BR2点的中点坐标BM2,计算CL1点和CR点的中点坐标CM1。
S709c,基于中点坐标BM1、中点坐标BM2和中点坐标CM1,拟合得到对称面。
在本实施例中,将光平面与钢轨断面成一定角度模拟失真情况,拍摄如图25所示的一组钢轨激光目标图像。
尽管此时钢轨表面光条纹交线所反映的测量轮廓相比标准轮廓发生了失真,但不论光平面如何偏斜,轨头处的光条纹曲线始终包含3对特征点信息,特征点位置标示在图25中,分别对应双侧单线激光在钢轨各自一侧轨头轮廓上的Bl1点和Br1点、十字激光分别在钢轨左右侧轨头轮廓上的Bl2点和Br2点以及单线激光分别在左右侧的轨颚点Cl1点和Cr1点。
通过分析钢轨外形存在的几何约束关系,可以得知向量和向量方向都与钢轨纵向一致,且无论钢轨方向偏斜程度如何,这3对特征点只会沿着钢轨纵向在对应直线上移动。根据钢轨断面轮廓存在的左右对称关系,每对特征点的中点都落在垂直于轨距方向的对称平面上,因此本文提出了基于对称面拟合的钢轨纵向向量标定法。
如图26所示,对于一次测量所能得到的钢轨轮廓点云而言,通过定位单线激光钢轨轨头轮廓的Bl1点和Br1点,可计算其中点Bm1点,利用左右侧轨颚点Cl1点和Cr1点计算其中点Cm1点,同样提取十字激光钢轨轨头轮廓的Bl2点和Br2点的中点Bm2。
已知Bm1,Bm2,Cm1三点坐标,可计算得到对称中垂面参数,计算对称面与两段轨头轮廓交点,分别定位单线激光与十字激光的轨头轮廓轨顶中点A1,A2点,两轨顶中点组成向量即为钢轨纵向向量。
如图27至图38所示,在本申请的一实施例中,所述采用双圆心坐标与标准轮廓的双圆心位置的匹配关系进行粗匹配得到ICP算法的初值,依据ICP算法将校准后的该组目标图像中每一个光条中心点的公共坐标与标准钢轨端面轮廓精配准,基于标准规定设置形影的标示线,将提取拟合标示线与测量轮廓的交点定位测点,得到钢轨轮廓测量结果包括如下S716至S725:
S716,选取一组目标图像。
S717,获取该组目标图像的校准后的该组目标图像中每一个光条中心点的公共坐标中轨头侧面轮廓斜率1:20直线特征点。
S718,利用直线的端点坐标与标准轮廓直线的端点坐标变换,以轨头一侧轮廓直线段为匹配基准,轨颚点为基点进行粗配准,得到轨头粗配准后的结果。
S719,获取轨头粗配准后的一侧轨腰,依据道格拉斯-普克算法对标准轮廓的一侧轨腰的两段圆弧端点和切点进行定位,以得到大圆弧对应的大圆心坐标与小圆弧对应的小圆心坐标。
S720,获取标准轮廓的一侧轨腰上的大圆弧对应的大圆心坐标与小圆弧对应的小圆心坐标,定义其中一个圆心坐标为基点,利用大圆心坐标与小圆心坐标向量计算轨头粗配准后的轮廓到标准轮廓的刚体变换系数,对腰轨进行拟合,得到双圆心坐标拟合配准结果。
S721,依据ICP算法对双圆心坐标拟合配准结果进行精配准,得到双圆心坐标拟合配准结果与标准轮廓的精配准结果。
S722,基于得到的双圆心坐标拟合配准结果与标准轮廓的精配准结果,建立标示线,得到带有标示线的双圆心坐标拟合配准结果与标准轮廓的精配准结果。
S723,提取距离标示线最近的5个测量点坐标,依据最小二乘法对提取的每一个测量点坐标拟合,得到每一个标示线的直线方程。
S724,基于每一个标示线的直线方程,得到每一个测点坐标,将得到的每一个测点坐标与标准轮廓尺寸标准对比,得到每一个测点的检测结果,并相应的存储。
S725,返回所述选取一组目标图像,直至每一组目标图像均被选取过一次。
在本实施例中,参考ICP的执行过程,点对匹配的准确度是影响配准结果的重要因素,ICP配准对初值设置较为敏感。因此,本文采用了双圆心坐标拟合法作为ICP配准的前置步骤,通过双圆心坐标与标准轮廓的双圆心位置的匹配关系进行粗匹配,为ICP配准提供初值。
如图27所示,在提取了轨头侧面轮廓斜率1:20直线特征点的基础上,利用直线端点坐标与标准轮廓BC直线段坐标变换,以轨头左侧轮廓直线段为匹配基准,轨颚点C点为基点进行粗配准。
设测量轮廓B点为pB(xB,yB)轨颚点为pC(xC,yC),标准轮廓对应点分别为p'B(x'B,y'B)和p'C(x'C,y'C),则对于轮廓一点p(x,y),其粗配准后的对应点p'(x',y')为:
式中θ为测量轮廓与标准轮廓直线夹角,xx为两轮廓轨颚点的平移量,其计算方式为:
将定位的对应点坐标代入公式10和公式11后进行配准,配准结果如图33所示。
由上图可知经直线段粗配准后的测量轮廓位姿基本与标准轮廓保持一致,可通过设置高度范围内截取轨腰段轮廓。
使用双圆心坐标拟合法对轮廓进行进一步粗配准,以左侧轨腰轮廓作为匹配基准,对截取的轨腰区域使用道格拉斯-普克算法定位两圆弧端点和切点,对应图24的D点、E点和F点,根据实验结果,距离阈值设置为0.6mm,第1个采样点和第3个采样点为大圆弧端点,第3个采样点及第6个采样点为小圆弧端点,定位结果如图34所示。
为了利用两圆弧段所有的测量点获取大小圆参数,从而得到两圆的圆心坐标,本文使用非线性最小二乘法对双圆弧段测点进行拟合。待拟合圆的一般表达式为:
(xi-x0)+(yi-y0)=R2 公式12
(xi-x0)+(yi-y0)=R2 公式12
公式12中,R为标准中规定的圆弧半径。圆弧段点集为N为点集数量。待求圆心点坐标为(x0,y0),将已知的圆弧半径作为约束条件,令:
基于非线性最小二乘法的优化条件,待优化的目标函数为:
目标函数值达到最小时,此时求解得到的圆心坐标(x0,y0)为拟合的最优解,小圆弧段的圆心拟合结果如图35所示。使用该方法求取速度快,拟合结果稳定,精度较高。
根据求取测量轮廓R400圆心C400(x400,y400)和R20圆心C20(x20,y20)以及标准轮廓已知的大小圆圆心C'400(x'400,y'400)和C'20(x'20,y'20),以小圆圆心为基点,利用双圆心坐标向量计算测量轮廓到标准轮廓的刚体变换系数。取测量轮廓与标准轮廓的点对p(x,y)和p'(x',y'),其变换过程同公式10,夹角θ及平移量[txty]T计算方式为:
根据圆心拟合结果对轮廓进行配准,配准结果如图36所示。对粗配准后的钢轨轮廓使用ICP算法进一步完成精配准,并计算测量轮廓与标准轮廓误差,结果如37所示。
根据标准中的公差数据基准规定,针对不同的测量指标通过对应的标示线进行测点定位,标示线的设置方式及对应的尺寸标准如表2所示。
表2
特别地,不对称度及轨脚高度左右两侧各有一处测量位置,最终结果综合两侧结果取平均值作为测量结果,不对称度的测点定位由轨头宽和轨底宽测点共同参与计算。根据标示线对测点进行定位,并根据定位结果计算测量指标,标示定位的结果如图38所示。
通常情况下,测量轮廓上的点无法与标示线相应坐标保持严格一致,因此,本文选取距离标示线最近的5个测量点,在微小区域内,轮廓段内可微分成细小的直线段。基于以上假设,对提取的测量点坐标使用最小二乘法拟合得到直线参数,之后再根据标示线的对应坐标插值得到测点,此时得到的测点坐标与标示线的对应坐标保持一致。最终根据测点比对计算出钢轨各项测量指标,结果如表3所示。
表3
在本申请的一实施例中,提供一种钢轨断面轮廓测量系统,所述的钢轨断面轮廓测量系统包括采集设备和处理设备。
所述采集设备用于采集被测钢轨在不同拍摄角度下的图像。所述采集装置包括光源发射装置和图像采集装置。
所述处理设备与采集装置通信连接,所述处理设备用于执行如前文中任一实施例所述的钢轨断面轮廓测量方法。
在本实施例中,数据后端处理模块硬件设施主要是处理设备,光源发射装置照射在钢轨两侧激光平面与钢轨表面相交光条纹曲线共面,十字激光器安装在钢轨轨头正上方,使用十字激光器的优点主要有两个:一是十字激光在轨头处补充了光条纹数量,可利用多线结构光提取到轨颚等特征点,结合钢轨轮廓存在的几何关系对安装偏移或方向偏移的测量轮廓进行失真校正。二是轨头区域是两侧工业相机的公共视场范围内,在后续的轮廓拼接与配准算法中可补充双侧相机坐标系下的公共点云作为配准依据,可进一步提高双目配准精度,图像采集装置采集得到的数字图像传输至处理设备进行图像处理,特征提取,测点定位和指标分析计算等一系列数据处理工作,并且实现对其它模块的自动化控制。
以上所述实施例的各技术特征可以进行任意的组合,各方法步骤也并不做执行顺序的限制,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请的保护范围应以所附权利要求为准。
Claims (10)
- 一种钢轨断面轮廓测量方法,其特征在于,所述钢轨断面轮廓测量方法包括:依据张正友标定法对相机进行标定,得到相机的内参与外参矩阵;获取第一相机在一个拍摄位置下拍摄被测钢轨的图像,以及获取第二相机在一个拍摄位置下拍摄被测钢轨的图像,得到一组目标图像;在拍摄图像时,控制激光器射出至少一道单线激光至被测钢轨的表面,每一道单线激光的照射方向均与被测钢轨的表面的垂直,第一相机和第二相机分别设置于被测钢轨的两侧;同步移动第一相机的拍摄位置和第二相机的拍摄位置,获取另一组目标图像;在同步移动第一相机的拍摄位置和第二相机的拍摄位置时,第一相机的拍摄方向和每一道单线激光的照射方向之间的夹角保持不变,第二相机的拍摄方向和每一道单线激光的照射方向之间的夹角保持不变,第一相机的拍摄方向和第二相机的拍摄方向之间的夹角保持不变;反复执行所述同步移动第一相机的拍摄位置和第二相机的拍摄位置,获取另一组目标图像,直至得到N组目标图像;N为正整数且N大于1;依据光条中心提取法获取每组目标图像中每张目标图像的光条中心图像,得到与每张目标图像对应的光条中心图像;基于每张光条中心图像,获取每张光条中心图像的光条中心部分包含的每一个光条中心点的三维坐标,以形成每一张光条中心图像的光条中心点集;选取一组目标图像;定义该组目标图像中任意一个目标图像的相机坐标系为公共坐标系,将该组目标图像中另一个目标图像的光条中心点的三维坐标系转换到公共坐标系,以得到每张光条中心图像中每一个光条中心点的公共坐标;依据失真轮廓投影校正法,将每一个光条中心点的公共坐标进行校准,得到每一个光条中心点校准后的公共坐标;采用双圆心坐标与标准轮廓的双圆心位置的匹配关系进行粗匹配得到ICP算法的初值,依据ICP算法将校准后的该组目标图像中每一个光条中心点的公共坐标与标准钢轨端面轮廓精配准,基于标准规定设置形影的标示线,将提取拟合标示线与测量轮廓的交点定位测点,得到钢轨轮廓测量结果;返回所述选取一组目标图像,直至所有目标图像均被选取完毕;基于多组目标图像、每一张目标图像对应的光条中心图像、每一张光条中心图像每一个光条中心点的公共坐标、每一张光条中心图像每一个光条中心点校准后的公共坐标、标准的钢轨端面轮廓以及每一张校正后的钢轨端面轮廓与标准的钢轨端面轮廓之间的对比误差图像,构建基于钢轨端面轮廓误差检测模型。
- 根据权利要求1所述的钢轨断面轮廓测量方法,其特征在于,所述控制激光器射出至少一道单线激光至被测钢轨的表面,包括:控制设置在钢轨上方的第一激光器射出两道单线激光至被测钢轨的轨头,两道单线激光各自形成的光平面相互垂直;控制设置在钢轨一侧的第二激光器射出一道单线激光至被测钢轨;控制设置在钢轨另一侧的第三激光器射出一道单线激光至被测钢轨;所述第二激光器射出的单线激光所形成的光平面和所述第三激光器射出的单线激光所形成的光平面为共平面。
- 根据权利要求2所述的钢轨断面轮廓测量方法,其特征在于,在所述依据张正友标定法对相机进行标定之后,所述方法还包括,对光平面进行标定,所述对光平面进行标定包括:固定设置标定用激光器和相机之间的相对位置;调整棋盘格标定板的位姿,使得标定用激光器射出的单线激光所形成的光平面与棋盘格标定板相交形成光条纹直线,且同时控制光条纹直线和棋盘格标定板出现在相机的拍摄范围内;保持棋盘格标定板的位姿不变,拍摄一张无激光条纹的棋盘格图像与一张包含激光条纹的棋盘格图像,作为一个棋盘格图像对;更换棋盘格标定板的位姿,返回所述保持棋盘格标定板的位姿不变,拍摄一张无激光条纹的棋盘格图像与一张包含激光条纹的棋盘格图像,作为一个棋盘格图像对,直至得到M个棋盘格图像对;M为正整数且大于1;获取M个棋盘格图像对;每一个棋盘格图像对包括一张无激光条纹的棋盘格图像与一张包含激光条纹的棋盘格图像;提取每一个棋盘格图像对中无激光条纹的棋盘格图像;依据张正友标定法,从无激光条纹的棋盘格图像中得到相机内参矩阵、以及相对棋盘格外参矩阵;依据光条中心提取法,提取每一个棋盘格图像对中包含激光条纹的棋盘格图像的光条中心点的像素坐标;依据相对棋盘格外参矩阵,计算每一个棋盘格图像对中包含激光条纹的棋盘格图像的光条中心点在世界坐标系下的三维坐标;依据每一个棋盘格图像对中包含激光条纹的棋盘格图像的光条中心点的像素坐标、一个棋盘格图像对中包含激光条纹的棋盘格图像的光条中心点在世界坐标系下的三维坐标,得到每一个棋盘格图像对中包含激光条纹的棋盘格图像的光条中心点在相机坐标系下的三维坐标;对得到的所有棋盘格图像对中包含有激光条纹图像的光条中心点在相机坐标系下进行拟合得到光平面标定方程。
- 根据权利要求3所述的钢轨断面轮廓测量方法,其特征在于,所述依据光条中心提取法获取每组目标图像中每张目标图像的光条中心图像,得到与每张目标图像对应的光条中心图像,包括:选取一张目标图像;依据ROI算法提取该目标图像的精准光条区域图像;基于该目标图像的精准光条区域图像,利用Hessian算法得到该目标图像的所有光条中心点在像素坐标系下的像素坐标;基于标定参数投影第一激光器射出两道单线激光形成的光平面的交线,得到第一光平面投影线,以及基于标定参数投影第二激光器射出的单线激光形成的光平面与第一激光器射出一道单线激光形成的光平面的交线,得到第二光平面投影线;提取所有光条中心点、第一光平面投影线和第二光平面投影线之间的交点,作为光条交叉点;所述光条交叉点的数量为2;基于两个光条交叉点的像素坐标,得到一条过两个光条交叉点直线的直线方程和该直线的中点的像素坐标;计算每一个光条中心点与过两个光条交叉点的直线之间的直线距离,将直线距离小于直线距离阈值的光条中心点删除,得到去噪后的光条中心点;计算每相邻两个去噪后的光条中心点的直线距离,作为相邻直线距离,将相邻直线距离大于相邻直线距离阈值的噪后的光条中心删除,以去除噪音段;依据Spline样条插值补全法将噪音段补全,得到补全后的光条中心点的像素坐标点集并将补全后的光条中心点的坐标点集和该目标图像相对应地存储;返回所述选取一张目标图像,直至所有目标图像均被选取一次。
- 根据权利要求4所述的钢轨断面轮廓测量方法,其特征在于,在所述依据张正友标定法对相机进行标定,得到相机坐标系之后,还包括:固定设置第一激光器和相机之间的相对位置;调整棋盘格标定板的位姿,使得第一激光器射出的两道单线激光所形成的两个相交的光平面落在棋盘格标定板上,与棋盘格标定板相交形成十字光条,且同时控制十字光条和棋盘格标定板出现在相机的拍摄范围内;保持棋盘格标定板的位姿不变,拍摄一张无十字光条的棋盘格图像与一张包含十字光条的棋盘格图像,作为一个十字光条棋盘格图像对;更换棋盘格标定板的位姿,返回所述保持棋盘格标定板的位姿不变,拍摄一张无十字光条的棋盘格图像与一张包含十字光条的棋盘格图像,作为一个十字光条棋盘格图像对,直至得到K个棋盘格图像对;K为正整数且大于1;选取一张包含十字光条的棋盘格图像;执行Hessian算法提取该包含十字光条的棋盘格图像中所有十字光条中心点在像素坐标系下的像素坐标;利用RANSAC算法筛选与第一最佳匹配直线匹配的十字光条中心点,作为第一类十字光条中心点;利用RANSAC算法筛选除第一十字光条中心点之外剩余的十字光条中心点中与第二最佳匹配直线匹配的十字光条中心点,作为第二类十字光条中心点;计算第一最佳匹配直线和第二最佳匹配直线的交点,去除与交点直线距离大于第一预设距离的第一类十字光条中心点,以及去除与交点直线距离大于第二预设距离的第二类十字光条中心点;返回所述选取一张包含十字光条的棋盘格图像,直至包含十字光条的棋盘格图像均被选取一次,得到每一张包含十字光条的棋盘格图像的第一类十字光条中心点和第二类十字光条中心点;依据每一张包含十字光条的棋盘格图像的第一类十字光条中心点和第二类十字光条中心点,对光平面标定方程进行修正。
- 根据权利要求5所述的钢轨断面轮廓测量方法,其特征在于,所述定义该组目标图像中任意一个目标图像的相机坐标系为公共坐标系,将该组目标图像中另一个目标图像的光条中心点的三维坐标系转换到公共坐标系,以得到每张光条中心图像中每一个光条中心点的公共坐标,包括:选取一组目标图像;定义该组目标图像中任意一个目标图像的相机坐标系为公共坐标系;获取一个目标图像在公共坐标系中的两个光条交叉点的公共坐标,另一个目标图像在公共坐标系中的两个光条交叉点的公共坐标;基于一个目标图像在公共坐标系中的两个光条交叉点的公共坐标得到一个公共向量,基于另一个目标图像在公共坐标系中的两个光条交叉点的公共坐标得到另一个公共向量;利用两个公共向量,将该组目标图像中两个目标图像的光条中心点的三维坐标系转换到公共坐标系,以得到每张光条中心图像中每一个光条中心点的公共坐标;返回所述选取一组目标图像,直至每一组目标图像均被选取一次。
- 根据权利要求6所述的钢轨断面轮廓测量方法,其特征在于,所述依据失真轮廓投影校正法,将每一个光条中心点的公共坐标进行校准,得到每一个光条中心点校准后的公共坐标,包括:选取一组目标图像;将该组目标图像中每一个光条中心点的公共坐标向第二激光器射出的单线激光所形成的光平面投影,得到该组目标图像中每一个光条中心点的二维坐标;依据道格拉斯-普克算法对该组目标图像中每一个光条中心点进行二维特征点定位,以得到对称面;获取对称面与该组目标图像中每一个光条中心点的交点,以得到两个交点,求取两个交点的坐标;将两个交点连接,得到钢轨纵向向量;基于钢轨纵向向量,构建与钢轨断面平行的辅助平面;将该组目标图像中每一个光条中心点向辅助平面投影,得到校准后的该组目标图像中每一个光条中心点的公共坐标;输出校准后的该组目标图像中每一个光条中心点的公共坐标,并将校准后的该组目标图像中每一个光条中心点的公共坐标与该组目标图像相对应地存储;返回所述选取一组目标图像,直至每一组目标图像均被选取一次。
- 根据权利要求7所述的钢轨断面轮廓测量方法,其特征在于,所述依据道格拉斯-普克算法对该组目标图像中每一个光条中心点进行二维特征点定位,以得到对称面,包括:依据道格拉斯-普克算法对该组目标图像中每一个光条中心点进行二维特征点定位,得到三对特征点;三对特征点分别为双侧单线激光在钢轨各自一侧轨头轮廓上的BL1点和BR1点、十字激光分别在钢轨左右侧轨头轮廓上的BL2点和BR2点以及单线激光分别在左右侧的轨颚点CL1点和CR1点;计算BL1点和BR1点的中点坐标BM1,计算BL2点和BR2点的中点坐标BM2,计算CL1点和CR点的中点坐标CM1;基于中点坐标BM1、中点坐标BM2和中点坐标CM1,拟合得到对称面。
- 根据权利要求8所述的钢轨断面轮廓测量方法,其特征在于,所述采用双圆心坐标与标准轮廓的双圆心位置的匹配关系进行粗匹配得到ICP算法的初值,依据ICP算法将校准后的该组目标图像中每一个光条中心点的公共坐标与标准钢轨端面轮廓精配准,基于标准规定设置形影的标示线,将提取拟合标示线与测量轮廓的交点定位测点,计算得到钢轨轮廓测量指标,包括:选取一组目标图像;获取该组目标图像的校准后的该组目标图像中每一个光条中心点的公共坐标中轨头侧面轮廓斜率1:20直线特征点;利用直线的端点坐标与标准轮廓直线的端点坐标变换,以轨头一侧轮廓直线段为匹配基准,轨颚点为基点进行粗配准,得到轨头粗配准后的结果;获取轨头粗配准后的一侧轨腰,依据道格拉斯-普克算法对标准轮廓的一侧轨腰的两段圆弧端点和切点进行定位,以得到大圆弧对应的大圆心坐标与小圆弧对应的小圆心坐标;获取标准轮廓的一侧轨腰上的大圆弧对应的大圆心坐标与小圆弧对应的小圆心坐标,定义其中一个圆心坐标为基点,利用大圆心坐标与小圆心坐标向量计算轨头粗配准后的轮廓到标准轮廓的刚体变换系数,对腰轨进行拟合,得到双圆心坐标拟合配准结果;依据ICP算法对双圆心坐标拟合配准结果进行精配准,得到双圆心坐标拟合配准结果与标准轮廓的精配准结果;基于得到的双圆心坐标拟合配准结果与标准轮廓的精配准结果,建立标示线,得到带有标示线的双圆心坐标拟合配准结果与标准轮廓的精配准结果;提取距离标示线最近的5个测量点坐标,依据最小二乘法对提取的每一个测量点坐标拟合,得到每一个标示线的直线方程;基于每一个标示线的直线方程,得到每一个测点坐标,将得到的每一个测点坐标与标准轮廓尺寸标准对比,得到每一个测点的检测结果,并相应的存储;返回所述选取一组目标图像,直至每一组目标图像均被选取过一次。
- 一种钢轨断面轮廓测量系统,其特征在于,所述的钢轨断面轮廓测量系统包括:采集设备,用于采集被测钢轨在不同拍摄角度下的图像;所述采集设备包括光源发射装置和图像采集装置;处理设备,与采集设备通信连接,所述处理设备用于执行如权利要求1至9中任意一项权利要求所述的钢轨断面轮廓测量方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202311748070.0A CN117990001A (zh) | 2023-12-18 | 2023-12-18 | 钢轨断面轮廓测量方法及系统 |
| CN202311748070.0 | 2023-12-18 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2025129443A1 true WO2025129443A1 (zh) | 2025-06-26 |
Family
ID=90895345
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/139807 Pending WO2025129443A1 (zh) | 2023-12-18 | 2023-12-19 | 钢轨断面轮廓测量方法及系统 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN117990001A (zh) |
| WO (1) | WO2025129443A1 (zh) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120894434A (zh) * | 2025-07-22 | 2025-11-04 | 北京建筑大学 | 空间激光束直线外推的相机阵列外参初值精准检校方法 |
| CN120947528A (zh) * | 2025-10-16 | 2025-11-14 | 三代光学科技(天津)有限公司 | 轴类件测量方法、装置、介质和设备 |
| CN121310950A (zh) * | 2025-12-12 | 2026-01-09 | 成都理工大学工程技术学院 | 一种晶圆预对准装置及预对准方法 |
| CN121576944A (zh) * | 2025-11-24 | 2026-02-27 | 浙江大学 | 一种基于十字激光基准与无人机的结构变形测量方法 |
| CN121904172A (zh) * | 2026-03-24 | 2026-04-21 | 杭州汇萃智能科技有限公司 | 基于动态拟合与局部优化的机器视觉圆圆交点测量方法 |
| CN122062563A (zh) * | 2026-04-15 | 2026-05-19 | 重庆成田科技有限公司 | 一种基于图像视觉的笔记本外壳注塑件尺寸监测方法及系统 |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119063629B (zh) * | 2024-11-05 | 2025-02-11 | 阿普塔恒煜(威海)医疗器材有限公司 | 一种橡胶模具尺寸参数测量方法及系统 |
| CN119941623B (zh) * | 2024-12-05 | 2025-10-28 | 中国铁建重工集团股份有限公司 | 全断面廓形配准的钢轨磨耗检测方法、装置、电子设备及存储介质 |
Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104677305A (zh) * | 2015-02-11 | 2015-06-03 | 浙江理工大学 | 一种基于十字结构光的物体表面三维重建方法和系统 |
| WO2018046948A1 (en) * | 2016-09-09 | 2018-03-15 | The University Of Warwick | Three-dimensional shape error detection |
| CN109017867A (zh) * | 2018-08-01 | 2018-12-18 | 湖南大学 | 钢轨波磨动态测量方法 |
| CN109798844A (zh) * | 2018-12-28 | 2019-05-24 | 北京交通大学 | 一种钢轨磨耗动态测量中的轨廓自动配准方法 |
| CN110615016A (zh) * | 2019-10-11 | 2019-12-27 | 中国铁道科学研究院集团有限公司 | 钢轨廓形及磨耗检测系统的标定方法及检定方法 |
| CN112414318A (zh) * | 2020-11-10 | 2021-02-26 | 杭州申昊科技股份有限公司 | 基于结构光钢轨磨耗快速测量算法 |
| CN112614191A (zh) * | 2020-12-16 | 2021-04-06 | 江苏智库智能科技有限公司 | 基于双目深度相机的装卸位置检测方法、装置和系统 |
| CN116091531A (zh) * | 2023-02-23 | 2023-05-09 | 天津理工大学 | 一种用于提取线结构光光条中心线的方法及其应用 |
-
2023
- 2023-12-18 CN CN202311748070.0A patent/CN117990001A/zh active Pending
- 2023-12-19 WO PCT/CN2023/139807 patent/WO2025129443A1/zh active Pending
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104677305A (zh) * | 2015-02-11 | 2015-06-03 | 浙江理工大学 | 一种基于十字结构光的物体表面三维重建方法和系统 |
| WO2018046948A1 (en) * | 2016-09-09 | 2018-03-15 | The University Of Warwick | Three-dimensional shape error detection |
| CN109017867A (zh) * | 2018-08-01 | 2018-12-18 | 湖南大学 | 钢轨波磨动态测量方法 |
| CN109798844A (zh) * | 2018-12-28 | 2019-05-24 | 北京交通大学 | 一种钢轨磨耗动态测量中的轨廓自动配准方法 |
| CN110615016A (zh) * | 2019-10-11 | 2019-12-27 | 中国铁道科学研究院集团有限公司 | 钢轨廓形及磨耗检测系统的标定方法及检定方法 |
| CN112414318A (zh) * | 2020-11-10 | 2021-02-26 | 杭州申昊科技股份有限公司 | 基于结构光钢轨磨耗快速测量算法 |
| CN112614191A (zh) * | 2020-12-16 | 2021-04-06 | 江苏智库智能科技有限公司 | 基于双目深度相机的装卸位置检测方法、装置和系统 |
| CN116091531A (zh) * | 2023-02-23 | 2023-05-09 | 天津理工大学 | 一种用于提取线结构光光条中心线的方法及其应用 |
Non-Patent Citations (1)
| Title |
|---|
| 张晓宇 (ZHANG, XIAOYU): "基于激光三维扫描的路面表观三维重构与构造深度指标提取 (Non-official translation: 3D Reconstruction of Road Surface and Extraction of Structural Depth Index Based on 3D Laser Scanning)", 中国优秀硕士学位论文全文数据库工程科技Ⅱ辑 (CHINA MASTER'S THESES FULL-TEXT DATABASE, ENGINEERING SCIENCE & TECHNOLOGY II), vol. 009564317, no. 6, 15 June 2022 (2022-06-15), pages 1 - 76, XP009564317, ISSN: 1674-0246 * |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120894434A (zh) * | 2025-07-22 | 2025-11-04 | 北京建筑大学 | 空间激光束直线外推的相机阵列外参初值精准检校方法 |
| CN120947528A (zh) * | 2025-10-16 | 2025-11-14 | 三代光学科技(天津)有限公司 | 轴类件测量方法、装置、介质和设备 |
| CN121576944A (zh) * | 2025-11-24 | 2026-02-27 | 浙江大学 | 一种基于十字激光基准与无人机的结构变形测量方法 |
| CN121310950A (zh) * | 2025-12-12 | 2026-01-09 | 成都理工大学工程技术学院 | 一种晶圆预对准装置及预对准方法 |
| CN121904172A (zh) * | 2026-03-24 | 2026-04-21 | 杭州汇萃智能科技有限公司 | 基于动态拟合与局部优化的机器视觉圆圆交点测量方法 |
| CN122062563A (zh) * | 2026-04-15 | 2026-05-19 | 重庆成田科技有限公司 | 一种基于图像视觉的笔记本外壳注塑件尺寸监测方法及系统 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN117990001A (zh) | 2024-05-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN117990001A (zh) | 钢轨断面轮廓测量方法及系统 | |
| US11551341B2 (en) | Method and device for automatically drawing structural cracks and precisely measuring widths thereof | |
| CN103411553B (zh) | 多线结构光视觉传感器的快速标定方法 | |
| CN107876970B (zh) | 一种机器人多层多道焊接焊缝三维检测及焊缝拐点识别方法 | |
| CN110230998B (zh) | 基于线激光和双目相机的快速精密三维测量方法和装置 | |
| CN104484648B (zh) | 基于轮廓识别的机器人可变视角障碍物检测方法 | |
| CN101526336B (zh) | 基于量块的线结构光三维视觉传感器标定方法 | |
| CN104266608B (zh) | 视觉传感器现场标定装置和标定方法 | |
| CN105839505B (zh) | 一种三维可视化的路面破损信息的检测方法及检测装置 | |
| KR20160121509A (ko) | 2개의 카메라로부터의 곡선의 세트의 구조형 광 매칭 | |
| CN115731301B (zh) | 一种多线结构光双目视觉立体匹配方法和系统 | |
| CN114413790A (zh) | 固连摄影测量相机的大视场三维扫描装置及方法 | |
| CN105574812A (zh) | 多角度三维数据配准方法及装置 | |
| CN117419663A (zh) | 钢轨几何外形检测系统 | |
| CN113074660A (zh) | 一种大尺寸透明物体的面型测量方法 | |
| CN113155057A (zh) | 一种使用非特制靶标的线结构光平面标定方法 | |
| CN121594792A (zh) | 一种超密度条纹结构光三维面扫描方法及系统 | |
| CN205711654U (zh) | 一种三维可视化的路面破损信息的检测装置 | |
| CN112116665A (zh) | 一种结构光传感器标定方法 | |
| CN121747065A (zh) | 基于多传感器融合的公路检测车路面病害检测方法及系统 | |
| CN121499540B (zh) | 铁路隧道裂缝监测方法及系统 | |
| CN117433447A (zh) | 钢轨扣件三维几何检测系统 | |
| CN115575407B (zh) | 一种应用于轨道与隧道的检测方法 | |
| CN114612412B (zh) | 三维点云数据的处理方法及其用途、电子设备、存储介质 | |
| CN112902878B (zh) | 轨道几何检测系统激光平面调整方法及装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23961788 Country of ref document: EP Kind code of ref document: A1 |