Precise tool appearance size data detection method and system based on AI driving

By using an AI-driven approach, SIFT and RANSAC algorithms are used to detect key points of the cutting tool. Combined with pixel gradient change and gray-level co-occurrence matrix algorithms, high-precision comprehensive appearance inspection results are generated, which solves the problem of large errors of two-dimensional vision sensors in precision cutting tool inspection and achieves high-precision and comprehensive inspection.

CN120953347APending Publication Date: 2025-11-14SHENZHEN SILAN PRECISION MASCH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511023220.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-24
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing two-dimensional vision sensors are affected by lens distortion in tool inspection, resulting in high-precision measurement errors and failing to meet the high-precision requirements of precision tools.

Method used

An AI-driven approach is adopted, using the SIFT algorithm to detect key points, combined with the RANSAC algorithm to remove mismatched points, using pixel gradient changes to detect boundary regions, and generating a texture feature set through the gray-level co-occurrence matrix algorithm. The size parameters and texture description set are then integrated for data fusion.

Benefits of technology

It improves the accuracy and comprehensiveness of tool inspection, reduces the impact of geometric distortion, adapts to different types of tools and shooting angles, and meets the needs of precision inspection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120953347A_ABST
    Figure CN120953347A_ABST
Patent Text Reader

Abstract

The invention discloses an AI driving-based precision cutter appearance dimension data detection method and system, and the method comprises the steps: obtaining image data of the surface of a cutter, and carrying out the preprocessing, and obtaining optimized image data; key points are detected through an S-IFT algorithm, and a key feature point set is generated; an RANSAC algorithm is used to eliminate mismatching points and generate a matching result set, effective point pairs with the distance between the matching point pairs smaller than a preset distance threshold value are reserved, corresponding positioning data are searched to lock a key area, and a boundary area is obtained through pixel gradient change detection; extracting a coordinate extreme value of the edge point coordinate of which the discontinuous proportion is smaller than a preset proportion threshold value to obtain a size parameter; meanwhile, surface texture information is extracted, an initial texture feature set is generated through a gray-level co-occurrence matrix algorithm, and a texture description set is obtained through analysis; and integrating the size parameters and the texture description set, and generating a comprehensive appearance detection result through feature splicing and fusion. According to the method, high-precision cutter appearance detection can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cutting tool inspection technology, and in particular to an AI-driven method and system for detecting the external dimensions of precision cutting tools. Background Technology

[0002] As an indispensable core area in the modern industrial system, the development level of the cutting tool manufacturing industry is directly related to machining accuracy, efficiency, and product quality. With the advancement of intelligent manufacturing, innovation in cutting tool size and appearance inspection technologies has become key to improving productivity and competitiveness.

[0003] Currently, one existing technology for quality inspection of PCB cutting tools and precision cutting tools relies on two-dimensional vision sensors. This involves uniformly illuminating the area under test with a light source, acquiring a planar image through a camera, extracting edge features using software, and then calculating linear dimensions based on preset reference points to obtain the two-dimensional dimensional parameters of the cutting tool, enabling rapid detection of the tool's dimensions.

[0004] However, two-dimensional vision sensors are limited by lens distortion, which produces geometric distortion in the image edge area. When measuring the cutting edge length, the error increases non-linearly as the measured feature deviates from the center, which cannot meet the high precision requirements for measuring cutting tools. Summary of the Invention

[0005] This invention provides an AI-driven method and system for detecting the external dimensions of precision cutting tools, addressing the problem that existing technologies cannot meet high-precision requirements for high-precision tool measurement.

[0006] In a first aspect, to address the aforementioned technical problems, this invention provides an AI-driven method for detecting the external dimensions of precision cutting tools, comprising:

[0007] Acquire image data of the tool surface;

[0008] The image data is preprocessed to obtain optimized image data;

[0009] Based on the optimized image data, key points are detected using the SIFT algorithm to generate a set of key feature points that can characterize the key areas of the cutting tool.

[0010] Based on the set of key feature points, mismatched points are eliminated by the RANSAC algorithm and a matching result set is generated. Point pairs with a distance less than a preset distance threshold are retained to generate a set of valid point pairs and search for the corresponding location data.

[0011] Based on the positioning data, the key area is identified, and the boundary area is obtained by pixel gradient change detection.

[0012] Extract the coordinates of edge points in the boundary region. When the discontinuity ratio of the edge point coordinates is less than a preset ratio threshold, extract the extreme values ​​of the edge point coordinates to obtain the size parameters.

[0013] Surface texture information in the boundary region is extracted, and an initial texture feature set is generated by statistically analyzing the gray-level relationship of pixel pairs using the gray-level co-occurrence matrix algorithm. The initial texture feature set is then analyzed to generate a texture description set.

[0014] By integrating the size parameters and the texture description set, a comprehensive appearance detection result is generated through feature splicing and data fusion.

[0015] Preferably, the preprocessing of the image data to obtain optimized image data includes:

[0016] The image data is subjected to noise filtering to obtain a preliminary texture dataset;

[0017] Surface texture features are extracted from the preliminary texture dataset to obtain a texture feature set;

[0018] The texture feature set is subjected to contrast enhancement processing to obtain an enhanced feature set;

[0019] An edge feature set is obtained based on the enhanced feature set. When the integrity of the edge feature set meets the preset integrity condition, optimized image data reflecting surface texture and edge features is obtained.

[0020] Preferably, the step of detecting key points using the SIFT algorithm based on the optimized image data to generate a set of key feature points that can characterize the key areas of the cutting tool includes:

[0021] The SIFT algorithm is used to analyze the local gradient direction of the optimized image data, identify key points at the corners of the tool edge, and generate a preliminary feature descriptor set containing position and direction.

[0022] Based on the preliminary feature descriptor set, multi-scale analysis is performed on complex surfaces to obtain a multi-scale feature set;

[0023] Based on the multi-scale feature set, key points of the tool region are extracted to generate a key feature point set that can characterize the key regions of the tool.

[0024] Preferably, the step of eliminating mismatched points and generating a matching result set based on the key feature point set using the RANSAC algorithm, and retaining point pairs whose distance between matching point pairs is less than a preset distance threshold, to generate a valid point pair set, includes:

[0025] The RANSAC algorithm is used to select a subset from a large number of matching pairs to generate a preliminary matching result set;

[0026] False matching points are extracted from the preliminary matching result set and deleted to obtain the filtered matching result set;

[0027] The distance between point pairs is calculated based on the filtered matching result set. Point pairs with a distance less than a preset distance threshold are retained to generate a valid point pair set.

[0028] Preferably, the step of locking the key region based on the positioning data and obtaining the boundary region through pixel gradient change detection includes:

