Calculation method for gap offset of mechanical structure

Through digital image processing and machine learning models, camera distortion is automatically corrected to achieve accurate calculation of the gap offset of the mechanical structure, solving the problems of inaccurate measurement and slow processing speed in the existing technology, and improving detection efficiency and reliability. Suitable for various mechanical structure maintenance scenarios.

CN118657707APending Publication Date: 2024-09-17SHANGHAI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410547160.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-06
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

In the existing mechanical structure detection methods, camera distortion leads to inaccurate measurement of gaps in the image, making it difficult to achieve rapid response and real-time monitoring. The processing speed is slow and cannot meet actual engineering needs.

Method used

A method for calculating the notch offset of a mechanical structure is adopted. Through digital image processing in the preparation stage and detection stage, edge detection algorithms and machine learning models are used to automatically correct distortion and improve measurement accuracy and processing speed, including obtaining notches and benchmarks. The position refers to the edge information of the structure, and the position information and offset of the gap center line are calculated.

Benefits of technology

It achieves accurate calculation of the notch offset of the mechanical structure, improves the efficiency and reliability of the detection process, reduces the workload of maintenance personnel and potential safety risks, can maintain high accuracy in complex environments, and is suitable for various mechanical structures. Maintenance scenario.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657707A
    Figure CN118657707A
Patent Text Reader

Abstract

According to the method for calculating the gap offset of the mechanical structure, the error caused by distortion is corrected by calculating the difference between the edge position information in the initial image and the edge position information in the real-time image stored in the preparation stage, and the correction process is automatic and does not need manual intervention, so that the correction efficiency is greatly improved. Therefore, the efficiency and the reliability of the whole detection process are improved. The method is based on image processing, the measurement accuracy is improved, and the workload of maintenance personnel and potential safety risks are greatly reduced. And meanwhile, by introducing a distortion correction algorithm, the reliability of a measurement result is remarkably improved, and high precision can be kept even under complex outdoor illumination and weather conditions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a mechanical structure detection system based on image vision, and in particular to a method for calculating a notch offset of a mechanical structure. Background Art

[0002] Traditional inspection methods for mechanical structures, such as the maintenance and monitoring of railway mechanical systems, usually rely on physical measurements and regular on-site inspections. These methods include direct measurement of notches using measuring tools such as calipers and laser rangefinders, as well as manual observation to identify potential wear or damage. Although these traditional methods are still effective in some cases, they have some significant limitations, such as being time-consuming, labor-intensive, difficult to achieve continuous monitoring, and sensitive to environmental conditions.

[0003] As technology develops, image processing-based methods have begun to be applied to the safety detection of gaps. These methods use images captured by cameras to automate the measurement and analysis process. Through image processing technology, the shape, size, and position of the gap can be accurately calculated, thereby achieving more efficient and continuous monitoring. However, these image-based methods face the problem of camera distortion, which can lead to inaccurate measurements of gaps in the image.

[0004] Traditional distortion correction methods usually require complex algorithms and precise camera parameters, which may be difficult to implement in practical applications, especially in railway maintenance environments that require rapid response. In addition, these methods may require a lot of computing resources, resulting in slow processing speeds and difficulty meeting the needs of real-time monitoring. Summary of the invention

[0005] In view of the above-mentioned defects of the prior art, the technical problem to be solved by the present invention is that in the existing mechanical structure detection method, there may be camera distortion, resulting in inaccurate measurement of the gap in the image, or difficulty in achieving rapid response, slow processing speed, and failure to meet the needs of real-time monitoring. The present invention provides a method for calculating the offset of the gap in a mechanical structure, which reduces the influence of camera distortion on the calculation structure, can effectively correct the distortion, improve the accuracy of measurement, simplify the distortion correction process, maintain fast processing speed and high real-time performance, and is more suitable for practical engineering applications.

[0006] To achieve the above object, the present invention provides a method for calculating the offset of a notch of a mechanical structure, comprising a preparation stage and a detection stage, wherein the preparation stage comprises the following steps:

[0007] Move the mechanical structure gap to a predetermined position;

