An image data management method and system for high-precision dimensional visual inspection

CN121366152BActive Publication Date: 2026-08-14CHANGCHUN AUTOMOBILE IND INST
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0004]但现有的用于高精度尺寸视觉检测的图像数据管理方法及系统在进行使用时数据采集环节多依赖单视角图像采集,忽略多视角图像对零部件全方位尺寸信息的覆盖价值,易因视角盲区导致局部尺寸(如零部件内侧凹槽、异形曲面)漏检,无法匹配复杂结构零部件的检测需求,同时区域分割处理多采用固定阈值算法,未考虑工业场景中光照变化、油污干扰对图像灰度分布的影响,导致目标区域与背景区域分割边界模糊,甚至出现目标区域断连,为后续特征提取埋下误差隐患,针对相关技术中的问题,目前尚未提出有效的解决方案

Benefits of technology

1、本发明通过多视角图像数据集与物理尺寸标定数据集的同步采集,结合几何量标准器具的标定参照,解决传统单视角图像信息不全、物理尺寸映射偏差大的问题,同时通过自适应阈值分割算法与边缘轮廓优化,剔除图像噪声、精准区分目标与背景区域,提升原始数据的有效性与区域分割的精度,为后续特征提取奠定高质量数据基础,同时引入模糊逻辑推理算法构建轮廓映射关联模型,通过数据样本迭代优化实现轮廓特征参数与物理尺寸标定数据的动态映射,规避传统特征关联中人为设定映射规则的主观性,且结合特征有效性评估指标的量化评分与筛选规则,精准筛选高价值轮廓特征,解决特征冗余、有效性不足的问题,提升输入模型的特征质量。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121366152B_ABST
    Figure CN121366152B_ABST
Patent Text Reader

Abstract

This invention discloses an image data management method and system for high-precision size visual inspection, relating to the field of image data technology. The image data management method for high-precision size visual inspection includes the following steps: S1, acquiring a dataset and performing region segmentation; S2, correcting and enhancing the dataset and extracting contour feature parameters; S3, performing mapping association and filtering / classification; S4, optimizing and adjusting parameters to generate a standardized size detection feature set; S5, constructing a size detection model to obtain the quantitative detection result of the target size; S6, verifying accuracy and establishing an image feature size parameter association database. This invention solves the problems of incomplete information and large deviations in physical size mapping caused by traditional single-view image methods by simultaneously acquiring multi-view image datasets and physical size calibration datasets, combined with the calibration reference of geometric standard instruments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image data technology, and more particularly to an image data management method and system for high-precision size visual inspection. Background Technology

[0002] High-precision dimensional visual inspection technology is a core means of achieving non-contact precision measurement in the industrial manufacturing field. Its core is to quantify the dimensional parameters of precision parts through image data acquisition and processing. It has become a key link in ensuring product qualification rate and maintaining production line stability. Moreover, this technology is widely used in scenarios with stringent dimensional accuracy requirements, such as automobile manufacturing, semiconductor packaging, and high-end equipment.

[0003] Efficient image data management is a core prerequisite for the implementation of high-precision dimensional visual inspection technology. Image data management can not only solve the problems of chaotic traditional image data acquisition and inefficient processing, helping enterprises reduce detection misjudgments caused by data errors and reduce rework and scrap costs, but also promote the upgrading of the inspection process from manual intervention to fully automated closed-loop, replacing traditional manual visual inspection or contact inspection, greatly improving the inspection efficiency of the production line, and providing a unified data standard for multi-production line collaborative inspection, reducing inconsistencies in cross-line inspection results.

[0004] However, existing image data management methods and systems for high-precision dimensional visual inspection often rely on single-view image acquisition during the data acquisition stage, neglecting the value of multi-view images in covering the omnidirectional dimensional information of parts. This can easily lead to missed detection of local dimensions (such as inner grooves or irregular curved surfaces of parts) due to blind spots in the viewpoint, failing to meet the inspection requirements of complex structural parts. At the same time, the region segmentation processing often uses fixed threshold algorithms, failing to consider the impact of lighting changes and oil pollution on the grayscale distribution of images in industrial scenarios. This results in blurred boundaries between the target area and the background area, or even disconnection of the target area, creating potential errors for subsequent feature extraction. Currently, no effective solutions have been proposed to address these issues in the relevant technologies. Summary of the Invention

[0005] To address the problems in related technologies, this invention proposes an image data management method and system for high-precision dimensional visual inspection, thereby overcoming the aforementioned technical problems existing in the prior art.

[0006] To achieve the above objectives, the specific technical solution adopted by the present invention is as follows: According to one aspect of the present invention, an image data management method for high-precision size visual inspection is provided, comprising the following steps: S1. Collect multi-view image datasets and physical size calibration datasets using high-precision size detection equipment, and perform region segmentation processing on the multi-view image datasets; As a preferred embodiment, the process of acquiring multi-view image datasets and physical size calibration datasets using a high-precision size detection device, and performing region segmentation processing on the multi-view image datasets, includes the following steps: S11. Set up a detection device consisting of a high-precision industrial camera and a light source system, and adjust the shooting angle to collect multi-view images of the target object to form a multi-view image dataset. S12. Use existing geometric standard instruments as calibration references, and simultaneously collect images and physical dimension parameters of the standard gauge block from various perspectives to form a physical dimension calibration dataset. S13. Adaptive threshold segmentation algorithm is used to segment the multi-view image dataset into regions to obtain target region dataset and background region dataset. As a preferred embodiment, the step of using an adaptive threshold segmentation algorithm to segment the multi-view image dataset into regions, obtaining the target region dataset and the background region dataset, includes the following steps: S131. Remove image noise from the multi-view image dataset; S132. Preset an adaptive threshold calculation window set and match the adaptive threshold calculation window set with the denoised multi-view image dataset. S133. Extract grayscale distribution features and target size parameters from multi-view image datasets using a matching-based adaptive threshold calculation window; S134. Perform binarization segmentation on the grayscale distribution features and target size parameters to obtain the target region dataset and the background region dataset.

[0007] S14. Extract the edge contours of the target region dataset and the background region dataset, and fill the holes inside the region.

[0008] As a preferred embodiment, the step of extracting the edge contours of the target region dataset and the background region dataset, and filling the holes inside the region, includes the following steps: S141. Preset edge detection algorithm library and morphological processing parameter library, and set edge strength threshold and area threshold of voids inside the region; S142. Extract the gray-level gradient feature values ​​of the target region dataset and the background region dataset, and select the edge detection algorithm from the edge detection algorithm library based on the gray-level gradient feature values. S143. Apply the selected edge detection algorithm to the target region dataset and the background region dataset, and filter and adjust the edge contour based on the edge intensity threshold. S144. Identify the internal voids in the region of the edge contour, and call the closing operation parameter and the region internal void area threshold in the morphological processing parameter library to fill the internal voids in the edge contour.

[0009] S2. Correct and enhance the multi-view image dataset after region segmentation, and extract the contour feature parameters of the corrected and enhanced multi-view image dataset. S3. Preset feature effectiveness evaluation index, map and associate contour feature parameters with physical dimension calibration data, and filter and classify the mapped and associated contour feature parameters according to the feature effectiveness evaluation index; As a preferred embodiment, the preset feature effectiveness evaluation index maps and associates contour feature parameters with physical dimension calibration data, and filters and classifies the mapped and associated contour feature parameters according to the feature effectiveness evaluation index, including the following steps: S31. Preset feature effectiveness evaluation indicators and combine contour feature parameters with physical dimension calibration data to obtain a data contour sample set; S32. A contour mapping association model is constructed using a fuzzy logic reasoning algorithm, and the contour mapping association model is iteratively optimized using a data contour sample set. As a preferred embodiment, the step of constructing a contour mapping association model using a fuzzy logic reasoning algorithm and iteratively optimizing the contour mapping association model through a data contour sample set includes the following steps: S321. Define the input and output variables of the contour mapping association model, and construct fuzzy sets and membership functions based on the input and output variables; S322. Set up a contour mapping association model based on fuzzy sets and membership functions; S323. Preset fuzzy rules and perform fuzzification processing on the data contour sample set based on the fuzzy rules to obtain a fuzzy contour sample set; S324. Input the fuzzy contour sample set and the data contour sample set into the contour mapping association model respectively to calculate the fuzzy contour parameters and the data contour parameters; S325. Preset the model iteration threshold, calculate the contour error parameter of the fuzzy contour parameter and the data contour parameter, and perform threshold matching between the contour error parameter and the model iteration threshold; S326. Iteratively optimize the contour mapping association model based on the threshold matching results.

[0010] S33. Input the contour feature parameters into the iteratively optimized contour mapping association model to generate a feature size mapping table, and quantify and score each set of contour feature parameters in the feature size mapping table according to the feature effectiveness evaluation index. As a preferred embodiment, the step of inputting contour feature parameters into the iteratively optimized contour mapping association model to generate a feature size mapping table, and then quantitatively scoring each set of contour feature parameters in the feature size mapping table according to the feature effectiveness evaluation index, includes the following steps: S331. Input the contour feature parameters into the iteratively optimized contour mapping association model to calculate the physical size association value, and combine the contour feature parameters and physical size association values ​​to form a feature size mapping table. S332. Set feature scoring standards and weight allocation standards for each indicator of feature effectiveness evaluation indicators; S333. Extract the associated data of each group of contour feature parameters in the feature size mapping table, and calculate the quantitative score of each evaluation index based on the feature scoring standard and weight allocation standard.

[0011] S34. Preset scoring and filtering rules, filter contour feature parameters after quantification and scoring based on the scoring and filtering rules, and classify them according to feature type.