[0029] Based on the positioning data, the pixels in the key area are located, and the gradient magnitude of each pixel is calculated using the Sobel operator.

[0030] Pixels with gradient magnitudes greater than a preset boundary threshold are marked as initial boundary points. A non-maximum suppression algorithm is used to retain the points with the largest local gradient magnitudes as target boundary points, and adjacent target boundary points are connected to obtain the boundary region.

[0031] Preferably, the step of extracting the edge point coordinates in the boundary region, and extracting the extreme values ​​of the edge point coordinates to obtain the size parameters when the discontinuity ratio of the edge point coordinates is less than a preset ratio threshold, includes:

[0032] Extract the set of all edge pixels from the boundary region, and arrange the points in order according to the contour tracking algorithm to form an ordered edge point sequence;

[0033] Traverse the ordered edge point sequence, calculate the Euclidean distance between two adjacent points, and if the Euclidean distance exceeds a preset pixel threshold, mark it as a discontinuous point pair. Count the number of all discontinuous point pairs and calculate the discontinuity ratio.

[0034] Determine whether the discontinuity ratio is less than a preset ratio threshold. If it is, the edge continuity is considered to meet the requirements, and the extreme values ​​of the edge point coordinates are extracted to obtain the size parameters. If not, it is considered invalid data and the current size parameters are discarded. The size parameters include length and width.

[0035] Preferably, the discontinuity ratio is calculated using the following formula:

[0036]

[0037] Where a represents a discontinuous proportion, and N dis N represents the number of all discontinuous point pairs. total This represents the total number of edge points.

[0038] Preferably, the step of extracting surface texture information in the boundary region, generating an initial texture feature set by statistically analyzing the gray-level relationship of pixel pairs using a gray-level co-occurrence matrix algorithm, and analyzing the initial texture feature set to generate a texture description set includes:

[0039] Local images of surface texture are extracted from the boundary region, converted into grayscale images, and histogram equalization is performed to obtain preprocessed texture images;

[0040] A gray-level co-occurrence matrix is ​​constructed based on the preprocessed texture image, and texture features are extracted from the gray-level co-occurrence matrix to generate an initial texture feature set;

[0041] The parameters in the initial texture feature set are normalized, and the normalized feature values ​​are weighted by preset weight coefficients to form a texture description set.

[0042] Preferably, the step of integrating the size parameters and the texture description set, and generating a comprehensive appearance detection result through feature splicing and data fusion includes:

[0043] The pixel values ​​in the size parameters are converted into actual physical dimensions based on the calibration parameters, and then normalized according to the preset maximum and minimum allowable lengths to obtain the normalized size parameters.

[0044] The normalized size parameters and the texture description set are concatenated in a fixed order to form a comprehensive feature vector, which is then input into a preset machine learning classifier. The classification result is output as the comprehensive appearance detection result.

[0045] Secondly, the present invention provides an AI-driven precision cutting tool appearance dimension data detection system, comprising:

[0046] Image data acquisition module, used to acquire image data of the tool surface;

[0047] An image data preprocessing module is used to preprocess the image data to obtain optimized image data;

[0048] The key feature point detection module is used to detect key points based on the optimized image data using the SIFT algorithm, and generate a set of key feature points that can characterize the key areas of the tool.

[0049] The positioning data acquisition module is used to remove mismatched points and generate a matching result set based on the key feature point set using the RANSAC algorithm, retain point pairs whose distance between matching point pairs is less than a preset distance threshold, generate a set of valid point pairs, and search for the corresponding positioning data.

[0050] The boundary region detection module is used to lock key regions based on the positioning data and obtain boundary regions by detecting pixel gradient changes.

[0051] The size parameter extraction module is used to extract the coordinates of edge points in the boundary region. When the discontinuity ratio of the edge point coordinates is less than a preset ratio threshold, the extreme values ​​of the edge point coordinates are extracted to obtain the size parameters.

[0052] The texture description acquisition module is used to extract surface texture information in the boundary region, generate an initial texture feature set by statistically analyzing the gray-level relationship of pixel pairs using the gray-level co-occurrence matrix algorithm, and analyze the initial texture feature set to generate a texture description set.

[0053] The comprehensive result generation module is used to integrate the size parameters and the texture description set, and generate a comprehensive appearance detection result by performing data fusion through feature splicing.

[0054] Thirdly, the present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the AI-driven precision tool appearance dimension data detection method described in any one of the above.

[0055] Fourthly, the present invention also provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the AI-driven precision tool appearance dimension data detection method described above.

[0056] Compared with the prior art, the present invention has the following beneficial effects:

[0057] 1. This invention optimizes the acquired image data to reduce the impact of noise and distortion. The SIFT algorithm is invariant to image scale and rotation, effectively extracting key feature points and avoiding key point loss or mismatches caused by lens distortion. The RANSAC algorithm eliminates mismatched points, retaining point pairs with a distance less than a preset threshold, generating a valid point pair set and further improving the accuracy of key point matching. Detecting boundary regions through pixel gradient changes allows for more precise positioning of the tool's critical areas, reducing the impact of geometric distortion on boundary detection. Through these steps, this invention effectively reduces the impact of geometric distortion on detection results and improves detection accuracy.

[0058] 2. This invention detects boundary regions through pixel gradient changes and then extracts edge point coordinates. When the discontinuity ratio of edge point coordinates is less than a preset threshold, the extreme values ​​of the edge point coordinates are extracted to obtain the dimensional parameters. This step ensures that the extracted edge point coordinates have high continuity and accuracy, thereby guaranteeing high precision of the dimensional parameters. Through the above steps, this invention can extract high-precision dimensional parameters, meeting the high-precision requirements of precision tool inspection.

[0059] 3. This invention uses a gray-level co-occurrence matrix algorithm to statistically analyze the gray-level relationships of pixel pairs, generating an initial texture feature set. Analyzing this initial texture feature set generates a texture description set, which comprehensively describes the texture features of the tool surface. The dimensional parameters and texture description set are fused through feature concatenation to generate a comprehensive appearance inspection result. This process considers not only the tool's dimensional parameters but also surface texture information, making the inspection results more comprehensive and accurate. Through the above steps, this invention can provide a more comprehensive appearance inspection result, including not only dimensional parameters but also surface texture features, improving the comprehensiveness and reliability of the inspection.

