A method for surface image correction of curved optical elements
By correcting the surface image of curved optical elements using ring sub-image segmentation and Lanczos interpolation, the problem of image distortion of curved optical elements is solved, and efficient defect detection is achieved.
Patent Information
- Application Number
- CN202411826254.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-12-12
AI Technical Summary
Existing technologies struggle to effectively correct the distortion effects of curved optical element images, impacting the accuracy and efficiency of defect detection.
The surface image of the curved optical element is corrected by using the Lanczos interpolation method, which employs ring sub-image segmentation, correction factor calculation, center magnification and edge stretching. The process includes ring sub-image slicing, correction factor calculation, center magnification and edge stretching operations, and finally stitching them together to form a distortion-free image.
It significantly reduces or even eliminates image distortion effects, providing more accurate and reliable surface defect detection results for curved optical components, and improving detection accuracy and efficiency.
Smart Images

Figure CN119762401B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image correction technology, and in particular relates to a method for surface image correction of curved optical elements. Background Technology
[0002] Surface defect detection of optical components is crucial for ensuring the performance of optical systems. Lenses, mirrors, prisms, and other components are core parts of many high-tech devices, including microscopes, telescopes, camera lenses, laser systems, and various medical and industrial imaging equipment. Even the smallest surface imperfection can affect the way light passes or is reflected, thus impacting image quality. With technological advancements, the applications of optical components are constantly expanding, and the requirements for precision are increasing. Advanced inspection technologies can not only detect problems that traditional methods cannot identify but also drive the development of new manufacturing technologies and materials.
[0003] The main methods for inspecting planar optical components are imaging methods and energy methods. Imaging methods utilize visual inspection, filtering (high-pass, low-pass, adaptive), and grazing refraction techniques, combined with image analysis, to identify surface defects. Energy methods focus on the quantitative analysis of scattered light energy, such as scattered energy analysis and spectral analysis, to assess defect characteristics. With the leaps in machine vision and AI technologies, computer vision-based automated inspection technology has become the new norm for inspecting planar optical components, significantly improving the accuracy and efficiency of inspection. Furthermore, microscopic scattering imaging technology is also widely used in the design of surface defect inspection equipment in scientific research and industrial production. Although high-resolution microscopes (such as AFM, STM, and interference microscopes) can provide detailed information on surface defects, their high cost and slow inspection speed limit their widespread application.
[0004] Curved optical elements, due to their complex shapes and curved surface characteristics, present greater challenges for defect detection. Traditional detection methods are often inapplicable directly, requiring higher precision and more complex algorithms to accurately identify and quantify defects. Optical coherence tomography (OCT) is primarily used for detecting internal defects in non-transparent materials, but in some cases, it can also be applied to surface inspection of curved optical elements. The Sm-Net OCT proposed in this research can significantly improve the adaptability and practicality of OCT imaging and expand its application areas. However, this method has high hardware costs and a complex detection process, making it more suitable for detecting internal material defects. Infrared thermal imaging technology utilizes infrared radiation to detect temperature differences in objects to find potential defects, but its effectiveness in detecting minute defects is limited. The Spherical Surface Defect Evaluation System (SSDES) is based on the detection principle of microscopic scattering dark-field illumination. It includes a variable aperture angle illumination source, an automatic centering system, an imaging system, and a multi-axis spatial pose adjustment system. It can detect surface defects in curved optical elements, but its hardware is complex, the detection steps are cumbersome, and errors may exist in the hardware pose adjustment.
[0005] To achieve faster and more efficient surface defect detection for curved optical components, combining advanced machine vision technology and deep learning algorithms is a feasible solution. However, the non-planar nature of curved optical components leads to distortion effects in the images acquired by the camera, posing a challenge to surface defect detection. Currently, there is no effective method to correct images of curved optical components acquired from a single camera's top-down view to eliminate distortion effects and restore their true shape and size. Therefore, this invention proposes a surface image correction method for curved optical components. Summary of the Invention
[0006] The purpose of this invention is to provide a surface image correction method for curved optical elements, which aims to solve the problems mentioned in the background art.
[0007] The objective of this invention is achieved through the following technical solution:
[0008] A method for correcting surface images of curved optical elements includes the following steps:
[0009] Step 1: Ring-shaped sub-image segmentation, specifically: the half-section image of the curved optical element is divided equally around the center point to form multiple ring-shaped sub-image slices; the arc length of each segment and its position within the ring are calculated. The projected length along the axis direction ultimately yields the first... The ring and the first The radius difference between the rings;
[0010] Step 2: Calculate the correction factor for the circular sub-image, specifically: for each circular sub-image slice, calculate its correction factor in... Correction factors in the axial direction to correct for 3D image distortion. Distortion existing in the axial direction;
[0011] Step 3: Calculate the center magnification factor and edge stretching factor. Specifically, calculate the center magnification factor and edge stretching factor of each ring based on the correction factor of the ring sub-image.
[0012] Step 4: Circular sub-image slicing, specifically: performing actual slicing operations on the original image to obtain the sliced circular sub-image;
[0013] Step 5: Center magnification, specifically: using the Lanczos interpolation method to magnify the central region of each annular sub-image;
[0014] Step 6: Image edge stretching, specifically: stretch the edge region of each annular sub-image to keep the inner diameter region of the annular image unchanged, while stretching the region from the inner diameter to the outer diameter to the specified length;
[0015] Step 7: Image re-stitching, specifically: re-stitching all the corrected and processed ring sub-images to form the final corrected image;
[0016] The specific process of step 6 is as follows:
[0017] Step 61: Reinitialize the stretched image, initializing all pixels, with each pixel's color channel value set to 0; the new image's length and width are the sum of the original image's length and width plus twice the stretched radius, specifically expressed as:
[0018] ;
[0019] ;
[0020] ;
[0021] in: This indicates the required change in radius after an image edge stretching operation. This indicates the height of the stretched image. This represents the width of the image after stretching. This represents the outer radius length of the stretched image. This represents the outer radius length of the original annulus;
[0022] Step 62: Traverse all pixels of the original image, where pixel coordinates are represented as... ;
[0023] Step 63: Calculate in Length corrected in the axial direction And calculate the angle between the current pixel and the center of the circle in the coordinate system. :
[0024] ;
[0025] ;
[0026] ;
[0027] in: This indicates that the value is rounded down; Indicates the coordinates of the center of the stretched image;
[0028] Step 64: Determine the region where the pixel is located, and recalculate the pixel value and radial position. The specific operation is as follows:
[0029] if , Let represent the inner radius of the original annulus, then:
[0030] ;
[0031] in: and This indicates the recalculated pixel value. and Indicates the image center position value;
[0032] if Then, a linear interpolation method is used:
[0033] ;
[0034] ;
[0035] in: Indicates the interpolation coefficients. This indicates the new radial position.
[0036] Furthermore, the specific process of step 1 is as follows:
[0037] The half-section diagram of the curved optical element is centered at a circle. Decompose the reference point into Divide into equal parts to obtain an arc. , ... The original central angle of the half-section diagram is The central angle corresponding to each arc segment is Define region To divide the smallest unit sector region, we obtain points. ;
[0038] Length and , ... The length of each arc segment is:
[0039] ;
[0040] ;
[0041] in: r express The radius length; This indicates that the function value is rounded down;
[0042] Known points The coordinates are The arc length of each segment is obtained through iterative calculation. The projected length along the axis direction yields the first... The ring and the first The radius difference between the rings is:
[0043] .
[0044] Furthermore, the specific process of step 2 is as follows:
[0045] For each arc length, the image is... The length in the axial direction is corrected to That is, it satisfies the following equation:
[0046] ;
[0047] in: The correction factor required for each arc length. For the first The ring and the first The radius difference between the rings In order to be in The corrected length along the axis; after transforming Equation 4 into an equivalent matrix, the following is calculated. The value is .
[0048] Furthermore, the specific process of step 3 is as follows:
[0049] The center magnification factor is calculated as follows:
[0050] ;
[0051] The edge stretching factor is calculated as follows:
[0052] .
[0053] Furthermore, the specific process of step 4 is as follows:
[0054] Step 41: Obtain the height and width of the original image, and calculate the center coordinates of the image;
[0055] Step 42: Define the inner and outer diameters of all the rings to be sliced;
[0056] Step 43: After excluding the inner circle, calculate the image mask by looping through the image, apply the mask to the original image, and finally display the sub-images after all slices.
[0057] Furthermore, the specific process of step 5 is as follows:
[0058] Extending one-dimensional Lanczos interpolation to the two-dimensional case yields the Lanczos kernel function and the weighted average weights:
[0059] ;
[0060] ;
[0061] in: Let a be the Lanczos function, and let a represent the order of the Lanczos function. and The position to be interpolated. and For the existing sampling locations, For the existing location pixel value, That is, obtained by interpolation. The interpolation result at the location.
[0062] Furthermore, the specific process of step 7 is as follows:
[0063] Step 71: Extract the annular features from the first corrected smallest annular sub-image, and map the annular features to the second corrected annular sub-image to form a new sub-image. ;
[0064] Step 72: The circular features in the image are extracted and mapped onto the third corrected circular sub-image to form a new sub-image. ;
[0065] Step 73: Repeat the above operation until all the corrected ring sub-images are stitched together to form the final new corrected image. .
[0066] Compared with the prior art, the beneficial effects of the present invention are:
[0067] This surface image correction method for curved optical elements can effectively correct original images with distortion effects. The image correction effect improves with the increase of the number of image slices. When the number of slices approaches infinity, the image is basically restored. It can not only accurately correct the shape and size of defects on the surface of curved optical elements, but also significantly reduce or even eliminate the interference of distortion effects on defect detection, thereby providing more accurate and reliable detection results. Attached Figure Description
[0068] Figure 1 This is a flowchart of the method of the present invention.
[0069] Figure 2 This is a schematic diagram of the principle of slicing a circular sub-image.
[0070] Figure 3 This is a schematic diagram of the edge stretching operation.
[0071] Figure 4 This is a screenshot showing the effect of slicing an image.
[0072] Figure 5 Enlarged view of the image centered on the subject.
[0073] Figure 6 This is an image showing the effect of edge stretching.
[0074] Figure 7 The result of re-stacking the images.
[0075] Figure 8 This is a comparison image of the original image and the corrected image. Detailed Implementation
[0076] In order to provide a clearer understanding of the technical features, objectives and beneficial effects of the present invention, the technical solution of the present invention will now be described in detail below, but it should not be construed as limiting the scope of implementation of the present invention.
[0077] The specific implementation of the present invention will be described in detail below with reference to specific embodiments.
[0078] One embodiment of the present invention provides a method for surface image correction of curved optical elements, the flowchart of which is shown below. Figure 1 As shown, the method includes the following steps:
[0079] Step 1: Ring-shaped sub-image segmentation, specifically: the half-section image of the curved optical element is divided equally around the center point to form multiple ring-shaped sub-image slices; the arc length of each segment and its position within the ring are calculated. The projected length along the axis direction ultimately yields the first... The ring and the first The difference in radius between the rings.
[0080] Figure 2 This is a schematic diagram of a sliced curved optical element. Figure 2 Figure (a) shows a half-section view of a curved optical element, in which The original circular arc on the surface of the half-section view. The center of the original arc in the half-section view is used as the reference point. First, the half-section view is repositioned around the center of the arc. Decompose the reference point into Divide into equal parts, corresponding to the arcs in the diagram. , ... The original central angle of the half-section diagram is The central angle corresponding to each arc segment is . Figure 2 (b) shows an isometric view of a curved optical element, in the region. Similarly, the smallest unit sector region is divided into... Figure 2 Dividing the data in the manner described in (a) yields points. Its corresponding Figure 2 Point (a) , ... The smallest unit sector area The arc length is divided into equal parts, which correspond to contour lines. The resulting contour line diagram is shown below. Figure 2 As shown in (b).
[0081] Length and , ... The length of each arc segment is:
[0082] Formula 1: ;
[0083] Formula 2: ;
[0084] in: r express The radius length; This indicates that the function value is rounded down;
[0085] Known points The coordinates are The arc length of each segment is obtained through iterative calculation. The projection length along the axial direction is calculated using the following method: ; ; ; and so on, we get:
[0086] Formula 3: ;
[0087] Therefore, the first... The ring and the first The radius difference between the rings is:
[0088] Formula 4: .
[0089] Step 2: Calculate the correction factor for the circular sub-image, specifically: for each circular sub-image slice, calculate its correction factor in... Correction factors in the axial direction to correct for 3D image distortion. Distortions existing in the axial direction.
[0090] exist Figure 2 In (a), to correct the three-dimensional image in The distortion problem in the axial direction, that is, the correction of the original two-dimensional image, requires that for each arc length, the image be... The length in the axial direction is corrected to That is, it satisfies the following equation:
[0091] Formula 5: ;
[0092] in: The correction factor required for each arc length. For the first The ring and the first The radius difference between the rings In order to be in The corrected length along the axial direction;
[0093] Equation 5 is transformed into an equivalent matrix, as shown below:
[0094] Formula 6: ;
[0095] Formula 7: ;
[0096] Therefore, it is calculated that The value is .
[0097] Step 3: Calculate the center magnification factor and edge stretching factor. Specifically, calculate the center magnification factor and edge stretching factor of each ring based on the correction factor of the ring sub-image.
[0098] for In terms of its correction factor Center magnification factor Edge stretching coefficient It is decomposed into a ring without an inner diameter, that is, a small circle. For In terms of its correction factor , The revised version Correcting the previous ,but The center magnification factor is calculated as follows:
[0099] Formula 8: ;
[0100] Formula 9: ;
[0101] for In terms of the center magnification correction before The revised version ,but The edge stretching factor is calculated as follows:
[0102] Formula 10: ;
[0103] Similarly, for In terms of its correction factor The center magnification factor is calculated as follows:
[0104] Formula 11: ;
[0105] The edge stretching factor is calculated as follows:
[0106] Formula 12: 。;
[0107] Step 4: Circular sub-image slicing. Specifically, after calculating all the parameters required for image slicing, the original image is sliced to obtain the sliced circular sub-image. The difference between this step and Step 1 is that Step 1 is a theoretical slicing division, while this step is the actual operation.
[0108] The specific steps are as follows:
[0109] Step 41: Obtain the height and width of the original image, and calculate the center coordinates of the image;
[0110] Step 42: Define the inner and outer diameters of all the rings to be sliced;
[0111] Step 43: After excluding the inner circle, calculate the image mask by looping through the image, apply the mask to the original image, and finally display the sub-images after all slices.
[0112] Step 5: Center magnification, specifically: using the Lanczos interpolation method to magnify the central region of each annular sub-image.
[0113] The principle of image center magnification is the same as that of image enlargement, both utilizing interpolation to enlarge or reduce the image. For interpolation functions, Lanczos kernel interpolation is a method used in image and signal processing. It is based on the Lanczos function, a smoothing window function used to limit the interpolation bandwidth. Lanczos interpolation is commonly used for image scaling and resampling because it can reduce jagged edges while preserving image details. The basic idea of Lanczos interpolation is to use the Lanczos function as a weighting function to perform a weighted average of the original data points to obtain the interpolation points. The shape of the Lanczos function depends on its order; typically, a 2nd or 3rd order Lanczos function is used. Higher order results in smoother interpolation, but also increases computational cost. Weights at different locations... for:
[0114] Formula 13: ;
[0115] in, The position to be interpolated is denoted by 'a'; 'a' represents the order of the Lanczos function. When a=2, the algorithm is suitable for image downscaling interpolation; when a=3, the algorithm is suitable for image upscaling interpolation. ,get:
[0116] Formula 14: ;
[0117] After calculating the weights of the 16 points, a weighted average is taken from the 16 values, as shown in the following formula:
[0118] Formula 15: ;
[0119] in: The position to be interpolated. For the existing sampling locations, The pixel value at the current location. For interpolation The interpolation result at the location.
[0120] Extending one-dimensional Lanczos interpolation to the two-dimensional case, the Lanczos kernel function and the weighted average weights are:
[0121] Formula 16: ;
[0122] Formula 17: ;
[0123] in: For Lanczos interpolation functions, and The position to be interpolated. and For the existing sampling locations, For the existing location pixel value, That is, obtained by interpolation. The interpolation result at the specified location. In this invention, it is necessary to magnify a single sub-ring, so the Lanczos function with a=3 is used for interpolation, resulting in a smoother image interpolation change.
[0124] Step 6: Image edge stretching, specifically: stretch the edge region of each annular sub-image to keep the inner diameter region of the annular image unchanged, while stretching the region from the inner diameter to the outer diameter to the specified length.
[0125] like Figure 3 The diagram shows an edge stretching operation. and This represents the height and width of the original image, with the height and width values represented by... and express; The inner radius of the original annulus is represented by... express; The outer radius of the original annulus is represented by... express; Represents the edges of the original image; The outer radius of the stretched image is represented by... express; This indicates stretching the image edges. Based on the edge stretching coefficient, all annular regions except the innermost ring need to undergo edge stretching. The specific operation is as follows:
[0126] Step 61: Reinitialize the stretched image, initializing all pixels so that the color channel value of each pixel is 0, resulting in a black image. The length and width of the new image are the sum of the original image's length and width plus twice the stretched radius, specifically expressed as:
[0127] Formula 18: ;
[0128] Formula 19: ;
[0129] Formula 20: ;
[0130] in: This indicates the required change in radius after an image edge stretching operation. This indicates the height of the stretched image. This indicates the width of the image after stretching.
[0131] Step 62: Traverse all pixels of the original image. This is done by sequentially traversing all columns of pixels in all rows of the image. The pixel coordinates are represented as follows: .
[0132] Step 63: Calculate in Length corrected in the axial direction And calculate the angle between the current pixel and the center of the circle in the coordinate system. :
[0133] Equation 21: ;
[0134] Equation 22: ;
[0135] Equation 23: ;
[0136] in: This indicates that the value is rounded down; This indicates the coordinates of the center of the stretched image.
[0137] Step 64: Determine the region where the pixel is located, and recalculate the pixel value and radial position. The specific operation is as follows:
[0138] if Then we have:
[0139] Formula 24: ;
[0140] in: and This indicates the recalculated pixel value. and This indicates the value of the image center position.
[0141] if Then, a linear interpolation method is used:
[0142] Formula 25:
[0143] Equation 26:
[0144] in: Indicates the interpolation coefficients. This indicates the new radial position.
[0145] Step 7: Image re-stitching, specifically: re-stitching all the corrected and processed ring sub-images to form the final corrected image.
[0146] The specific splicing process is as follows:
[0147] Step 71: Extract the annular features from the first corrected smallest annular sub-image, and map the annular features to the second corrected annular sub-image to form a new sub-image. .
[0148] Step 72: The circular features in the image are extracted and mapped onto the third corrected circular sub-image to form a new sub-image. .
[0149] Step 73: Repeat the above operation until all the corrected ring sub-images are stitched together to form the final new corrected image. .
[0150] In this embodiment of the invention, after acquiring the original image, steps 1-7 above are performed. The image slicing effect is as follows. Figure 4 As shown. The center magnification effect is as follows. Figure 5 As shown. The edge stretching effect is as follows. Figure 6 As shown. The image re-stitching effect is as follows. Figure 7 As shown. Comparison between the original image and the corrected image. Figure 8 As shown, the surface defect features of the curved optical element are restored, avoiding the influence of distortion effects on the image defect features.
[0151] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present invention, and these should also be considered within the scope of protection of the present invention. These modifications and improvements will not affect the effectiveness of the implementation of the present invention or the practicality of the patent.
Claims
1. A method for correcting surface images of curved optical elements, characterized in that, Includes the following steps: Step 1: Ring-shaped sub-image segmentation, specifically: the half-section image of the curved optical element is divided equally around the center point to form multiple ring-shaped sub-image slices; the arc length of each segment and its position within the ring are calculated. The projected length along the axis direction ultimately yields the first... The ring and the first The radius difference between the rings; Step 2: Calculate the correction factor for the circular sub-image, specifically: for each circular sub-image slice, calculate its correction factor in... Correction factors in the axial direction to correct for 3D image distortion. Distortion existing in the axial direction; Step 3: Calculate the center magnification factor and edge stretching factor. Specifically, calculate the center magnification factor and edge stretching factor of each ring based on the correction factor of the ring sub-image. Step 4: Circular sub-image slicing, specifically: performing actual slicing operations on the original image to obtain the sliced circular sub-image; Step 5: Center magnification, specifically: using the Lanczos interpolation method to magnify the central region of each annular sub-image; Step 6: Image edge stretching, specifically: stretch the edge region of each annular sub-image to keep the inner diameter region of the annular image unchanged, while stretching the region from the inner diameter to the outer diameter to the specified length; Step 7: Image re-stitching, specifically: re-stitching all the corrected and processed ring sub-images to form the final corrected image; The specific process of step 6 is as follows: Step 61: Reinitialize the stretched image, initializing all pixels, with each pixel's color channel value set to 0; the new image's length and width are the sum of the original image's length and width plus twice the stretched radius, specifically expressed as: ; ; ; in: This indicates the required change in radius after an image edge stretching operation. This indicates the height of the stretched image. This represents the width of the image after stretching. This represents the outer radius length of the stretched image. This represents the outer radius length of the original annulus; Step 62: Traverse all pixels of the original image, where pixel coordinates are represented as... ; Step 63: Calculate in Length corrected in the axial direction And calculate the angle between the current pixel and the center of the circle in the coordinate system. : ; ; ; in: This indicates that the value is rounded down; Indicates the coordinates of the center of the stretched image; Step 64: Determine the region where the pixel is located, and recalculate the pixel value and radial position. The specific operation is as follows: if , Let represent the inner radius of the original annulus, then: ; in: and This indicates the recalculated pixel value. and Indicates the image center position value; if Then, a linear interpolation method is used: ; ; in: Indicates the interpolation coefficients. This indicates the new radial position.
2. The surface image correction method for curved optical elements according to claim 1, characterized in that, The specific process of step 1 is as follows: The half-section diagram of the curved optical element is centered at a circle. Decompose the reference point into Divide into equal parts to obtain an arc. , ... The original central angle of the half-section diagram is The central angle corresponding to each arc segment is Define region To divide the smallest unit sector region, we obtain points. ; Length and , ... The length of each arc segment is: ; ; in: r express The radius length; This indicates that the function value is rounded down; Known points The coordinates are The arc length of each segment is obtained through iterative calculation. The projected length along the axis direction yields the first... The ring and the first The radius difference between the rings is: 。 3. The surface image correction method for curved optical elements according to claim 1, characterized in that, The specific process of step 2 is as follows: For each arc length, the image is... The length in the axial direction is corrected to That is, it satisfies the following equation: ; in: The correction factor required for each arc length. For the first The ring and the first The radius difference between the rings In order to be in The corrected length along the axis; after transforming the above equation into an equivalent matrix, calculate... The value is .
4. The surface image correction method for curved optical elements according to claim 1, characterized in that, The specific process of step 3 is as follows: The center magnification factor is calculated as follows: ; The edge stretching factor is calculated as follows: 。 5. The surface image correction method for curved optical elements according to claim 1, characterized in that, The specific process of step 4 is as follows: Step 41: Obtain the height and width of the original image, and calculate the center coordinates of the image; Step 42: Define the inner and outer diameters of all the rings to be sliced; Step 43: After excluding the inner circle, calculate the image mask by looping through the image, apply the mask to the original image, and finally display the sub-images after all slices.
6. The surface image correction method for curved optical elements according to claim 1, characterized in that, The specific process of step 5 is as follows: Extending one-dimensional Lanczos interpolation to the two-dimensional case yields the Lanczos kernel function and the weighted average weights: ; ; in: Let a be the Lanczos function, and let a represent the order of the Lanczos function. and The position to be interpolated. and For the existing sampling locations, For the existing location pixel value, That is, obtained by interpolation. The interpolation result at the location.
7. The surface image correction method for curved optical elements according to claim 1, characterized in that, The specific process of step 7 is as follows: Step 71: Extract the annular features from the first corrected smallest annular sub-image, and map the annular features to the second corrected annular sub-image to form a new sub-image. ; Step 72: The circular features in the image are extracted and mapped onto the third corrected circular sub-image to form a new sub-image. ; Step 73: Repeat the above operation until all the corrected ring sub-images are stitched together to form the final new corrected image. .
Citation Information
Patent Citations
Image radial distortion automatic correction method and system
CN106327441A
Small-caliber container inner wall defect detection method based on computer vision
CN115471482A