Non-contact detection device and method for precision of guide rail of milling and boring machine

By using a non-contact inspection device independent of the milling and boring machine and employing image acquisition and processing technology, the problems of easy damage in contact measurement and insufficient accuracy in non-contact measurement are solved, thus achieving efficient, non-destructive, and accurate straightness inspection of guide rails.

CN123175185APending Publication Date: 2026-11-27GENERAL TECH GRP MASCH TOOL ENG RES INST CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611322936.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-28
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing contact measurement methods for milling and boring machine guideways are prone to damaging the workpiece surface and are inefficient. Non-contact measurement methods lack sufficient accuracy and stability on large milling and boring machines, making it difficult to obtain two-dimensional information about the guideways.

Method used

Design a non-contact inspection device independent of milling and boring machines, including an inspection frame, an image acquisition module and control components. The device calculates the straightness error of the guide rail through image processing and replaces traditional contact measurement with image displacement measurement under an independent reference.

Benefits of technology

It enables non-destructive testing of the guide rail surface, provides rich two-dimensional image information, improves the traceability and accuracy of measurement, eliminates human error, and has the ability to solve straightness error with high efficiency and high accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123175185A_ABST
    Figure CN123175185A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of detection devices, and provides a non-contact detection device and a detection method for the precision of a guide rail of a milling and boring machine. The detection frame body of the detection device is independently installed on the side of the milling and boring machine. The horizontal movement assembly of the detection frame body is arranged on the base, and is suitable for linear reciprocating movement in the horizontal direction. The vertical movement assembly is arranged on the horizontal movement assembly and is arranged in mutual orthogonality with the horizontal movement assembly, and is suitable for linear reciprocating movement in the vertical direction. The movement sliding table is installed on the vertical movement assembly. The image acquisition module is arranged on the movement sliding table and is used for acquiring image information of the guide rail. The position detection unit is used for detecting the position of the movement sliding table. The control assembly is electrically connected with the horizontal movement assembly, the vertical movement assembly, the image acquisition module and the position detection unit. The image displacement measurement under the independent reference is used to replace the traditional contact type relative measurement which depends on the reference of the machine tool itself, and the measurement accuracy is higher.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of testing equipment technology, and in particular to a non-contact testing device and method for the accuracy of milling machine guideways. Background Technology

[0002] Milling and boring machines are key basic equipment in the equipment manufacturing industry, and the straightness of the guideways of each motion axis is one of the core geometric indicators for ensuring the machining accuracy of the machine tool. If the straightness of the guideways exceeds the tolerance, it will directly disrupt the relative motion accuracy benchmark between the tool and the workpiece, causing a series of machining quality problems, such as exceeding the tolerance for bore coaxiality and milling flatness, and deterioration of the machined surface roughness. Simultaneously, straightness deviations can also cause localized contact stress concentration on the guideways, leading to abnormal wear, low-speed crawling, and drive system overload, thereby accelerating the degradation of equipment accuracy. Therefore, efficient and accurate periodic inspection of the straightness of the milling and boring machine guideways is a crucial step in ensuring the machine tool's service accuracy and extending its service life.

[0003] Currently, the contact measurement method is the most widely used and traditional technique for measuring the straightness of linear guideways in machine tools. Typical methods include using a dial indicator with a standard straightedge or gauge blocks for segmented dial measurement, using a coordinate measuring machine for offline sampling, and employing various specialized contact straightness measuring instruments. The common characteristic of these methods is that the measuring head (such as the dial indicator tip or ball) maintains direct physical contact with the guideway surface, relying on mechanical transmission to record displacement changes at different positions, and then calculating the straightness error of the guideway through data processing. However, contact measurement methods have several inherent defects determined by their measurement principle itself: First, the direct contact and relative sliding between the measuring head and the surface being measured can easily scratch the surface of the precision guide rail, causing irreversible damage, if the operation is improper or if there are hard particles on the guide rail surface; Second, the measurement process usually relies on manual point-by-point operation and reading. For large milling and boring machine guide rails with a stroke of several meters or even tens of meters, the number of detection points is large. Manual measurement is not only time-consuming, labor-intensive, and inefficient, but it is also difficult to avoid human reading errors and recording errors introduced by the operator; Third, factors such as the installation of the measuring reference (such as a straightedge) and its own accuracy maintenance, as well as thermal expansion caused by changes in ambient temperature, can all affect the final measurement accuracy.

[0004] To overcome the problems of damage to workpiece surfaces and low measurement efficiency associated with contact measurements, non-contact measurement technologies have emerged. The most representative of these is the laser displacement sensor measurement scheme based on the principle of optical triangulation. This method uses a laser beam projected onto the surface of the guide rail being measured. By receiving the reflected light and observing the changes in the image position on a position-sensitive detector or photodiode array, the displacement of the surface relative to the sensor is calculated, thus achieving non-contact measurement. While these methods solve the surface scratch problem, they still face a series of technical challenges when dealing with the high-precision inspection requirements of large milling and boring machine guideways: First, laser measurement is extremely sensitive to industrial environmental factors. Air disturbances, stray light, and changes in the material and roughness of the measured surface can all cause laser speckle effects or light intensity fluctuations, leading to a decrease in measurement accuracy and stability. Second, measurements are usually performed at single points or limited points. To cover the entire stroke, additional precision linear motion references are still needed as a support platform, making system setup and calibration cumbersome and complex. Third, for the evaluation of guideway straightness, these methods often only provide one-dimensional displacement data, making it difficult to intuitively and comprehensively obtain two-dimensional information containing the complete geometric shape of the guideway edge, which is not conducive to subsequent error tracing and accuracy diagnosis. Summary of the Invention

[0005] This invention provides a non-contact detection device and method for milling and boring machine guideway accuracy, which solves the defects in the prior art. The detection device is completely separated from the milling and boring machine bed and has its own independent detection platform with high-precision orthogonal reference. An image acquisition module is mounted on this platform. The image displacement measurement under the independent reference replaces the traditional contact-type relative measurement that relies on the machine tool's own reference, thereby calculating the straightness error of the guideway.

[0006] A first aspect of the present invention provides a non-contact testing device for the accuracy of milling and boring machine guideways, comprising: A testing frame, independently installed beside the milling and boring machine, comprising: Base; A horizontal moving component is disposed on the base, and the horizontal moving component is adapted to perform linear reciprocating motion in the horizontal direction; A vertical moving component is disposed on the horizontal moving component and arranged orthogonally to the horizontal moving component. The vertical moving component is adapted to perform linear reciprocating motion along the vertical direction. A motion slide is mounted on the vertical moving assembly; An image acquisition module, mounted on the motion slide, is used to acquire image information of the guide rail; The position detection unit is used to detect the position of the moving slide. The control component is electrically connected to the horizontal movement component, the vertical movement component, the image acquisition module, and the position detection unit, respectively. It is used to control the movement of the motion slide according to the preset sampling position and the position signal fed back by the position detection unit, and to trigger the image acquisition module to acquire image information when the preset sampling position is reached. It is also used to receive the image information acquired by the image acquisition module, extract the guide rail edge features based on image processing, and calculate the straightness error of the guide rail.

[0007] According to the non-contact detection device for milling and boring machine guideway accuracy provided by the present invention, the control component includes: The motion control module is electrically connected to the horizontal movement component, the vertical movement component, and the position detection unit, and is used to control the movement of the motion slide according to the preset sampling position and the position signal fed back by the position detection unit, so as to drive the image acquisition module to move. The image processing module is communicatively connected to the image acquisition module and the motion control module. It is used to receive the image sequence acquired by the image acquisition module and extract the edge features of the guide rail based on image processing to calculate the straightness error of the guide rail.