[0060] 4. This invention utilizes the SIFT algorithm, which is invariant to image scale and rotation changes, enabling it to adapt to different types of cutting tools and varying shooting angles. Preset distance thresholds and discontinuity ratio thresholds, among other parameters, can be flexibly adjusted based on different tool types, enhancing the adaptability of the solution. Each step in this invention (such as image preprocessing, keypoint detection, boundary detection, and texture feature extraction) can be independently optimized and extended, facilitating adjustments and upgrades based on actual needs. Through these steps, this invention exhibits strong adaptability and scalability, capable of meeting the detection requirements of various types of cutting tools. Attached Figure Description

[0061] Figure 1 This is a schematic diagram of a method for detecting the appearance and size data of a precision cutting tool based on AI, provided in an embodiment of the present invention.

[0062] Figure 2 This is a schematic diagram of a precision cutting tool appearance dimension data detection system based on AI driven according to an embodiment of the present invention. Detailed Implementation

[0063] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0064] Reference Figure 1The first embodiment of the present invention provides a schematic flowchart of a precision cutting tool appearance dimension data detection method based on AI, including the following steps:

[0065] S11, acquire image data of the tool surface;

[0066] S12, preprocess the image data to obtain optimized image data;

[0067] S13, based on the optimized image data, key points are detected using the SIFT algorithm to generate a set of key feature points that can characterize the key areas of the cutting tool;

[0068] S14. Based on the set of key feature points, the RANSAC algorithm is used to remove mismatched points and generate a matching result set. Point pairs with a distance between matching point pairs that is less than a preset distance threshold are retained. A set of valid point pairs is generated and the corresponding positioning data is obtained by searching.

[0069] S15, based on the positioning data, the key area is locked, and the boundary area is obtained by pixel gradient change detection;

[0070] S16, extract the coordinates of the edge points in the boundary region. When the discontinuity ratio of the edge point coordinates is less than a preset ratio threshold, extract the extreme values ​​of the edge point coordinates to obtain the size parameters.

[0071] S17, extract the surface texture information in the boundary region, generate an initial texture feature set by statistically analyzing the gray-level relationship of pixel pairs using the gray-level co-occurrence matrix algorithm, analyze the initial texture feature set and generate a texture description set;

[0072] S18, integrate the size parameters and the texture description set, and generate a comprehensive appearance detection result by data fusion through feature splicing.

[0073] In step S11, image data of the tool surface is acquired.

[0074] For example, image data acquisition can use an optical microscope or a laser scanner to collect information such as texture, wear marks and micro-cracks on the tool surface, forming a dataset containing images and three-dimensional point clouds as image data. This method can comprehensively capture the details of the tool surface.

[0075] In step S12, the image data is preprocessed to obtain optimized image data, including:

[0076] The image data is subjected to noise filtering to obtain a preliminary texture dataset;

[0077] Surface texture features are extracted from the preliminary texture dataset to obtain a texture feature set;

[0078] The texture feature set is subjected to contrast enhancement processing to obtain an enhanced feature set;

[0079] An edge feature set is obtained based on the enhanced feature set. When the integrity of the edge feature set meets the preset integrity condition, optimized image data reflecting surface texture and edge features is obtained.

[0080] The noise filtering process for the image data can be performed by mean filtering to remove interference signals. Mean filtering replaces the original value of each data point by calculating the neighborhood average value of each data point and uses it as a preliminary texture dataset, thereby reducing interference signals and smoothing the data.

[0081] The surface texture feature extraction method utilizes the principle that rough surfaces may exhibit frequent jumps in grayscale values ​​between adjacent pixels, while smooth surfaces show gradual changes. Therefore, grayscale variations in image data can be analyzed to characterize texture. This involves converting the initial texture dataset into grayscale image data. If the original image is color, a weighted average method is used to generate grayscale image data. The grayscale image data is then scanned pixel by pixel. Using the current pixel as the center, its grayscale value is compared with that of neighboring pixels. If a neighboring pixel's value is greater than the center value, it is marked as 1; if a neighboring pixel's value is less than the center value, it is marked as 0, generating a binary number. This binary number is then converted to a decimal value to obtain the LBP code for that pixel, forming an LBP texture map. The LBP texture map is divided into uniform sub-regions. An LBP histogram is calculated for each sub-region, and the frequency distribution of different LBP codes is statistically analyzed. Finally, the histograms of all sub-regions are concatenated in spatial order to generate a texture feature set.

[0082] It should be noted that the weighted average method can be implemented using the following formula:

[0083] Gray = 0.299R + 0.587G + 0.114B

[0084] Where Gray is the pixel brightness value of the grayscale image, R is the pixel value of the red channel of the color image, G is the pixel value of the green channel of the color image, and B is the pixel value of the blue channel of the color image.

[0085] The contrast enhancement process can adjust the grayscale range of the image through the following steps to make texture details more prominent: loading the texture feature set into a preset image data processing program; statistically analyzing the grayscale values ​​of the texture feature set and finding the maximum and minimum values ​​to determine the original grayscale range; setting a target grayscale range that is wider than the original grayscale range to enhance image contrast; using a linear transformation to map the grayscale values ​​in the original grayscale range to the target grayscale range; and outputting the enhanced feature set.

[0086] It should be noted that when and G oldmax When they are not equal, the formula for the linear transformation is:

[0087]

[0088] Among them, I old (x,y) is the gray value of the original image at position (x,y), I new (x,y) is the gray value at position (x,y) in the image after contrast enhancement. and G oldmax These are the minimum and maximum values ​​of the original grayscale range, respectively. and G newmax These are the minimum and maximum values ​​of the target grayscale range, respectively.

[0089] Among them, targeting and G oldmax In cases of equality anomalies, the contrast enhancement step can be skipped.

[0090] For example, the grayscale range of the original texture feature set image is 50-150. After contrast enhancement processing, the grayscale range is expanded to 20-200, thereby making the grayscale values ​​of details such as tiny cracks or wear marks more different, and making the texture and defects on the tool surface clearer.

[0091] It should be noted that contrast enhancement processing can amplify feature differences, making it easier to identify complex patterns in the future. However, it can also amplify interference signals. If the interference signals in the enhanced feature set exceed the preset interference threshold, they need to be filtered again by mean filtering.

[0092] The process of obtaining the edge feature set based on the enhanced feature set can be achieved by adaptively setting high and low thresholds for the enhanced feature set and using the Canny edge detection algorithm to detect coarse edges; then, sub-pixel interpolation is performed to improve the edge positioning accuracy to the 0.1 pixel level; by calculating the extreme points of the second derivative in the gradient direction, the precise coordinates of the sub-pixel edge points are determined, thus obtaining the edge feature set.

[0093] For example, the adaptive high and low threshold settings can be: the high threshold is the top 10% of the image gradient magnitude as the strong edge threshold, for example, gradient magnitude ≥ 120; the low threshold is set to 40% of the high threshold, for example, gradient magnitude ≥ 48, to connect broken edges.