[0012] S4. Preset a multi-scale feature fusion strategy, and optimize and adjust the contour feature parameters after screening and classification according to the multi-scale feature fusion strategy to generate a standardized size detection feature set. As a preferred approach, a multi-scale feature fusion strategy is preset, and the contour feature parameters after screening and classification are optimized and adjusted according to the multi-scale feature fusion strategy to generate a standardized size detection feature set, including the following steps: S41. A multi-scale feature fusion strategy is preset, which includes a hierarchical fusion strategy library and an alignment method database, and divides the fusion scale level threshold and feature space alignment threshold. S42. Normalize the multi-scale contour feature parameters after screening and classification. S43. Extract the fusion scale level value and contour feature space alignment value of the normalized multi-scale contour feature parameters, and select the hierarchical fusion strategy and spatial alignment method from the hierarchical fusion strategy library and alignment method database based on the fusion scale level value and contour feature space alignment value. S44. Based on the hierarchical fusion strategy and spatial alignment method, the contour feature parameters are optimized and adjusted to generate a standardized size detection feature set.

[0013] S5. Construct a size detection model based on a deep learning fusion algorithm, and input the standardized size detection feature set into the size detection model for iterative training to obtain the target size quantification detection result; As a preferred embodiment, the step of constructing a size detection model based on a deep learning fusion algorithm and inputting a standardized size detection feature set into the size detection model for iterative training to obtain the target size quantification detection result includes the following steps: S51. A pre-defined deep learning fusion algorithm architecture is provided, which includes a network layer configuration library and a training parameter database, and a size detection model is constructed based on the network layer configuration library and the training parameter database. S52. Perform data augmentation processing on the standardized size detection feature set and divide it into training set, validation set and test set; S53. Input the training set, validation set, and test set into the size detection model for iterative training; S54. Input the standardized size detection feature set into the iteratively trained size detection model to obtain the target size quantification detection result.

[0014] S6. Verify the accuracy of the target size quantization detection results, and establish an image feature size parameter association database based on the verified target size quantization detection results.

[0015] According to another aspect of the present invention, an image data management system for high-precision size visual inspection is provided. The system includes: a data acquisition and segmentation module, an image correction and extraction module, a feature evaluation and screening module, a feature optimization and generation module, a model building and training module, and a result verification and database building module. The data acquisition and segmentation module is used to acquire multi-view image datasets and physical size calibration datasets through high-precision size detection equipment, and to perform region segmentation processing on the multi-view image datasets. The image correction and extraction module is used to correct and enhance the multi-view image dataset after region segmentation and extract the contour feature parameters of the corrected and enhanced multi-view image dataset. The feature evaluation and filtering module is used to preset feature effectiveness evaluation indicators, map and associate contour feature parameters with physical dimension calibration data, and filter and classify the mapped and associated contour feature parameters according to the feature effectiveness evaluation indicators. The feature optimization and generation module is used to preset a multi-scale feature fusion strategy and optimize and adjust the contour feature parameters after screening and classification according to the multi-scale feature fusion strategy to generate a standardized size detection feature set. The model building and training module is used to build a size detection model based on a deep learning fusion algorithm, and input a standardized size detection feature set into the size detection model for iterative training to obtain the target size quantification detection result. The result verification and database building module is used to verify the accuracy of the target size quantization detection results and to build an image feature size parameter association database based on the verified target size quantization detection results.

[0016] The beneficial effects of this invention are as follows: 1. This invention solves the problems of incomplete information and large deviations in physical size mapping in traditional single-view images by simultaneously acquiring multi-view image datasets and physical size calibration datasets, combined with calibration references of geometric standard instruments. At the same time, it removes image noise and accurately distinguishes target and background regions through adaptive threshold segmentation algorithm and edge contour optimization, improving the effectiveness of the original data and the accuracy of region segmentation, laying a high-quality data foundation for subsequent feature extraction. It also introduces fuzzy logic reasoning algorithm to construct contour mapping association model, and realizes dynamic mapping between contour feature parameters and physical size calibration data through data sample iterative optimization, avoiding the subjectivity of manually setting mapping rules in traditional feature association. Furthermore, it combines quantitative scoring and screening rules of feature effectiveness evaluation indicators to accurately screen high-value contour features, solve the problems of feature redundancy and insufficient effectiveness, and improve the feature quality of input model.

[0017] 2. This invention uses a multi-scale feature fusion strategy to normalize and optimize the selected contour features, solving the problems of strong heterogeneity and low fusion adaptability of features at different scales. At the same time, by dividing the fusion scale level threshold and spatial alignment threshold, the standardization of the feature set is improved, enhancing the adaptability of features to different detection scenarios. Furthermore, a size detection model is constructed based on a deep learning fusion algorithm, and iterative training is performed using the standardized feature set, overcoming the limitations of traditional detection models in capturing complex image features and low detection accuracy.

[0018] 3. This invention achieves traceability and reuse of detection data by establishing an accuracy verification and image feature size parameter association database, solving the problems of scattered data management and reliance on manual decision-making in traditional detection. The intelligent data processing and model output of the whole process promotes the automation closed loop of high-precision size visual inspection from data acquisition to result judgment, improving the efficiency and intelligence level of industrial inspection. Furthermore, through hierarchical verification of training set, validation set and test set, the generalization ability of the model to different target objects and different shooting conditions is improved, realizing high-precision quantitative output of target size. Attached Figure Description

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

[0020] Figure 1 This is a flowchart of an image data management method for high-precision size visual inspection according to an embodiment of the present invention; Figure 2This is a system block diagram of an image data management system for high-precision size visual inspection according to an embodiment of the present invention.

[0021] In the picture: 1. Data acquisition and segmentation module; 2. Image correction and extraction module; 3. Feature evaluation and screening module; 4. Feature optimization and generation module; 5. Model building and training module; 6. Result verification and database construction module. Detailed Implementation

[0022] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.

[0023] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0024] According to embodiments of the present invention, an image data management method and system for high-precision dimensional visual inspection are provided.

[0025] The present invention will now be further described in conjunction with the accompanying drawings and specific embodiments. According to one embodiment of the present invention, such as... Figure 1 As shown, the image data management method for high-precision size visual inspection according to an embodiment of the present invention includes the following steps: S1. Collect multi-view image datasets and physical size calibration datasets using high-precision size detection equipment, and perform region segmentation processing on the multi-view image datasets; In this embodiment of the application, the step of acquiring a multi-view image dataset and a physical size calibration dataset using a high-precision size detection device, and performing region segmentation processing on the multi-view image dataset includes the following steps: S11. Set up a detection device consisting of a high-precision industrial camera and a light source system, and adjust the shooting angle to collect multi-view images of the target object to form a multi-view image dataset. Specifically, select a high-resolution (e.g., 10-megapixel) industrial camera with a low-distortion lens to match the target size detection accuracy requirements; select a ring, strip, or coaxial light source according to the target material (reflective / matte), and ensure uniform illumination of the target area by adjusting the brightness and color temperature to avoid interference from highlights or shadows. When setting up the equipment, fix the relative position of the camera and the light source, use a rigid bracket to ensure stability, and calibrate the camera's internal and external parameters through a calibration plate to eliminate imaging distortion.

[0026] When adjusting the shooting angle to acquire multi-view images, based on the geometric features of the target object (such as planes, curved surfaces, and hole distribution), at least three differentiated viewpoints are set through a multi-axis adjustment frame, covering key detection surfaces such as the front, side, and oblique views. Adjacent viewpoints need to retain 15%-30% of the feature overlap area to ensure the integrity of subsequent stitching. During acquisition, camera parameters (focal length, exposure time) are unified. Batch shooting is performed by triggering a synchronization mechanism. After removing blurry and overexposed images, they are classified and integrated according to viewpoint to form a multi-view image dataset covering all dimensions of the target's features.

[0027] S12. Use existing geometric standard instruments as calibration references, and simultaneously collect images and physical dimension parameters of the standard gauge block from various perspectives to form a physical dimension calibration dataset. Specifically, when using existing geometric standard instruments as calibration references, it is necessary to select high-precision standard gauge blocks (such as first- or second-class gauge blocks) and calibration gauges certified by legal metrology institutions. Their physical dimensional parameters (length, width, diameter, etc.) must be clearly defined and accompanied by uncertainty certificates to ensure the authority of the calibration benchmark.

[0028] Before acquisition, the standard gauge block is fixed on the same detection platform as the target object, and its placement posture (such as horizontal or vertical) is consistent with that of the target to be detected. This avoids calibration errors caused by positional deviations. During synchronous acquisition, the same industrial camera and light source parameters (focal length, exposure time, brightness, etc.) as the multi-view image dataset are used to capture clear images of the standard gauge block under the pre-set shooting angles to ensure consistent imaging conditions.

[0029] Simultaneously, physical size parameters (accurate to the micrometer level) are extracted from the standard block certificate, and the image number and parameter value corresponding to each viewpoint are recorded to form the viewpoint-image-physical size association data. Finally, the data is classified and integrated according to the viewpoint, and samples with blurry or incorrect parameter matching are removed to construct a physical size calibration dataset, providing an accurate benchmark for the subsequent mapping association between contour features and actual size.

[0030] S13. Adaptive threshold segmentation algorithm is used to segment the multi-view image dataset into regions to obtain target region dataset and background region dataset. In this embodiment of the application, the step of using an adaptive threshold segmentation algorithm to segment a multi-view image dataset into regions, and obtaining a target region dataset and a background region dataset, includes the following steps: S131. Remove image noise from the multi-view image dataset; Specifically, to remove image noise from multi-view image datasets, the noise type (such as Gaussian noise, salt-and-pepper noise) and intensity are first analyzed using methods such as image gray-level histograms and noise variance calculation to select appropriate methods for subsequent processing. For salt-and-pepper noise, median filtering is prioritized. By setting a 3×3 or 5×5 filter kernel, the pixel gray-level value is replaced with the median of neighboring pixels, efficiently removing isolated noise points. For Gaussian noise, Gaussian filtering is used, adjusting the standard deviation of the filter kernel based on the noise variance to smooth the noise while reducing detail blur.