[0008] The non-contact testing device for milling and boring machine guideway accuracy provided by the present invention further includes: A leveling mechanism is provided at the bottom of the base for adjusting the horizontal level of the horizontal moving component and the vertical level of the vertical moving component.

[0009] According to the non-contact detection device for milling and boring machine guide rail accuracy provided by the present invention, the leveling mechanism includes a plurality of lockable leveling feet, each of which is equipped with a threaded adjustment mechanism.

[0010] According to the non-contact detection device for milling and boring machine guideway accuracy provided by the present invention, the image acquisition module includes: An industrial camera, mounted on the moving slide, is used to acquire image information of the guide rail; An auxiliary light source is symmetrically mounted on both sides of the industrial camera along the length of the guide rail, and is used to illuminate the surface of the guide rail at a predetermined angle.

[0011] A second aspect of the present invention provides a non-contact method for detecting the accuracy of milling machine guideways, employing any one of the non-contact detection devices for milling machine guideway accuracy described in any one of the claims, comprising the following steps: The internal parameters of the image acquisition module are calibrated to establish a mapping relationship between image pixel coordinates and world coordinates; and a detection reference coordinate system is established with the intersection of the horizontal movement component and the vertical movement component as the origin. The motion slide is controlled to drive the image acquisition module to move stepwise in the horizontal or vertical direction: when the position detection unit detects that the motion slide has reached the preset sampling position, it triggers the image acquisition module to acquire the guide rail image, and at the same time records the displacement of the motion slide corresponding to each sampling position to obtain an image sequence; Based on the image sequence, combined with the industrial camera calibration parameters and the displacement corresponding to each sampling position, a set of points representing the actual spatial position of the guide rail under the detection reference coordinate system is obtained; The least squares method is used to fit a straight line to the point set to obtain a reference straight line. The deviation of each point in the point set relative to the reference straight line is calculated, and the difference between the maximum and minimum deviations among the deviations of each point is taken as the straightness error of the guide rail.

[0012] According to the non-contact detection method for milling and boring machine guideway accuracy provided by the present invention, the step of calibrating the internal parameters of the image acquisition module, establishing the mapping relationship between image pixel coordinates and world coordinates, and establishing a detection reference coordinate system with the intersection of the horizontal movement component and the vertical movement component as the origin specifically includes: Fix the checkerboard calibration plate in a stable position next to the guide rail to be tested, ensuring that the plane of the calibration plate is perpendicular to the optical axis of the camera. Control the camera to move to the calibration position, maintaining the same focal length, object distance and lighting environment as when acquiring the guide rail image. First, acquire one checkerboard image A; then, change the orientation of the calibration plate within this field of view and acquire 9 calibration plate images with different orientations for camera intrinsic parameter calibration. After obtaining the calibration parameters, the checkerboard image A is corrected using the calibration parameters. Then, the subpixelated corner coordinates are extracted to obtain the pixel distance between adjacent corners. Finally, the pixel equivalent is calculated based on the proportional relationship. Using the intersection of the horizontal and vertical moving components as the origin, the moving direction of the horizontal moving component as the positive X-axis, and the moving direction of the vertical moving component as the positive Y-axis, a detection reference coordinate system is established. Based on the known size features on the calibration plate, the conversion relationship between image pixel coordinates and world coordinates is established.

[0013] According to the non-contact detection method for milling and boring machine guideway accuracy provided by the present invention, the step of recording the displacement of the moving slide corresponding to each sampling position to obtain an image sequence specifically includes: Images acquired at adjacent preset sampling positions have a 20% to 30% overlap area; Furthermore, at each preset sampling position, the image acquisition module is triggered to acquire at least three images, record the displacement of the moving slide corresponding to each acquisition, and take the average value of these position readings for subsequent data processing at that position.

[0014] According to the non-contact detection method for milling and boring machine guide rail accuracy provided by the present invention, obtaining the point set characterizing the actual spatial position of the guide rail specifically includes: The images acquired at each sampling location are preprocessed and subpixel edge detected to extract the subpixel coordinate points of the guide rail edge; By using the calibration parameters of the industrial camera and the displacement corresponding to each sampling position, the sub-pixel coordinate points are transformed to the detection reference coordinate system.

[0015] According to the non-contact detection method for milling and boring machine guide rail accuracy provided by the present invention, obtaining the point set characterizing the actual spatial position of the guide rail specifically includes: Feature matching and image stitching are performed on adjacent images with overlapping areas to obtain a complete and continuous panoramic image of the guide rail; Subpixel edge detection is performed on the panoramic image to extract edge features on both sides of the guide rail in the horizontal and vertical image sequences, respectively. The extracted straight line features of the guide rail edge are transformed into the detection reference coordinate system to form the point set.

[0016] The non-contact detection device for milling and boring machine guide rails provided by this invention is completely separated from the milling and boring machine bed and has its own independent detection platform with a high-precision orthogonal reference. An image acquisition module is mounted on this platform. By measuring the image displacement under the independent reference, the traditional contact-type relative measurement that relies on the machine tool's own reference is replaced, thereby calculating the straightness error of the guide rail.

[0017] Specifically, by independently mounting the testing frame beside the milling and boring machine, the interference of machine tool deformation, vibration, and motion errors on the measurement benchmark is eliminated. This ensures that the measurement results accurately reflect the absolute straightness of the guide rail relative to the ground benchmark, improving the traceability and confidence of the measurement. The motion slide is the execution unit for the testing motion, enabling high-precision calibration of the image acquisition position. This provides a physical scale for subsequently converting local image coordinates into unified spatial coordinates across the entire guide rail, overcoming the cumulative errors that may result from simply relying on image stitching.

[0018] The image acquisition module achieves non-destructive testing of the guide rail surface by capturing high-contrast images of the guide rail edges. It also provides rich two-dimensional image information for precision measurement, enabling sub-pixel-level high-resolution edge location identification, and the entire testing process is traceable. A position detection unit achieves closed-loop positioning, ensuring that the physical position of each sampling point corresponds to the acquired image, avoiding image blurring and positional deviations caused by motion overshoot or oscillations, and ensuring high fidelity of the measurement data.

[0019] The control component controls the movement of the sliding table based on the preset sampling position and the position signal fed back by the position detection unit. Upon reaching the preset sampling position, it triggers the image acquisition module to acquire image information. All acquired images are then processed uniformly to calculate and output the straightness error of the guide rail. By replacing manual reading and calculation with digital algorithms, fully automated and highly efficient calculation of straightness error from the original image is achieved, eliminating human error and enabling high-precision evaluation of massive point cloud data.

[0020] The non-contact detection method for milling machine guideway accuracy provided by the present invention has all the above advantages because it includes the aforementioned non-contact detection device for milling machine guideway accuracy. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0022] Figure 1 This is a schematic diagram of the non-contact detection device for milling machine guide rail accuracy provided by the present invention.

[0023] Figure 2 This is a schematic diagram of the installation scenario of the guide rail to be tested in the non-contact detection device for milling machine guide rail accuracy provided by the present invention.

[0024] Figure 3 This is a flowchart illustrating the non-contact detection method for milling machine guideway accuracy provided by the present invention.

[0025] Figure 4 This is a schematic diagram of image feature extraction for the non-contact detection method for milling machine guide rail accuracy provided by the present invention.

[0026] Figure 5 This is a least squares calculation error diagram of the non-contact detection method for milling machine guideway accuracy provided by the present invention.