[0094] The preset integrity conditions can be set by the user. For example, if the edge features are continuous and there are no obvious breaks, it indicates that the preprocessing effect is good; if the edge data is missing, the filtering parameters need to be readjusted or morphological closing operations need to be performed to bridge the minor breaks.

[0095] In one embodiment, if the completeness rate of the point cloud data at the edge of a certain tool is detected to be 95%, it can be considered that the completeness of the edge feature set meets the preset completeness condition, the optimization is completed, and the optimized image data is obtained.

[0096] In step S13, key points are detected using the SIFT algorithm based on the optimized image data to generate a set of key feature points that can characterize the key areas of the cutting tool, including:

[0097] The SIFT algorithm is used to analyze the local gradient direction of the optimized image data, identify key points at the corners of the tool edge, and generate a preliminary feature descriptor set containing position and direction.

[0098] Based on the preliminary feature descriptor set, multi-scale analysis is performed on complex surfaces to obtain a multi-scale feature set;

[0099] Based on the multi-scale feature set, key points of the tool region are extracted to generate a key feature point set that can characterize the key regions of the tool.

[0100] It should be noted that the SIFT algorithm performs multi-scale Gaussian blurring on the optimized image data; it subtracts adjacent Gaussian blurred images in the same group layer by layer to obtain a Gaussian difference image; in each layer of the Gaussian difference image, each pixel is compared with its 26 neighboring pixels, and local maxima or minima are marked as candidate keypoints; the curvature ratio of the candidate keypoints is calculated, and pseudo-edge points with curvature ratios exceeding 10 are eliminated; sub-pixel correction of the candidate keypoints is performed through Taylor expansion to improve the localization accuracy and obtain the final keypoints; in the region surrounding the final keypoints, the gradient magnitude and direction of each pixel are calculated; and a preliminary feature descriptor set is obtained.

[0101] The texture of the tool surface may vary at different scales due to wear or machining marks. In one implementation, the multi-scale analysis can be performed through the following steps: grouping the gradient directions of all pixels in the area surrounding the final key point in the preliminary feature descriptor set by angle, calculating the cumulative intensity of each direction, and generating a direction histogram; selecting the direction with the highest intensity in the histogram as the main direction; rotating the image to align with the main direction with the final key point as the center, dividing a 16×16 pixel area into 4×4 sub-blocks; calculating the gradient intensity of 8 directions for each sub-block, forming an 8-dimensional vector for each sub-block; concatenating the vectors of the 16 sub-blocks into a 128-dimensional descriptor and normalizing it to describe the surrounding local features; combining the final key points detected at different scales with the corresponding feature descriptors to form a multi-scale feature set; wherein, the multi-scale feature set contains surface feature information at different scales, from rough areas to fine scratches.

[0102] For example, take an optimized image of a tool surface, which contains rough areas and fine scratches. In a large-scale smooth image, the texture variation of the rough areas is large and can be captured well; for example, a rough texture with 5 significant fluctuations per millimeter will appear as obvious local extrema in a large-scale Gaussian difference image. The feature descriptors of these key points can reflect the overall characteristics of the rough areas, such as the general direction and density of the texture.

[0103] In smooth images at smaller scales, the features of fine scratches become more prominent; for example, a fine scratch with only two undulations per millimeter can be accurately detected as a key point in a small-scale Gaussian difference image. The feature descriptors of these key points can describe in detail the local features of the fine scratch, such as the direction and width of the scratch.

[0104] It is worth noting that, based on the coordinate range of the ROI region of the tool in the image, key points whose coordinates fall within this range are selected from the multi-scale feature set; the Douglas-Peucker algorithm is used to approximate polygons for the key points, the deviation between the fitted edge and the theoretical model is calculated, and outliers with deviations exceeding ±2 pixels are removed; the distribution of the main directions of the key points is statistically analyzed, and if the direction of a certain region changes abruptly, it is re-matched; for the key points that pass the verification, the multi-scale descriptors are merged, and the 128-dimensional descriptors are concatenated into 256 dimensions to enhance the feature discrimination; according to the spatial distribution of the key points, their respective regions are labeled, such as the cutting edge, the tool holder, and the wear area; and a set of key feature points is generated.

[0105] In step S14, based on the key feature point set, mismatched points are removed using the RANSAC algorithm, and a matching result set is generated. Point pairs with a distance less than a preset distance threshold are retained, generating a valid point pair set and searching for the corresponding location data, including:

[0106] The RANSAC algorithm is used to select a subset from a large number of matching pairs to generate a preliminary matching result set;

[0107] False matching points are extracted from the preliminary matching result set and deleted to obtain the filtered matching result set;

[0108] The distance between point pairs is calculated based on the filtered matching result set. Point pairs with a distance less than a preset distance threshold are retained to generate a valid point pair set.

[0109] It should be noted that when using the RANSAC algorithm to process matching calculations, the core of the algorithm is to filter out reliable correct matches from point pairs containing a large number of mismatches by combining random sampling with consistency verification, thereby eliminating the interference of abnormal matches.

[0110] For example, when the tool surface is distorted due to changes in the shooting angle, resulting in a large number of mismatches mixed in the feature point matching pairs, the RANSAC algorithm first randomly selects a small number of matching pairs, assumes that these matching pairs are correct matches, and establishes a preliminary geometric transformation model based on the coordinate relationship of these matching pairs. Then, it verifies the consistency of other matching pairs, calculates the transformation error of each point pair under the preliminary geometric transformation model, and considers point pairs with small errors as correct matches, while those with large errors are judged as mismatches. Finally, the above process is repeated multiple times, and the number of correct matches that conform to the model is recorded each time. Finally, the model with the most correct matches and its corresponding point pairs are selected as the preliminary matching result set, thereby eliminating most of the interference from mismatches.

[0111] The process of obtaining the filtered matching result set involves applying a transformation matrix to all matching points, calculating the projection error, marking points with errors greater than a threshold as mismatched points, deleting all mismatched points, and retaining the set of correct matching points as the filtered matching result set.

[0112] The preset distance threshold is used to retain valid point pairs. The distance between point pairs is the Euclidean distance between the two points, which can be calculated using the following formula:

[0113]

[0114] Where d is the Euclidean distance between the two points, x1 and y1 are the x and y coordinates of the first point, and x2 and y2 are the x and y coordinates of the second point.

[0115] Preferably, the preset distance threshold can be set to 0.5 mm. If the distance between point pairs on the tool surface is less than 0.5 mm, the matching is considered reasonable and a valid point pair set is generated; if the distance between point pairs on the tool surface is greater than 0.5 mm, the pair is considered invalid.