[0008] Use the camera to obtain a picture of the notch location;

[0009] Performing digital image processing on the acquired image to obtain and store position information of the edges of both sides of the notch at the predetermined position;

[0010] Performing digital image processing on the acquired picture to obtain and store position information of the edges on both sides of the reference structure at the predetermined reference position;

[0011] The detection phase includes the following steps:

[0012] Use the camera to get a picture of the notch;

[0013] Performing digital image processing on the acquired notch image to obtain position information of edges on both sides of the notch;

[0014] Calculate the centerline position information of the notch based on the acquired position information of the edges on both sides of the notch and the stored position information of the edges on both sides of the notch at the predetermined position;

[0015] The gap offset is calculated based on the calculated gap centerline position information and the stored edge position information on both sides of the reference structure at the base position. The gap offset refers to the displacement of the gap centerline relative to the reference structure centerline.

[0016] Furthermore, the notch centerline refers to a straight line between two edges of the notch, and the straight line is equidistant from the two edges. It passes through the geometric center of the notch and divides the notch into two symmetrical parts, which is used to calculate the offset of the notch.

[0017] Furthermore, the center line of the reference position reference structure refers to a straight line between two edges of the reference position reference structure, and is equidistant between the two edges. It passes through the geometric center of the reference position reference structure, dividing the reference position reference structure into two symmetrical parts, and is used to provide a stable reference benchmark when calculating the notch offset.

[0018] Furthermore, the predetermined position refers to the actual position of the notch when the projection of the notch centerline on the image coincides with the image abscissa centerline.

[0019] Furthermore, the optical axis of the camera and the center line of the notch at the reference position are in the same plane, and the center line of the reference position reference structure and the center line of the notch after movement are both parallel to the plane.

[0020] Further, the camera is configured to capture images of the notch and the reference structure of the reference position, so as to ensure that when the notch is translated in a plane, the position change of the centerline of the notch relative to the centerline of the reference structure of the reference position can be accurately monitored;

[0021] The center line of the reference structure is used as a fixed reference. Its position and direction remain unchanged during the measurement process and are used to compare with the position change of the notch center line.

[0022] The movement of the notch is limited to the plane in which it is located, and the calculation of the notch offset is based on the comparison of the notch centerline position information captured by the camera and the stored reference structure centerline position information.

[0023] Furthermore, the digital image processing includes an edge detection algorithm for identifying and locating the edge of the notch and its reference position reference structure, the edge detection algorithm is based on gradient changes, including the Sobel operator, the Canny edge detection algorithm, or other algorithms that can accurately identify the edge in the image;

[0024] Digital image processing also includes image enhancement steps, including contrast adjustment, filtering and denoising, to improve image quality and optimize the accuracy of edge detection.

[0025] Furthermore, digital image processing also includes the use of machine learning or deep learning models to automatically identify and extract edge features of gaps and benchmark position reference structures, and is capable of handling complex image conditions, including lighting changes, occlusions, and image noise, thereby improving the detection accuracy of the gap centerline and benchmark position reference structure centerline position information.

[0026] Furthermore, it also includes establishing a pixel coordinate system for the image, with the center of the image being the origin of the coordinate system. image , the horizontal axis is the u axis, the vertical axis is the v axis, and the unit is pixel.

[0027] Furthermore, obtaining the position information of the edges of the notch at the predetermined position includes the following steps: taking any straight line v=v parallel to the u axis g , draw a straight line perpendicular to the u-axis through the intersection of the straight line and the edges of the notch on both sides, intersecting the u-axis at points and in Indicates the horizontal position information of the left edge of the predetermined position gap. Indicates the horizontal position information of the right edge of the predetermined position gap.

[0028] Technical Effects

[0029] The present invention provides a method for calculating the offset of the gap of a mechanical structure. The error caused by the distortion is corrected by calculating the difference between the initial image stored in the preparation stage and the edge position information in the real-time image. This correction process is automated and does not require manual intervention, thereby improving the efficiency and reliability of the entire detection process. The method of the present invention is based on image processing, which not only improves the accuracy of the measurement, but also greatly reduces the workload of maintenance personnel and potential safety risks. At the same time, by introducing a distortion correction algorithm, the reliability of the measurement results is significantly improved, and high accuracy can be maintained even under complex outdoor lighting and weather conditions.