[0027] Figure label: 1. Vertical moving component; 2. Vertical guide rail; 3. Moving slide; 4. Horizontal moving component; 5. Connecting seat; 6. Horizontal guide rail; 7. Leveling support; 8. Base; 9. Column; 10. Column guide rail; 11. Spindle box; 12. Slide guide rail; 13. Slide; 14. Boring spindle. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0029] See Figure 1 and Figure 2 This invention provides a non-contact testing device for the accuracy of milling machine guideways, which includes a testing frame, an image acquisition module, a position detection unit, and a control component.

[0030] The testing frame is independently mounted beside the milling and boring machine, rather than on moving parts of the machine tool such as the spindle box 11 or the worktable. This isolates the measurement results from the influence of the machine tool's own motion errors. In other words, vibrations and stress deformations generated during milling and boring machine processing or movement will not be transmitted to the testing frame, ensuring the absolute stability of the measurement reference. Traditional methods (such as attaching the gauge base to the spindle box 11) result in measurement results that combine guideway straightness errors and the machine tool's own motion errors. This embodiment of the invention moves the measurement reference externally, achieving the separation of error sources, and measuring only the true spatial position of the guideway relative to the absolute horizontal or vertical plane.

[0031] The testing frame includes a base 8, a horizontal moving assembly 4, a vertical moving assembly 1, and a sliding table 3. The horizontal moving assembly 4 includes a drive motor, a horizontal guide rail 6, and a connecting seat 5 that slides with the horizontal guide rail 6. The drive motor drives a lead screw, and the connecting seat 5 is threadedly engaged with the lead screw. The vertical moving assembly 1 includes a drive motor and a vertical guide rail 2. The sliding table 3 slides with the vertical guide rail 2, and the drive motor drives a lead screw, with the vertical guide rail 2 threadedly engaged with the lead screw.

[0032] The base 8 serves as the stable foundation of the entire device, and the horizontally moving component 4 and the vertically moving component 1, arranged orthogonally to each other, constitute a two-dimensional rectangular coordinate motion system. The horizontally moving component 4 is mounted on the base 8 and can perform linear reciprocating motion along the horizontal direction (set as the X-axis); the vertically moving component 1 is mounted on the horizontally moving component 4 and moves horizontally along with it, while it can also perform linear reciprocating motion along the vertical direction (set as the Y-axis).

[0033] The motion slide 3, mounted on the vertical moving assembly 1, serves as the final support and motion output end, used to fix the image acquisition module. The motion slide 3 is the motion detection execution unit, driven by the horizontal moving assembly 4 and the vertical moving assembly 1, to move independently in both horizontal and vertical directions. Because the horizontal and vertical driving and guiding are independent and orthogonal, the industrial camera can reach any preset sampling grid point in a Cartesian coordinate system by scanning frame by frame.

[0034] Each time the motion slide 3 moves to a position, its physical coordinates (X, Y) relative to the origin of the detection frame (the intersection of the horizontal movement component 4 and the vertical movement component 1) are known. These known coordinates serve as the scale for subsequently stitching the sequence images into a complete world coordinate system.

[0035] The image acquisition module is fixed on the motion slide 3 and moves synchronously with it. The core component of the image acquisition module is an industrial camera. The industrial camera does not contact the surface of the guide rail being measured, eliminating the risk of scratches and damage to the microstructure. The industrial camera captures high-contrast images of the guide rail edge; for example, a clear light-dark boundary can be formed by lighting. The distance between this point on the guide rail and the measurement reference is recorded as the pixel position of the guide rail edge at that point in the image.

[0036] The position detection unit is a feedback element for sampling, used to detect the actual position of the moving slide 3 in real time, ensuring that the moving slide 3 stops accurately at the preset sampling position.

[0037] The control component is electrically connected to the aforementioned horizontal movement component 4, vertical movement component 1, image acquisition module, and position detection unit. It is used to control the horizontal movement component 4 and vertical movement component 1 to drive the motion slide 3 to move according to the preset sampling position coordinates and the position signal fed back in real time by the position detection unit, so as to form a closed-loop positioning control.

[0038] When the motion slide 3 is determined to have accurately reached the preset sampling position, the image acquisition module is immediately triggered to capture an image. For example, when the actual position enters a window of ±2 μm from the target position, the motion controller sends a trigger pulse to the camera via a hardware trigger signal line. After a delay of 100 μs, the industrial camera completes image acquisition. The control component is also used to receive the acquired guide rail image sequence, run the built-in image processing algorithm, extract the edge feature information of the guide rail from the image, and finally calculate the straightness error of the guide rail.

[0039] During testing, the device is first placed independently beside the guide rail of the milling and boring machine to be tested, and leveling and centering are completed. The control component, according to the sampling path set in the program (e.g., multiple points along the length of the guide rail), issues commands to drive the horizontal moving component 4 and the vertical moving component 1 to move the motion slide 3 (carrying the image acquisition module) to the first sampling position. The position detection unit provides real-time position feedback, and the control component performs closed-loop adjustment to ensure accurate positioning. After positioning, the control component triggers the image acquisition module to take a picture. Then, the motion slide 3 steps to the next sampling position, repeating the acquisition trigger until the image sequence of the entire guide rail is acquired. Finally, the control component processes all acquired images uniformly, calculates and outputs the straightness error of the guide rail.

[0040] It is understood that the non-contact detection device for milling and boring machine guide rail accuracy provided by the present invention constructs an independent detection platform that is completely separated from the milling and boring machine bed and has its own high-precision orthogonal reference. An image acquisition module is mounted on this platform. The image displacement measurement under the independent reference replaces the traditional contact-type relative measurement that relies on the machine tool's own reference, thereby calculating the straightness error of the guide rail.

[0041] Specifically, by independently mounting the testing frame beside the milling and boring machine, the interference of machine tool deformation, vibration, and motion errors on the measurement benchmark is eliminated. This ensures that the measurement results accurately reflect the absolute straightness of the guide rail relative to the ground benchmark, improving the traceability and confidence of the measurement. The motion slide 3 is the execution unit for the testing motion, achieving high-precision calibration of the image acquisition position. This provides a physical scale for subsequently converting local image coordinates into unified spatial coordinates across the entire guide rail, overcoming the cumulative errors that may result from simply relying on image stitching.

[0042] The image acquisition module achieves non-destructive testing of the guide rail surface by capturing high-contrast images of the guide rail edges. It also provides rich two-dimensional image information for precision measurement, enabling sub-pixel-level high-resolution edge location identification, and the entire testing process is traceable. A position detection unit achieves closed-loop positioning, ensuring that the physical position of each sampling point corresponds to the acquired image, avoiding image blurring and positional deviations caused by motion overshoot or oscillations, and ensuring high fidelity of the measurement data.

[0043] The control component controls the movement of the motion slide 3 based on the preset sampling position and the position signal fed back by the position detection unit. When it reaches the preset sampling position, it triggers the image acquisition module to acquire image information and performs unified processing on all acquired images to calculate and output the straightness error of the guide rail. By replacing manual reading and calculation with digital algorithms, it achieves fully automatic and efficient solution from the original image to the straightness error, eliminating human error and possessing the ability to process massive point cloud data for high-precision evaluation.

[0044] In some embodiments of the present invention, the control components include a motion control module and an image processing module. The motion control module, as the core of motion execution, is electrically connected to the horizontal movement component 4, the vertical movement component 1, and the position detection unit to form a complete motion closed-loop control system. The motion control module uses the feedback signal from the position detection unit for precise control to drive the motion slide 3.