[0116] It is worth noting that after generating valid point pairs, the acquisition of positioning data is essentially based on the coordinate information of the point pairs. By establishing a mapping relationship between the reference image coordinate system and the current image coordinate system, the coordinate information of the point pairs is transformed into positioning data for the critical area of ​​the tool.

[0117] In step S15, locking the key region based on the positioning data and obtaining the boundary region through pixel gradient change detection includes:

[0118] Based on the positioning data, the pixels in the key area are located, and the gradient magnitude of each pixel is calculated using the Sobel operator.

[0119] Pixels with gradient magnitudes greater than a preset boundary threshold are marked as initial boundary points. A non-maximum suppression algorithm is used to retain the points with the largest local gradient magnitudes as target boundary points, and adjacent target boundary points are connected to obtain the boundary region.

[0120] It is worth noting that the process involves locking the pixels in the key region based on the positioning data by converting the positioning data into a corresponding geometric model; extending a safety distance of ±5 pixels along the geometric model to generate a strip-shaped ROI region; performing inverse distortion on the boundary points of the ROI region; calculating the coordinates in the original image and mapping them back to the original image coordinate system; and locking the actual pixel region.

[0121] It should be noted that the formula for converting positioning data into the corresponding geometric model is as follows:

[0122] x′=x(1+k1r 2 +k2r 4 )

[0123]

[0124] The formula for calculating the coordinates in the original image is:

[0125]

[0126] Where x and y are the x and y coordinates of the effective point pairs in the pixel coordinate set, respectively. ′ y ′ These are the horizontal and vertical coordinates of the physical coordinates in the geometric model, k1 and k2 are lens distortion parameters, which can be calibrated using a calibration plate, and r, r ′ These are the normalized radius of the original image and the normalized radius after correction, respectively.

[0127] The calculation of the gradient magnitude of each pixel using the Sobel operator can be achieved through the following process: Detect the horizontal and vertical edges of the image using horizontal and vertical convolution kernels respectively, and calculate the first-order partial derivatives in the corresponding directions to obtain the horizontal and vertical Sobel operators; take a 3×3 neighborhood for each pixel in the key region and convolve it with the horizontal and vertical Sobel operators respectively to obtain the horizontal and vertical convolution results; calculate the gradient magnitude based on the Pythagorean theorem combined with the horizontal and vertical convolution results; process boundary pixels where a complete 3×3 neighborhood cannot be obtained.

[0128] The following two processing methods can be provided for the processing that cannot obtain the boundary pixels of the complete 3×3 neighborhood: ignore the boundary pixels and only calculate the gradient magnitude of the internal pixels, or fill the image, such as zero padding, to add zero-value pixels outside the image boundary to ensure that the boundary pixels can also perform convolution operations.

[0129] It should be noted that the preset boundary threshold, which is used to mark pixels with gradient amplitudes greater than the preset boundary threshold, does not have a fixed and uniform value. It needs to be dynamically adjusted according to the surface roughness of the tool, lighting conditions, and noise level. For example, for a new tool with a clear edge, the preset boundary threshold can be set to 150, and for a worn tool, it can be set to 80. Finally, the rationality of the threshold is verified through experiments to ensure that the boundary area is both complete and non-redundant. Pixels with gradient amplitudes greater than the preset boundary threshold are marked as preliminary boundary points.

[0130] The purpose of employing the non-maximum suppression algorithm is to refine the edges, retaining only the initial boundary points with the largest local gradient magnitude, and eliminating the problem of excessively wide edges caused by multiple adjacent pixels being marked as boundary points simultaneously. This can be achieved through the following steps: Calculate the gradient direction based on the convolution results in the horizontal and vertical directions combined with the arctangent function; discretize the gradient direction into 4 or 8 fixed direction intervals, each interval corresponding to a main direction, and classify any gradient direction to the nearest main direction for easy neighborhood comparison; traverse all pixels marked as initial boundary points; based on the gradient direction, find two adjacent pixels perpendicular to the gradient direction in the neighborhood of each initial boundary point, compare whether the gradient magnitude of the initial boundary point is greater than the gradient magnitude of the two adjacent pixels, if so, retain the initial boundary point as a target boundary point; if not, remove the initial boundary point from the boundary point set; connect adjacent target boundary points to obtain the boundary region.

[0131] In step S16, the extraction of edge point coordinates in the boundary region, when the discontinuity ratio of the edge point coordinates is less than a preset ratio threshold, involves extracting the extreme values ​​of the edge point coordinates to obtain size parameters, including:

[0132] Extract the set of all edge pixels from the boundary region, and arrange the points in order according to the contour tracking algorithm to form an ordered edge point sequence;

[0133] Traverse the ordered edge point sequence, calculate the Euclidean distance between two adjacent points, and if the Euclidean distance exceeds a preset pixel threshold, mark it as a discontinuous point pair. Count the number of all discontinuous point pairs and calculate the discontinuity ratio.

[0134] Determine whether the discontinuity ratio is less than a preset ratio threshold. If it is, the edge continuity is considered to meet the requirements, and the extreme values ​​of the edge point coordinates are extracted to obtain the size parameters. If not, it is considered invalid data and the current size parameters are discarded. The size parameters include length and width.

[0135] The step of using a contour tracking algorithm to arrange pixels in sequence can be achieved through Freeman chaincode or Moore-Neighbor tracking via the following steps.

[0136] Freeman chain code traverses the image to find the bottom left boundary pixel as the starting point. Starting directly above the starting point, it records a direction code for every 45° interval, numbered 0-7. Using the starting point as the center, it checks the neighborhood in a clockwise direction and records the direction code of the next boundary point relative to the current point. It updates the center point to the new boundary point and updates the search direction to 0. When it returns to the starting point, it stops tracking and obtains a Freeman chain code sequence composed of direction codes as an ordered sequence of edge points.

[0137] Moore-Neighbor tracking, on the other hand, traverses the image, finds the top left boundary pixel as the starting point, defines an eight-neighbor inspection order, inspects the neighborhood of the starting point in sequence, finds unvisited boundary points, records their coordinates and marks them as visited, records the direction of unvisited boundary points relative to the starting point to avoid backtracking, and starts the inspection from the next direction next to that direction next time, and returns to the starting point or after all boundary points have been traversed to form an ordered sequence of edge points.

[0138] It is worth noting that Freeman chain code compactly represents the contour through directional encoding, which is suitable for storing and analyzing contour shapes; Moore-Neighbor tracking directly records the coordinate sequence, intuitively reflecting the contour position, which is convenient for subsequent distance and extreme value calculations; both methods achieve edge point sorting through ordered tracking, laying the foundation for edge analysis.