[0031] For detection scenarios requiring edge feature preservation, bilateral filtering is employed. This involves calculating weights in both the spatial and grayscale domains to denoise while protecting the target's edge contours. During processing, filtering parameters (such as kernel size and standard deviation) for multi-view images must be standardized to avoid feature deviations in the same target from different perspectives due to parameter differences. The denoising effect is then verified using peak signal-to-noise ratio (PSNR) and structural similarity index. Images that remain blurry or lose key details after denoising are discarded, ensuring that the processed multi-view images are free of significant noise while retaining the texture and edge information required for high-precision size detection.

[0032] S132. Preset an adaptive threshold calculation window set and match the adaptive threshold calculation window set with the denoised multi-view image dataset. Specifically, when setting the adaptive threshold calculation window set, the core parameters of the window are first determined based on the resolution, target object size, and grayscale distribution characteristics of the denoised multi-view image. In terms of size, small windows such as 3×3 and 5×5 are selected for small components or edge details, while large windows such as 11×11 and 15×15 are selected for large targets or uniform backgrounds. At the same time, windows of different shapes such as rectangles and circles are used to adapt to the irregular edges of the target (such as holes and corners). The step size is set to 1-2 pixels to balance the calculation efficiency and local grayscale capture accuracy. Finally, a window set containing 5-8 sets of differentiated parameters is formed, and the size, shape, and step size information of each set of windows are labeled to facilitate subsequent matching and tracing.

[0033] The matching process consists of three steps: First, grayscale normalization is performed on the denoised multi-view images, mapping all grayscale values ​​to the 0-255 range to eliminate grayscale shifts caused by differences in light source intensity at different viewpoints, providing a unified benchmark for matching. Second, images are processed one by one according to viewpoint. For a single image, each group of windows in the window set is called and slides across the image with a set step size, calculating the local grayscale mean and variance within each window in real time to generate the corresponding local grayscale feature matrix. Third, the optimal matching window is selected based on the local grayscale feature matrix: for regions with a high proportion of the target area in the image, smaller windows are prioritized to preserve details; for regions with a high proportion of background, larger windows are selected to improve anti-interference capabilities. Simultaneously, the window matching results for the same target at different viewpoints are compared to ensure compatibility of window parameters between adjacent viewpoints (e.g., size difference not exceeding 2 levels), avoiding segmentation breaks in the target area due to differences in window selection. After matching is completed, the optimal window parameters for each image are recorded, providing accurate local threshold calculation basis for subsequent binarization segmentation.

[0034] S133. Extract grayscale distribution features and target size parameters from multi-view image datasets using a matching-based adaptive threshold calculation window; Specifically, for each denoised image, the image is traversed by sliding along a set step size, using a matched adaptive threshold calculation window as the unit. Local grayscale data within each window is collected in real time, and the mean grayscale value (reflecting the brightness of the area), variance (reflecting the grayscale fluctuation range), and grayscale histogram (presenting the probability of grayscale distribution) of pixels within the window are calculated. The window features of the boundary area between the target and the background are marked, and these areas usually have a large grayscale variance, which serves as a key basis for subsequent target localization. At the same time, the coordinate position of each window is recorded to establish the correlation between window-grayscale feature-coordinate.

[0035] Next, local features are integrated to form global grayscale distribution features. For a single image, the grayscale mean distribution range, variance extreme value, and histogram peak range of all windows are statistically analyzed to distinguish the grayscale feature differences between the target area (which is mostly a continuous grayscale range) and the background area (which has a more discrete grayscale distribution). For multi-view image sets, the commonalities of grayscale features of the same target under different views (such as the grayscale mean fluctuation range of the target core area) are compared to eliminate the local feature differences caused by viewpoint bias and form a unified grayscale distribution feature template.

[0036] Target size parameters are extracted. Based on grayscale distribution feature templates, the target region in images from various viewpoints is located. Using the size of the matching window (known number of pixels) as a benchmark, and combined with the pixel-physical size conversion coefficient obtained from camera calibration (e.g., 1 pixel corresponds to 0.01 mm), the key size parameters of the target are calculated. The pixel span of the target edge is determined by the window coordinates and converted into physical length and width. For features such as circles and holes, the contour is fitted by the peak area of ​​the window grayscale histogram to calculate parameters such as diameter and radius. At the same time, the deviation of the same size parameter under different viewpoints is checked (controlled within the detection accuracy threshold) to ensure parameter consistency, forming structured data of viewpoint-grayscale distribution features-target size parameters.

[0037] S134. Perform binarization segmentation on the grayscale distribution features and target size parameters to obtain the target region dataset and the background region dataset.

[0038] Specifically, an initial binarization threshold is determined based on grayscale distribution characteristics. Combining the previously extracted global grayscale mean, variance, and local grayscale histogram of the window, a dynamic thresholding method is used to calculate the basic segmentation threshold, dividing the image pixels into foreground (suspected target) and background. For regions with uneven grayscale distribution (such as the transition area between the target edge and the background), the local grayscale features of the matching window are further invoked to set differentiated sub-thresholds for different regions, avoiding edge segmentation breakage caused by the global threshold, and obtaining the initial binarized image.

[0039] Secondly, target size parameters are introduced to optimize the segmentation results. Based on the target size parameters extracted in the early stage (such as minimum / maximum physical area and length range), size screening rules are established. For connected regions in the initial binarized image, their pixel area is calculated (combined with pixel-physical size conversion coefficient). Noise regions (such as dust and light spots) with an area smaller than the minimum target size and background regions (such as detection platform edges) with an area larger than the maximum target size are removed. At the same time, the matching degree between the shape features (such as aspect ratio) of the connected regions and the target size parameters is checked, and interference regions with inconsistent shapes (such as irregular background shadows) are eliminated, and suspected target regions are initially separated.

[0040] The segmentation is further improved by performing multi-view verification. Morphological operations are performed on suspected target regions (first erosion to remove small burrs, then dilation to fill small holes in the region) to restore the integrity of the segmented region. The segmentation results of the same target under different views are compared to ensure the consistency of the size and contour of the target region in each view (the deviation is controlled within the detection accuracy threshold) to avoid misjudgment from a single view. Finally, the regions are classified and integrated according to the view. Connected regions that meet both grayscale and size standards are classified as target region datasets, and the remaining regions are classified as background region datasets.

[0041] S14. Extract the edge contours of the target region dataset and the background region dataset, and fill the holes inside the region.

[0042] In this embodiment of the application, the step of extracting the edge contours of the target region dataset and the background region dataset, and filling the holes inside the region, includes the following steps: S141. Preset edge detection algorithm library and morphological processing parameter library, and set edge strength threshold and area threshold of voids inside the region; Specifically, the preset edge detection algorithm library and morphological processing parameter library need to be built around the scenario requirements of high-precision size detection, according to the algorithm / parameter classification and scenario adaptation logic, and at the same time, the two types of thresholds should be scientifically set in combination with data features.

[0043] When setting up an edge detection algorithm library, it is necessary to include multiple mainstream algorithms and clearly define the applicable scenarios: the core algorithms include Canny (adapted to weak edge and noisy interference scenarios, with adjustable parameters including high and low thresholds and Gaussian filter kernel size), Sobel (adapted to scenarios that need to distinguish between horizontal and vertical edges, with adjustable parameters including convolution kernel size and orientation weights), and Laplacian (adapted to scenarios that quickly detect zero-crossing edges, with adjustable parameters including filter kernel type and grayscale change sensitivity); at the same time, the calling priority of each type of algorithm should be marked (e.g., Canny should be used first to handle complex contour targets, and Sobel should be used to handle regular rectangular / circular targets), and an interface for fine-tuning algorithm parameters should be reserved to facilitate subsequent adaptation based on image features.

[0044] When presetting the morphological processing parameter library, parameters should be stored according to operation type: For erosion operations, store rectangular / circular structuring elements of different sizes such as 3×3 and 5×5 (small kernel adaptation removes small burrs, large kernel adaptation eliminates wide interference), and 1-2 iterations; for dilation operations, store structuring elements that match erosion (used to repair edge shrinkage caused by erosion); for closing operations (filling holes), store structuring elements of 5×5-11×11 and 2-3 iterations; all parameters must be associated with target size parameters (e.g., the size of the structuring element should not exceed 1 / 5 of the smallest pixel size of the target) to avoid overprocessing and destroying the target contour.

[0045] When setting the edge strength threshold, first calculate the average grayscale gradient of the target edge in multi-view sample images (e.g., 100-150). Set the lower edge strength threshold (e.g., 60) for edges below 60% of the average to filter out noise and false edges; set the upper edge threshold (e.g., 180) for edges above 120% of the average to retain strong edges; supplement the filtering in the middle range with edge continuity verification (e.g., consecutive edge pixel count ≥ 5). When setting the area threshold for holes within a region, set the filling threshold for holes with an area ≤ 1% of the minimum target area (e.g., 1 pixel) based on the minimum physical area of ​​the target to ensure that small holes are eliminated; at the same time, set the upper edge threshold (e.g., 5% of the minimum target area) to avoid accidentally filling holes in the target itself (e.g., assembly holes in parts), and adjust the threshold through multi-view hole consistency verification (the same hole appears in ≥ 3 views) to form a reusable threshold standard.

[0046] S142. Extract the gray-level gradient feature values ​​of the target region dataset and the background region dataset, and select the edge detection algorithm from the edge detection algorithm library based on the gray-level gradient feature values. Specifically, the target and background region datasets are preprocessed: the images of both types of regions are uniformly converted to grayscale and mean normalized to eliminate grayscale shifts caused by differences in light sources from different viewing angles; then, a 3×3 Sobel gradient operator is used to traverse the region pixels, calculating the gradient components of each pixel in the x (horizontal) and y (vertical) directions to obtain the grayscale gradient magnitude matrix and direction matrix of the entire region. Next, the core gradient feature values ​​are extracted: the gradient magnitude range (e.g., 50-200, reflecting edge strength), gradient direction distribution (e.g., concentrated at 0° / 90°, indicating that the edges are mostly horizontal / vertical), and edge density (the proportion of pixels in the target region whose gradient magnitude exceeds the threshold, reflecting edge richness) of the target region are statistically analyzed. At the same time, the gradient features of the background region are compared (usually low magnitude and discrete distribution) to clarify the unique features of the target edge and form a region type-gradient feature value comparison table.

