Geometric correction method and system of linear scanning camera based on circular hole ellipse distortion, computer readable storage medium and computer program product

By analyzing the elliptical distortion of the circular aperture of a line scan camera, and self-calibrating and correcting the sector scan image, the problem of high-cost hardware dependence in existing technologies is solved, and high-precision geometric correction effect is achieved.

CN121724877APending Publication Date: 2026-03-24GUANGDONG AOPUTE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610190099.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-09
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing line scan cameras face geometric correction challenges in sector scanning imaging, leading to image distortion, scale inaccuracies, and 3D data errors. Current methods rely on high-cost hardware and cannot provide real-time correction.

Method used

By analyzing the elliptical distortion of the circular aperture array, the elliptical parameters are extracted, a polar coordinate scanning geometric model is established, self-calibration correction is performed, and a corrected image is generated.

Benefits of technology

It enables geometric correction without the need for external hardware, simplifies the correction process, reduces costs, and improves the accuracy and stability of images and 3D data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121724877A_ABST
    Figure CN121724877A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of geometric correction of line scanning cameras, and discloses a geometric correction method and system of a line scanning camera based on circular hole ellipse distortion, a computer readable storage medium and a computer program product, and the method comprises the steps: obtaining a fan-shaped image through continuous scanning of the line scanning camera; setting an ROI region of the fan-shaped image; extracting a plurality of boundary points of elliptical circular holes in the ROI region to form an elliptical candidate boundary point set; fitting to obtain corresponding ellipse parameters based on the ellipse candidate boundary point set; solving a rotation center and an angular velocity based on the ellipse parameters, and establishing a polar coordinate scanning geometric model; and performing geometric correction on the fan-shaped image by using the polar coordinate scanning geometric model to generate a corrected image. By analyzing the ellipse distortion rule of the circular hole in the sector scanning, ellipse parameter extraction, backstepping of the corresponding relation of the rotation center, the angular velocity and the pixels and sector expansion correction of the image are achieved, and the correction method is simple, reliable and low in cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of geometric correction technology for line scan cameras, and in particular to a geometric correction method, system, computer-readable storage medium, and computer program product for line scan cameras based on elliptical distortion of circular apertures. Background Technology

[0002] Line scan cameras include 2D and 3D line scan cameras. Because they rely on motion to achieve imaging, they include two typical imaging modes: linear uniform speed line scan (common in conveyor belts) and rotating scan (fan-shaped scan) (common in turntable scanning, cylindrical scanning, surface defect detection, etc.). The second type, fan-shaped scan, has an angular trajectory, and its imaging coordinates are essentially a projection from polar coordinates to Cartesian coordinates, possessing the following characteristics: (1) The horizontal direction (camera pixel x) corresponds to the radial direction; (2) The vertical direction (line scan time series y) corresponds to the scanning angle; (3) After the circular aperture is imaged, it becomes an ellipse with the flattening ratio varying with the radius.

[0003] Without geometric correction, 2D images of the obtained sector shape will exhibit distortion and scale inaccuracies, while 3D data will suffer from radius errors, height errors, and volume calculation deviations, rendering them unusable for precision industrial tasks such as dimensional inspection and contour measurement. Therefore, processing is necessary. Existing processing techniques primarily rely on mechanically measuring the rotating shaft, using external encoders to provide angular velocity, and assuming the scanning trajectory is an ideal geometric model. However, these methods suffer from high costs (encoders, mechanical fixtures), uncorrectable assembly errors, inability to reflect motion drift in real time, and the inability to perform image-level geometric inversion. Furthermore, the actual imaging ellipse of a circular hole naturally contains information such as scanning radius errors, angular velocity errors, and distortion errors, information that is not fully utilized by industry.

[0004] Therefore, there is an urgent need in this field for a "self-calibrated geometric correction method" that can recover geometric parameters from images alone without relying on external hardware. Summary of the Invention

[0005] The purpose of this invention is to provide a geometric correction method, system, computer-readable storage medium, and computer program product for a line scan camera based on elliptical distortion of a circular aperture, so as to solve or at least partially solve the technical problems mentioned in the background art.

[0006] To achieve this objective, the present invention adopts the following technical solution: In a first aspect, the present invention provides a geometric correction method for a line scan camera based on elliptical distortion of a circular aperture, comprising: A calibration plate containing a circular aperture array is placed on the rotating mechanism of the line scanning system, and a fan-shaped image is obtained by continuous scanning by the line scanning camera; Define the Region of Interest (ROI) of the sector image; where the ROI is the region containing the elliptical hole. Extract multiple boundary points of the elliptical hole in the ROI region to form a set of elliptical candidate boundary points; Based on the set of candidate boundary points of the ellipse, the corresponding ellipse parameters are obtained by fitting. A polar coordinate scanning geometric model is established by solving the rotation center and angular velocity based on elliptic parameters. A corrected image is generated by using a polar coordinate scanning geometric model to perform geometric correction on the sector image.