[0045] Specifically, the motion control module includes a driver and a motion controller. The driver receives instructions from the motion controller and drives the motors of the horizontal moving component 4 and the vertical moving component 1 to move the motion slide 3. At the same time, the position detection unit (such as a grating ruler) feeds back the actual position of the motion slide 3 to the motion controller in real time. The motion controller compares the actual position with the preset sampling position to form a closed-loop control, ensuring the positioning accuracy of each step (down to the micrometer level).

[0046] Only when the position detection unit confirms that the actual position of the motion slide 3 has entered the preset tolerance range of the target sampling position, does the motion controller send a hardware trigger signal to the industrial camera of the image acquisition module, thereby eliminating the measurement error caused by residual motion oscillation.

[0047] The image processing module, as the core of data processing, communicates with the image acquisition module and the motion control module. On one hand, it receives image sequence data from the image acquisition module; on the other hand, it interacts with the motion control module to obtain the precise position data corresponding to each shot, which is used for coordinate conversion. Its core task is to execute image processing algorithms, extract guide rail edge features, and calculate straightness error.

[0048] The image processing module includes an industrial control computer (ICC) that integrates image processing algorithm software developed using C++ and OpenCV libraries. This software performs image preprocessing, edge feature extraction, coordinate transformation, and straightness error calculation, and automatically generates a detection report. The image processing module is configured to: preprocess and perform sub-pixel edge detection on images acquired by the image acquisition module at each sampling position, extracting the sub-pixel coordinates of the edges on both sides of the guide rail; based on pre-calibrated camera parameters and the displacement of the motion slide corresponding to each sampling position, transform the sub-pixel coordinates to a reference coordinate system with the detection frame as the reference, obtaining a set of spatial coordinate points on the guide rail edges; and use the least squares method to perform straight line fitting on the spatial coordinate point set, using the sum of the absolute values ​​of the maximum positive and maximum negative deviations of each point relative to the fitted straight line as the straightness error. Its working process consists of three steps: The first step, image processing and feature extraction, involves preprocessing the single or fused images acquired at each sampling location sequentially, including grayscale conversion and noise reduction. Then, a sub-pixel edge detection algorithm is used to extract the two edges of the guide rail, pushing the measurement resolution below the physical pixel size. This algorithm typically consists of two steps: first, coarse edge localization at the pixel level is performed using operators such as Canny; then, interpolation, fitting, or moment methods are used to improve the accuracy of the edge position from a single pixel to a fraction of a pixel, thereby obtaining sub-pixel level edge coordinates.

[0049] The second step is coordinate transformation: using the intrinsic and extrinsic parameters obtained from the industrial camera calibration, a mapping relationship is established between pixel coordinates in the image and physical dimensions in the world coordinate system. Coordinate transformation based on the displacement of the motion slide 3 ensures the overall consistency and physical scale accuracy of long-distance measurements. For each sampling position, the sub-pixel coordinates of the guide rail edge extracted in the first step are combined with the known displacement of the motion slide 3 at that position (grating ruler reading) and transformed into a reference coordinate system with the intersection of the orthogonal guide rails of the detection frame as the zero point. In this way, the edge points in all local images are stitched together into a set of guide rail spatial coordinate points in a unified coordinate system.

[0050] The third step is error assessment: For the obtained set of spatial coordinate points of the guide rail, a straight line is fitted using the least squares method as an ideal reference. This method minimizes the sum of the squared distances from all points to the straight line, with a clear mathematical meaning. Then, the deviations of all actual points relative to this fitted straight line are calculated, and the sum of the absolute values ​​of the largest positive deviation and the largest negative deviation is taken as the final straightness error value of the guide rail.

[0051] The image processing module also stitches together images acquired from adjacent sampling locations to obtain a panoramic image of the guide rail. After acquiring an image sequence covering the entire length of the guide rail, edge detection is not immediately performed on individual images; instead, image stitching is performed first. The algorithm identifies overlapping areas between adjacent images, uses feature point matching algorithms such as SIFT and SURF to find common features within the overlapping areas, calculates the optimal spatial transformation matrix, and then seamlessly merges all images into a complete, continuous, and high-resolution panoramic image of the guide rail. Subsequent subpixel edge detection is then performed directly on this generated panoramic image.

[0052] First, the panoramic image provides a complete guide rail edge contour without segments or breaks, which facilitates overall fitting and eliminates discontinuity errors at the seams of segmented fitting. Second, edge extraction is completed in one step on the panoramic image, which can effectively filter out noise and false edges that may appear on the edges of a single image, making the detected edge lines smoother and closer to the real physical state. The resulting straightness evaluation value is more accurate and reliable, especially suitable for high-precision detection of ultra-long guide rails.

[0053] In some embodiments of the present invention, the detection frame further includes a leveling mechanism, which is disposed at the bottom of the base 8 and is typically composed of multiple support points, for adjusting the horizontality of the horizontal moving component 4 and the verticality of the vertical moving component 1.

[0054] Essentially, the leveling mechanism adjusts the posture of the entire testing frame to ensure that the movement trajectory of the horizontal moving component 4 is truly horizontal and the movement trajectory of the vertical moving component 1 is truly vertical. Since the horizontal moving component 4 and the vertical moving component 1 are mechanically fixed to the base 8, adjusting the posture of the base 8 is equivalent to simultaneously adjusting the spatial orientation of the two orthogonal moving components.

[0055] When installing the testing frame, place a precision level on the guide rail of the horizontal movement component 4 to monitor its horizontal state; place a precision perpendicularity gauge or right-angle ruler on the guide rail of the vertical movement component 1 to monitor its vertical state. Based on the instrument readings, the operator gradually rotates the adjusting threads of each support leg in the leveling mechanism to change the support height of that leg until the readings of both the level and perpendicularity gauges reach the preset accuracy requirements. After leveling, lock the leveling mechanism to maintain the long-term stability of the testing frame.

[0056] By configuring a leveling mechanism, the testing frame is given the ability to actively establish an absolute measurement benchmark. Through fine leveling, the motion axis of the horizontal moving component 4 is calibrated to be parallel to the absolute horizontal plane of the earth, and the motion axis of the vertical moving component 1 is calibrated to be parallel to the absolute vertical plane of the earth. This ensures that the trajectory of all subsequent stepping movements of the industrial camera is carried out in an absolutely orthogonal coordinate system with the direction of gravity of the earth as a reference. This guarantees that the measured straightness of the guide rail is relative to the deviation from the absolute horizontal or absolute vertical, and the measurement results have the highest metrological traceability and comparability, rather than just measuring the undulations of the guide rail surface.

[0057] Furthermore, the leveling mechanism includes multiple lockable leveling feet 7, typically three or four points, each equipped with a threaded adjustment mechanism. By rotating the threads of each foot, its support height is changed, thereby achieving overall leveling. After leveling, it can be locked in place using a locking nut or similar structure to maintain accuracy. After leveling, the axis of motion of the horizontal moving component 4 is defined as absolutely horizontal, and the axis of motion of the vertical moving component 1 is defined as absolutely vertical.

[0058] During the leveling operation, the precision threads on each support leg are rotated individually. Due to the very small lead of the threads, a single rotation of the handle results in a change in the support leg height of only one thread pitch. This allows for sub-millimeter or even arcsecond-level angle adjustments. Once the levelness and verticality of the testing frame meet the standards, the threaded joints are locked using the locking nut or similar mechanism on each support leg to prevent loosening or retraction during prolonged use or under minor external forces.