[0047] When selecting an edge detection algorithm based on grayscale gradient features, it is necessary to match the algorithm characteristics with the feature requirements: If the gradient magnitude of the target region is generally low (many weak edges) and contains a small amount of noise, the Canny algorithm should be called first from the algorithm library (its Gaussian filtering can reduce noise, and its dual threshold can preserve weak edges). The high threshold of the algorithm should be set to 80% of the upper limit of the target gradient magnitude, and the low threshold should be set to 50% of the lower limit. If the target gradient direction is concentrated (such as the rectangular edge of a part), the Sobel algorithm should be selected (it can specifically calculate horizontal / vertical gradients to strengthen directional edges), and the corresponding convolution kernel should be matched. If the gradient of the target region changes drastically (such as sharp corners) and there is no obvious noise, the Laplacian algorithm should be selected (it quickly detects zero-crossing edges without direction filtering). After selection, the edge extraction effect of a single-view image should be tested to ensure edge continuity (number of broken pixels ≤ 3) and integrity (covering more than 95% of the target contour) before generalizing to the entire dataset to form the adaptation rules for gradient feature algorithms.

[0048] S143. Apply the selected edge detection algorithm to the target region dataset and the background region dataset, and filter and adjust the edge contour based on the edge intensity threshold. Specifically, the first step is to perform preprocessing before application: adjust the images of the target and background regions to the same resolution, and synchronously normalize the grayscale values ​​to the 0-255 range to eliminate algorithm response deviations caused by differences in light sources from multiple viewpoints or inconsistent resolutions; for the target region dataset, generate an additional region mask (keeping only the target pixels and masking the background pixels) to avoid background noise interfering with the algorithm's capture of the target edges, thus providing a clean data environment for the algorithm application.

[0049] Next, edge detection algorithms are adapted: The Canny algorithm is selected, and high and low thresholds are set based on the gray-level gradient feature values ​​(such as the gradient mean) of the target region (high threshold is 1.2 times the gradient mean, low threshold is 0.5 times). Then, Gaussian filtering is performed on the masked target region image for noise reduction, gradient magnitude and direction are calculated, and non-maximum suppression (edge ​​thinning) is applied. Finally, edge concatenation is performed using a double threshold. If the Sobel algorithm is selected, the corresponding convolution kernel (x-direction or y-direction) is chosen for the main direction of the target edge (such as horizontal / vertical), and the gradient response is calculated by convolving the target region image to strengthen the directional edge signal. The background region dataset is only processed using basic algorithms and is mainly used for comparison to eliminate interfering contours outside the target edges.

[0050] Subsequently, edge strength threshold filtering and adjustment are performed: a preset lower limit threshold for edge strength (e.g., gradient magnitude ≥ 60) is called to filter out false edges (e.g., false responses caused by minor background noise) in the algorithm output below this threshold; for the filtered edge pixels, their continuity is checked (number of consecutive edge pixels ≥ 5), and isolated edge points are removed; if there are edge break regions (e.g., weak edge segments), the edge distribution of adjacent viewpoints is compared, and the break parts are filled in by interpolation. Finally, post-processing is performed: morphological thinning is performed on the filtered edge pixels to remove redundant edge pixels and generate a clear outline with a single pixel width; the matching degree between the outline and the target region is checked (the deviation between the outline-enclosed area and the target region area ≤ 3%) to ensure no obvious offset, and finally a complete and accurate target edge outline is obtained, while the background region retains its basic edge information for subsequent comparative analysis.

[0051] S144. Identify the internal voids in the region of the edge contour, and call the closing operation parameter and the region internal void area threshold in the morphological processing parameter library to fill the internal voids in the edge contour.

[0052] Specifically, when identifying internal holes, firstly, connected component analysis is performed on the generated single-pixel edge contour to mark all closed regions within the contour; by judging the contour hierarchy (the outer contour is the parent level and the inner contour is the child level), the child level regions that are completely surrounded by the outer contour and are not connected to the background region are selected and initially identified as internal holes; then, combined with the preset internal hole area threshold, the pixel area of ​​each suspected hole is calculated (by pixel counting), and regions whose area exceeds the upper limit of the threshold are removed (such as the functional holes of the target itself, which need to be distinguished in advance by associating with the target size parameters), and real holes with areas within the threshold range (such as 1-20 pixels) are retained to form a hole location-area comparison table.

[0053] Next, the closing operation parameters in the morphological processing parameter library are called: the corresponding parameters are matched according to the area size of the hole in the reference table. For small holes with an area ≤ 10 pixels, the closing operation parameter of 3×3 circular structural element with 1 iteration is called to avoid excessive expansion of the edge during filling; for larger holes with an area of ​​10-20 pixels, the parameter of 5×5 circular structural element with 2 iterations is matched to ensure that the hole is completely filled; if there are irregularly shaped holes, rectangular or elliptical structural elements that are similar to the outline of the hole are selected first to reduce the deformation of the outline after filling.

[0054] Finally, the closing operation is performed for filling and effect verification: matching closing parameters are applied to the edge contour image. First, the contour pixels are expanded by dilation to close the hole opening, and then the original size of the contour is restored by erosion to complete the hole filling. After filling, the area of ​​the region within the contour is recalculated to check whether the hole is completely eliminated. At the same time, the edge contour accuracy before and after filling is compared (e.g., edge pixel coordinate deviation ≤ 1 pixel) to avoid distortion of the target size caused by filling. For multi-view images, the hole filling effect of the same target is verified simultaneously to ensure the consistency of filling from each view. Finally, a target edge image with no internal holes and a complete contour is obtained, providing an accurate contour basis for subsequent feature extraction.

[0055] S2. Correct and enhance the multi-view image dataset after region segmentation, and extract the contour feature parameters of the corrected and enhanced multi-view image dataset. Specifically, in the correction and enhancement stage, geometric correction is performed first: the intrinsic parameters (focal length, principal point coordinates) and extrinsic parameters (rotation matrix, translation vector) obtained from camera calibration are called, and the images from each viewpoint are projected onto a unified world coordinate system through perspective transformation to eliminate the proportional deviation caused by lens distortion (radial / tangential distortion) and viewpoint tilt, ensuring that the pixel span of the same physical size is consistent under different viewpoints; for the corrected image, the illumination enhancement algorithm is used to optimize the image quality, and CLAHE (limited contrast adaptive histogram equalization) is applied to areas with uneven illumination to improve local contrast while avoiding noise amplification; gamma correction (γ value 0.6-0.8) is performed on low-brightness areas, and grayscale stretching is performed on overexposed areas to make the grayscale difference between the target and the background more significant, resulting in an enhanced image set with clear details and aligned viewpoints.

[0056] Contour feature parameter extraction is based on the enhanced image: First, the closed contour of the target is located using edge detection results, and the continuous coordinates of contour pixels are recorded using chain code encoding; then, basic geometric parameters are calculated, including contour perimeter (accumulated pixel distances), bounding area (using the polygon area formula), longest axis / shortest axis length (fitted by the minimum bounding rectangle), and axis ratio; shape feature parameters are extracted, such as the number of curvature extrema (inflection points), average curvature (reflecting contour smoothness), and convex hull defects (identifying concave areas); moment features (such as Hu moments) are calculated to describe the overall shape of the contour, while recording the parameter correspondence of the same contour under multiple views (such as the mapping value of the longest axis in the world coordinate system under different views). After extraction, the parameters are normalized (scaled according to the maximum size of the target), outliers (such as parameters exceeding 3 times the standard deviation) are removed, forming a contour feature parameter set containing multi-view correlation information of geometric shape.

[0057] S3. Preset feature effectiveness evaluation index, map and associate contour feature parameters with physical dimension calibration data, and filter and classify the mapped and associated contour feature parameters according to the feature effectiveness evaluation index; In this embodiment of the application, the preset feature effectiveness evaluation index maps and associates contour feature parameters with physical dimension calibration data, and filters and classifies the mapped and associated contour feature parameters according to the feature effectiveness evaluation index, including the following steps: S31. Preset feature effectiveness evaluation indicators and combine contour feature parameters with physical dimension calibration data to obtain a data contour sample set; Specifically, when setting up evaluation indicators, the core dimensions and calculation methods are first clarified: First, the mapping error rate, used to measure the accuracy of the correlation between contour feature parameters and physical dimensions. It calculates the percentage of the absolute deviation between the predicted physical dimension corresponding to a single set of contour feature parameters (such as contour perimeter, curvature extremes) and the physical dimension calibration data, setting a threshold of ≤1% for excellent and 1%-3% for good. Second, multi-view consistency, evaluating the stability of the same feature under different viewpoints. It calculates the coefficient of variation (standard deviation / mean) of the same feature parameter under multiple viewpoints. A coefficient of variation ≤5% is acceptable, avoiding feature failure caused by viewpoint deviation. Third, size sensitivity, testing the feature's responsiveness to changes in physical dimensions. By making minor adjustments to the size of standard gauge blocks (e.g., ±0.01mm), the change rate of the corresponding feature parameter is calculated. A change rate ≥80% indicates a highly sensitive feature. Simultaneously, weights are assigned to the indicators (mapping error rate 40%, consistency 30%, sensitivity 30%), forming a complete evaluation system.