[0007] Optionally, the step of fitting and obtaining the corresponding ellipse parameters based on the set of elliptical candidate boundary points specifically includes: Ellipse fitting is performed based on the ellipse candidate boundary point set to obtain the initial parameters of the elliptical circular hole and construct an ellipse model; the initial parameters include the ellipse center, major axis, minor axis and principal axis direction; Calculate the geometric distances from the boundary points in the candidate boundary point set of the ellipse to the ellipse model, and form a distance set; The set of effective boundary points is obtained by filtering based on the mean and dispersion of the geometric distances in the distance set; The ellipse is refitted based on the set of valid boundary points to obtain the corresponding ellipse parameters.

[0008] Optionally, the step of solving for the rotation center and angular velocity based on elliptic parameters to establish a polar coordinate scanning geometric model specifically includes: The flattening of the elliptical circular hole obtained by scanning the circular hole satisfies: ;in, Let be the elliptic flattening ratio corresponding to the i-th circular hole. Let be the radius of the major axis of the ellipse corresponding to the i-th circular hole. The minor axis radius of the ellipse corresponding to the i-th circular hole; For all round holes To perform linear regression, that is: , ; in, To estimate the flatness of the regression model, The x-coordinate of the center of the ellipse. The regression slope related to the radius growth rate. The intercept related to the offset of the rotation center; The center of rotation is found to be: ; To determine the x-position of the center of rotation in the sector image coordinates; The fitting quality index is: ;in, To determine the goodness of fit of the regression, This represents the average flattening.

[0009] Optionally, the step of establishing a polar coordinate scanning geometric model by solving for the rotation center and angular velocity based on elliptic parameters further includes: In the sector scan model: ; Let i be the actual scanning angle of the i-th circular hole. The ordinate of the center of the ellipse is y. This is the angular velocity-pixel scaling factor. This is the initial angular offset of the line scan camera when it begins acquiring images; If the holes on the calibration plate are arranged at equal angles, then: ; Starting angle, is the theoretical angular interval between holes, and i is the hole number; Alternatively, it can be obtained through calibration board CAD. ; Then, to By performing a linear fit, the following can be obtained: .

[0010] Optionally, the step of establishing a polar coordinate scanning geometric model by solving for the rotation center and angular velocity based on elliptic parameters further includes: After determining the center of rotation and angular velocity, a polar coordinate scanning geometric model is established, namely: The output image coordinates are: , , ; Where x is the pixel column coordinate of the sector image, y is the linear scan time series index, and r is the scan radius. The angle of the sector scan.

[0011] Optionally, the method for performing geometric correction on the sector image using a polar coordinate scanning geometric model to generate a corrected image is as follows: Let the coordinates of the sector image be (x, y), and the coordinates of the corrected image be... The geometric expansion mapping relationship is as follows: , ;in, The angular sampling scale; Then, mapping this back to the original sector image: , ; Then, the original sector image is sampled using bilinear interpolation to generate the geometrically corrected image.

[0012] Optionally, the geometric correction method further includes: If the fan-shaped image is a 3D image, the structured light stripe offset of the 3D image is: ,but: Radius error is corrected by back projection mapping: ; The true radius after geometric correction. This is the radius error term derived from the flatness fitting; Then, by combining the geometric relationships of optical triangulation, a geometrically corrected 3D height map is obtained, namely: ; For actual height / depth, For camera-laser baseline, The projection angle, To calibrate the model function for the system.

[0013] Optionally, the setting of the ROI region of the sector image specifically refers to: Multiple ROI regions containing a single circular hole are manually selected by the operator in the image; and / or, By performing grayscale analysis, edge detection, or connected component analysis on the fan-shaped image, the elliptical hole regions are automatically located, and a corresponding ROI region is generated for each hole.

[0014] Optionally, when fitting the elliptical parameters of the elliptical hole, a robust ellipse fitting algorithm is used to estimate the ellipse model parameters based on the extracted set of elliptical candidate boundary points to obtain the corresponding ellipse parameters. The robust ellipse fitting algorithm includes least squares fitting, ellipse fitting based on random sampling consistency, or a combination of both.

[0015] Optionally, when constructing a linear regression model based on the flatness of multiple elliptical holes and the corresponding ellipse center positions, a linear regression method based on random sampling consistency is used to fit the relationship between the flatness and the ellipse center positions, and abnormal elliptical holes that do not meet the geometric consistency constraints are eliminated.

[0016] Secondly, the present invention provides a geometric correction system for a line scan camera based on elliptical distortion of a circular aperture, comprising: The image acquisition module includes a line scan camera for continuously scanning to obtain a fan-shaped image after a calibration plate containing a circular aperture array is placed on the rotating mechanism of the line scan system. The ROI setting module is electrically connected to the image acquisition module and is used to set the ROI region of the fan-shaped image; wherein, the ROI region is the region containing the elliptical hole; The boundary point extraction module is electrically connected to the ROI setting module and is used to extract multiple boundary points of the elliptical circular hole in the ROI region to form an elliptical candidate boundary point set. The boundary point fitting module is electrically connected to the boundary point extraction module and is used to fit and obtain the corresponding ellipse parameters based on the set of ellipse candidate boundary points. The model building module is electrically connected to the boundary point fitting module and is used to solve for the rotation center and angular velocity based on the ellipse parameters to establish a polar coordinate scanning geometric model. The correction module, electrically connected to the model building module, is used to perform geometric correction on the sector image using a polar coordinate scanning geometric model to generate a corrected image.