[0059] This design provides a simple, cost-effective, and highly reliable leveling and locking solution. The precision threaded adjustment mechanism ensures high adjustment sensitivity and self-locking capability, while the lockable design ensures that the testing frame can maintain its high-precision benchmark over a long period of time after experiencing temperature changes and ground micro-vibrations, meeting the stringent requirements for benchmark stability in long-term repeated testing in industrial settings.

[0060] In some embodiments of the present invention, the image acquisition module includes an industrial camera and an auxiliary light source. The industrial camera is mounted on the motion slide 3 and is used to acquire image information of the guide rail. The auxiliary light source is symmetrically mounted on both sides of the industrial camera along the length of the guide rail and is used to illuminate the surface of the guide rail at a predetermined angle. A filter can be installed in front of the lens of the industrial camera to suppress ambient light interference.

[0061] The auxiliary light source uses an LED strip light source because of its high brightness, long lifespan, and low heat generation. It is symmetrically installed on both sides of the camera along the length of the guide rail and illuminates the surface of the guide rail under test at a predetermined angle (e.g., a 45° grazing angle).

[0062] During image acquisition, an auxiliary light source works synchronously with the industrial camera. Light rays emanating from one or two symmetrical directions at a certain angle onto the guide rail surface will produce bright reflections or deep shadows at geometric abrupt changes such as the edges, chamfers, and steps of the guide rail, thus generating a clear, high-contrast boundary line on the two-dimensional image captured by the industrial camera.

[0063] Active illumination is used to highlight the measured features and suppress environmental interference. Symmetrically arranged auxiliary light sources weaken planar features such as scratches or textures on the guide rail surface, while the edges of the guide rail produce bright reflections or create strong light and dark contrasts, resulting in very sharp and clear edge features in the image. This reduces the difficulty and uncertainty of subsequent image processing algorithms in extracting edges, effectively improving the accuracy of sub-pixel edge extraction and ensuring the accuracy of the final straightness error measurement.

[0064] It should be noted that the position detection unit is a grating ruler. The reading head of the grating ruler is mounted on the moving slide 3, and the scale of the grating ruler is fixed parallel to the corresponding guide rail side. The grating ruler is a precision displacement sensor based on the moiré fringe principle, consisting of a scale grating (main grating) and a reading head (indicating grating and photoelectric receiving element). The scale is fixed parallel to the guide rail side of the horizontal or vertical moving assembly 1, and the reading head is mounted on the moving slide 3; the two are strictly aligned in space but without mechanical friction.

[0065] When the servo motor drives the moving slide 3 to move, the reading head moves with the moving slide 3 relative to the stationary scale grating. Light emitted from the light source passes through the two relatively moving gratings, generating periodically changing moiré fringes. The photoelectric element inside the reading head converts these fringes into an approximately sinusoidal electrical signal. Subsequent circuits subdivide and count these signals to obtain the actual displacement of the moving slide 3 relative to the guide rail, with a resolution typically reaching micrometers or even sub-micrometer levels. This high-precision real-time position information is directly fed back to the motion controller, forming a fully closed-loop position control.

[0066] Using a grating ruler as the position detection unit, high-precision direct measurement of the position of the moving slide 3 is achieved. Compared with the semi-closed-loop control that relies on the encoder at the rear end of the motor, the grating ruler directly measures the actual position of the final moving part (moving slide 3), eliminating the influence of all intermediate transmission errors such as lead screw backlash, thermal expansion, and elastic deformation, and ensuring the positioning accuracy of the industrial camera at the preset sampling point.

[0067] Based on the above structural description, those skilled in the art can implement the specific solutions of the embodiments of the present invention according to the following complete process: First, a separate concrete foundation is selected next to the milling and boring machine, and the testing frame is securely installed using anchor bolts or pressure plates. At this point, the testing frame is not in contact with any structural components of the milling and boring machine, forming complete mechanical isolation. Then, using a high-precision level and verticality gauge as reference points, the leveling mechanism at the bottom of the base 8 is adjusted to ensure that the axis of motion of the horizontal moving component 4 is parallel to the absolute horizontal plane, and the axis of motion of the vertical moving component 1 is parallel to the absolute vertical plane. At this point, a two-dimensional world coordinate system is established with the intersection of the horizontal moving component 4 and the vertical moving component 1 as the origin. The measurement results reflect the true straightness of the guide rail relative to the absolute horizontal or vertical plane.

[0068] Then, the industrial camera is calibrated using a standard calibration board (such as a checkerboard pattern). A high-precision checkerboard calibration board with known dimensions is placed at different positions and orientations within the camera's field of view, and the industrial camera captures multiple images. The calibration algorithm calculates the camera's internal parameters, including focal length, principal point coordinates, and lens distortion coefficient, by identifying the corner points of the checkerboard pattern in the images. Subsequently, a two-dimensional Cartesian coordinate system is established, using the theoretical intersection of the horizontal movement component 4 and the vertical movement component 1 of the leveled detection frame as the origin (0,0), with the horizontal movement direction as the positive X-axis and the vertical movement direction as the positive Y-axis. This is the detection reference coordinate system. Using the known dimensions on the calibration board, the actual physical size represented by each pixel in this coordinate system can be calculated.

[0069] By standardizing the measurement scale, edge features scattered across various images and measured in pixels can be accurately converted and combined into a unified physical coordinate system measured in millimeters or micrometers, which can then be used for subsequent error assessment.

[0070] The operator sets the travel and sampling step distance of the guide rail under test in the host computer software. The system automatically generates a series of equally spaced sampling point target positions. The motion controller issues commands to drive the servo motor to move the motion slide in three steps. In each step cycle, the position detection unit monitors the actual position of the slide in real time and feeds it back to the controller. When the controller determines that the actual position of the slide has stabilized within the preset small tolerance zone of the target position, it generates a hardware trigger signal to control the image acquisition module to perform exposure and capture a local image of the guide rail under the current field of view. At the same time, the precise displacement of this position is recorded and associated with the file name of the acquired image. This process is repeated until the entire length of the guide rail is covered, obtaining a set of image sequences with precise position labels.

[0071] The software (image processing module) within the industrial control computer preprocesses each frame of the image, performing grayscale conversion, filtering, and noise reduction to improve the signal-to-noise ratio. Then, sub-pixel edge detection is performed: for example, the Canny operator is first used to achieve pixel-level coarse edge localization; subsequently, for each coarsely located point, polynomial interpolation or curve fitting is performed along its gradient direction using the grayscale values ​​of its neighboring pixels to find the maximum gradient point. The coordinates of this point are the sub-pixel edge points with a precision of a few tenths of a pixel. After sub-pixel extraction of all images, the coordinate transformation process is initiated. Using the obtained industrial camera calibration parameters and pixel equivalents, the sub-pixel coordinates in the image, measured in pixels, are converted into local physical coordinates measured in millimeters. Combined with the recorded displacement of the moving slide 3 corresponding to each image, these local physical coordinates are translated into a detection reference coordinate system established with the frame origin as the reference, ultimately forming a discrete set of spatial coordinate points that represent the actual physical contour of the entire length of the measured guide rail.

[0072] Finally, the spatial coordinates of all sampled positions on a guide rail are converted into a single point set. A reference straight line is then fitted to this point set using the least squares method. The maximum deviation of each point from this reference straight line in both the positive and negative directions is calculated, and the sum of their absolute values ​​represents the straightness error value of the guide rail as defined.

[0073] This inspection method avoids scratching the guide rail surface and transfers the measurement benchmark from the machine tool itself to an independent and calibrable geodetic reference, eliminating interference errors from machine tool deformation or movement, resulting in higher confidence in the measurement results. Through step-scanning and multi-point automatic triggering acquisition, data acquisition for the entire guide rail stroke is automated, solving the problems of time-consuming and labor-intensive traditional manual point-by-point measurement. Closed-loop positioning triggering and sub-pixel algorithms push positioning accuracy and edge recognition accuracy to the micrometer level, avoiding errors introduced by manual reading, recording, and calculation.