[0030] In addition, the method of the present invention is highly adaptable and scalable. It is compatible with different types of cameras and mechanical mechanism systems, making it widely applicable to various mechanical structure maintenance scenarios. Through the present invention, the mechanical mechanism maintenance team can achieve real-time monitoring of the gap status of the mechanical structure, timely discover and deal with potential problems, thereby ensuring the safety and smoothness of the mechanical structure.

[0031] The concept, specific structure and technical effects of the present invention will be further described below in conjunction with the accompanying drawings to fully understand the purpose, characteristics and effects of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 It is a flow chart of a method for calculating the offset of a notch of a mechanical structure according to a preferred embodiment of the present invention;

[0033] Figure 2 It is a schematic diagram illustrating a calculation method of a method for calculating a gap offset of a mechanical structure in a preferred embodiment of the present invention in world coordinates;

[0034] Figure 3 It is a schematic diagram illustrating a calculation method of a method for calculating a gap offset of a mechanical structure in a preferred embodiment of the present invention in pixel coordinates. DETAILED DESCRIPTION

[0035] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0036] In the following description, specific details such as specific internal procedures and techniques are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.

[0037] like Figure 1 As shown, the present invention provides a method for calculating the offset of a notch of a mechanical structure, comprising a preparation stage and a detection stage, wherein the preparation stage comprises the following steps:

[0038] a1. Move the mechanical structure gap to the predetermined position;

[0039] a2. Use the camera to obtain a picture of the notch location;

[0040] a3. Perform digital image processing on the acquired image to obtain the position information of the edges of the notch on both sides of the predetermined position and store it;

[0041] a4. Perform digital image processing on the acquired image to obtain and store the position information of the edges of the reference structure on both sides of the predetermined reference position;

[0042] The detection phase includes the following steps:

[0043] b1. Use the camera to obtain the notch image;

[0044] b2. Perform digital image processing on the acquired notch image to obtain position information of the edges on both sides of the notch;

[0045] b3. Based on the acquired position information of the edges of the gap on both sides and the position information of the edges of the gap on both sides stored at a predetermined position, calculate the position information of the centerline of the gap;

[0046] b4. Calculate the gap offset based on the calculated gap centerline position information and the stored edge position information on both sides of the reference structure at the base position; wherein the gap offset refers to the displacement of the gap centerline relative to the centerline of the reference structure at the base position.

[0047] Among them, the reference structure of the benchmark position has the following characteristics:

[0048] Benchmark: The benchmark position reference structure is a fixed structure used to provide a stable and accurate reference benchmark position so as to serve as a constant reference point in the calculation process of the notch offset;

[0049] Identification: The reference structure has features that are easily identifiable during image processing, such as specific shapes, colors, or marks, so that it can be quickly located and identified in automated inspection systems;

[0050] Versatility: The reference structure is designed to be compatible with a variety of sensors and measurement technologies, can adapt to different measurement environments and conditions, and is suitable for a wide range of application scenarios;

[0051] Durability: The fiducial position reference structure is manufactured from weather-resistant materials and is designed to maintain its structural integrity and measurement accuracy during long-term exposure to the elements, ensuring long-term reliability and stable performance.

[0052] Center proximity: The projection of the center line of the reference structure at the base position on the image is close to the center of the image's horizontal coordinate. The effect of camera distortion can be ignored during calculation, ensuring high calculation accuracy.

[0053] The notch in the embodiment of the present invention has the following characteristics:

[0054] Definition: A notch is a predetermined break or groove in a mechanical structure, whose shape, size and position are precisely defined according to specific design requirements;

[0055] Functionality: Notches are designed to achieve specific mechanical functions, such as connecting, positioning or assembling parts, and play a key role in mechanical operation;

[0056] Measurability: The characteristics of the notch allow for precise measurement using image processing techniques to determine its offset relative to a reference structure at a given position;