[0017] Optionally, the boundary point fitting module is specifically used for: Ellipse fitting is performed based on the ellipse candidate boundary point set to obtain the initial parameters of the elliptical circular hole and construct an ellipse model; the initial parameters include the ellipse center, major axis, minor axis and principal axis direction; Calculate the geometric distances from the boundary points in the candidate boundary point set of the ellipse to the ellipse model, and form a distance set; The set of effective boundary points is obtained by filtering based on the mean and dispersion of the geometric distances in the distance set; The ellipse is refitted based on the set of valid boundary points to obtain the corresponding ellipse parameters.

[0018] Alternatively, the method for solving the center of rotation is as follows: The flattening of the elliptical circular hole obtained by scanning the circular hole satisfies: ;in, Let be the elliptic flattening ratio corresponding to the i-th circular hole. Let be the radius of the major axis of the ellipse corresponding to the i-th circular hole. The minor axis radius of the ellipse corresponding to the i-th circular hole; For all round holes To perform linear regression, that is: , ; in, To estimate the flatness of the regression model, The x-coordinate of the center of the ellipse. The regression slope related to the radius growth rate. The intercept related to the offset of the rotation center; The center of rotation is found to be: ; To determine the x-position of the center of rotation in the sector image coordinates; The fitting quality index is: ;in, To determine the goodness of fit of the regression, This represents the average flattening.

[0019] Alternatively, the angular velocity can be calculated as follows: In the sector scan model: ; Let i be the actual scanning angle of the i-th circular hole. The ordinate of the center of the ellipse is y. This is the angular velocity-pixel scaling factor. This is the initial angular offset of the line scan camera when it begins acquiring images; If the holes on the calibration plate are arranged at equal angles, then: ; Starting angle, is the theoretical angular interval between holes, and i is the hole number; Alternatively, it can be obtained through calibration board CAD. ; Then, to By performing a linear fit, the following can be obtained: .

[0020] Optionally, establishing the polar coordinate scanning geometric model specifically includes: After determining the center of rotation and angular velocity, a polar coordinate scanning geometric model is established, namely: The output image coordinates are: , , ; Where x is the pixel column coordinate of the sector image, y is the linear scan time series index, and r is the scan radius. The angle of the sector scan.

[0021] Optionally, the method for performing geometric correction on the sector image using a polar coordinate scanning geometric model to generate a corrected image is as follows: Let the coordinates of the sector image be (x, y), and the coordinates of the corrected image be... The geometric expansion mapping relationship is as follows: , ;in, The angular sampling scale; Then, mapping this back to the original sector image: , ; Then, the original sector image is sampled using bilinear interpolation to generate the geometrically corrected image.

[0022] Optionally, the correction module is further configured to: If the fan-shaped image is a 3D image, the structured light stripe offset of the 3D image is: ,but: Radius error is corrected by back projection mapping: ; The true radius after geometric correction. This is the radius error term derived from the flatness fitting; Then, by combining the geometric relationships of optical triangulation, a geometrically corrected 3D height map is obtained, namely: ; For actual height / depth, For camera-laser baseline, The projection angle, To calibrate the model function for the system.

[0023] Optionally, the ROI setting module is specifically used for: The operator manually selects multiple regions containing a single circular hole in the image and sets them as ROI regions; and / or, By performing grayscale analysis, edge detection, or connected component analysis on the fan-shaped image, the elliptical hole regions are automatically located, and a corresponding ROI region is generated for each hole.

[0024] Optionally, when fitting the elliptical parameters of the elliptical hole, a robust ellipse fitting algorithm is used to estimate the ellipse model parameters based on the extracted set of elliptical candidate boundary points to obtain the corresponding ellipse parameters. The robust ellipse fitting algorithm includes least squares fitting, ellipse fitting based on random sampling consistency, or a combination of both.

[0025] Optionally, when constructing a linear regression model based on the flatness of multiple elliptical holes and the corresponding ellipse center positions, a linear regression method based on random sampling consistency is used to fit the relationship between the flatness and the ellipse center positions, and abnormal elliptical holes that do not meet the geometric consistency constraints are eliminated.

[0026] Thirdly, the present invention provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to implement a geometric correction method for a line scan camera based on elliptical distortion of a circular aperture as described above.

[0027] Fourthly, the present invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the geometric correction method for a line scan camera based on elliptical distortion of a circular aperture as described above.

[0028] Compared with the prior art, the beneficial effects of the present invention are as follows: The geometric correction method for line scan cameras based on elliptical distortion of circular aperture proposed in this application analyzes the elliptical distortion law of circular aperture in sector scanning, realizes the extraction of elliptical parameters, the inverse deduction of rotation center, angular velocity, and pixel correspondence, and the correction of sector unfolding of image. This correction method can complete the geometric correction of line scan imaging system without additional hardware or known motion trajectory. The correction method is simple, reliable and low cost. Attached Figure Description