[0058] When generating a sample set by combining data, the correspondence between viewpoint, feature, and calibration data is first established: At the same shooting viewpoint, the corrected and enhanced contour feature parameters (such as perimeter, number of inflection points, Hu moment) are matched one-to-one with the physical dimension calibration data (such as actual length, diameter, and angle) under that viewpoint, ensuring that a single sample contains one set of viewpoint information + 5-8 contour feature parameters + corresponding physical dimension values. Then, the data is integrated using a structured table, labeling the parameter source (such as image number, detection area) and the calibration data accuracy level (such as ±0.001mm for a first-class gauge block). Finally, data filtering is performed, removing samples with a mapping error rate >5% or those failing to meet multi-view consistency standards. Simultaneously, feature-calibration data pairs of standard gauge blocks of different sizes are added to ensure that the samples cover key dimension nodes within the detection range. This ultimately forms a data contour sample set that combines diversity and accuracy, providing high-quality training data for subsequent contour mapping association model construction.

[0059] S32. A contour mapping association model is constructed using a fuzzy logic reasoning algorithm, and the contour mapping association model is iteratively optimized using a data contour sample set. In this embodiment of the application, the step of constructing a contour mapping association model using a fuzzy logic reasoning algorithm and iteratively optimizing the contour mapping association model through a data contour sample set includes the following steps: S321. Define the input and output variables of the contour mapping association model, and construct fuzzy sets and membership functions based on the input and output variables; Specifically, when defining the input and output variables of the contour mapping association model, the scope of core parameters should be clearly defined: the input variables are the contour feature parameters extracted after correction and enhancement, including geometric features (such as contour perimeter, enclosing area, and longest axis length) and shape features (such as the number of inflection points, average curvature, and number of convex hull defects). The value range of each parameter needs to be determined based on the data contour sample set (such as perimeter 50-500 pixels, inflection points 2-15). The output variables are the corresponding physical dimension calibration data, such as actual length (0.5-50mm), diameter (0.3-30mm), and angle (30°-150°). The value range needs to match the calibration range of the standard gauge block.

[0060] When constructing fuzzy sets and membership functions based on input and output variables, first divide the fuzzy subsets according to the distribution characteristics of the variables: input variables, such as contour perimeter, are divided into three subsets: small, medium, and large; output variables, such as actual length, are divided into three subsets: short, medium, and long. The subset boundaries need to cover the full range of the variables and retain a 10%-20% overlap area to ensure a smooth transition. Then, configure membership functions for each subset: for variables with a concentrated data distribution (such as the perimeter of a standard part), use a trigonometric function, with the vertex corresponding to the sample statistical mean (e.g., the vertex of the medium perimeter is the sample average perimeter), and the base covering the range of ±2 standard deviations; for variables with a more discrete distribution (such as the curvature of a complex contour), use a Gaussian function, with the mean set as the subset center value, and the standard deviation adjusted according to the degree of data dispersion (e.g., 10%-15% center value). Finally, a variable-fuzzy subset-membership function association table is formed.

[0061] S322. Set up a contour mapping association model based on fuzzy sets and membership functions; Specifically, the model's input and output variables are clearly defined: the input is the contour feature parameters (such as perimeter, number of inflection points, curvature), and the output is the corresponding physical dimensions (such as actual length, diameter). The variables are divided into subsets based on fuzzy sets (such as input perimeter divided into small / medium / large, and output length divided into short / medium / long) to ensure that the subsets cover the full range of parameters.

[0062] Next, define the membership function: for each variable subset, select a triangular or Gaussian membership function (e.g., use a left-leaning triangle for the small perimeter and a symmetrical triangle for the medium perimeter). Based on the parameter distribution in the data profile sample set, adjust the coordinates of the function vertex (e.g., set the vertex of the small perimeter to the minimum perimeter value of the sample) and the width so that the function can accurately describe the degree to which the variable belongs to each subset, forming a variable-fuzzy subset-membership function correspondence table.

[0063] Construct a fuzzy inference mechanism: Based on the association relationship of variable subsets (e.g., if the perimeter fuzzy value is 'm', then the length fuzzy value is 'm'), a fuzzy rule base is preset; configure the inference algorithm to fuzzify the input feature parameters through the membership function, substitute them into the rule base for logical inference, and output fuzzy results; at the same time, set a defuzzification method (such as the centroid method) to convert the fuzzy results into precise physical size values, complete the basic architecture settings of the model, and ensure that the model can achieve fuzzy mapping from contour features to physical dimensions.

[0064] S323. Preset fuzzy rules and perform fuzzification processing on the data contour sample set based on the fuzzy rules to obtain a fuzzy contour sample set; Specifically, the pre-defined fuzzy rules should be based on the fuzzy set association patterns of input and output variables, combined with domain experience and sample data characteristics. The core is the correspondence between input variables (e.g., small / medium / large contour perimeter) and output variables (e.g., short / medium / long actual length). If the fuzzy value of the contour perimeter is small, then the fuzzy value of the actual length is short; if the fuzzy value of the number of inflection points is medium, then the fuzzy value of the angle is medium. The rules should cover the main feature association scenarios (usually 2-3 times the number of input subsets) and avoid conflicts (e.g., the same input condition corresponds to a unique output tendency), forming a structured fuzzy rule base.

[0065] When performing fuzzification processing on a data contour sample set based on fuzzy rules, it is necessary to convert precise parameters for each sample: For the precise values ​​of each input (e.g., perimeter of 50 pixels) and output (e.g., length of 0.5 mm) in the sample, call the preset membership function to calculate its membership degree to each fuzzy subset (e.g., 50 pixels has a membership degree of 0.9 for the small perimeter and 0.1 for the medium perimeter), and generate a three-dimensional fuzzy vector of parameters-fuzzy subset-membership degree; then match the association relationship between the input fuzzy vector and the output fuzzy vector according to the rule base, supplement the rule adaptation label, integrate the fuzzy vectors and rule matching results of all samples, classify them according to viewpoint and features, and form a fuzzy contour sample set containing fuzzification parameters and association rule information.

[0066] S324. Input the fuzzy contour sample set and the data contour sample set into the contour mapping association model respectively to calculate the fuzzy contour parameters and the data contour parameters; Specifically, when calculating the corresponding parameters by inputting the fuzzy contour sample set and the data contour sample set respectively, it is necessary to combine the fuzzy inference and defuzzification mechanisms of the model and process them according to a differentiated process: When inputting a fuzzy contour sample set, first extract each set of input fuzzy vectors from the samples (such as the membership distribution of contour perimeter and the number of inflection points), and substitute them into the contour mapping association model. The model calls a preset fuzzy rule library, matches the input fuzzy vectors with the rules through the Mamdani inference method, calculates the fuzzy relation matrix, and generates a fuzzy set at the output end (such as the short / medium / long membership distribution corresponding to physical dimensions). This fuzzy set is directly used as the fuzzy contour parameter and temporarily stored as the association data of sample number-fuzzy set, preserving the integrity of fuzzy features.

[0067] When inputting a data contour sample set, the precise contour feature parameters (e.g., perimeter 50 pixels, 8 inflection points) are first extracted from the samples. The model then converts these parameters into fuzzy vectors using a preset membership function (completing the fuzzification of precise values). The fuzzy inference process described above is then repeated to obtain the output fuzzy set. Subsequently, the defuzzification module is activated, and the centroid method is used to calculate the centroid coordinates of the fuzzy set, converting it into precise physical size values ​​(e.g., length 0.5 mm). These precise values ​​are the data contour parameters. Finally, two sets of parameters are stored according to sample type, forming a correspondence table between fuzzy contour parameters and data contour parameters, laying the foundation for subsequent calculation of contour error parameters.

[0068] S325. Preset the model iteration threshold, calculate the contour error parameter of the fuzzy contour parameter and the data contour parameter, and perform threshold matching between the contour error parameter and the model iteration threshold; Specifically, the preset model iteration threshold needs to be combined with the detection accuracy requirements and data characteristics: based on the uncertainty of the physical size calibration data in the data contour sample set (such as ±0.001mm of the standard block), the maximum allowable deviation of the model inference is superimposed, and the iteration threshold is set to 1.2-1.5 times the calibration accuracy (such as ±0.0015mm). At the same time, an error rate threshold (such as ≤1.5%) is added to form a two-dimensional threshold standard of absolute error + relative error, so as to ensure that the threshold covers a reasonable error range and can constrain the model accuracy.

[0069] When calculating the contour error parameters, the fuzzy contour parameters (fuzzy set) are first defuzzified using the centroid method and converted into precise physical size values. Then, based on the data contour parameters (precise physical size), the absolute error (|fuzzy conversion value - data parameter value|) and relative error (absolute error / data parameter value × 100%) of the two are calculated for each sample. At the same time, the mean and variance of the errors of multiple samples are statistically analyzed to form a contour error parameter set that includes the single sample error and the overall error distribution.

[0070] During threshold matching, the absolute error and relative error of each sample are compared with the preset iteration threshold. If both errors are less than the threshold, the sample is considered a qualified match and is used for model validation. If any error exceeds the threshold, the sample is marked as an unqualified match, and the features of the sample with the out-of-bounds error (such as a specific viewpoint or feature parameters) are recorded to provide a basis for error tracing for subsequent model iteration optimization, thus completing the threshold matching process.

[0071] S326. Iteratively optimize the contour mapping association model based on the threshold matching results.

[0072] S33. Input the contour feature parameters into the iteratively optimized contour mapping association model to generate a feature size mapping table, and quantify and score each set of contour feature parameters in the feature size mapping table according to the feature effectiveness evaluation index. In this embodiment of the application, the step of inputting contour feature parameters into the iteratively optimized contour mapping association model, generating a feature size mapping table, and quantitatively scoring each group of contour feature parameters in the feature size mapping table according to the feature effectiveness evaluation index includes the following steps: S331. Input the contour feature parameters into the iteratively optimized contour mapping association model to calculate the physical size association value, and combine the contour feature parameters and physical size association values ​​to form a feature size mapping table. Specifically, the contour feature parameters are input into the iteratively optimized contour mapping association model to form a feature size mapping table. This process needs to proceed according to the parameters preprocessing-model calculation-structured combination process to ensure accurate association and data standardization. First, the contour feature parameters are adapted: the corrected and enhanced parameters (such as contour perimeter, number of inflection points, and curvature extrema) are extracted and normalized according to the parameter range during model training (such as perimeter 0-1000 pixels, number of inflection points 2-20) to eliminate dimensional differences; at the same time, outliers (such as parameters exceeding 3 times the standard deviation) are removed to avoid interfering with model inference, resulting in an adapted set of feature parameters.