[0074] Furthermore, the measurement results are not just a single straightness value, but also include discrete point cloud coordinates and the original image of the entire guide rail length. All data can be digitally stored, facilitating guide rail wear trend prediction, full lifecycle accuracy management, and quality traceability.

[0075] See Figures 3 to 5 This invention also provides a non-contact method for detecting the accuracy of milling machine guideways, using any of the above-described embodiments of the non-contact detection device for milling machine guideway accuracy. Taking a boring machine with a column 9 and a ram 13 as an example, the column 9 is provided with a column guideway 10, the ram 13 is provided with a ram guideway 12, the spindle box 11 is slidably engaged with the column guideway 10, the ram 13 is inserted into the spindle box 11, the spindle box 11 is slidably engaged with the ram guideway 12, and a boring spindle 14 is provided inside the ram 13. The non-contact method for detecting guideway accuracy includes the following steps: Step S100: Calibrate the internal parameters of the image acquisition module, establish the mapping relationship between image pixel coordinates and world coordinates; and establish a detection reference coordinate system with the intersection of the horizontal movement component 4 and the vertical movement component 1 as the origin.

[0076] Understandably, this is a preparatory step before measurement. First, the internal parameters of the industrial camera (focal length, distortion, etc.) are calibrated to ensure accurate conversion of two-dimensional image coordinates into three-dimensional world coordinates. Second, a detection reference coordinate system is established, with the origin chosen at the intersection of the horizontal moving component 4 and the vertical moving component 1. This is essentially a Cartesian coordinate system with the mechanical zero point as its origin, providing a unified benchmark for all spatial position measurements.

[0077] Step S200: Control the motion slide 3 to drive the image acquisition module to move in a stepping manner along the horizontal or vertical direction: When the position detection unit detects that the motion slide 3 has reached the preset sampling position, it triggers the image acquisition module to acquire the guide rail image, and at the same time records the displacement of the motion slide 3 corresponding to each sampling position to obtain the image sequence.

[0078] Understandably, the control component controls the motion slide 3 to move the image acquisition module in a step-by-step manner along the extension direction of the guide rail. Each time it reaches a preset position, the position detection unit confirms its placement before triggering a photograph, simultaneously recording the displacement of the motion slide 3 relative to the origin, i.e., the coordinates of the current sampling point in the detection reference coordinate system. This ultimately yields a series of local guide rail images with precise position labels.

[0079] Step S300: Based on the image sequence, combined with the industrial camera calibration parameters and the displacement corresponding to each sampling position, obtain the point set representing the actual spatial position of the guide rail in the detection reference coordinate system.

[0080] Understandably, the image sequence acquired in the previous step is combined with the industrial camera calibration parameters obtained in the first step (used for image coordinate transformation) and the displacement of each sampling position recorded in the second step (used to provide a position reference for each image block in the global coordinate system) for comprehensive processing. The final result is a set of points, composed of a series of discrete points, representing the actual spatial orientation of the guide rail in the detection reference coordinate system. This set of points is like drawing a point cloud map of the actual edge of the guide rail.

[0081] Step S400: Use the least squares method to perform line fitting on the point set to obtain a reference line, calculate the deviation of each point in the point set relative to the reference line, and use the difference between the maximum and minimum deviations of each point as the straightness error of the guide rail.

[0082] Understandably, a least-squares straight line is fitted to the set of points representing the actual spatial position of the guide rail using mathematical methods to obtain an ideal reference straight line. Then, the spatial distance deviation from each point in the set to this reference straight line is calculated. Finally, the difference between the maximum and minimum deviations (i.e., the distance between a pair of parallel lines encompassing all points) is taken as the straightness error value of the guide rail.

[0083] The overall design principle of this method is to decompose the macroscopic geometric quantity of guide rail straightness into a series of precise acquisitions of local images and precise stitching and reconstruction of the global coordinate system. Through step-scanning and position-closed-loop triggering, the measurement of large workpieces is transformed into a high-precision measurement problem with a small field of view within a high-resolution imaging area. It does not rely on a physical long scale, but instead utilizes the two-dimensional precision motion of the inspection frame itself as the measurement scale, and the least squares method provides an objective evaluation standard.

[0084] Further, in step S100, the internal parameters of the image acquisition module are calibrated, the mapping relationship between image pixel coordinates and world coordinates is established, and a detection reference coordinate system is established with the intersection of the horizontal movement component 4 and the vertical movement component 1 as the origin, specifically including: Step S110: Fix the checkerboard calibration plate in a stable position next to the guide rail to be tested, ensuring that the plane of the calibration plate is perpendicular to the optical axis of the camera. Control the camera to move to the calibration position, maintaining the same focal length, object distance and lighting environment as when acquiring the guide rail image. First, acquire a checkerboard image A; then, change the orientation of the calibration plate within this field of view and acquire 9 calibration plate images with different orientations for camera intrinsic parameter calibration.

[0085] Understandably, using a checkerboard calibration board, and maintaining optical conditions as similar as possible to subsequent measurements, a calibration board image A perpendicular to the optical axis is first acquired (for subsequent pixel equivalent calculations). Then, the calibration board is rotated within the field of view to acquire nine images in different poses. The computer uses these images to calculate the camera's intrinsic parameters and distortion coefficients.

[0086] Step S120: After obtaining the calibration parameters, the checkerboard image A is corrected using the calibration parameters, and then the subpixelated corner coordinates are extracted to obtain the pixel distance between adjacent corners. Then, the pixel equivalent is calculated according to the proportional relationship.

[0087] Understandably, after calibrating the intrinsic parameters, the calibrated parameters are used to correct the vertically shot image A, eliminating lens distortion. Then, on the corrected image, a sub-pixel algorithm is used to extract the corner points of the checkerboard pattern, accurately calculating the pixel distance between adjacent corner points. Knowing the physical dimensions of the checkerboard squares, the actual physical dimension represented by the next pixel at that distance is obtained.

[0088] Step S130: Establish a detection reference coordinate system with the intersection of the horizontal moving component 4 and the vertical moving component 1 as the origin, the moving direction of the horizontal moving component 4 as the positive X-axis, and the moving direction of the vertical moving component 1 as the positive Y-axis. Establish the transformation relationship between image pixel coordinates and world coordinates through the known size features on the calibration plate.

[0089] Understandably, the origin and axes of the coordinate system are clearly defined. Then, since the size of the calibration plate is known, it is placed beside the guide rail, which can serve as a bridge to associate the image pixel coordinates with the world coordinates (i.e., the detection reference coordinate system).

[0090] Specifically, the camera is moved to the calibration position, and a checkerboard image A is acquired under the same experimental conditions as the guide rail under test, including the same focal length, object distance, and lighting environment. Nine calibration plate images in different orientations are then acquired within the field of view. After obtaining the calibration parameters, the checkerboard image A is corrected using these parameters. Subpixelated corner coordinates are then extracted to obtain the pixel distance between adjacent corner points, and the pixel equivalent is calculated based on the proportional relationship. A two-dimensional reference coordinate system for the detection system is established with the intersection of the horizontal guide rail 6 and the vertical guide rail 2 as the origin, the direction of movement of the horizontal guide rail 6 as the positive X-axis, and the direction of movement of the vertical guide rail 2 as the positive Y-axis. The transformation relationship between image pixel coordinates and world coordinates is established using the known dimensional features on the calibration plate.