[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art 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.

[0030] Figure 1 This is a flowchart illustrating a geometric correction method for a line scan camera based on elliptical distortion of a circular aperture, provided as an embodiment of the present invention.

[0031] Figure 2 A fan-shaped image acquired by a line scan camera provided in an embodiment of the present invention.

[0032] Figure 3 for Figure 2 The corresponding 3D image.

[0033] Figure 4 This is a schematic diagram of a Region of Interest (ROI) provided in an embodiment of the present invention.

[0034] Figure 5 From Figure 4 A schematic diagram of the elliptical edge extracted from the ROI region.

[0035] Figure 6 for Figure 2 The 2D image obtained after correcting the fan-shaped image.

[0036] Figure 7 for Figure 2 The 3D image is obtained after the fan-shaped image is corrected.

[0037] Figure 8 Another fan-shaped image acquired by the line scan camera provided in this embodiment of the invention.

[0038] Figure 9 This is another schematic diagram of the ROI region provided in an embodiment of the present invention.

[0039] Figure 10 The straight line obtained by fitting ellipse parameters is provided in the embodiments of the present invention.

[0040] Figure 11 for Figure 8 The corrected image corresponding to the sector image.

[0041] Figure 12 This is a geometric correction system architecture diagram for a line scan camera based on elliptical distortion of a circular aperture, provided as an embodiment of the present invention. Detailed Implementation

[0042] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0043] Example 1: Please refer to Figure 1 , Figure 1 A flowchart of a geometric correction method for a line scan camera based on elliptical distortion of a circular aperture, provided in an embodiment of the present invention, is shown. The method includes: Step 100: Place the calibration plate containing the circular hole array on the rotating mechanism of the line scanning system, and obtain a fan-shaped image by continuous scanning with the line scanning camera.

[0044] For example, a calibration plate is placed on a turntable (i.e., a rotating mechanism) and rotated at a constant speed. The line scan acquisition frequency is set to 1000Hz and the rotation speed is 100rad / s. The 2D image acquired by the line scan camera is as follows: Figure 2 As shown, the corresponding 3D image is as follows Figure 3 As shown.

[0045] Step 110: Define the ROI region of the sector image.

[0046] In this step, the ROI (Region of Interest) is the region containing the elliptical hole, such as... Figure 4As shown, five circular hole locations were selected as the ROI region.

[0047] Specifically, this step supports a combination of manual ROI selection and automatic ROI detection, including: Manual ROI selection: Operators manually select multiple regions of interest containing a single circular hole in the image for quick calibration or verification; Automatic ROI detection: By performing grayscale analysis, edge detection, or connected component analysis on the image, the elliptical hole regions are automatically located, and a corresponding ROI is generated for each hole.

[0048] Step 120: Extract multiple boundary points of the elliptical hole in the ROI region to form a set of elliptical candidate boundary points.

[0049] Specifically, after grayscale preprocessing of the ROI region, the candidate boundary point set corresponding to the circular hole boundary is automatically extracted based on gradient information, threshold segmentation or contour tracking methods, forming an elliptical candidate boundary point set.

[0050] For example, such as Figure 5 As shown, Figure 5 From Figure 4 A schematic diagram of the elliptical edge extracted from the ROI region.

[0051] Step 130: Based on the set of candidate boundary points of the ellipse, fit and obtain the corresponding ellipse parameters.

[0052] Specifically, step 130 includes: Step 131: Perform ellipse fitting based on the ellipse candidate boundary point set to obtain the initial parameters of the elliptical circular hole and construct the elliptical model.

[0053] In step 131, the initial parameters include the center of the ellipse, the major axis, the minor axis, and the direction of the principal axis; For example, after ellipse fitting, the following five ellipses are obtained, and the calculated ellipse parameters are as follows: [ { "id": 1, "cx": 673.821750088885, "cy": 539.2141568432206, "rx": 46.46627314627677, "ry": 22.632286554086665, "angle": -0.08252302486452202, }, { "id": 2, "cx": 1152.4304188130695, "cy": 764.9186856815284, "rx": 44.878919352667836, "ry": 15.695015671674215, "angle": -0.0321381512337756, }, { "id": 3, "cx": 1756.0416035921107, "cy": 996.0404132075216, "rx": 44.85698354096789, "ry": 11.31480951759128, "angle": -0.010634285265018034, }, { "id": 4, "cx": 2578.807014114605, "cy": 1701.2846090379878, "rx": 45.272757971901974, "ry": 8.41463010044718, "angle": 0.0035826655978483503, }, { "id": 5, "cx": 2055.228058759674, "cy": 829.6384708369922, "rx": 45.25185723991936, "ry": 10.16217399659454, "angle": 0.0023924357317571436, } ]。

[0054] Step 132: Calculate the geometric distance from the boundary points in the candidate boundary point set of the ellipse to the ellipse model, and form a distance set.

[0055] Using the initial ellipse parameters, the geometric distance from each boundary point in the candidate boundary point set to the ellipse model is calculated, forming a distance set; wherein, the geometric distance is used to characterize the degree of deviation between the boundary point and the ellipse model.

[0056] Step 133: Based on the mean and dispersion of the geometric distances in the distance set, obtain the set of effective boundary points.

[0057] Statistical analysis is performed on the distance set to calculate the mean and dispersion of the geometric distances. Based on the statistical distribution characteristics of the geometric distances, the candidate boundary points are adaptively divided into: effective boundary points and outliers. Outliers include invalid boundary points caused by noise, reflection, occlusion, or imaging anomalies.

[0058] Step 134: Refit the ellipse based on the set of valid boundary points to obtain the corresponding ellipse parameters.