[0073] Next, input the model to calculate the physical size correlation value: The iteratively optimized model has optimized the fuzzy rules and membership functions through error adjustment. After substituting the adaptation parameters, the model first completes parameter fuzzification, and then outputs the corresponding physical size correlation value through accurate inference (such as a perimeter of 500 pixels corresponding to a length of 5mm, and 8 inflection points corresponding to a diameter of 3mm). The accuracy of the correlation value must meet the preset detection threshold (such as absolute error ≤ 0.002mm).

[0074] Finally, a feature size mapping table is formed: according to the structure of sample number - contour feature parameter group - physical size correlation value - shooting angle, each group of parameters and correlation values ​​are integrated one by one. The parameter group must fully include geometric and shape features (such as perimeter, number of convex hull defects), and the correlation values ​​are labeled with units. At the same time, the data in the table is verified, some correlation values ​​are compared with physical size calibration data, and error out-of-bounds items are eliminated, finally forming a structured and high-precision feature size mapping table.

[0075] S332. Set feature scoring standards and weight allocation standards for each indicator of feature effectiveness evaluation indicators; Specifically, the core evaluation indicators (mapping error rate, multi-view consistency, and size sensitivity) are clearly defined, and then scoring standards are formulated for each: For the mapping error rate, it is divided into three levels according to the error value: ≤1% (accurate correlation between feature and physical size) gets 100 points, 1%-3% (qualified correlation) gets 60 points, and >3% (ineffective correlation) gets 0 points. Features with an error exceeding 3% are directly removed. For multi-view consistency, based on the coefficient of variation, ≤5% (stable feature across views) gets 100 points, 5%-10% (slight fluctuation) gets 60 points, and >10% (drastic fluctuation) gets 0 points. For size sensitivity, based on the parameter change rate, ≥80% (sensitive to size changes) gets 100 points, 60%-80% (moderate response) gets 60 points, and <60% (sluggish response) gets 0 points.

[0076] The weighting allocation needs to consider the degree of influence of the indicators on the detection accuracy: the mapping error rate directly determines the accuracy of size correlation, and its weight is set to 40% (maximum); multi-view consistency affects the cross-view reliability of features, and its weight is set to 30%; size sensitivity ensures the feature's ability to capture subtle size changes, and its weight is set to 30%, with the sum of the three being 100%. Finally, the rationality is verified through expert review or sample testing. If a certain type of feature (such as curved parts) has a higher sensitivity requirement, the sensitivity weight is fine-tuned to 35%, and the consistency weight is correspondingly reduced to 25% to ensure that the standard is adapted to the actual detection scenario.

[0077] S333. Extract the associated data of each group of contour feature parameters in the feature size mapping table, and calculate the quantitative score of each evaluation index based on the feature scoring standard and weight allocation standard.

[0078] Specifically, each set of contour feature parameters (such as perimeter, number of inflection points, and curvature) is retrieved one by one from the mapping table, and its corresponding physical size associated values ​​(such as actual length and diameter) are synchronously associated. The physical size calibration data from which the set of parameters originates (for calculating errors), the parameter set of the same feature under multiple views (for calculating consistency), and the feature parameter change value after size fine-tuning (such as ±0.01mm) (for calculating sensitivity) are matched to form a complete associated data set of contour feature parameters - physical size associated values ​​- calibration data - multi-view parameters - fine-tuning change values, ensuring that each set of data can be traced back to a specific sample and viewpoint.

[0079] The quantitative scoring process involves three steps: First, calculate the score for each individual indicator according to the feature scoring standards. The mapping error rate is calculated as / physical size correlation value - calibration data / calibration data × 100%, yielding scores of 100 / 60 / 0 based on the standard. Multi-view consistency is calculated by taking the coefficient of variation (standard deviation / mean) of the multi-view parameters and obtaining the corresponding score according to the standard. Size sensitivity is calculated as / fine-tuned feature parameter - original parameter / original parameter × 100%, matching the standard score. Second, combine the weight allocation standards (e.g., mapping error rate 40%, consistency 30%, sensitivity 30%) and multiply the individual indicator scores by their corresponding weights. Third, sum the results to obtain the comprehensive quantitative score for each group of parameters (e.g., 100 × 40% + 80 × 30% + 90 × 30% = 91 points), while discarding invalid feature parameter groups with a comprehensive score below 60 to ensure the output score accurately reflects the effectiveness of the features.

[0080] S34. Preset scoring and filtering rules, filter contour feature parameters after quantification and scoring based on the scoring and filtering rules, and classify them according to feature type.

[0081] Specifically, the preset scoring and screening rules should focus on ensuring the effectiveness and practicality of features, and formulate a dual screening standard based on quantitative scoring dimensions: First, a comprehensive scoring threshold, setting a comprehensive score of ≥60 points as the basic passing line to ensure that the features as a whole meet the detection requirements; Second, a single indicator bottom line, requiring that the three single indicators of mapping error rate, multi-view consistency, and size sensitivity must not be 0 points, and the mapping error rate (core indicator) score must be ≥60 points to prevent features that fail in key dimensions from entering the subsequent process; At the same time, a multi-view stability clause is added, requiring the same feature to score ≥60 points under ≥80% of the views to exclude unstable features that are occasionally qualified under a single view.

[0082] The screening process follows a holistic approach followed by local analysis: First, batch filter contour feature parameter groups with a comprehensive score <60 to initially eliminate invalid features; second, check each remaining qualified group for individual indicators and eliminate parameter groups with indicators of 0 or a mapping error rate <60; third, verify the multi-view score distribution of the same feature and delete features with a qualified viewpoint percentage <80%.

[0083] The classification stage is divided according to feature type: geometric features (such as contour perimeter, enclosed area, and longest axis length) are grouped into one category, and shape features (such as number of inflection points, average curvature, and number of convex hull defects) are grouped into another category; the average comprehensive score, highest score, and percentage of qualified viewing angles of each feature are labeled under each category to form a classification table of feature type-parameter name-score information, which facilitates the subsequent on-demand use of highly effective features.

[0084] S4. Preset a multi-scale feature fusion strategy, and optimize and adjust the contour feature parameters after screening and classification according to the multi-scale feature fusion strategy to generate a standardized size detection feature set. In this embodiment, a multi-scale feature fusion strategy is preset, and the contour feature parameters after screening and classification are optimized and adjusted according to the multi-scale feature fusion strategy to generate a standardized size detection feature set, including the following steps: S41. A multi-scale feature fusion strategy is preset, which includes a hierarchical fusion strategy library and an alignment method database, and divides the fusion scale level threshold and feature space alignment threshold. Specifically, two major foundational libraries are constructed: First, a hierarchical fusion strategy library, which associates fusion methods according to feature scale. For low-scale features (such as edge burrs and small holes), pixel-level fusion (weighted average method, with weights allocated according to feature scores) is used to preserve details; for mid-scale features (such as local corners and convex hull structures), feature-level fusion (feature stitching method, with stitching dimensions including geometric and shape parameters) is used to strengthen local correlation; and for high-scale features (such as overall contours and bounding boxes), decision-level fusion (voting method, weighted voting based on multi-view feature effectiveness scores) is used to ensure global consistency. The applicable feature types and computational complexity of each strategy are also labeled. Second, an alignment method database, which includes three types of methods: spatial alignment (perspective transformation, adapting to coordinate deviations after geometric correction), feature alignment (Hu moment registration, adapting to differences in shape feature distribution), and grayscale alignment (histogram matching, adapting to grayscale deviations caused by uneven lighting). The applicable scenarios (such as perspective transformation for multi-view geometric feature alignment) and accuracy indicators (such as spatial alignment pixel deviation ≤ 2) for each method are clearly defined.

[0085] Next, key thresholds are defined: the fusion scale level thresholds are divided according to the feature pixel size, with low-scale thresholds <10 pixels (corresponding to detailed features), medium-scale thresholds 10-50 pixels (corresponding to local features), and high-scale thresholds >50 pixels (corresponding to global features). Each threshold is associated with the corresponding method in the strategy library. The feature space alignment threshold is set with dual standards: the pixel deviation threshold for spatial alignment is ≤2 pixels (to ensure consistent geometric position), and the Hu moment distance threshold for feature alignment is ≤0.1 (to ensure similar shape distribution). If the threshold is exceeded, the optimization process in the alignment method library is triggered to ensure fusion accuracy.

[0086] S42. Normalize the multi-scale contour feature parameters after screening and classification. S43. Extract the fusion scale level value and contour feature space alignment value of the normalized multi-scale contour feature parameters, and select the hierarchical fusion strategy and spatial alignment method from the hierarchical fusion strategy library and alignment method database based on the fusion scale level value and contour feature space alignment value. Specifically, when extracting the fusion scale level values, the actual pixel span of each contour feature parameter after normalization (such as the pixel length of local burrs and the pixel enclosing range of the overall contour) is first calculated. Then, the span is compared with the preset fusion scale level thresholds (low < 10 pixels, medium 10-50 pixels, high > 50 pixels) to determine the level value of each type of feature. For example, a pixel span of 6 corresponds to the low scale, and a span of 35 corresponds to the medium scale, forming a correlation table between features and level values.