[0057] Reference: The position information of the notch is compared with the reference structure of the base position to calculate the notch offset, thereby evaluating the alignment and performance of the mechanical structure.

[0058] Furthermore, the notch centerline refers to a straight line between two edges of the notch, and the straight line is equidistant from the two edges. It passes through the geometric center of the notch and divides the notch into two symmetrical parts, which is used to calculate the offset of the notch.

[0059] The center line of the reference position reference structure refers to a straight line between the two edges of the reference position reference structure, and is equidistant between the two edges. It passes through the geometric center of the reference position reference structure and divides the reference position reference structure into two symmetrical parts, providing a stable reference benchmark for calculating the notch offset.

[0060] The predetermined position refers to the actual position of the notch when the projection of the notch centerline on the image coincides with the centerline of the image abscissa.

[0061] The optical axis of the camera and the center line of the notch at the reference position are in the same plane, and the center line of the reference position reference structure and the center line of the notch after movement are parallel to the plane. Specifically, the camera is configured to capture images of the notch and the reference position reference structure to ensure that when the notch is translated in the plane, the position change of the notch center line relative to the center line of the reference position reference structure can be accurately monitored; the center line of the reference position reference structure serves as a fixed reference, and its position and direction remain unchanged during the measurement process, which is used to compare with the position change of the notch center line; the movement of the notch is limited to the plane in which it is located, and the calculation of the notch offset is based on the comparison of the notch center line position information captured by the camera and the stored center line position information of the reference position reference structure.

[0062] In the embodiment of the present invention, the digital image processing includes an edge detection algorithm for identifying and locating the edge of the notch and its reference position reference structure, the edge detection algorithm is based on gradient changes, including a Sobel operator, a Canny edge detection algorithm, or other algorithms that can accurately identify edges in an image;

[0063] Digital image processing also includes image enhancement steps, including contrast adjustment, filtering and denoising, to improve image quality and optimize edge detection accuracy. Digital image processing also includes the use of machine learning or deep learning models to automatically identify and extract edge features of gaps and reference structures, capable of handling complex image conditions, including lighting changes, occlusions, and image noise, thereby improving the detection accuracy of the gap centerline and reference structure centerline position information.

[0064] Further, based on the calculated notch centerline position information and the stored edge position information of the reference structure at both sides, the notch offset is calculated; wherein the notch offset refers to the displacement of the notch centerline relative to the centerline of the reference structure at the reference position. This includes establishing a pixel coordinate system for the image, with the center of the image as the origin of the coordinate system. image , the horizontal axis is the u axis, the vertical axis is the v axis, and the unit is pixel.

[0065] Furthermore, obtaining the position information of the edges of the notch at the predetermined position includes the following steps: taking any straight line v=v parallel to the u axis g , draw a straight line perpendicular to the u-axis through the intersection of the straight line and the edges of the notch on both sides, intersecting the u-axis at points and in Indicates the horizontal position information of the left edge of the predetermined position gap. Indicates the horizontal position information of the right edge of the predetermined position gap.

[0066] Specifically, in step a1. moving the mechanical structure gap to the predetermined position, the mechanical mechanism system must first be precisely physically adjusted to ensure that the gap moves to the standard alignment position of the reference. This position is set according to the railway maintenance specifications and the technical requirements of the mechanical mechanism manufacturer, and usually corresponds to a state where the gap offset value is zero. In this state, the geometric center of the gap is aligned with the theoretical center line in the mechanical mechanism design drawing, providing a clear reference for subsequent image capture and data processing.

[0067] Step a2. Use a camera to obtain a picture of the notch position. The camera needs to be properly placed to ensure that the acquired image is comprehensive and clear. Use a specially configured high-resolution camera to capture the initial image at the notch of the mechanical mechanism. The camera is accurately calibrated to reduce errors that may be caused by installation angle or lens distortion. The capture of the initial image is carried out under controlled lighting conditions to ensure image quality. By applying advanced digital image processing algorithms such as edge detection, contour recognition and feature extraction, the position information of the notch edge is accurately extracted from the initial image. This information is then stored in a reliable data storage system for rapid retrieval during the inspection phase.