[0059] On the filtered set of valid boundary points, ellipse fitting is performed again to obtain the final ellipse parameters, which are used for subsequent geometric model back-calculation and correction.

[0060] Step 140: Solve for the rotation center and angular velocity based on the ellipse parameters to establish a polar coordinate scanning geometric model.

[0061] The specific method for solving the center of rotation is as follows: The flattening of the elliptical circular hole obtained by scanning the circular hole satisfies: ;in, Let be the elliptic flattening ratio corresponding to the i-th circular hole. Let be the radius of the major axis of the ellipse corresponding to the i-th circular hole. The minor axis radius of the ellipse corresponding to the i-th circular hole; For all round holes To perform linear regression, that is: , ; in, To estimate the flatness of the regression model, The x-coordinate of the center of the ellipse. The regression slope related to the radius growth rate. The intercept related to the offset of the rotation center; The center of rotation is found to be: ; To determine the x-position of the center of rotation in the sector image coordinates; The fitting quality index is: ;in, To determine the goodness of fit of the regression, This represents the average flattening.

[0062] The specific method for calculating angular velocity is as follows: In the sector scan model: ; Let i be the actual scanning angle of the i-th circular hole. The ordinate of the center of the ellipse is y. This is the angular velocity-pixel scaling factor. This is the initial angular offset of the line scan camera when it starts acquiring images. It should be noted that since the start time of line scan imaging is usually not completely consistent with the physical zero position of the scanning mechanism, this parameter is needed to compensate for the overall scanning angle to ensure the accurate correspondence between the image row number and the actual scanning angle.

[0063] If the holes on the calibration plate are arranged at equal angles, then: ; Starting angle, is the theoretical angular interval between holes, and i is the hole number; Alternatively, it can be obtained through calibration board CAD. ; Then, to By performing a linear fit, the following can be obtained: .

[0064] After determining the center of rotation and angular velocity, a polar coordinate scanning geometric model is established, namely: The output image coordinates are: , , ; Where x is the pixel column coordinate of the sector image, y is the linear scan time series index, and r is the scan radius. The angle of the sector scan.

[0065] More specifically, the method for establishing the polar coordinate scanning geometric model is as follows: In this embodiment, for manually selected ROI regions, the least squares fitting line method is used to fit all circular holes. Perform linear regression to obtain a linear model; For the automatically generated ROI region, linear regression is performed using a line fitting method based on RANSAC (Random Sample Consensus) to obtain a linear model. It is understood that RANSAC is an existing technique, so its principles and processes will not be elaborated upon here.

[0066] The RANSAC method can stably obtain the initial parameters of a straight line even in the presence of a large number of noise points, occlusion points, or abnormal edges.

[0067] When fitting the elliptical parameters of the elliptical hole, a robust ellipse fitting algorithm is used to estimate the ellipse model parameters based on the extracted set of ellipse candidate boundary points, and the corresponding ellipse parameters are obtained. The robust ellipse fitting algorithm includes least squares fitting, ellipse fitting based on random sampling consistency, or a combination of both.

[0068] When constructing a linear regression model based on the flatness of multiple elliptical holes and the corresponding ellipse center positions, a linear regression method based on random sampling consistency is used to fit the relationship between the flatness and the ellipse center positions, and abnormal elliptical holes that do not meet the geometric consistency constraints are removed.

[0069] By iteratively eliminating and refitting, the influence of outliers on the estimation of straight line parameters can be gradually eliminated, thereby improving the stability and accuracy of the fitting results.

[0070] Step 150: Use the polar coordinate scanning geometric model to perform geometric correction on the sector image and generate a corrected image.

[0071] Specifically, the geometric correction method is as follows: Let the coordinates of the sector image be (x, y), and the coordinates of the corrected image be... The geometric expansion mapping relationship is as follows: , ; in, The angular sampling scale describes the proportional relationship between the scanning angle and the pixel coordinates of the unfolded image along the angular direction. Its value determines the number of pixels corresponding to a unit angle. This parameter allows continuous scanning angles to be mapped to discrete image pixel coordinates, thereby achieving uniform sampling and unfolding of the fan-shaped scan image along the angular direction.

[0072] Then, mapping this back to the original sector image: , ; Then, the original sector image is sampled using bilinear interpolation, resulting in a geometrically corrected image. This step eliminates sector distortion and restores the true proportions.

[0073] If the fan-shaped image is a 3D image, the structured light stripe offset of the 3D image is: ,but: Radius error is corrected by back projection mapping: ; The true radius after geometric correction. This is the radius error term derived from the flatness fitting; Then, by combining the geometric relationships of optical triangulation, a geometrically corrected 3D height map is obtained, namely: ; For actual height / depth, For camera-laser baseline, The projection angle, To calibrate the model function for the system.

[0074] For example, such as Figure 6 and Figure 7 As shown, Figure 6 for Figure 2 The 2D image obtained after correcting the fan-shaped image. Figure 7 for Figure 2 The 3D image is obtained by correcting the fan-shaped image.

[0075] The geometric correction method provided in this embodiment has at least the following advantages: 1. Self-calibration capability without the need for mechanical positioning or encoders; 2. Simultaneously correct 2D images and 3D height maps using a unified method; 3. It can compensate for distortions caused by unstable scanning motion; 4. Suitable for all uniformly rotating imaging devices (turntables, articulated arms, rotating mirrors). 5. Significantly improves geometric measurement accuracy (sub-pixel level); 6. It can calibrate and monitor equipment status drift in real time online.