[0139] The Euclidean distance between two adjacent points can be calculated using the Euclidean distance calculation formula between two points in step S14.

[0140] It should be noted that the specific value of the preset pixel threshold needs to be determined comprehensively based on factors such as image resolution, target object size, expected edge continuity, and noise level; for example, if the maximum allowed discontinuous physical length is 0.1 mm and the resolution is 100 pixels / mm, then the pixel threshold is 10 pixels.

[0141] For example, in the edge detection of a simple geometric figure of 100×100 pixels, if the Euclidean distance between adjacent edge points exceeds 2 pixels, it is considered discontinuous, and the preset pixel threshold can be set to 2. In a mechanical part image of 500×500 pixels, considering that there may be slight wear or shooting noise at the edge of the part, the preset pixel threshold can be set to 5.

[0142] It is worth noting that if the Euclidean distance exceeds a preset pixel threshold, it is marked as a discontinuous point pair. The number of all discontinuous point pairs is counted, and the discontinuity ratio is calculated using the following formula:

[0143]

[0144] Where a represents a discontinuous proportion, and N dis N represents the number of all discontinuous point pairs. total This represents the total number of edge points.

[0145] In step S17, the extraction of surface texture information in the boundary region, the generation of an initial texture feature set by statistically analyzing the gray-level relationships of pixel pairs using the gray-level co-occurrence matrix algorithm, and the analysis of the initial texture feature set to generate a texture description set include:

[0146] Local images of surface texture are extracted from the boundary region, converted into grayscale images, and histogram equalization is performed to obtain preprocessed texture images;

[0147] A gray-level co-occurrence matrix is ​​constructed based on the preprocessed texture image, and texture features are extracted from the gray-level co-occurrence matrix to generate an initial texture feature set;

[0148] The parameters in the initial texture feature set are normalized, and the normalized feature values ​​are weighted by preset weight coefficients to form a texture description set.

[0149] Specifically, the process of extracting surface texture from a local image in the boundary region, converting it to a grayscale image, and performing histogram equalization to obtain a preprocessed texture image requires defining the Region of Interest (ROI) containing the surface texture based on the boundary region and location data. Then, the ROI is cropped from the optimized image data to obtain a local image containing the surface texture. The color local image is converted to a grayscale image according to the weighted average calculation formula in step S12. The grayscale value distribution of the grayscale image is extended to the entire dynamic range to enhance the distinguishability of texture details, thus obtaining the preprocessed texture image.

[0150] It is worth noting that the specific steps for constructing the gray-level co-occurrence matrix are as follows: determine the spatial interval between two pixels, define the relative direction of pixel pairs, and re-divide the original gray levels of the image into k levels to simplify calculations; create a k×k zero matrix to record the number of times pixel pairs appear; for each pixel in the image, find the corresponding pixel according to the specified distance and direction, count the number of times the gray-level value pairs of these two pixels appear, and record them in the gray-level co-occurrence matrix; extract a series of texture features based on the calculation formulas of the gray-level co-occurrence matrix and different texture features to obtain the initial texture feature set.

[0151] It is worth noting that the initial texture features include contrast, correlation, energy, and entropy, with contrast being the most important factor. norm The calculation formula is:

[0152]

[0153] Where Contrast is the initial contrast, Contrast norm This is the normalized contrast ratio, where k is the number of gray levels (e.g., 256 levels), stabilizing the result range within a reasonable range. Normalized contrast ratio reflects the sharpness of textures; a higher value indicates sharper texture edges. For example, scratches and wear areas have high contrast.

[0154] The formula for calculating correlation is:

[0155]

[0156] Correlation reflects the directional regularity of texture. The larger the value, the stronger the consistency of texture direction. For example, regular processed textures have high correlation.

[0157] The formula for calculating energy is:

[0158]

[0159] Energy represents the uniformity of texture; a larger value indicates a more uniform grayscale distribution. For example, a smooth surface has high energy.

[0160] The formula for calculating entropy is:

[0161]

[0162] Entropy describes the complexity of a texture; the larger the value, the more chaotic the texture. For example, rusted areas have high entropy values.

[0163] Where i is the gray value of the first pixel, j is the gray value of the co-occurring pixel, P(i,j) is the gray-level co-occurrence matrix, and μ x and μ y These are the mean of the matrix's rows and columns, respectively, σ x and σ y These are the standard deviations of the matrix rows and columns, respectively.

[0164] It should be noted that the parameters in the initial texture feature set are normalized respectively, and the normalized feature values ​​are weighted by preset weight coefficients to form a texture description set. The feature values ​​can be normalized using the minimum-maximum normalization formula, as follows:

[0165]

[0166] Where x is the original eigenvalue, x min x max These are the minimum and maximum values ​​of the characteristic, x. norm These are the normalized eigenvalues.

[0167] In one embodiment, the preset weighting coefficients can be assigned to different features based on the sensitivity of the tool surface defects. If the tool scratches depend more on contrast and entropy, the weighting coefficient for contrast can be set to 0.4, the weighting coefficient for entropy to 0.3, and the weighting coefficient for energy and correlation to 0.3. The corresponding weighting coefficients are multiplied by the normalized feature values, and then summed to obtain a weighted score, which finally yields the texture description set.

[0168] In step S18, integrating the size parameters and the texture description set, and generating a comprehensive appearance detection result through feature splicing, includes:

[0169] The pixel values ​​in the size parameters are converted into actual physical dimensions based on the calibration parameters, and then normalized according to the preset maximum and minimum allowable lengths to obtain the normalized size parameters.

[0170] The normalized size parameters and the texture description set are concatenated in a fixed order to form a comprehensive feature vector, which is then input into a preset machine learning classifier. The classification result is output as the comprehensive appearance detection result.

[0171] The normalization process based on preset maximum and minimum allowable lengths to obtain normalized size parameters aims to normalize all size parameters to the [0,1] interval, thereby standardizing the data and facilitating fusion and splicing with the texture description set for further analysis and processing.

[0172] For example, suppose a pixel value in the size parameter represents a length of L, and the preset maximum allowed length is L. max The minimum allowed length is L min Then the normalized size parameter L norm It can be calculated using the following formula:

[0173]

[0174] The maximum allowed length is L. max The minimum allowed length is L. min The tolerance range is determined by the tool type, and the two are not equal. This formula maps the original length L to the interval [0,1]. If L = L min Then L norm =0; if L=L max Then L norm =1; while for those between L min and L max For L between these two values, the corresponding normalized value is calculated based on their relative positions. For example, if L is exactly L... min and L max The average value of L, then norm=0.5.