[0087] When extracting the spatial alignment value of contour features, it is calculated from two dimensions: geometry and shape. In terms of geometry, the coordinate deviation of the same feature under multiple views (based on the world coordinate system calibrated by the camera) is compared to obtain the spatial alignment value. In terms of shape, the Hu moment distance of the features under multiple views (measuring the similarity of shape distribution) is calculated to obtain the shape alignment value. The two together constitute the spatial alignment value of contour features (e.g., coordinate deviation of 1.5 pixels and Hu moment distance of 0.08).

[0088] When selecting strategies and methods, the following are executed: for low-scale hierarchical values, pixel-level weighted average is selected from the hierarchical fusion strategy library; for medium-scale values, feature-level stitching is selected; and for high-scale values, decision-level voting is selected. If the coordinate deviation in the spatial alignment value is ≤2 pixels, perspective transformation is selected from the alignment method database; if the Hu moment distance is ≤0.1, Hu moment registration is selected; if the threshold is exceeded, optimization methods in the library are called (such as iteratively adjusting perspective transformation parameters) to ensure fusion and alignment accuracy.

[0089] S44. Based on the hierarchical fusion strategy and spatial alignment method, the contour feature parameters are optimized and adjusted to generate a standardized size detection feature set.

[0090] Specifically, spatial alignment optimization is first performed: based on the selected spatial alignment method (such as perspective transformation or Hu moment registration), coordinate and shape corrections are performed on the contour feature parameters from multiple perspectives. For geometric features, perspective transformation is used to map the coordinates of different perspectives to a unified world coordinate system, so that the spatial position deviation is ≤2 pixels. For shape features, Hu moment registration is used to adjust the contour distribution, ensuring that the shape alignment value (Hu moment distance) is ≤0.1, thus eliminating feature misalignment caused by perspective deviation.

[0091] Next, features are integrated according to a hierarchical fusion strategy: low-scale features (such as edge burrs) are fused using pixel-level weighted fusion, with weights allocated according to feature scores (high-scoring features account for more than 60% of the weight) to retain detailed information; mid-scale features (such as local corners) are fused by feature-level stitching, merging geometric parameters (such as corner angles) and shape parameters (such as curvature) by dimension to form a structured sub-feature set; high-scale features (such as overall contours) are fused using decision-level voting, with the physical size correlation value of multi-view features as the basis for weighted selection of the global parameters (such as average perimeter and longest axis length) with the highest consistency.

[0092] Finally, standardization adjustments are made: redundant features after fusion (such as parameters with repeatability > 80%) are removed, and feature units (such as physical dimensions in mm) and formats (such as feature name-value-error range) are standardized; the correlation error between features and physical dimension calibration data is verified (≤ 0.002 mm) to ensure accuracy meets the standards. Finally, a standardized dimension detection feature set containing geometric, shape features and multi-view fusion information is generated to provide a unified data benchmark for subsequent dimension detection.

[0093] S5. Construct a size detection model based on a deep learning fusion algorithm, and input the standardized size detection feature set into the size detection model for iterative training to obtain the target size quantification detection result; In this embodiment of the application, the step of constructing a size detection model based on a deep learning fusion algorithm and inputting a standardized size detection feature set into the size detection model for iterative training to obtain the target size quantification detection result includes the following steps: S51. A pre-defined deep learning fusion algorithm architecture is provided, which includes a network layer configuration library and a training parameter database, and a size detection model is constructed based on the network layer configuration library and the training parameter database. Specifically, when constructing the network layer configuration library, it is designed in layers according to the feature processing logic: the feature extraction layer includes multi-scale convolutional modules (such as 3×3 / 5×5 convolutional kernels to adapt to features of different sizes) and residual connections (to alleviate gradient vanishing); the fusion layer includes attention mechanism layers (such as channel attention to highlight the weights of high-scoring features) and cross-scale splicing layers (sponging low / medium / high-scale feature maps); the output layer adopts a fully connected layer + regression head (outputting physical size parameters, such as length and diameter), while labeling the parameter range of each layer (such as the number of convolutional kernels 32-256, adjusted according to the feature dimension).

[0094] The training parameter database needs to cover key training variables: the optimizer should be Adam (initial learning rate 0.001, step decay), the batch size should be set to 8-32 (adjusted according to the sample size), the number of iterations should be 50-200 (based on loss convergence), the loss function should be a combination of MSE (physical size error) + Dice loss (contour matching degree), and regularization parameters (such as L2 weight decay coefficient 0.0001) should be stored.

[0095] When constructing the size detection model, an adaptation module is selected from the network layer configuration library: based on the dimension of the standardized size detection feature set (e.g., feature map size 256×256), 3-5 layers of convolution are configured to extract features, and an attention fusion layer is connected to integrate multi-scale information. Finally, the size prediction value is output through the output layer. The model is initialized by calling the training parameter database, and jointly trained with the fuzzy contour sample set and the data contour sample set. The loss change is monitored in real time (target loss < 0.001), and the network weights and training parameters are iteratively optimized to form a stable size detection model.

[0096] S52. Perform data augmentation processing on the standardized size detection feature set and divide it into training set, validation set and test set; Specifically, during data augmentation, methods that do not compromise dimensional accuracy are preferred: First, geometric transformations, which involve small-range translations, slight rotations (0°-10° to maintain shape integrity), and proportional scaling (0.9-1.1 times to maintain dimensional proportions) of the contour images in the feature set to ensure that the physical size labels remain unchanged after augmentation; Second, grayscale enhancement, which uses random grayscale jitter and slight Gaussian noise (standard deviation ≤ 0.05) to simulate lighting fluctuations and sensor noise in actual detection, while avoiding masking edge features. Furthermore, the original feature set must be preserved during the augmentation process to prevent over-enhancement from causing data distortion.

[0097] Dataset partitioning must adhere to the principles of random sampling and consistent distribution: The enhanced feature set (including the original set) should be randomly divided into a training set (70%, used for model parameter learning), a validation set (20%, used for hyperparameter tuning and model selection), and a test set (10%, used for final performance evaluation) in a standard 7:2:1 ratio. Before partitioning, the data order must be shuffled to ensure that the feature distribution (e.g., size range, feature type proportion) of the three datasets is consistent with the original set. If the sample size is small (<1000), 5-fold cross-validation should be used instead of fixed partitioning to improve data utilization, ultimately forming three independent and representative datasets to support model training and evaluation.

[0098] S53. Input the training set, validation set, and test set into the size detection model for iterative training; S54. Input the standardized size detection feature set into the iteratively trained size detection model to obtain the target size quantification detection result.

[0099] Specifically, the first step is to perform input adaptation processing: verify that the format of the standardized feature set (such as feature map dimensions and parameter order) is consistent with the input requirements during model training. If the feature set is image data, the resolution needs to be adjusted to the model's specified size (such as 256×256). If it is parametric data (such as perimeter and curvature values), it needs to be confirmed that the normalization range (such as 0-1) is the same as the preprocessing logic during training to avoid inference errors caused by format deviations. At the same time, filter out abnormal samples in the feature set (such as missing features or data exceeding the measurement range) to reduce the interference of invalid input on the results.

[0100] Next, the model inference is executed: the optimal model weights saved after iterative training (usually the weights with the lowest loss on the validation set) are loaded, the adapted feature sets are batched, and the model automatically completes secondary feature extraction (through convolutional layers), multi-scale fusion (through attention layers), and size regression calculation (through output layers), directly outputting preliminary quantitative prediction values ​​of target size (such as length 5.02mm and diameter 3.15mm), and simultaneously outputting prediction confidence (reflecting the reliability of the results).

[0101] Finally, the detection results are optimized: the initial predicted values ​​are calibrated for accuracy, and the error patterns of the physical size calibration data are combined (e.g., when the model predicts small sizes too low, it is corrected by a fixed coefficient of 1.02). Abnormal results with confidence levels <0.8 or predicted values ​​exceeding the reasonable range are eliminated, the output dimensions are unified (e.g., all dimensions are in mm), and the error range of each result is marked (e.g., 5.02±0.003mm). Finally, accurate and traceable quantitative detection results of the target size are obtained.

[0102] S6. Verify the accuracy of the target size quantization detection results, and establish an image feature size parameter association database based on the verified target size quantization detection results.

[0103] Specifically, first select validation samples covering the entire detection range (such as the detection results corresponding to small, medium, and large-sized standard gauge blocks), and calculate the absolute error (|detected value - calibration value|) and relative error (absolute error / calibration value × 100%) for each sample; then, statistically analyze the overall validation indicators, including mean absolute error and root mean square error. If the mean absolute error ≤ 0.002 mm, RMSE ≤ 0.003 mm, and the relative error of a single sample ≤ 1.5%, the result is considered accurate; for results that exceed the tolerance, backtrack the model reasoning process (such as input adaptation and parameter calibration), eliminate systematic errors, and re-validate.

[0104] When establishing an image feature size parameter association database, a structured data framework needs to be constructed: core fields include image feature information (normalized contour parameters, multi-scale fusion features, spatial alignment values), target size data (quantized detection values, error range, confidence level, verification results), physical calibration data (actual values ​​of standard blocks, calibration accuracy level), and metadata (detection viewpoint, time, equipment number). Abnormal data (such as unqualified detection results) is first cleaned, and then integrated according to the association relationship between image features, size data, and calibration data. A relational database is used for storage to ensure cross-table queries between fields, ultimately forming an association database that supports feature backtracking and size tracing, providing data support for subsequent model optimization and detection scenario expansion.