[0076] The geometric correction method of this application will be further applied and verified with another example below: First, acquire images of the rotating platform after it has rotated the circular hole calibration plate: A 2D calibration plate is placed on the turntable and rotated at a constant speed. The linear scan acquisition frequency is set to 1000Hz and the rotation speed is 70rad / s. The acquired fan-shaped image is as follows. Figure 8 As shown; Select automatic ellipse detection, and then use iterative least squares fitting, as follows: Figure 9 As shown, the ellipse parameter points involved in the fitting are shown in green, and the outliers that were removed are shown in red.

[0077] The linear fitting results are obtained, such as Figure 10 As shown: -2780.08, = 7.685*10 -4 , =0.99; The final corrected image is as follows Figure 11 As shown.

[0078] In summary, the geometric correction method provided in this embodiment does not rely on external hardware and can recover geometric parameters solely from the image. It utilizes the elliptical distortion characteristics of the circular aperture in sector scanning imaging to achieve the reverse deduction of the imaging geometric model, the construction of the correction mapping, and the complete correction of the reconstructed image.

[0079] Example 2: Please refer to Figure 12 , Figure 12 This invention provides an embodiment of a geometric correction system architecture for a line scan camera based on elliptical distortion of a circular aperture. The system includes: Image acquisition module 10 includes a line scan camera for continuously scanning to obtain a fan-shaped image after a calibration plate containing a circular aperture array is placed on the rotating mechanism of the line scan system. The ROI setting module 20 is electrically connected to the image acquisition module 10 and is used to set the ROI region of the fan-shaped image; wherein, the ROI region is the region containing the elliptical hole; Boundary point extraction module 30 is electrically connected to ROI setting module 20 and is used to extract multiple boundary points of the elliptical circular hole in the ROI region to form a set of elliptical candidate boundary points. The boundary point fitting module 40 is electrically connected to the boundary point extraction module 30 and is used to fit and obtain the corresponding ellipse parameters based on the set of ellipse candidate boundary points. The model building module 50 is electrically connected to the boundary point fitting module 40 and is used to solve the rotation center and angular velocity based on the ellipse parameters to establish a polar coordinate scanning geometric model. The correction module 60 is electrically connected to the model construction module 50 and is used to perform geometric correction on the sector image using a polar coordinate scanning geometric model to generate a corrected image.

[0080] The geometric correction method for a line scan camera based on elliptical distortion of a circular aperture has been described in detail in Embodiment 1, so it will not be repeated in this embodiment.

[0081] Example 3: This embodiment also provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to implement a geometric correction method for a line scan camera based on elliptical distortion of a circular aperture as described in Embodiment 1.

[0082] Since Embodiment 1 has already described in detail the geometric correction method for a line scan camera based on elliptical distortion of a circular aperture, it will not be repeated in this embodiment.

[0083] Example 4: The present invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements a geometric correction method for a line scan camera based on elliptical distortion of a circular aperture as described in Embodiment 1.

[0084] Since Embodiment 1 has already described in detail the geometric correction method for a line scan camera based on elliptical distortion of a circular aperture, it will not be repeated in this embodiment.

[0085] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware, or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0086] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

[0087] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A geometric correction method for a line scan camera based on elliptical distortion of a circular aperture, characterized in that, include: A calibration plate containing a circular aperture array is placed on the rotating mechanism of the line scanning system, and a fan-shaped image is obtained by continuous scanning by the line scanning camera; Define the Region of Interest (ROI) of the sector image; where the ROI is the region containing the elliptical hole. Extract multiple boundary points of the elliptical hole in the ROI region to form a set of elliptical candidate boundary points; Based on the set of candidate boundary points of the ellipse, the corresponding ellipse parameters are obtained by fitting. A polar coordinate scanning geometric model is established by solving the rotation center and angular velocity based on elliptic parameters. A corrected image is generated by using a polar coordinate scanning geometric model to perform geometric correction on the sector image.

2. The geometric correction method for a line scan camera based on elliptical distortion of a circular aperture as described in claim 1, characterized in that, The process of fitting and obtaining the corresponding ellipse parameters based on the set of ellipse candidate boundary points specifically includes: Ellipse fitting is performed based on the ellipse candidate boundary point set to obtain the initial parameters of the elliptical circular hole and construct an ellipse model; the initial parameters include the ellipse center, major axis, minor axis and principal axis direction; Calculate the geometric distances from the boundary points in the candidate boundary point set of the ellipse to the ellipse model, and form a distance set; The set of effective boundary points is obtained by filtering based on the mean and dispersion of the geometric distances in the distance set; The ellipse is refitted based on the set of valid boundary points to obtain the corresponding ellipse parameters.