[0068] In step a3, the goal is to extract the position information of the left and right edges of the notch from the notch image captured by the camera through digital image processing technology. Specifically, the following steps are included:

[0069] Use a pre-trained object detection algorithm (such as YOLO, SSD, or Faster R-CNN) to identify and locate the gap area. The object detection algorithm will mark the approximate location of the gap in the image to provide a reference for subsequent edge detection. The output of the object detection algorithm is usually a bounding box, and its mathematical representation includes the center point, width, and height of the bounding box. Taking the YOLO algorithm as an example, its output can be expressed as: B = (x c ,y c ,w,h,confidence,class_scores), where (x c ,y c ) is the center coordinate of the bounding box, w and h are the width and height of the bounding box, confidence is the confidence of the detected object, and class_scores is the probability that the object belongs to each category.

[0070] Apply filtering algorithms (such as Gaussian filtering or median filtering) to preprocess the image to reduce noise and smooth the image. The filtered image will help improve the accuracy of edge detection. For example, the Gaussian filtering algorithm is expressed as: Among them, I filtered(x,y) is the pixel value of the filtered image at point (x, y), I(x′, y′) is the pixel value of the original image at point (x′, y′), and σ is the standard deviation of the Gaussian kernel.

[0071] Apply histogram equalization to the image to enhance the contrast of the image so that the edge of the notch is more clearly visible. This step is particularly useful when the contrast between the image background and foreground (such as the notch) is not high.

[0072] The image is converted to black and white through binarization processing, so that the edge extraction algorithm can more accurately identify the outline of the gap. Select a suitable threshold or adaptive threshold method to ensure that the gap area is effectively separated from the background. The binarization formula is expressed as: The threshold T converts the image into a binary image.

[0073] Apply edge detection algorithms such as the Canny edge detector to identify the edges in the image. The edge detection algorithm will mark the exact location of the edge of the gap in the binary image. The Canny algorithm includes multiple steps, among which Gaussian filtering is used to remove noise, gradient calculation is used to determine the edge strength, and dual threshold detection is used to determine and connect the edges.

[0074] Feature points are extracted from the edge detection results, such as the starting point, end point and turning point of the edge. The coordinates of these feature points will be used to determine the position information of the edges on the left and right sides of the gap.

[0075] Through the above steps, the position information of the left and right edges of the gap can be accurately extracted from the image captured by the camera. This information will be used for the subsequent gap offset calculation, thereby achieving effective monitoring and maintenance of the mechanical system status. During the implementation process, it may be necessary to adjust the algorithm parameters according to the actual image quality and environmental conditions to ensure the best effect.

[0076] Finally, the extracted edge location information is digitized and stored in a database or file system. The stored information should include the coordinates of each edge point, and possibly other relevant features such as edge strength and direction. The specific storage steps are as follows:

[0077] First, the extracted edge location information is formatted into a format suitable for storage. This may include creating a structured data model, for example, the coordinates of each edge point can be stored as a pair of floating point numbers (x, y), and may include other metadata such as timestamps, image capture conditions, etc.

[0078] Identify the medium used to store the location information. This could be a database system (such as a SQL or NoSQL database), a file system (such as a CSV file or a dedicated data file format), or another data storage solution.

[0079] Store the formatted position information to the selected media. If using a database system, you may want to create a database table with fields for storing image information, edge coordinates, and other relevant data.

[0080] During the storage process, data validation and error detection may be required to ensure the integrity and accuracy of the data.

[0081] In order to quickly retrieve the stored edge location information during the detection phase, an indexing mechanism may be required. This can be achieved through database indexes, file naming conventions, or other organizational structures.

[0082] Indexes should be designed to quickly locate relevant data based on specific criteria, such as timestamp or image capture context.

[0083] Ensure stored data is secure from unauthorized access and data loss. This may involve implementing encryption measures, access controls and regular backups.

[0084] Backups can be local or remote to ensure data recovery in the event of a system failure.

[0085] If necessary, develop a user interface or provide an API interface so that maintenance personnel and other systems can access and retrieve the stored edge location information.

