Multi-focal-plane image fusion method and system for three-dimensional workpiece inspection
Patent Information
- Application Number
- PCT/CN2026/075020
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-02-25
- Filing Date
- 2026-01-27
- Publication Date
- 2026-09-03
Smart Images

Figure CN2026075020_03092026_PF_FP_ABST
Abstract
Description
A multi-focal plane image fusion method and system for three-dimensional workpiece inspection Technical Field
[0001] This invention relates to the field of visual inspection technology for three-dimensional workpieces, and more specifically, to a multi-focal plane image fusion method and system for inspecting three-dimensional workpieces. Background Technology
[0002] For 2D vision inspection, accurate and reliable feature information can only be provided when light is clearly focused on the focal plane after passing through the imaging system, forming a clear and sharp image. If the object deviates from the focal plane, the light cannot be precisely focused, resulting in a blurred image and unclear edges, which increases the difficulty of image processing and reduces the accuracy of inspection. However, under normal circumstances, a vision system can only perform vision inspection on one focal plane, which is difficult to meet the inspection requirements of complex 3D workpieces. The inspection of complex 3D workpieces requires the simultaneous use of multiple machine vision systems, which not only complicates the processing of inspection results but also results in low inspection speed and high inspection costs. Summary of the Invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.
[0004] Therefore, the purpose of this invention is to provide a multi-focal plane image fusion method and system for three-dimensional workpiece inspection. A variable-focus lens is mounted on an industrial camera to acquire multi-dimensional focal plane image data of the three-dimensional workpiece. The image is then segmented using multiple thresholds, and the focal plane images of each segmented region are fused to obtain a complete image with high definition and high visual effect. Various parameters are then detected on this complete image. The processing of the detection results is relatively simple, which not only improves the detection efficiency but also solves the problems of low efficiency caused by repeated manual focusing and camera adjustments at different focal plane heights of the three-dimensional workpiece, as well as the need to use multiple machine vision systems simultaneously.
[0005] To achieve the above objectives, the present invention provides a multi-focal plane image fusion method for three-dimensional workpiece inspection, comprising the following steps:
[0006] Acquire multi-dimensional focal plane image data of a three-dimensional workpiece from a vertical or adjustable specified angle;
[0007] The acquired raw image data is preprocessed, including gamma transformation based on the overall gray level of the image, dynamic gray level equalization, and setting block size and contrast.
[0008] Gaussian curve fitting and smoothing are performed on the gray-level histogram based on the preprocessed image data, and the minimum points in the gray-level histogram are accurately extracted as multi-threshold segmentation parameters.
[0009] According to the multi-threshold segmentation parameter, the gray value interval of the pre-processed image data is hierarchically and recursively segmented to generate a plurality of image segmentation regions;
[0010] Based on the morphological algorithm of multi-scale closing operation, the small false targets and noise points in the image segmentation region are removed, and the area, shape and edge features of the image segmentation region are combined for secondary screening;
[0011] Based on the Bezier curve fitting algorithm, the boundary of the image segmentation region is high-precision smooth optimized, and the irregularity of the boundary is eliminated based on the Gaussian edge filter algorithm;
[0012] The optimized image segmentation region is labeled and spatially indexed;
[0013] According to the image segmentation region, the most clear image of each image segmentation region is extracted by taking a screenshot from the pre-processed image data and calculating the clarity according to the multi-factor clarity evaluation model;
[0014] All the most clear images of the image segmentation region are fused to form a complete image.
[0015] In the above technical solution, preferably, the most clear image of all image segmentation regions is fused to form a complete image, comprising the following steps:
[0016] Determine the focal plane of the most clear image of each image segmentation region as the target focal plane thereof;
[0017] Based on the region feature fusion algorithm, the target focal plane parameters of each image segmentation region are normalized and the key data is stored to determine the target focal plane information of each image segmentation region, wherein the key data includes position coordinate data and focal plane data;
[0018] Select the target focal plane of the image segmentation region with the highest clarity as the reference focal plane;
[0019] The target focal planes of different image segmentation regions are seamlessly spliced and fused with the reference focal plane according to their positional relationship to form a complete image.
[0020] In any of the above technical solutions, preferably, the most clear image of all image segmentation regions is fused to form a complete image, comprising the following steps:
[0021] Determine the focal plane of the most clear image of each image segmentation region as the target focal plane thereof;
[0022] Based on the region feature fusion algorithm, the target focal plane parameters corresponding to the clearest image of each image segmentation region are normalized and key data is stored to determine the target focal plane information of each image segmentation region. The key data includes position coordinate data and focal plane data.
[0023] The target focal plane of the image segmentation region with the largest area is selected as the reference focal plane.
[0024] The target focal planes of different image segmentation regions are seamlessly stitched and fused with the reference focal plane according to their mutual positional relationship to form a complete image.
[0025] In any of the above technical solutions, preferably, before seamlessly stitching and fusing the target focal planes of different image segmentation regions with the reference focal plane according to their mutual positional relationship to form a complete image,
[0026] Based on the spatial projection correction algorithm and the reference focal plane, parameter matching and alignment are performed on the target focal plane other than the reference focal plane. The parameters include regional location information and boundary information.
[0027] In any of the above technical solutions, preferably, the following steps are also included:
[0028] Gaussian smoothing and image reconstruction algorithms are used to eliminate artifacts and transition traces at the boundaries of regions in the fused complete image, and a high-definition and high-visual-effect complete image is reconstructed.
[0029] In any of the above technical solutions, preferably, the acquisition of multi-dimensional focal plane image data of a three-dimensional workpiece from a vertical or adjustable specified angle includes the following steps:
[0030] Obtain the background image without the 3D workpiece and the global image containing the 3D workpiece;
[0031] Based on the pixel-level difference calculation method, the global image and the background image are denoised and fused. The background region is eliminated by an adaptive segmentation algorithm, and only the image of the three-dimensional workpiece is retained, so as to obtain the multi-dimensional focal plane image data of the three-dimensional workpiece.
[0032] In any of the above technical solutions, preferably, the step of performing Gaussian curve fitting and smoothing on the grayscale histogram based on the preprocessed image data, and accurately extracting the minimum points in the grayscale histogram as multi-threshold segmentation parameters, includes the following steps:
[0033] Calculate the absolute histogram of grayscale values in the preprocessed image data, and count the number of pixels for each grayscale value according to the first formula, where the first formula is: ,in, The grayscale value is represented by the pixel value at coordinates (x, y) in the image, N and M represent the width and height of the image, respectively, H(I) represents the number of pixels with a grayscale value of I, and δ represents the interval between grayscale levels, that is, the difference between adjacent grayscale values.
[0034] Gaussian filtering is used to smooth the absolute histogram, and local minima are extracted from the smoothed histogram to obtain the set of minima.
[0035] Use the set of minimum points as the multi-threshold segmentation parameter.
[0036] In any of the above technical solutions, preferably, the step of performing hierarchical recursive segmentation of the gray value range of the preprocessed image data according to multiple threshold segmentation parameters to generate multiple image segmentation regions includes the following steps:
[0037] The grayscale value range of the preprocessed image data is segmented according to multiple threshold segmentation parameters, where the multiple threshold segmentation parameters include I1, I2, ..., I... n The grayscale value range is divided into [0, I1], [I1, I2], ..., [I... n-1 ,255];
[0038] Each grayscale value range corresponds to a potential segmentation region;
[0039] The center of each potential segmentation region is used as the seed point, and the search is carried outwards sequentially. If the difference between the gray value of the newly added pixel and the current region is greater than the gray value threshold, or the shortest distance between the coordinate point of the newly added pixel and the current region is greater than the distance value threshold, the search is stopped and all pixels in the obtained connected regions are marked for preliminary segmentation. The gray value threshold is 5-10 pixels, and the distance value threshold is 15-20 pixels.
[0040] For the already segmented connected regions, the center of each region is used as the seed point, and the above outward search steps are repeated to gradually increase the region until the pixel value difference between the edge positions of two adjacent segmented regions is greater than the set threshold, which is 5-10 pixels. At the same time, there are no segmented regions with an area less than 50 pixels, thus forming multiple image segmented regions.
[0041] In any of the above technical solutions, preferably, the multi-factor clarity evaluation model includes: ,
[0042] Wherein, Clarity represents the image sharpness of the segmented region, α, β, and γ represent the weight coefficients, G(x,y) represents the gradient magnitude of the segmented region, C represents the contrast, and H represents the texture entropy.
[0043] The technical solution of this invention also proposes a multi-focal plane image fusion system for three-dimensional workpiece inspection, including a variable-focus image acquisition module, which includes an industrial camera and a variable-focus lens for dynamically acquiring images at different focal lengths; a computer device, which includes a processor for executing a computer program stored in a memory to implement the multi-focal plane image fusion method for three-dimensional workpiece inspection as described above; and the computer device is communicatively connected to the variable-focus image acquisition module.
[0044] The multi-focal plane image fusion method and system for three-dimensional workpiece inspection proposed in this invention have the following beneficial technical effects:
[0045] (1) The multi-focal plane image fusion method and system for three-dimensional workpiece detection proposed in this invention can fuse the image segmentation areas under multiple focal planes of a three-dimensional workpiece to form a complete image with high definition and high visual effect. It can effectively reduce the problem of needing to move hardware equipment to repeatedly fix the focus due to different focal planes at different positions of the three-dimensional workpiece, and greatly improve the detection efficiency and detection accuracy.
[0046] (2) The multi-focal plane image fusion method and system for three-dimensional workpiece inspection proposed in this invention is to install a variable zoom lens on an industrial camera, acquire multi-dimensional focal plane image data of three-dimensional workpieces, perform multi-threshold segmentation on the image, and then fuse the focal plane images of each segmented region to obtain a complete image with high definition and high visual effect. The detection of various parameters of this complete image is relatively simple, which not only improves the detection efficiency, but also solves the problem of low efficiency caused by multiple manual focusing adjustments of the camera on different height focal planes of three-dimensional workpieces and the problem of needing to use multiple machine vision systems at the same time.
[0047] (3) The multi-focal plane image fusion method and system for three-dimensional workpiece inspection proposed in this invention can acquire image data of different focal planes at vertical or a certain specified angle without changing the position of the industrial camera by adding a variable zoom lens. The image acquisition method is simpler and more reliable. The clarity of each area in these image data is different. By analyzing and fusing these image data, a complete inspection image can be obtained. Only this inspection image needs to be analyzed to obtain the inspection result. The inspection analysis is relatively simple and the inspection accuracy is high.
[0048] (4) The multi-focal plane image fusion method and system for three-dimensional workpiece detection proposed in this invention evaluates the sharpness of image segmentation regions through a multi-factor sharpness evaluation model, which is more accurate and can more accurately determine the target focal plane with the highest sharpness in each image segmentation region, which is beneficial to improving the fusion effect.
[0049] (5) The multi-focal plane image fusion method and system for three-dimensional workpiece inspection proposed in this invention can realize the fusion of multiple images, and fuse the clearest photos of each image segmentation area, resulting in better fusion effect. All parts of the three-dimensional workpiece under the same angle of the industrial camera are clearly presented in the same fused image, which is convenient for detection and analysis.
[0050] (6) The multi-focal plane image fusion method and system for three-dimensional workpiece inspection proposed in this invention normalizes the focal plane parameters of each region through a regional feature fusion algorithm, determines the focal plane information of each segmented region, selects the target focal plane of the largest area in the segmented region as the reference focal plane or the target focal plane of the segmented region with the highest clarity as the reference focal plane, and uses spatial projection correction technology to match and align the parameters of the focal planes of other regions so that their characteristics are consistent with the reference focal plane, thereby achieving seamless splicing and fusion of each image segmented region. At the same time, the image is smoothly reconstructed to ensure the consistency of the image content in space and vision.
[0051] Additional aspects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description or may be learned by practice of the invention. Attached Figure Description
[0052] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0053] Figure 1 shows a schematic flowchart of a multi-focal plane image fusion method for three-dimensional workpiece inspection according to an embodiment of the present invention;
[0054] Figure 2 shows a schematic diagram of preliminary image segmentation for a multi-focal plane image fusion method for three-dimensional workpiece inspection according to an embodiment of the present invention;
[0055] Figure 3 shows a schematic diagram of the formation of multiple image segmentation regions in a multi-focal plane image fusion method for three-dimensional workpiece inspection according to an embodiment of the present invention.
[0056] Figure 4 shows a focal plane image of a car door lock;
[0057] Figure 5 shows another focal plane image of the car door lock;
[0058] Figure 6 shows a fused image of the car door lock. Detailed Implementation
[0059] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0060] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0061] The following describes in detail, with reference to Figures 1 to 6, a multi-focal plane image fusion method and system for three-dimensional workpiece detection according to an embodiment of the present invention.
[0062] As shown in Figure 1, a multi-focal plane image fusion method for three-dimensional workpiece detection according to an embodiment of the present invention includes the following steps:
[0063] S102, acquires multi-dimensional focal plane image data of a three-dimensional workpiece from a vertical or adjustable specific angle;
[0064] The system uses an industrial-grade high-resolution camera to capture multi-dimensional focal plane image data of a three-dimensional workpiece from a vertical or adjustable specified angle. The acquisition system is equipped with autofocus and an intelligent illumination module to ensure uniform illumination and image clarity. Simultaneously, it utilizes an intelligently controlled stage to achieve multi-angle dynamic imaging of the workpiece under test, providing high-quality input data for subsequent processing.
[0065] S104, preprocess the acquired raw image data. The preprocessing includes: setting the gamma value according to the overall gray level of the image to perform gamma transformation, and performing dynamic gray level equalization of the image, setting the block size and contrast.
[0066] Gamma transform and dynamic grayscale equalization can improve image brightness, enhance image contrast, and highlight image defects.
[0067] S106, Gaussian curve fitting and smoothing are performed on the gray-level histogram based on the preprocessed image data, and the minimum points in the gray-level histogram are accurately extracted as multi-threshold segmentation parameters.
[0068] S108, perform hierarchical recursive segmentation of the gray value range of the preprocessed image data according to the multi-threshold segmentation parameters to generate multiple image segmentation regions;
[0069] S110, based on multi-scale closing operations of morphological algorithms, removes small pseudo-targets and noise points in the image segmentation region, and performs secondary screening by combining the area, shape and edge features of the image segmentation region; in addition, a deep learning classification model is used to perform region labeling and classification of the screened targets, which facilitates subsequent focal plane extraction and fusion.
[0070] S112, based on the Bézier curve fitting algorithm, performs high-precision smoothing optimization on the boundaries of the image segmentation region, and eliminates the irregularity of the boundaries based on the Gaussian edge filtering algorithm; thus, it can ensure the generation of regular and high-precision target regions.
[0071] S114, the optimized image segmentation region is labeled and spatially indexed; thus, it facilitates subsequent focal plane extraction and fusion calculation.
[0072] S116, From the preprocessed image data, screenshots are taken according to the image segmentation region, and the sharpness is calculated according to the multi-factor sharpness evaluation model to extract the sharpest image of each image segmentation region; the multi-factor sharpness evaluation model includes: In this model, Clarity represents the image sharpness of the segmented region, α, β, and γ represent weighting coefficients, G(x,y) represents the gradient magnitude of the segmented region, C represents contrast, and H represents texture entropy. Therefore, by utilizing multiple factors to comprehensively evaluate the image sharpness of each segmented region, the image sharpness assessment achieves high accuracy.
[0073] S118 merges the clearest images from all image segmentation regions to form a complete image.
[0074] This enables the fusion of multiple focal planes on a three-dimensional workpiece, effectively reducing the need for repeated focusing by moving hardware due to different focal planes at different positions on the workpiece, and greatly improving detection efficiency and accuracy.
[0075] Further, step S102 specifically includes: S1021, obtaining a background image without the three-dimensional workpiece and a global image containing the three-dimensional workpiece; S1022, based on the pixel-level difference calculation method, performing noise reduction and fusion on the global image and the background image, eliminating the background region through an adaptive segmentation algorithm, retaining only the image of the three-dimensional workpiece, and obtaining the multi-dimensional focal plane image data of the three-dimensional workpiece. Taking the three-dimensional workpiece as a car door lock as an example, the specific details are shown in Figures 4 and 5.
[0076] This can greatly reduce the computational complexity of multi-focal plane image fusion methods and improve the accuracy of image segmentation region extraction.
[0077] Further, step S106 specifically includes: S1061, calculating the absolute histogram of gray values in the preprocessed image data, and counting the number of pixels for each gray value according to the first formula, wherein the first formula is: ,in, S1062 represents the pixel value at coordinates (x, y) in the image, I represents the gray value, N and M represent the width and height of the image respectively, H(I) represents the number of pixels with gray value I, and δ represents the interval between gray levels, i.e. the difference between adjacent gray values; S1063, Gaussian filtering is used to smooth the absolute histogram, and local minima are extracted from the smoothed histogram to obtain the set of minima; S1064, the set of minima is used as the multi-threshold segmentation parameter.
[0078] When smoothing an absolute histogram using Gaussian filtering, it's crucial to select an appropriate Gaussian filter standard deviation parameter. Specifically, this parameter should preserve the original histogram curve without losing key change points. This effectively reduces noise in the histogram, making the minimum values more prominent and stable. Furthermore, using the set of minimum points as multi-threshold segmentation parameters enables multi-region segmentation of the image, facilitating the identification and fusion of the clearest segmented regions.
[0079] Further, step S108 specifically includes: S1081, segmenting the grayscale value range of the preprocessed image data according to multiple threshold segmentation parameters, wherein the multiple threshold segmentation parameters include I1, I2, ..., I... n The grayscale value range is divided into [0, I1], [I1, I2], ..., [I... n-1
[255] ; S1082, each gray value interval corresponds to a potential segmentation region; S1083, the center of each potential segmentation region is used as a seed point, and the search is performed outwards sequentially. If the difference between the gray value of the newly added pixel and the current region is greater than the gray value threshold or the shortest distance between the coordinate point of the newly added pixel and the current region is greater than the distance value threshold, the search is stopped, and all pixels in the obtained connected regions are marked for preliminary segmentation. The gray value threshold is 5-10 pixel value, and the distance value threshold is 15-20 pixel value. Taking a car door lock as an example, the schematic diagram of the preliminary image segmentation is shown in Figure 2; S1084, for the connected regions that have been segmented, the center of each region is used as a seed region, and the step of searching outwards sequentially in S1082 is repeated to gradually increase the region until the pixel value difference between the edge positions of two adjacent segmentation regions is greater than the set threshold, which is 5-10 pixel value. At the same time, there are no segmentation regions with an area less than 50 pixel value, forming multiple image segmentation regions, as shown in Figure 3.
[0080] Therefore, by performing hierarchical recursive segmentation of the gray value range, high accuracy and completeness of image segmentation can be ensured.
[0081] Further, step S118 specifically includes: S1181, determining the focal plane of the sharpest image in each image segmentation region as its target focal plane; S1182, based on a region feature fusion algorithm, normalizing the target focal plane parameters of each image segmentation region and storing key data to determine the target focal plane information of each image segmentation region. The key data includes position coordinate data and focal plane data. The normalization process uses Z-Score, adjusting the mean of the data to 0 and the standard deviation to 1. Where μ is the mean of the focal plane parameters of all regions, and σ is the standard deviation; S1183, the target focal plane of the image segmentation region with the highest clarity is selected as the reference focal plane, and the target focal planes of other image segmentation regions are matched and aligned according to the spatial projection correction algorithm. The parameters include the region position information and boundary information to ensure that their characteristics are consistent with the reference focal plane; S1184, the target focal planes of different image segmentation regions are seamlessly stitched and fused with the reference focal plane according to their mutual positional relationship, and the color, brightness and texture features between the images are adjusted to ensure the consistency of the image content in space and vision; S1185, Gaussian smoothing and image reconstruction algorithms are used to eliminate artifacts and transition traces at the boundaries of the fused image regions, and a complete image with high definition and high visual effect is reconstructed. Taking a car door lock as an example, as shown in Figure 6, the overall image has better coherence and aesthetics, which facilitates the measurement of various parameters of the fused image and improves the accuracy of 3D workpiece detection.
[0082] In addition, S1183 can also select the target focal plane of the image segmentation region with the largest area as the reference focal plane.
[0083] The method of this invention for multi-focal plane imaging of three-dimensional workpieces solves the difficulties of conventional focus adjustment through hardware systems. This not only simplifies the operation process but also significantly improves imaging efficiency and accuracy. Furthermore, it can automatically select different focal levels for image fusion, effectively solving the image blurring problem caused by inaccurate focus. This ensures that the details of the three-dimensional workpiece are clearly presented on different focal planes, thereby improving the reliability and accuracy of quality inspection.
[0084] A multi-focal-plane image fusion system for three-dimensional workpiece inspection according to an embodiment of the present invention includes a variable-focus image acquisition module, which includes an industrial camera and a variable-focus lens for dynamically acquiring images at different focal lengths; and a computer device, which includes a processor for executing a computer program stored in a memory to implement the multi-focal-plane image fusion method for three-dimensional workpiece inspection described in the above embodiment. The computer device is communicatively connected to the variable-focus image acquisition module. The industrial camera is an industrial-grade high-resolution camera that captures multi-dimensional focal-plane image data of the three-dimensional workpiece from a vertical or adjustable specified angle. By adjusting the focal length of the variable-focus lens, the system achieves dynamic acquisition of images at different focal lengths. The acquisition system is equipped with an autofocus function and an intelligent supplementary lighting module to ensure uniform illumination and image clarity. Simultaneously, it utilizes an intelligently controlled stage to achieve multi-angle dynamic imaging of the workpiece under test, providing high-quality input data for subsequent processing.
[0085] The steps in the method of this invention can be adjusted, combined, or deleted according to actual needs.
[0086] The units in the device of the present invention can be merged, divided, or deleted according to actual needs.
[0087] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.
[0088] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A multi-focal plane image fusion method for three-dimensional workpiece inspection, characterized in that, Includes the following steps: Acquire multi-dimensional focal plane image data of a three-dimensional workpiece from a vertical or adjustable specified angle; The acquired raw image data is preprocessed, including setting the gamma value according to the overall gray level of the image for gamma transformation, performing dynamic gray level equalization, and setting the block size and contrast. Gaussian curve fitting and smoothing are performed on the gray-level histogram based on the preprocessed image data, and the minimum points in the gray-level histogram are accurately extracted as multi-threshold segmentation parameters. Based on multiple threshold segmentation parameters, the gray value range of the preprocessed image data is recursively segmented in a hierarchical manner to generate multiple image segmentation regions. Based on the multi-scale closing operation of morphological algorithms, small false targets and noise points in the image segmentation region are removed, and secondary screening is performed by combining the area, shape and edge features of the image segmentation region. Based on the Bézier curve fitting algorithm, the boundaries of the image segmentation region are optimized with high precision and smoothness, and the irregularity of the boundaries is eliminated based on the Gaussian edge filtering algorithm. The optimized image segmentation regions are then labeled and spatially indexed. From the preprocessed image data, screenshots are taken according to the image segmentation region, and the sharpness is calculated according to the multi-factor sharpness evaluation model to extract the sharpest image of each image segmentation region. The clearest images from all image segmentation regions are merged to form a complete image.
2. The multi-focal plane image fusion method for three-dimensional workpiece inspection according to claim 1, characterized in that, The process of fusing the clearest images from all segmented image regions to form a complete image includes the following steps: Determine the focal plane of the sharpest image for each segmented region as its target focal plane; Based on the regional feature fusion algorithm, the parameters of the target focal plane of each image segmentation region are normalized and key data is stored to determine the target focal plane information of each image segmentation region. The key data includes position coordinate data and focal plane data. The target focal plane of the image segmentation region with the highest resolution is selected as the reference focal plane; the target focal planes of different image segmentation regions are seamlessly stitched and fused with the reference focal plane according to their relative positions to form a complete image.
3. The multi-focal plane image fusion method for three-dimensional workpiece inspection according to claim 1, characterized in that, The process of fusing the clearest images from all segmented image regions to form a complete image includes the following steps: Determine the focal plane of the sharpest image for each segmented region as its target focal plane; Based on the regional feature fusion algorithm, the target focal plane parameters of each image segmentation region are normalized and key data is stored to determine the target focal plane information of each image segmentation region. The key data includes position coordinate data and focal plane data. The target focal plane of the image segmentation region with the largest area is selected as the reference focal plane. The target focal planes of different image segmentation regions are seamlessly stitched and fused with the reference focal plane according to their mutual positional relationship to form a complete image.
4. The multi-focal plane image fusion method for three-dimensional workpiece inspection according to claim 2 or 3, characterized in that, Before seamlessly stitching and fusing the target focal planes of different image segmentation regions with the reference focal plane according to their mutual positional relationships to form a complete image, Based on the spatial projection correction algorithm and the reference focal plane, parameter matching and alignment are performed on the target focal plane other than the reference focal plane. The parameters include regional location information and boundary information.
5. The multi-focal plane image fusion method for three-dimensional workpiece inspection according to claim 2 or 3, characterized in that, It also includes the following steps: Gaussian smoothing and image reconstruction algorithms are used to eliminate artifacts and transition traces at the boundaries of regions in the fused complete image, and a high-definition and high-visual-effect complete image is reconstructed.
6. The multi-focal plane image fusion method for three-dimensional workpiece inspection according to claim 1, characterized in that, The acquisition of multi-dimensional focal plane image data of a three-dimensional workpiece from a vertical or adjustable specified angle includes the following steps: Obtain the background image without the 3D workpiece and the global image containing the 3D workpiece; Based on the pixel-level difference calculation method, the global image and the background image are denoised and fused. The background region is eliminated by an adaptive segmentation algorithm, and only the image of the three-dimensional workpiece is retained, so as to obtain the multi-dimensional focal plane image data of the three-dimensional workpiece.
7. The multi-focal plane image fusion method for three-dimensional workpiece inspection according to claim 1, characterized in that, The process of performing Gaussian curve fitting and smoothing on the grayscale histogram of the preprocessed image data, and accurately extracting the minimum points in the grayscale histogram as multi-threshold segmentation parameters, includes the following steps: Calculate the absolute histogram of grayscale values in the preprocessed image data, and count the number of pixels for each grayscale value according to the first formula, where the first formula is: ,in, The grayscale value is represented by the pixel value at coordinates (x, y) in the image, N and M represent the width and height of the image, respectively, H(I) represents the number of pixels with a grayscale value of I, and δ represents the interval between grayscale levels, that is, the difference between adjacent grayscale values. Gaussian filtering is used to smooth the absolute histogram, and local minima are extracted from the smoothed histogram to obtain the set of minima. Use the set of minimum points as the multi-threshold segmentation parameter.
8. The multi-focal plane image fusion method for three-dimensional workpiece inspection according to claim 7, characterized in that, The step of performing hierarchical recursive segmentation of the grayscale value range of the preprocessed image data according to multiple threshold segmentation parameters to generate multiple image segmentation regions includes the following steps: The grayscale value range of the preprocessed image data is segmented according to multiple threshold segmentation parameters, where the multiple threshold segmentation parameters include I1, I2, ..., I... n The grayscale value range is divided into [0, I1], [I1, I2], ..., [I... n-1 ,255]; Each grayscale value range corresponds to a potential segmentation region; The center of each potential segmentation region is used as the seed point, and the search is carried outwards sequentially. If the difference between the gray value of the newly added pixel and the current region is greater than the gray value threshold, or the shortest distance between the coordinate point of the newly added pixel and the current region is greater than the distance value threshold, the search is stopped and all pixels in the obtained connected regions are marked for preliminary segmentation. The gray value threshold is 5-10 pixels, and the distance value threshold is 15-20 pixels. For the already segmented connected regions, the center of each region is used as the seed point, and the above outward search steps are repeated to gradually increase the region until the pixel value difference between the edge positions of two adjacent segmented regions is greater than the set threshold, which is 5-10 pixels. At the same time, there are no segmented regions with an area less than 50 pixels, thus forming multiple image segmented regions.
9. The multi-focal plane image fusion method for three-dimensional workpiece inspection according to claim 1, characterized in that, The multi-factor clarity evaluation model includes: Where Clarity represents the image sharpness of the segmented region, α, β, and γ represent the weighting coefficients, G(x,y) represents the gradient magnitude of the segmented region, C represents the contrast, and H represents the texture entropy.
10. A multi-focal plane image fusion system for three-dimensional workpiece inspection, characterized in that, The system includes a variable-focus image acquisition module, which comprises an industrial camera and a variable-focus lens, for dynamically acquiring images at different focal lengths; and a computer device, which includes a processor for executing a computer program stored in a memory to implement the multi-focal plane image fusion method for three-dimensional workpiece inspection as described in any one of claims 1 to 9, wherein the computer device is communicatively connected to the variable-focus image acquisition module.