3. The geometric correction method for a line scan camera based on elliptical distortion of a circular aperture as described in claim 2, characterized in that, The process of establishing a polar coordinate scanning geometric model based on solving for the rotation center and angular velocity using elliptic parameters specifically includes: The flattening of the elliptical circular hole obtained by scanning the circular hole satisfies: ;in, Let be the elliptic flattening corresponding to the i-th circular hole. Let be the radius of the major axis of the ellipse corresponding to the i-th circular hole. The minor axis radius of the ellipse corresponding to the i-th circular hole; For all round holes To perform linear regression, that is: , ; in, To estimate the flatness of the regression model, The x-coordinate of the center of the ellipse. The regression slope related to the radius growth rate. The intercept related to the offset of the rotation center; The center of rotation is found to be: ; To determine the x-position of the center of rotation in the sector image coordinates; The fitting quality index is: ;in, To determine the goodness of fit of the regression, This represents the average flattening.

4. The geometric correction method for a line scan camera based on elliptical distortion of a circular aperture as described in claim 3, characterized in that, The method for establishing a polar coordinate scanning geometric model based on solving for the rotation center and angular velocity using elliptic parameters also includes: In the sector scan model: ; Let i be the actual scanning angle of the i-th circular hole. The ordinate of the center of the ellipse is y. This is the angular velocity-pixel scaling factor. This is the initial angular offset of the line scan camera when it begins acquiring images; If the holes on the calibration plate are arranged at equal angles, then: ; Starting angle, is the theoretical angular interval between holes, and i is the hole number; Alternatively, it can be obtained through calibration board CAD. ; Then, to By performing a linear fit, the following can be obtained: 。 5. The geometric correction method for a line scan camera based on elliptical distortion of a circular aperture as described in claim 4, characterized in that, The method for establishing a polar coordinate scanning geometric model based on solving for the rotation center and angular velocity using elliptic parameters also includes: After determining the center of rotation and angular velocity, a polar coordinate scanning geometric model is established, namely: The output image coordinates are: , , ; Where x is the pixel column coordinate of the sector image, y is the linear scan time series index, and r is the scan radius. The angle of the sector scan.

6. The geometric correction method for a line scan camera based on elliptical distortion of a circular aperture as described in claim 5, characterized in that, The method for geometrically correcting the sector image using a polar coordinate scanning geometric model to generate a corrected image is as follows: Let the coordinates of the sector image be (x, y), and the coordinates of the corrected image be... The geometric expansion mapping relationship is as follows: , ;in, The angular sampling scale; Then, mapping this back to the original sector image: , ; Then, the original sector image is sampled using bilinear interpolation to generate the geometrically corrected image.

7. The geometric correction method for a line scan camera based on elliptical distortion of a circular aperture as described in claim 6, characterized in that, Also includes: If the fan-shaped image is a 3D image, the structured light stripe offset of the 3D image is: ,but: Radius error is corrected by back projection mapping: ; The true radius after geometric correction. This is the radius error term derived from the flatness fitting; Then, by combining the geometric relationships of optical triangulation, a geometrically corrected 3D height map is obtained, namely: ; For actual height / depth, For camera-laser baseline, The projection angle, To calibrate the model function for the system.

8. The geometric correction method for a line scan camera based on elliptical distortion of a circular aperture as described in claim 4, characterized in that, The defined ROI region of the sector image is specifically as follows: Multiple ROI regions containing a single circular hole are manually selected by the operator in the image; and / or, By performing grayscale analysis, edge detection, or connected component analysis on the fan-shaped image, the elliptical hole regions are automatically located, and a corresponding ROI region is generated for each hole.

9. The geometric correction method for a line scan camera based on elliptical distortion of a circular aperture as described in claim 1, characterized in that, When fitting the elliptical parameters of the elliptical hole, a robust ellipse fitting algorithm is used to estimate the ellipse model parameters based on the extracted set of ellipse candidate boundary points, and the corresponding ellipse parameters are obtained. The robust ellipse fitting algorithm includes least squares fitting, ellipse fitting based on random sampling consistency, or a combination of both.

10. The geometric correction method for a line scan camera based on elliptical distortion of a circular aperture as described in claim 3, characterized in that, When constructing a linear regression model based on the flatness of multiple elliptical holes and the corresponding ellipse center positions, a linear regression method based on random sampling consistency is used to fit the relationship between the flatness and the ellipse center positions, and abnormal elliptical holes that do not meet the geometric consistency constraints are eliminated.

11. A geometric correction system for a line scan camera based on elliptical distortion of a circular aperture, characterized in that, include: The image acquisition module includes a line scan camera for continuously scanning to obtain a fan-shaped image after a calibration plate containing an array of circular holes is placed on the rotating mechanism of the line scan system. The ROI setting module is electrically connected to the image acquisition module and is used to set the ROI region of the fan-shaped image; wherein, the ROI region is the region containing the elliptical hole; The boundary point extraction module is electrically connected to the ROI setting module and is used to extract multiple boundary points of the elliptical circular hole in the ROI region to form an elliptical candidate boundary point set. The boundary point fitting module is electrically connected to the boundary point extraction module and is used to fit and obtain the corresponding ellipse parameters based on the set of ellipse candidate boundary points. The model building module is electrically connected to the boundary point fitting module and is used to solve for the rotation center and angular velocity based on the ellipse parameters to establish a polar coordinate scanning geometric model. The correction module, electrically connected to the model building module, is used to perform geometric correction on the sector image using a polar coordinate scanning geometric model to generate a corrected image.