[0175] After normalization, the normalized size parameters and texture features are concatenated in a fixed order to form a comprehensive feature vector, which is then used as input to the detection model. For example, the comprehensive feature vector is represented as [length, width, contrast, energy, entropy, correlation, weighted score].

[0176] Next, the integrated feature vector is input into a pre-defined machine learning classifier, and the output classification result is used as the integrated appearance inspection result. The integrated appearance inspection result includes size compliance judgment, checking whether the length and width are within the allowable range; texture defect judgment, checking whether the weighted score of the surface texture exceeds the allowable range. If so, the surface is judged to have a defect; if not, it is rated as normal. The integrated result is qualified or unqualified.

[0177] It is worth noting that the preset machine learning classifier can be trained through the following steps:

[0178] Collect and integrate the size parameters and texture description set to obtain the comprehensive feature vector, as well as the historical data of the corresponding labels;

[0179] Check the data for missing values, outliers, etc. If any are found, delete the samples containing missing values ​​and correct or remove the outliers. If none are found, keep the data samples.

[0180] The historical data after inspection is divided into training and testing sets, usually with 70%-80% used for training and 20%-30% used for testing.

[0181] Normalize the comprehensive feature vectors in the training set to ensure comparability between different features and avoid affecting the model training effect due to differences in feature scale. For example, use the min-max normalization method to map feature values ​​to the [0,1] interval;

[0182] Choose an appropriate kernel function based on the characteristics of the data, such as linear kernel function, polynomial kernel function, radial basis function (RBF), etc.

[0183] Set relevant parameters for SVM, such as the penalty parameter C, to control the degree of punishment for misclassification. The larger the C is, the heavier the punishment for misclassification. The optimal value of C can be determined by cross-validation.

[0184] The SVM model is trained using the combined feature vectors and corresponding labels of the training set. The optimal hyperplane is found through the sequence minimum optimization algorithm to maximize the margin between different classes.

[0185] The trained SVM model is evaluated using a test set, and the accuracy is calculated.

[0186] Based on the evaluation results, determine whether the model meets the requirements. If it does, a well-trained machine learning classifier is obtained; if it does not, the parameters can be adjusted or other kernel functions can be tried for retraining.

[0187] For example, the tool inspection standard is set as follows: a length range of 1.18 to 1.22 mm is compliant, a width exceeding 0.5 mm is out of tolerance, and a surface texture weighted score greater than 0.6 is judged to have scratch defects. The inspection data of a tool is a length of 1.22 mm, a width of 0.51 mm, and a surface texture weighted score of 0.75. When the spliced ​​comprehensive feature vector is input into the preset machine learning classifier, the comprehensive appearance inspection result is: unqualified (reason: width out of tolerance, surface scratches).

[0188] In summary, this invention uses AI-driven data detection methods combined with multi-algorithm collaborative optimization to detect the appearance of cutting tools, accurately capturing the surface texture and dimensional features of complex cutting tools, and achieving high-precision tool appearance detection. This not only solves the accuracy bottleneck of traditional two-dimensional vision but also breaks through the limitations of single-dimensional detection, providing a high-precision, multi-dimensional, and reliable solution for the field of tool inspection.

[0189] Reference Figure 2 The second embodiment of the present invention provides an AI-driven precision cutting tool appearance dimension data detection system, comprising:

[0190] Image data acquisition module, used to acquire image data of the tool surface;

[0191] An image data preprocessing module is used to preprocess the image data to obtain optimized image data;

[0192] The key feature point detection module is used to detect key points based on the optimized image data using the SIFT algorithm, and generate a set of key feature points that can characterize the key areas of the tool.

[0193] The positioning data acquisition module is used to remove mismatched points and generate a matching result set based on the key feature point set using the RANSAC algorithm, retain point pairs whose distance between matching point pairs is less than a preset distance threshold, generate a set of valid point pairs, and search for the corresponding positioning data.

[0194] The boundary region detection module is used to lock key regions based on the positioning data and obtain boundary regions by detecting pixel gradient changes.

[0195] The size parameter extraction module is used to extract the coordinates of edge points in the boundary region. When the discontinuity ratio of the edge point coordinates is less than a preset ratio threshold, the extreme values ​​of the edge point coordinates are extracted to obtain the size parameters.

[0196] The texture description acquisition module is used to extract surface texture information in the boundary region, generate an initial texture feature set by statistically analyzing the gray-level relationship of pixel pairs using the gray-level co-occurrence matrix algorithm, and analyze the initial texture feature set to generate a texture description set.

[0197] The comprehensive result generation module is used to integrate the size parameters and the texture description set, and generate a comprehensive appearance detection result by performing data fusion through feature splicing.

[0198] It should be noted that the AI-driven precision tool appearance dimension data detection system provided in this embodiment of the invention is used to execute all the process steps of the AI-driven precision tool appearance dimension data detection method in the above embodiment. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.

[0199] This invention also provides an electronic device. The electronic device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a Moore-Neighbor tracking program. When the processor executes the computer program, it implements the steps described in the various embodiments of the AI-driven precision tool appearance dimension data detection method, for example... Figure 1 The step S11 shown. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the above-described device embodiments, such as the boundary region detection module.

[0200] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.

[0201] The electronic device may be a desktop computer, laptop, handheld computer, or smart tablet, etc. The electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the above components are merely examples of electronic devices and do not constitute a limitation on the electronic device. It may include more or fewer components than described above, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.

[0202] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the electronic device, connecting all parts of the electronic device via various interfaces and lines.

[0203] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, RAM, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0204] Wherein, if the modules / units integrated in the electronic device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0205] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.

[0206] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.

Claims

1. A method for detecting the external dimensions of precision cutting tools based on AI, characterized in that, include: Acquire image data of the tool surface; The image data is preprocessed to obtain optimized image data; Based on the optimized image data, key points are detected using the SIFT algorithm to generate a set of key feature points that can characterize the key areas of the cutting tool. Based on the set of key feature points, mismatched points are eliminated by the RANSAC algorithm and a matching result set is generated. Point pairs with a distance less than a preset distance threshold are retained to generate a set of valid point pairs and search for the corresponding location data. Based on the positioning data, the key area is identified, and the boundary area is obtained by pixel gradient change detection. Extract the coordinates of edge points in the boundary region. When the discontinuity ratio of the edge point coordinates is less than a preset ratio threshold, extract the extreme values ​​of the edge point coordinates to obtain the size parameters. Surface texture information in the boundary region is extracted, and an initial texture feature set is generated by statistically analyzing the gray-level relationship of pixel pairs using the gray-level co-occurrence matrix algorithm. The initial texture feature set is then analyzed to generate a texture description set. By integrating the size parameters and the texture description set, a comprehensive appearance detection result is generated through feature splicing and data fusion.