[0086] The interface or interface should provide intuitive operation methods, allowing maintenance personnel to easily view, export or analyze data.

[0087] Through the above steps, it can be ensured that the gap edge position information obtained from the preparation stage is effectively stored and managed, providing a reliable data basis for image comparison and offset calculation in the detection stage. During the implementation process, the scalability of the data, the maintainability of the system, and the compatibility with the existing maintenance process should be considered.

[0088] a4. Perform digital image processing on the acquired image to obtain and store the position information of the edges of the reference structure at the predetermined reference position. This step is similar to the above and will not be repeated here.

[0089] The specific implementation of step b1 is similar to that of step a2.

[0090] The specific implementation of step b2 is similar to that of step a3.

[0091] like Figure 2 As shown in the figure, it is the world coordinate system, with the plane where the optical axis of the camera is located as X w O w Z w The plane where the notch is located is Y w O w Z w The plane where the reference structure is located is X w O w Y w Surface, establish the world coordinate system.

[0092] like Figure 3 As shown, it is a pixel coordinate system, and the center of the image is the origin of the coordinate system O image , the horizontal axis is the u-axis, the vertical axis is the v-axis, the unit is pixel, the projection of the gap on the image is above the u-axis, the projection of the reference structure of the reference position on the image is below the u-axis, and the physical law of perspective imaging of the projection is displayed in the figure.

[0093] The step a3 of obtaining the position information of the edges of the notch at the predetermined position includes the following steps: taking any straight line v=v parallel to the u axis g , draw a straight line perpendicular to the u axis through the intersection of the straight line and the edges of the notch on both sides, intersecting at and in Indicates the horizontal position information of the left edge of the predetermined position gap. Indicates the horizontal position information of the right edge of the predetermined position gap;

[0094] The step a4 of obtaining the position information of the edges of the reference structure at both sides comprises the following steps: taking any straight line v=v parallel to the u axis p , draw a straight line perpendicular to the u axis through the intersection of the straight line and the edges of the notch on both sides, intersecting at and in Indicates the horizontal position information of the left edge of the reference structure. Indicates the horizontal position information of the right edge of the reference structure of the base position;

[0095] The method for calculating the centerline position information of the notch in step b3 comprises the following steps: first, determining the position information of the edges on both sides of the notch stored in step a4, which are respectively and Then, similarly determine the position information of the left and right edges of the gap obtained in real time in step b2, and take a straight line v=v parallel to the u axis. g , draw a straight line perpendicular to the u axis through the intersection of the straight line and the edges of the notch on both sides, intersecting at (u g,left ,0) and (u g,right ,0), where (u g,left ,0) represents the horizontal position information of the left edge of the real-time gap, (u g,right ,0) represents the horizontal position information of the right edge of the real-time gap; then, the pixel width of the gap in the preparation stage is calculated for Finally, determine the edge of the gap that is closer to the center of the image in the real-time image. If it is the left edge, calculate If it is the right edge, calculate where u g,mid The abscissa represents the intersection of the notch centerline and the abscissa;

[0096] Step b4 includes the following steps: calculating the vector of the gap center line relative to the image center line This vector is determined by the gap centerline position information (u g,mid ,0) relative to the image center line position O image (0,0), expressed as Calculate the vector of the center line of the reference structure relative to the center line of the image This vector is obtained by storing the left and right edge position information of the reference structure in step a6. and Relative to the image centerline position O image (0,0), expressed as Determine the actual offset vector of the notch relative to the reference structure at the datum position Specifically expressed as Among them, the vector The direction of indicates the offset direction of the gap, the vector Model Indicates the offset of the gap, w g is the actual width of the gap, w p The actual width of the reference structure for the base position.