[0105] According to another aspect of the invention, such as Figure 2 As shown, an image data management system for high-precision size visual inspection is provided. The system includes: a data acquisition and segmentation module 1, an image correction and extraction module 2, a feature evaluation and screening module 3, a feature optimization and generation module 4, a model building and training module 5, and a result verification and database building module 6. Among them, the data acquisition and segmentation module 1 is used to acquire multi-view image datasets and physical size calibration datasets through high-precision size detection equipment, and to perform region segmentation processing on the multi-view image datasets; Image correction and extraction module 2 is used to correct and enhance the multi-view image dataset after region segmentation processing, and extract the contour feature parameters of the corrected and enhanced multi-view image dataset. Feature evaluation and filtering module 3 is used to preset feature effectiveness evaluation indicators, map and associate contour feature parameters with physical dimension calibration data, and filter and classify the mapped and associated contour feature parameters according to the feature effectiveness evaluation indicators. Feature optimization and generation module 4 is used to preset a multi-scale feature fusion strategy and optimize and adjust the contour feature parameters after screening and classification according to the multi-scale feature fusion strategy to generate a standardized size detection feature set. Model building and training module 5 is used to build a size detection model based on a deep learning fusion algorithm, and input the standardized size detection feature set into the size detection model for iterative training to obtain the target size quantification detection result; The result verification and database building module 6 is used to verify the accuracy of the target size quantization detection results and to build an image feature size parameter association database based on the verified target size quantization detection results.

[0106] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. An image data management method for high-precision dimensional visual inspection, characterized in that, Includes the following steps: S1. Collect multi-view image datasets and physical size calibration datasets using high-precision size detection equipment, and perform region segmentation processing on the multi-view image datasets; S2. Correct and enhance the multi-view image dataset after region segmentation, and extract the contour feature parameters of the corrected and enhanced multi-view image dataset. S3. Preset feature effectiveness evaluation index, map and associate contour feature parameters with physical dimension calibration data, and filter and classify the mapped and associated contour feature parameters according to the feature effectiveness evaluation index; S4. Preset a multi-scale feature fusion strategy, and optimize and adjust the contour feature parameters after screening and classification according to the multi-scale feature fusion strategy to generate a standardized size detection feature set. S5. Construct a size detection model based on a deep learning fusion algorithm, and input the standardized size detection feature set into the size detection model for iterative training to obtain the target size quantification detection result; S6. Verify the accuracy of the target size quantization detection results, and establish an image feature size parameter association database based on the verified target size quantization detection results; The process of acquiring multi-view image datasets and physical size calibration datasets using high-precision size detection equipment, and performing region segmentation processing on the multi-view image datasets includes the following steps: S11. Set up a detection device consisting of a high-precision industrial camera and a light source system, and adjust the shooting angle to collect multi-view images of the target object to form a multi-view image dataset. S12. Use existing geometric standard instruments as calibration references, and simultaneously collect images and physical dimension parameters of the standard gauge block from various perspectives to form a physical dimension calibration dataset. S13. Adaptive threshold segmentation algorithm is used to segment the multi-view image dataset into regions to obtain target region dataset and background region dataset. S14. Extract the edge contours of the target region dataset and the background region dataset, and fill the holes inside the region; The preset multi-scale feature fusion strategy, and the optimization and adjustment of the filtered and classified contour feature parameters according to the multi-scale feature fusion strategy to generate a standardized size detection feature set, includes the following steps: S41. A multi-scale feature fusion strategy is preset, which includes a hierarchical fusion strategy library and an alignment method database, and divides the fusion scale level threshold and feature space alignment threshold. S42. Normalize the multi-scale contour feature parameters after screening and classification. S43. Extract the fusion scale level value and contour feature space alignment value of the normalized multi-scale contour feature parameters, and select the hierarchical fusion strategy and spatial alignment method from the hierarchical fusion strategy library and alignment method database based on the fusion scale level value and contour feature space alignment value. S44. Based on the hierarchical fusion strategy and spatial alignment method, the contour feature parameters are optimized and adjusted to generate a standardized size detection feature set.

2. The image data management method for high-precision dimensional visual inspection according to claim 1, characterized in that, The preset feature effectiveness evaluation index maps and associates contour feature parameters with physical dimension calibration data, and filters and classifies the mapped and associated contour feature parameters according to the feature effectiveness evaluation index, including the following steps: S31. Preset feature effectiveness evaluation indicators and combine contour feature parameters with physical dimension calibration data to obtain a data contour sample set; S32. A contour mapping association model is constructed using a fuzzy logic reasoning algorithm, and the contour mapping association model is iteratively optimized using a data contour sample set. S33. Input the contour feature parameters into the iteratively optimized contour mapping association model to generate a feature size mapping table, and quantify and score each set of contour feature parameters in the feature size mapping table according to the feature effectiveness evaluation index. S34. Preset scoring and filtering rules, filter contour feature parameters after quantification and scoring based on the scoring and filtering rules, and classify them according to feature type.

3. The image data management method for high-precision dimensional visual inspection according to claim 1, characterized in that, The process of constructing a size detection model based on a deep learning fusion algorithm and inputting a standardized size detection feature set into the size detection model for iterative training to obtain the target size quantification detection result includes the following steps: S51. A pre-defined deep learning fusion algorithm architecture is provided, which includes a network layer configuration library and a training parameter database, and a size detection model is constructed based on the network layer configuration library and the training parameter database. S52. Perform data augmentation processing on the standardized size detection feature set and divide it into training set, validation set and test set; S53. Input the training set, validation set, and test set into the size detection model for iterative training; S54. Input the standardized size detection feature set into the iteratively trained size detection model to obtain the target size quantification detection result.

4. The image data management method for high-precision dimensional visual inspection according to claim 1, characterized in that, The step of using an adaptive threshold segmentation algorithm to segment a multi-view image dataset into target region datasets and background region datasets includes the following steps: S131. Remove image noise from the multi-view image dataset; S132. Preset an adaptive threshold calculation window set and match the adaptive threshold calculation window set with the denoised multi-view image dataset. S133. Extract grayscale distribution features and target size parameters from multi-view image datasets using a matching-based adaptive threshold calculation window; S134. Perform binarization segmentation on the grayscale distribution features and target size parameters to obtain the target region dataset and the background region dataset.

5. The image data management method for high-precision dimensional visual inspection according to claim 4, characterized in that, The process of extracting the edge contours of the target region dataset and the background region dataset, and filling the holes inside the region, includes the following steps: S141. Preset edge detection algorithm library and morphological processing parameter library, and set edge strength threshold and area threshold of voids inside the region; S142. Extract the gray-level gradient feature values ​​of the target region dataset and the background region dataset, and select the edge detection algorithm from the edge detection algorithm library based on the gray-level gradient feature values. S143. Apply the selected edge detection algorithm to the target region dataset and the background region dataset, and filter and adjust the edge contour based on the edge intensity threshold. S144. Identify the internal voids in the region of the edge contour, and call the closing operation parameter and the region internal void area threshold in the morphological processing parameter library to fill the internal voids in the edge contour.

6. The image data management method for high-precision dimensional visual inspection according to claim 2, characterized in that, The process of constructing a contour mapping association model using a fuzzy logic reasoning algorithm and iteratively optimizing the contour mapping association model through a data contour sample set includes the following steps: S321. Define the input and output variables of the contour mapping association model, and construct fuzzy sets and membership functions based on the input and output variables; S322. Set up a contour mapping association model based on fuzzy sets and membership functions; S323. Preset fuzzy rules and perform fuzzification processing on the data contour sample set based on the fuzzy rules to obtain a fuzzy contour sample set; S324. Input the fuzzy contour sample set and the data contour sample set into the contour mapping association model respectively to calculate the fuzzy contour parameters and the data contour parameters; S325. Preset the model iteration threshold, calculate the contour error parameter of the fuzzy contour parameter and the data contour parameter, and perform threshold matching between the contour error parameter and the model iteration threshold; S326. Iteratively optimize the contour mapping association model based on the threshold matching results.

7. The image data management method for high-precision dimensional visual inspection according to claim 6, characterized in that, The process of inputting contour feature parameters into the iteratively optimized contour mapping association model to generate a feature size mapping table, and then quantitatively scoring each set of contour feature parameters in the feature size mapping table according to the feature effectiveness evaluation index, includes the following steps: S331. Input the contour feature parameters into the iteratively optimized contour mapping association model to calculate the physical size association value, and combine the contour feature parameters and physical size association values ​​to form a feature size mapping table. S332. Set feature scoring standards and weight allocation standards for each indicator of feature effectiveness evaluation indicators; S333. Extract the associated data of each group of contour feature parameters in the feature size mapping table, and calculate the quantitative score of each evaluation index based on the feature scoring standard and weight allocation standard.

8. An image data management system for high-precision dimensional visual inspection, used to implement the image data management method for high-precision dimensional visual inspection as described in any one of claims 1-7, characterized in that, The system includes: a data acquisition and segmentation module, an image correction and extraction module, a feature evaluation and screening module, a feature optimization and generation module, a model building and training module, and a result verification and database construction module; The data acquisition and segmentation module is used to acquire multi-view image datasets and physical size calibration datasets through high-precision size detection equipment, and to perform region segmentation processing on the multi-view image datasets. The image correction and extraction module is used to correct and enhance the multi-view image dataset after region segmentation and extract the contour feature parameters of the corrected and enhanced multi-view image dataset. The feature evaluation and filtering module is used to preset feature effectiveness evaluation indicators, map and associate contour feature parameters with physical dimension calibration data, and filter and classify the mapped and associated contour feature parameters according to the feature effectiveness evaluation indicators. The feature optimization and generation module is used to preset a multi-scale feature fusion strategy and optimize and adjust the contour feature parameters after screening and classification according to the multi-scale feature fusion strategy to generate a standardized size detection feature set. The model building and training module is used to build a size detection model based on a deep learning fusion algorithm, and input a standardized size detection feature set into the size detection model for iterative training to obtain the target size quantification detection result. The result verification and database building module is used to verify the accuracy of the target size quantization detection results and to build an image feature size parameter association database based on the verified target size quantization detection results.

Citation Information

Patent Citations

  • Metal shell optical size detection method and system based on image

    CN117173177A

  • Automatic control method and system for battery film production based on visual inspection

    CN119229372A

  • Method for high-precision measurement of diameter of inhibition zone of culture medium

    CN120707616A