[0091] Let point P be a point within the field of view of the industrial camera, and let the homogeneous coordinates of P in the camera coordinate system be... The homogeneous coordinates in the world coordinate system are The homogeneous transformation relationship between the world coordinate system and the image coordinate system is given by formula (I): (one) In the formula, R is the rotation matrix, t is the translation matrix, M1 is the camera intrinsic parameter matrix, and M2 is the camera extrinsic parameter matrix. , for , Equivalent focal length in direction; The coordinates of the principal point representing the camera are shown. The coordinates of point P in the industrial camera coordinate system are set as follows: Point P is projected onto the image coordinate plane. Let the normalized projected coordinates of point P on the image plane be... After adding the distortion point, the projected coordinates of point P are: Then we have: (two) In the formula: , is the radial distortion coefficient.

[0092] By separating and solving each parameter in the measurement chain step by step: first, the internal distortion and focal length of the industrial camera are calculated; then, the magnification (pixel equivalent) at that object distance is determined; finally, the image measurement is traced back to the actual physical size and position using a feature of known size. The operation steps are clear and can be fully reproduced by ordinary technicians. Moreover, the source of error in each step is controllable, ensuring the accuracy of the final spatial coordinate transformation.

[0093] Further, in step S200, the displacement of the moving slide corresponding to each sampling position is recorded to obtain an image sequence, specifically including: Step S210: Images acquired at adjacent preset sampling positions have a 20% to 30% overlap area. For example, if the field of view of the industrial camera is 100mm, the step size is set to 70mm to 80mm. The motion controller controls the slide to move according to this step size and triggers the camera to acquire images, thereby ensuring that there is sufficient overlap between any two adjacent images throughout the entire guide rail stroke. The overlap area effectively avoids missed shots or data loss at the sampling edges due to minor positioning errors.

[0094] Step S220: At each preset sampling position, the image acquisition module is triggered to acquire at least three images, the precise moving distance corresponding to each acquisition is recorded, and the average value of these position readings is taken for subsequent data processing at that position.

[0095] Once the motion slide is precisely positioned at a preset sampling location, the motion controller does not trigger the camera to take only one picture, but instead triggers it continuously and rapidly at least three times to obtain more than three image frames. These images are then transmitted to the image processing module, where the software averages the grayscale values ​​of each pixel in the multiple frames at the same location to generate an average image with a significantly improved signal-to-noise ratio. This average image will replace the single-frame image in the subsequent edge extraction process.

[0096] Taking the average value of multiple measurements suppresses random errors and can effectively reduce the single position reading error caused by random factors such as device micro-vibration and instantaneous fluctuations in sensor signals, thereby improving the accuracy and robustness of the position coordinates of each sampling point.

[0097] Further, in step S300, a set of points characterizing the actual spatial position of the guide rail is obtained, specifically including: The images acquired at each sampling location are preprocessed and subpixel edge detected to extract the subpixel coordinate points of the guide rail edge; the subpixel coordinate points are transformed to the detection reference coordinate system using the industrial camera calibration parameters and the displacement corresponding to each sampling location.

[0098] In other words, each acquired image is processed independently: First, preprocessing and sub-pixel edge detection are performed on a single image to extract the sub-pixel coordinates of a section of the guide rail edge within the image. Specifically, the horizontal and vertical templates of the Sobel operator are used to perform convolution operations on the preprocessed image to calculate the gray-level gradient components of each pixel in the x and y directions, thereby calculating the gradient magnitude and direction of that point. The point with the maximum gradient magnitude is the pixel-level edge location. To overcome pixel resolution limitations, along the gradient direction of the coarsely located edge point, the gradient magnitudes of that point and several neighboring points are selected to fit a quadratic curve. The coordinates corresponding to the extreme points of this curve are the sub-pixel edge coordinates with an accuracy of a few tenths of a pixel. Then, using the calibration parameters of the industrial camera, the pixel coordinates of this edge section are converted into local physical coordinates. Finally, using the displacement of the moving slide recorded during image acquisition as an offset, this local physical coordinate section is translated into the global detection reference coordinate system.

[0099] By treating the global guide rail edge as a series of stitched local edge segments, the algorithm logic is straightforward. The processing of each frame is independent and does not depend on feature matching of adjacent images. It has high computational efficiency and is suitable for use when the guide rail edge texture is clear and the features are obvious.

[0100] Further, in step S300, a set of points characterizing the actual spatial position of the guide rail is obtained, specifically including: Feature matching and image stitching are performed on adjacent images with overlapping regions to obtain a complete and continuous panoramic image of the guide rail. Specifically, a feature point detection algorithm is used to extract stable feature points from each image and generate a descriptive vector. Then, feature point matching is performed within the overlapping regions of adjacent images to find corresponding pairs of points. Based on these matching point pairs, the perspective transformation or affine transformation matrix between the images is calculated. Finally, all images are transformed to the same coordinate system, and methods such as weighted fusion are used to eliminate stitching seams, generating a complete panoramic image of the guide rail. Subsequent subpixel edge detection is then performed on this continuous panoramic image in one step.

[0101] Subpixel edge detection is performed on the panoramic image to extract edge features on both sides of the guide rail in the horizontal and vertical image sequences, respectively. The extracted straight line features of the guide rail edge are transformed into the detection reference coordinate system to form the point set.

[0102] This invention provides a completely different method for forming point sets: first, all local images are stitched together into a single large image, and then processed uniformly. The steps are as follows: First, by utilizing the overlapping areas of adjacent images, a feature matching algorithm is used to find matching points between them, and the spatial transformation relationship is calculated, thus stitching a series of local images into a complete and continuous panoramic image of the guide rail. Then, sub-pixel edge detection is performed on this panoramic image in a single step to extract the edges on both sides of the entire guide rail. Finally, using the system calibration parameters and coordinate mapping relationships used when capturing the panoramic image, the pixel coordinates of the entire edge are directly transformed to the detection reference coordinate system, forming the final point set.

[0103] This setup allows for a clear and intuitive observation of the overall direction of the guide rail in a complete view. The image stitching process itself has image smoothing and noise suppression effects, making the extracted edge potentially more continuous and smooth.

[0104] Specifically, the acquired image sequence is transmitted to an industrial control computer. After grayscale processing and filtering for noise reduction, the Otsu adaptive thresholding algorithm is used to convert the grayscale image into a binary image, effectively separating the guide rail edge from the background. The Canny edge detection operator is used to extract the guide rail edge contour from the binary image, achieving coarse edge detection and localization. Based on polynomial interpolation theory, given a set of points... interpolation function Formula (3) is as follows: (three) in, These are the edge coordinates obtained from coarse positioning.

[0105] Since the Canny operator's edge detection accuracy is only at the pixel level, which is insufficient for high-precision measurement, a sub-pixel edge localization algorithm is further employed to improve the edge localization accuracy to within 0.1 pixels. This is based on the Sobel operator on the original grayscale image. Find its gradient image After obtaining its gradient image, for the determined edge points The gradient magnitudes of five sampling points (including the gradient itself and its neighborhood) along the gradient direction are used to construct a quadratic interpolation function. ,make: (Four) The maximum value point is the sub-pixel point, and then we can obtain... The corresponding subpixel coordinates.

[0106] The SURF feature matching algorithm is used to extract feature points from adjacent segmented images and perform accurate matching, calculating the transformation matrix between images. Weighted average fusion is used to eliminate image stitching seams, resulting in a complete and continuous panoramic image of the guide rail. A global optimization algorithm for bundle adjustment is then used to calibrate the stitching results of all segmented images, eliminating accumulated segment errors and improving the overall accuracy of the panoramic image.