[0097] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. A method for calculating the offset of a mechanical structure gap. It is characterized in that It includes a preparation phase and a detection phase, wherein the preparation phase includes the following steps: Move the mechanical structure gap to a predetermined position; Use the camera to obtain a picture of the notch location; Performing digital image processing on the acquired image to obtain and store position information of the edges of both sides of the notch at the predetermined position; Performing digital image processing on the acquired picture to obtain and store position information of the edges on both sides of the reference structure at the predetermined reference position; The detection phase includes the following steps: Use the camera to get a picture of the notch; Performing digital image processing on the acquired notch image to obtain position information of edges on both sides of the notch; Calculate the centerline position information of the notch based on the acquired position information of the edges on both sides of the notch and the stored position information of the edges on both sides of the notch at the predetermined position; The gap offset is calculated based on the calculated gap centerline position information and the stored edge position information on both sides of the reference structure at the base position. The gap offset refers to the displacement of the gap centerline relative to the reference structure centerline at the base position.

2. A method for calculating the offset of a mechanical structure notch as claimed in claim 1, It is characterized in that The center line of the gap refers to a straight line between the two edges of the gap, and the straight line is equidistant from the two edges. It passes through the geometric center of the gap and divides the gap into two symmetrical parts, which is used to calculate the offset of the gap.

3. A method for calculating the offset of a mechanical structure notch as claimed in claim 1, It is characterized in that The center line of the reference position reference structure refers to a straight line between the two edges of the reference position reference structure, and is equidistant between the two edges. It passes through the geometric center of the reference position reference structure and divides the reference position reference structure into two symmetrical parts, providing a stable reference benchmark for calculating the notch offset.

4. A method for calculating the offset of a mechanical structure notch as claimed in claim 1, It is characterized in that The predetermined position refers to the actual position of the notch when the projection of the notch centerline on the image coincides with the image horizontal coordinate centerline.

5. A method for calculating the offset of a mechanical structure notch as claimed in claim 1, It is characterized in that The optical axis of the camera and the center line of the notch at the reference position are in the same plane, and the center line of the reference position reference structure and the center line of the notch after movement are both parallel to the plane.

6. A method for calculating the offset of a mechanical structure notch as claimed in claim 5, It is characterized in that The camera is configured to capture images of the notch and the reference structure of the reference position, so as to ensure that when the notch is translated in a plane, the position change of the center line of the notch relative to the center line of the reference structure of the reference position can be accurately monitored; The center line of the reference structure is used as a fixed reference. Its position and direction remain unchanged during the measurement process and are used to compare with the position change of the notch center line. The movement of the notch is limited to the plane in which it is located, and the calculation of the notch offset is based on the comparison of the notch centerline position information captured by the camera and the stored reference structure centerline position information.

7. A method for calculating the offset of a mechanical structure notch as claimed in claim 1, It is characterized in that The digital image processing includes an edge detection algorithm for identifying and locating the edge of the gap and its reference position reference structure, wherein the edge detection algorithm is based on gradient changes and includes a Sobel operator, a Canny edge detection algorithm, or other algorithms that can accurately identify edges in an image; The digital image processing also includes an image enhancement step, including contrast adjustment, filtering and denoising, to improve image quality and optimize the accuracy of edge detection.

8. A method for calculating the offset of a notch in a mechanical structure as claimed in claim 7, It is characterized in that The digital image processing also includes using machine learning or deep learning models to automatically identify and extract edge features of gaps and reference structures at the base position, and is capable of handling complex image conditions, including lighting changes, occlusions, and image noise, thereby improving the detection accuracy of the centerline position information of the gap and the centerline position information of the reference structure at the base position.

9. A method for calculating the offset of a notch in a mechanical structure as claimed in claim 8, It is characterized in that It also includes establishing a pixel coordinate system for the image, with the center of the image as the origin of the coordinate system O image , the horizontal axis is the u axis, the vertical axis is the v axis, and the unit is pixel.

10. A method for calculating the offset of a mechanical structure notch as claimed in claim 9, It is characterized in that Obtaining the position information of the edges of the predetermined position gap includes the following steps: taking a straight line v=v g , draw a straight line perpendicular to the u-axis through the intersection of the straight line and the edges of the notch on both sides, intersecting the u-axis at points and in Indicates the horizontal position information of the left edge of the predetermined position gap. Indicates the horizontal position information of the right edge of the predetermined position gap.