12. The geometric correction system for a line scan camera based on elliptical distortion of a circular aperture as described in claim 11, characterized in that, The boundary point fitting module is specifically used for: Ellipse fitting is performed based on the ellipse candidate boundary point set to obtain the initial parameters of the elliptical circular hole and construct an ellipse model; the initial parameters include the ellipse center, major axis, minor axis and principal axis direction; Calculate the geometric distances from the boundary points in the candidate boundary point set of the ellipse to the elliptical model, and form a distance set; The set of effective boundary points is obtained by filtering based on the mean and dispersion of the geometric distances in the distance set; The ellipse is refitted based on the set of valid boundary points to obtain the corresponding ellipse parameters.

13. The geometric correction system for a line scan camera based on elliptical distortion of a circular aperture as described in claim 12, characterized in that, The method for solving the center of rotation is as follows: The flattening of the elliptical circular hole obtained by scanning the circular hole satisfies: ;in, Let be the elliptic flattening corresponding to the i-th circular hole. Let be the radius of the major axis of the ellipse corresponding to the i-th circular hole. The minor axis radius of the ellipse corresponding to the i-th circular hole; For all round holes To perform linear regression, that is: , ; in, To estimate the flatness of the regression model, The x-coordinate of the center of the ellipse. The regression slope related to the radius growth rate. The intercept related to the offset of the rotation center; The center of rotation is found to be: ; To determine the x-position of the center of rotation in the sector image coordinates; The fitting quality index is: ;in, To determine the goodness of fit of the regression, This represents the average flattening.

14. The geometric correction system for a line scan camera based on elliptical distortion of a circular aperture as described in claim 13, characterized in that, The method for calculating angular velocity is as follows: In the sector scan model: ; Let i be the actual scanning angle of the i-th circular hole. The ordinate of the center of the ellipse is y. This is the angular velocity-pixel scaling factor. This is the initial angular offset of the line scan camera when it begins acquiring images; If the holes on the calibration plate are arranged at equal angles, then: ; Starting angle, is the theoretical angular interval between holes, and i is the hole number; Alternatively, it can be obtained through calibration board CAD. ; Then, to By performing a linear fit, the following can be obtained: 。 15. The geometric correction system for a line scan camera based on elliptical distortion of a circular aperture as described in claim 14, characterized in that, The establishment of the polar coordinate scanning geometric model specifically includes: After determining the center of rotation and angular velocity, a polar coordinate scanning geometric model is established, namely: The output image coordinates are: , , ; Where x is the pixel column coordinate of the sector image, y is the linear scan time series index, and r is the scan radius. The angle of the sector scan.

16. The geometric correction system for a line scan camera based on elliptical distortion of a circular aperture as described in claim 15, characterized in that, The method for geometrically correcting the sector image using a polar coordinate scanning geometric model to generate a corrected image is as follows: Let the coordinates of the sector image be (x, y), and the coordinates of the corrected image be... The geometric expansion mapping relationship is as follows: , ;in, The angular sampling scale; Then, mapping this back to the original sector image: , ; Then, the original sector image is sampled using bilinear interpolation to generate the geometrically corrected image.

17. The geometric correction system for a line scan camera based on elliptical distortion of a circular aperture as described in claim 16, characterized in that, The correction module is also used for: If the fan-shaped image is a 3D image, the structured light stripe offset of the 3D image is: ,but: Radius error is corrected by back projection mapping: ; The true radius after geometric correction. This is the radius error term derived from the flatness fitting; Then, by combining the geometric relationships of optical triangulation, a geometrically corrected 3D height map is obtained, namely: ; For actual height / depth, For camera-laser baseline, The projection angle, To calibrate the model function for the system.

18. The geometric correction system for a line scan camera based on elliptical distortion of a circular aperture as described in claim 14, characterized in that, The ROI setting module is specifically used for: The operator manually selects multiple regions containing a single circular hole in the image and sets them as ROI regions; and / or, By performing grayscale analysis, edge detection, or connected component analysis on the fan-shaped image, the elliptical hole regions are automatically located, and a corresponding ROI region is generated for each hole.

19. The geometric correction system for a line scan camera based on elliptical distortion of a circular aperture as described in claim 11, characterized in that, When fitting the elliptical parameters of the elliptical hole, a robust ellipse fitting algorithm is used to estimate the ellipse model parameters based on the extracted set of ellipse candidate boundary points, and the corresponding ellipse parameters are obtained. The robust ellipse fitting algorithm includes least squares fitting, ellipse fitting based on random sampling consistency, or a combination of both.

20. The geometric correction system for a line scan camera based on elliptical distortion of a circular aperture as described in claim 13, characterized in that, When constructing a linear regression model based on the flatness of multiple elliptical holes and the corresponding ellipse center positions, a linear regression method based on random sampling consistency is used to fit the relationship between the flatness and the ellipse center positions, and abnormal elliptical holes that do not meet the geometric consistency constraints are eliminated.

21. A computer-readable storage medium storing at least one instruction, characterized in that, The instructions are loaded and executed by the processor to implement a geometric correction method for a line scan camera based on elliptical distortion of a circular aperture as described in any one of claims 1-5.

22. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, the geometric correction method for a line scan camera based on elliptical distortion of a circular aperture, as described in any one of claims 1-5, is implemented.