2. The method for detecting the external dimensions of precision cutting tools based on AI-driven technology according to claim 1, characterized in that, The preprocessing of the image data to obtain optimized image data includes: The image data is subjected to noise filtering to obtain a preliminary texture dataset; Surface texture features are extracted from the preliminary texture dataset to obtain a texture feature set; The texture feature set is subjected to contrast enhancement processing to obtain an enhanced feature set; An edge feature set is obtained based on the enhanced feature set. When the integrity of the edge feature set meets the preset integrity condition, optimized image data reflecting surface texture and edge features is obtained.

3. The method for detecting the external dimensions of precision cutting tools based on AI as described in claim 1, characterized in that, The step of detecting key points using the SIFT algorithm based on the optimized image data and generating a set of key feature points that can characterize the key areas of the cutting tool includes: The SIFT algorithm is used to analyze the local gradient direction of the optimized image data, identify key points at the corners of the tool edge, and generate a preliminary feature descriptor set containing position and direction. Based on the preliminary feature descriptor set, multi-scale analysis is performed on complex surfaces to obtain a multi-scale feature set; Based on the multi-scale feature set, key points of the tool region are extracted to generate a key feature point set that can characterize the key regions of the tool.

4. The method for detecting the external dimensions of precision cutting tools based on AI as described in claim 1, characterized in that, The step of eliminating mismatched points and generating a matching result set based on the key feature point set using the RANSAC algorithm, retaining point pairs whose distance is less than a preset distance threshold, and generating a valid point pair set includes: The RANSAC algorithm is used to select a subset from a large number of matching pairs to generate a preliminary matching result set; False matching points are extracted from the preliminary matching result set and deleted to obtain the filtered matching result set; The distance between point pairs is calculated based on the filtered matching result set. Point pairs with a distance less than a preset distance threshold are retained to generate a valid point pair set.

5. The method for detecting the external dimensions of precision cutting tools based on AI as described in claim 1, characterized in that, The step of locking the key region based on the positioning data and obtaining the boundary region through pixel gradient change detection includes: Based on the positioning data, the pixels in the key area are located, and the gradient magnitude of each pixel is calculated using the Sobel operator. Pixels with gradient magnitudes greater than a preset boundary threshold are marked as initial boundary points. A non-maximum suppression algorithm is used to retain the points with the largest local gradient magnitudes as target boundary points, and adjacent target boundary points are connected to obtain the boundary region.

6. The method for detecting the external dimensions of precision cutting tools based on AI as described in claim 1, characterized in that, The step of extracting the edge point coordinates in the boundary region, and when the discontinuity ratio of the edge point coordinates is less than a preset ratio threshold, extracting the extreme values ​​of the edge point coordinates to obtain size parameters, includes: Extract the set of all edge pixels from the boundary region, and arrange the points in order according to the contour tracking algorithm to form an ordered edge point sequence; Traverse the ordered edge point sequence, calculate the Euclidean distance between two adjacent points, and if the Euclidean distance exceeds a preset pixel threshold, mark it as a discontinuous point pair. Count the number of all discontinuous point pairs and calculate the discontinuity ratio. Determine whether the discontinuity ratio is less than a preset ratio threshold. If it is, the edge continuity is considered to meet the requirements, and the extreme values ​​of the edge point coordinates are extracted to obtain the size parameters. If not, it is considered invalid data and the current size parameters are discarded. The size parameters include length and width.

7. The AI-driven precision cutting tool appearance dimension data detection method according to claim 6, characterized in that, The discontinuity ratio is calculated using the following formula: Where a represents a discontinuous proportion, and N dis N represents the number of all discontinuous point pairs. total This represents the total number of edge points.

8. The method for detecting the external dimensions of precision cutting tools based on AI-driven technology according to claim 1, characterized in that, The process of extracting surface texture information in the boundary region, generating an initial texture feature set by statistically analyzing the gray-level relationships of pixel pairs using a gray-level co-occurrence matrix algorithm, and analyzing the initial texture feature set to generate a texture description set includes: Local images of surface texture are extracted from the boundary region, converted into grayscale images, and histogram equalization is performed to obtain preprocessed texture images; A gray-level co-occurrence matrix is ​​constructed based on the preprocessed texture image, and texture features are extracted from the gray-level co-occurrence matrix to generate an initial texture feature set; The parameters in the initial texture feature set are normalized, and the normalized feature values ​​are weighted by preset weight coefficients to form a texture description set.

9. The method for detecting the external dimensions of precision cutting tools based on AI as described in claim 1, characterized in that, The process of integrating the size parameters and the texture description set, and generating a comprehensive appearance detection result through feature splicing, includes: The pixel values ​​in the size parameters are converted into actual physical dimensions based on the calibration parameters, and then normalized according to the preset maximum and minimum allowable lengths to obtain the normalized size parameters. The normalized size parameters and the texture description set are concatenated in a fixed order to form a comprehensive feature vector, which is then input into a preset machine learning classifier. The classification result is output as the comprehensive appearance detection result.

10. A precision cutting tool appearance dimension data inspection system based on AI, characterized in that, include: Image data acquisition module, used to acquire image data of the tool surface; An image data preprocessing module is used to preprocess the image data to obtain optimized image data; The key feature point detection module is used to detect key points based on the optimized image data using the SIFT algorithm, and generate a set of key feature points that can characterize the key areas of the tool. The positioning data acquisition module is used to remove mismatched points and generate a matching result set based on the key feature point set using the RANSAC algorithm, retain point pairs whose distance between matching point pairs is less than a preset distance threshold, generate a set of valid point pairs, and search for the corresponding positioning data. The boundary region detection module is used to lock key regions based on the positioning data and obtain boundary regions by detecting pixel gradient changes. The size parameter extraction module is used to extract the coordinates of edge points in the boundary region. When the discontinuity ratio of the edge point coordinates is less than a preset ratio threshold, the extreme values ​​of the edge point coordinates are extracted to obtain the size parameters. The texture description acquisition module is used to extract surface texture information in the boundary region, generate an initial texture feature set by statistically analyzing the gray-level relationship of pixel pairs using the gray-level co-occurrence matrix algorithm, and analyze the initial texture feature set to generate a texture description set. The comprehensive result generation module is used to integrate the size parameters and the texture description set, and generate a comprehensive appearance detection result by performing data fusion through feature splicing.

Citation Information

Cited By

  • Sheep body size measuring method and device and electronic equipment

    CN121323493A