[0107] Sub-pixel edge point set extracted from panoramic image After removing outliers using the RANSAC algorithm, polynomial curve fitting is performed based on the least squares method, and its formal formula (V) is as follows: (five) Select parameters Make It is the smallest.

[0108] Using the coordinate transformation relationship established in step two, the straight line features of the guide rail edges extracted from each image are transformed from pixel coordinates to the reference coordinate system of the detection system, thus obtaining the actual spatial coordinates of the guide rail edges at each sampling position. .

[0109] The straightness error assessment method of this invention uses the least squares method to fit a reference straight line, and takes the range between the maximum and minimum deviations of each measurement point relative to the reference straight line as the straightness error value. Based on the actual physical coordinate sequence of the guide rail edge obtained in step four, the ideal reference straight line of the guide rail is fitted using the least squares method. Calculate the deviation of each edge point from the ideal straight line. An ideal line is one whose sum of the squares of the distances from all points on the actual line to the line is minimized. Let the two data points farthest from the line on its upper and lower sides be... and Then the straightness error value The data points are on the straight line. When above Take a positive value, when it is below Take the negative value.

[0110] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A non-contact testing device for the accuracy of milling and boring machine guideways, characterized in that, include: A testing frame, independently installed beside the milling and boring machine, comprising: Base; A horizontal moving component is disposed on the base, and the horizontal moving component is adapted to perform linear reciprocating motion in the horizontal direction; A vertical moving component is disposed on the horizontal moving component and arranged orthogonally to the horizontal moving component. The vertical moving component is adapted to perform linear reciprocating motion along the vertical direction. A motion slide is mounted on the vertical moving assembly; An image acquisition module, mounted on the motion slide, is used to acquire image information of the guide rail; The position detection unit is used to detect the position of the moving slide. The control component is electrically connected to the horizontal movement component, the vertical movement component, the image acquisition module, and the position detection unit, respectively. It is used to control the movement of the motion slide according to the preset sampling position and the position signal fed back by the position detection unit, and to trigger the image acquisition module to acquire image information when the preset sampling position is reached. It is also used to receive the image information acquired by the image acquisition module, extract the guide rail edge features based on image processing, and calculate the straightness error of the guide rail.

2. The non-contact testing device for the accuracy of milling and boring machine guideways according to claim 1, characterized in that, The control component includes: The motion control module is electrically connected to the horizontal movement component, the vertical movement component, and the position detection unit, and is used to control the movement of the motion slide according to the preset sampling position and the position signal fed back by the position detection unit, so as to drive the image acquisition module to move. The image processing module is communicatively connected to the image acquisition module and the motion control module. It is used to receive the image sequence acquired by the image acquisition module and extract the edge features of the guide rail based on image processing to calculate the straightness error of the guide rail.

3. The non-contact detection device for milling and boring machine guideway accuracy according to claim 1, characterized in that, The detection frame also includes: A leveling mechanism is provided at the bottom of the base for adjusting the horizontal level of the horizontal moving component and the vertical level of the vertical moving component.

4. The non-contact detection device for milling and boring machine guideway accuracy according to claim 3, characterized in that, The leveling mechanism includes multiple lockable leveling feet, each of which is equipped with a threaded adjustment mechanism.

5. The non-contact testing device for the accuracy of milling and boring machine guideways according to any one of claims 1 to 4, characterized in that, The image acquisition module includes: An industrial camera, mounted on the moving slide, is used to acquire image information of the guide rail; An auxiliary light source is symmetrically mounted on both sides of the industrial camera along the length of the guide rail, and is used to illuminate the surface of the guide rail at a predetermined angle.

6. A non-contact method for detecting the accuracy of milling machine guideways, employing the non-contact detection device for the accuracy of milling machine guideways as described in any one of claims 1 to 5, characterized in that, Includes the following steps: The internal parameters of the image acquisition module are calibrated to establish a mapping relationship between image pixel coordinates and world coordinates; and a detection reference coordinate system is established with the intersection of the horizontal movement component and the vertical movement component as the origin. The motion slide is controlled to drive the image acquisition module to move stepwise in the horizontal or vertical direction: when the position detection unit detects that the motion slide has reached the preset sampling position, it triggers the image acquisition module to acquire the guide rail image, and at the same time records the displacement of the motion slide corresponding to each sampling position to obtain an image sequence; Based on the image sequence, combined with the industrial camera calibration parameters and the displacement corresponding to each sampling position, a set of points representing the actual spatial position of the guide rail under the detection reference coordinate system is obtained; The least squares method is used to fit a straight line to the point set to obtain a reference straight line. The deviation of each point in the point set relative to the reference straight line is calculated, and the difference between the maximum and minimum deviations among the deviations of each point is taken as the straightness error of the guide rail.

7. The non-contact detection method for the accuracy of milling and boring machine guideways according to claim 6, characterized in that, The calibration of the internal parameters of the image acquisition module, the establishment of a mapping relationship between image pixel coordinates and world coordinates, and the establishment of a detection reference coordinate system with the intersection of the horizontal and vertical movement components as the origin, specifically include: Fix the checkerboard calibration plate in a stable position next to the guide rail to be tested, ensuring that the plane of the calibration plate is perpendicular to the optical axis of the camera. Control the camera to move to the calibration position, maintaining the same focal length, object distance and lighting environment as when acquiring the guide rail image. First, acquire one checkerboard image A; then, change the orientation of the calibration plate within this field of view and acquire 9 calibration plate images with different orientations for camera intrinsic parameter calibration. After obtaining the calibration parameters, the checkerboard image A is corrected using the calibration parameters. Then, the subpixelated corner coordinates are extracted to obtain the pixel distance between adjacent corners. Finally, the pixel equivalent is calculated based on the proportional relationship. Using the intersection of the horizontal and vertical moving components as the origin, the moving direction of the horizontal moving component as the positive X-axis, and the moving direction of the vertical moving component as the positive Y-axis, a detection reference coordinate system is established. Based on the known size features on the calibration plate, the conversion relationship between image pixel coordinates and world coordinates is established.

8. The non-contact detection method for the accuracy of milling and boring machine guideways according to claim 6, characterized in that, The process of recording the displacement of the moving slide corresponding to each sampling position to obtain an image sequence specifically includes: Images acquired at adjacent preset sampling positions have a 20% to 30% overlap area; Furthermore, at each preset sampling position, the image acquisition module is triggered to acquire at least three images, record the displacement of the moving slide corresponding to each acquisition, and take the average value of these position readings for subsequent data processing at that position.

9. The non-contact detection method for the accuracy of milling and boring machine guideways according to claim 6, characterized in that, The obtained set of points representing the actual spatial position of the guide rail specifically includes: The images acquired at each sampling location are preprocessed and subpixel edge detected to extract the subpixel coordinate points of the guide rail edge; By using the calibration parameters of the industrial camera and the displacement corresponding to each sampling position, the sub-pixel coordinate points are transformed to the detection reference coordinate system.

10. The non-contact detection method for the accuracy of milling and boring machine guideways according to claim 6, characterized in that, The obtained set of points representing the actual spatial position of the guide rail specifically includes: Feature matching and image stitching are performed on adjacent images with overlapping areas to obtain a complete and continuous panoramic image of the guide rail; Subpixel edge detection is performed on the panoramic image to extract edge features on both sides of the guide rail in the horizontal and vertical image sequences, respectively. The extracted straight line features of the guide rail edge are transformed into the detection reference coordinate system to form the point set.