Optical correction camera lens module and imaging method thereof
By acquiring distortion parameters through an optically calibrated camera lens module, target recognition and rule-based screening are performed, and an optical calibration model is constructed for distortion correction. This solves the real-time problem of lens distortion correction and improves image quality and recognition accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN BAIBOHE TECH CO LTD
- Filing Date
- 2025-11-03
- Publication Date
- 2026-06-02
AI Technical Summary
In the current optical camera imaging process, lens distortion correction methods cannot achieve high real-time distortion correction, resulting in unavoidable imaging errors.
By acquiring the radial and tangential distortion parameters of the original imaging image, target recognition and regularization screening are performed. An optical correction model is constructed for distortion correction, and the pixel restoration matrix of the regularized target is used for region reconstruction and parameter extraction.
It achieves real-time and adaptive imaging distortion correction, improving imaging quality and the accuracy and repeatability of recognition results.
Smart Images

Figure CN121095589B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of imaging processing technology, and more specifically, to an optical correction camera lens module and its imaging method. Background Technology
[0002] Lens distortion refers to the image distortion phenomenon caused by the difference in magnification between the central and peripheral areas of a lens, resulting in the image deviating from the ideal position and appearing stretched or compressed. The degree of lens distortion increases from the center of the image to the edge, with the distortion being more pronounced at the edge. Due to the inherent structure of optical lenses, objects in the image produced by optical cameras undergo geometric distortion, especially radial distortion, which can easily lead to unavoidable errors in various subsequent applications.
[0003] Existing geometric distortion correction methods mainly obtain radial and axial distortion parameters by placing calibration templates in the scene, thereby achieving distortion correction. However, placing calibration templates in the scene is limited by the application scenario and cannot be corrected in real time, resulting in low real-time performance of imaging distortion correction. Summary of the Invention
[0004] This application provides an optical correction camera lens module and its imaging method, which can extract regularized recognition targets from the original imaging image and extract dynamic distortion correction parameters through regularized recognition targets, thereby improving the real-time performance of imaging distortion correction.
[0005] In a first aspect, this application provides an optical correction method for camera lens imaging. This method can be executed by a network device, or by a chip configured in the network device, and this application does not limit the execution of such method.
[0006] Specifically, the method includes:
[0007] Acquire the raw imaging image from the optically corrected camera; extract distortion features from the raw imaging image, the distortion features including radial distortion parameters and tangential distortion parameters;
[0008] When the radial distortion parameter and the tangential distortion parameter meet the preset distortion correction conditions, target recognition is performed on the original imaging image to obtain multiple recognized targets;
[0009] Multiple recognition targets are filtered according to rules to obtain regular recognition targets. The pixel restoration matrix of the regular recognition targets is extracted based on the regular recognition target library. The corresponding region of the original imaging image is reconstructed according to the pixel restoration matrix. Radial distortion correction parameters and tangential distortion correction parameters are extracted from the reconstructed image region.
[0010] An optical correction model is constructed based on the radial distortion correction parameters and the tangential distortion correction parameters. The original imaging image is then distorted using the optical correction model to obtain the target imaging image.
[0011] In conjunction with the first aspect, in some implementations of the first aspect, raw image data is acquired by the image sensor corresponding to the optical correction camera, and the raw image data is output to the image processing module through the camera driver interface to form a raw imaging image.
[0012] In conjunction with the first aspect, in certain implementations of the first aspect, target recognition is performed on the original imaging image to obtain multiple recognized targets, specifically including:
[0013] The original imaging image is subjected to multi-level binarization processing to obtain multiple binarized images;
[0014] Boundary contours are extracted from each binarized image to obtain multiple boundary contour features. A pre-trained target detection model is then used to identify targets for each boundary contour feature, resulting in multiple identified targets.
[0015] In conjunction with the first aspect, in some implementations of the first aspect, before performing target recognition on the original imaging image to obtain multiple recognized targets, the method further includes: performing grayscale processing on the original imaging image.
[0016] In conjunction with the first aspect, in some implementations of the first aspect, multiple identification targets are subjected to rule-based filtering to obtain rule-based identification targets, which specifically include:
[0017] For any target to be identified, extract the geometric shape features corresponding to that target.
[0018] Obtain the target category corresponding to the identified target, obtain the standard geometric shape parameters corresponding to the target category, and extract feature contrast based on the standard geometric shape parameters and the geometric shape features corresponding to the identified target;
[0019] Iterate through each recognition target and select the recognition target with the lowest feature contrast as the regularized recognition target.
[0020] In conjunction with the first aspect, in some implementations of the first aspect, extracting the pixel reconstruction matrix of the regularized recognition target based on the regularized target library specifically includes:
[0021] Obtain a rule-based target library, and match the boundary contour information of the rule-based recognition target with the standard geometric template of the corresponding category in the rule-based target library;
[0022] Based on the matching results, the position of each pixel of the target in the original image is mapped to the standard template coordinate position to generate the pixel reconstruction matrix of the regularized target.
[0023] In conjunction with the first aspect, in certain implementations of the first aspect, region reconstruction of the corresponding region of the original imaging image based on the pixel restoration matrix includes:
[0024] Obtain the corresponding region pixels of the regularized target in the original imaging image;
[0025] Each pixel is mapped to a standard template coordinate position based on the offset in the pixel reconstruction matrix. For non-integer coordinate positions, the pixel value is calculated by interpolation. All mapped pixels are then used to form a reconstructed region.
[0026] The reconstructed region is integrated into the original imaging image to obtain the reconstructed image region.
[0027] Secondly, this application provides an optical correction camera lens module, which includes an imaging processing unit, the imaging processing unit comprising:
[0028] An imaging data extraction module is used to acquire the original imaging image of an optically corrected camera; and to extract distortion features from the original imaging image, wherein the distortion features include radial distortion parameters and tangential distortion parameters.
[0029] An imaging data processing module is used to perform target recognition on the original imaging image when the radial distortion parameter and the tangential distortion parameter meet preset distortion correction conditions, thereby obtaining multiple recognized targets.
[0030] The imaging data processing module is also used to perform regularized filtering on multiple recognition targets to obtain regularized recognition targets, extract the pixel restoration matrix of the regularized recognition targets based on the regularized target library, reconstruct the corresponding region of the original imaging image according to the pixel restoration matrix, and extract radial distortion correction parameters and tangential distortion correction parameters according to the reconstructed image region.
[0031] An imaging distortion correction module is used to construct an optical correction model using the radial distortion correction parameters and the tangential distortion correction parameters, and to perform distortion correction on the original imaging image using the optical correction model to obtain the target imaging image.
[0032] Thirdly, this application provides a computer terminal device, which includes a memory and a processor. The memory stores code, and the processor is configured to acquire the code and execute the above-described optical correction camera lens imaging method.
[0033] Fourthly, this application provides a computer-readable storage medium storing at least one computer program, which is loaded and executed by a processor to perform the operations described above in an optical correction camera lens imaging method.
[0034] The technical solutions provided by the embodiments disclosed in this application have the following beneficial effects:
[0035] This application provides an optical correction camera lens module and its imaging method. First, the original imaging image of the optical correction camera is acquired. Distortion features are extracted from the original imaging image, including radial distortion parameters and tangential distortion parameters. When the radial and tangential distortion parameters meet preset distortion correction conditions, target recognition is performed on the original imaging image to obtain multiple recognition targets. These multiple recognition targets are then subjected to regularized filtering to obtain regularized recognition targets. Pixel reconstruction matrices of the regularized recognition targets are extracted based on a regularized target library. Region reconstruction is performed on the corresponding areas of the original imaging image based on the pixel reconstruction matrices. Radial and tangential distortion correction parameters are extracted from the reconstructed image regions. An optical correction model is constructed based on the radial and tangential distortion correction parameters. The original imaging image is then distorted using the optical correction model to obtain the target imaging image.
[0036] Therefore, this application extracts radial and tangential distortion parameters from the original imaging image to reflect the lens distortion state under the current acquisition conditions. When the distortion parameters are within a preset correctable range, i.e., when the distortion correction conditions are met, the image features are sufficiently stable and target recognition can be performed, thus ensuring the accuracy and repeatability of the recognition results. Based on this, multiple recognition targets are systematically screened. The target with the shape closest to the standard template and the most regular geometric features can be selected from the original image as the systematic recognition target. A pixel reconstruction matrix is extracted from the systematic target library, and the actual pixels are... Corresponding to standard template pixels, it can accurately restore the ideal geometry of the target region after region reconstruction, thereby eliminating the interference of local distortion on parameter calculation. Based on the reconstructed image region, radial distortion correction parameters and tangential distortion correction parameters are further extracted, so that the obtained distortion parameters can reflect the dynamic distortion characteristics under the current acquisition conditions. Compared with traditional preset parameters or fixed calibration methods, it is more real-time and adaptive. It can be directly used to construct an optical correction model and correct the original imaging image. Finally, the original image is mapped and corrected at the pixel level through the optical correction model to obtain the target imaging image, realizing real-time distortion correction.
[0037] In summary, this application can extract regularized target recognition based on the original imaging image and extract dynamic distortion correction parameters through regularized target recognition, thereby improving the real-time performance of imaging distortion correction. Attached Figure Description
[0038] Figure 1 This is an exemplary flowchart illustrating an optical correction camera lens imaging method according to some embodiments of this application;
[0039] Figure 2 This is a schematic diagram of the imaging processing unit according to some embodiments of this application;
[0040] Figure 3 This is a schematic diagram of the structure of a computer terminal device that implements an optical correction camera lens imaging method according to some embodiments of this application. Detailed Implementation
[0041] This application acquires the original imaging image from an optically corrected camera; extracts distortion features from the original imaging image, including radial distortion parameters and tangential distortion parameters; when the radial and tangential distortion parameters meet preset distortion correction conditions, targets are identified in the original imaging image to obtain multiple targets; the multiple targets are then filtered according to rules to obtain regularized targets; pixel reconstruction matrices of the regularized targets are extracted based on a regularized target library; corresponding regions of the original imaging image are reconstructed based on the pixel reconstruction matrices; radial and tangential distortion correction parameters are extracted from the reconstructed image regions; an optical correction model is constructed based on the radial and tangential distortion correction parameters; and distortion correction is performed on the original imaging image using the optical correction model to obtain the target imaging image. This method can extract regularized targets from the original imaging image and extract dynamic distortion correction parameters through the regularized targets, thus improving the real-time performance of imaging distortion correction.
[0042] To better understand the above technical solutions, a detailed explanation will be provided below with reference to the accompanying drawings and specific implementation methods; see references. Figure 1 The figure is an exemplary flowchart of an optical correction camera lens imaging method 100 according to some embodiments of this application. The optical correction camera lens imaging method 100 mainly includes the following steps:
[0043] In step S101, the original imaging image of the optically corrected camera is acquired; distortion features are extracted from the original imaging image, and the distortion features include radial distortion parameters and tangential distortion parameters.
[0044] It should be noted that the optical correction camera refers to a camera device with a data processing module used in this application. The data processing module can construct an optical correction model based on distortion parameters and perform geometric correction operations on the acquired images, thereby reducing the distortion effects caused by the lens structure. The original imaging image refers to image data acquired and output by the target camera lens without optical correction or image preprocessing operations. The original imaging image has inherent distortion characteristics of the camera lens, which will not be elaborated upon in this application.
[0045] Optionally, in some embodiments, acquiring the raw imaging image of the optically corrected camera specifically includes: acquiring raw image data through the image sensor corresponding to the optically corrected camera, wherein the raw image data can be selectively output in Bayer mode or RAW format, and the raw image data is output to the image processing module through the camera driver interface.
[0046] It should be noted that the radial distortion parameter described in this application is used to characterize the degree of distortion of the image in the direction of the optical axis radius, and the tangential distortion parameter is used to characterize the degree of distortion of the image in the direction of optical axis asymmetry. Preferably, in some embodiments, the distortion feature extraction of the original imaging image specifically includes:
[0047] Preset feature points are identified in the original imaging image, and the offset between the feature points and the ideal geometric position is calculated.
[0048] The offset is substituted into a preset distortion model, and the radial distortion parameters and tangential distortion parameters are solved using a nonlinear optimization algorithm.
[0049] In specific implementation, the built-in or external image processing module of the optically corrected camera can be used to automatically identify preset feature points in the original imaging image. The feature points can be checkerboard corner points, center points of dot arrays on a regular calibration board, or corner points and edge intersections extracted from natural scenes, etc., which have high stability. The pixel coordinates of the feature points are obtained through feature point detection algorithms, preferably such as Harris corner detection, Shi-Tomasi algorithm, and sub-pixel corner localization. Then, based on a preset geometric model, such as the ideal geometric relationship of a checkerboard dot array, the offset between the actual coordinates of the feature points in the original imaging image and their geometric positions on the ideal imaging plane is calculated. This offset is used to reflect the geometric deviation caused by camera lens distortion. The offset is substituted into the distortion model for fitting and solving. The distortion model is preferably a combination of radial distortion model and tangential distortion model, wherein the radial distortion parameter is used to describe the nonlinear deformation of the image center expanding or contracting outward, and the tangential distortion parameter is used to describe the lateral misalignment caused by lens assembly errors or tilt.
[0050] In some specific embodiments of this application, nonlinear optimization algorithms, preferably such as least squares, Levenberg-Marquardt, or gradient descent, can be used to iteratively solve the unknown parameters in the distortion model to minimize the reprojection error between the actual imaging position and the ideal position of all feature points, thereby obtaining the radial distortion parameters and tangential distortion parameters of the target camera lens and completing the extraction of distortion features.
[0051] In step S102, when the radial distortion parameter and the tangential distortion parameter meet the preset distortion correction conditions, target recognition is performed on the original imaging image to obtain multiple recognized targets.
[0052] It should be noted that, considering that when the parameter values of the distortion features are within a preset range, it indicates that the lens distortion has reached the condition for target recognition (in actual image acquisition, excessive distortion may lead to unstable feature recognition) triggering the target recognition step, preferably, in some embodiments, the distortion correction condition is: both the radial distortion parameter and the tangential distortion parameter are within a preset interval range. Further, the interval range can be set according to different types of camera lenses, focal lengths, and shooting environments. When the actually measured radial distortion parameter and tangential distortion parameter simultaneously fall into the corresponding preset interval, the system determines that the lens distortion is within an acceptable range, thereby activating the image target recognition module.
[0053] Preferably, in some embodiments, target recognition is performed on the original imaging image to obtain multiple recognized targets, specifically including:
[0054] The original imaging image is subjected to multi-level binarization processing to obtain multiple binarized images;
[0055] Boundary contours are extracted from each binarized image to obtain multiple boundary contour features. A pre-trained target detection model is then used to identify targets for each boundary contour feature, resulting in multiple identified targets.
[0056] In specific implementation, a multi-level threshold segmentation method is adopted. This application preferably uses existing threshold segmentation algorithms such as the Otsu algorithm, multi-threshold segmentation, and adaptive thresholding to binarize the grayscale image, thereby obtaining multiple binarized images. Each binarized image corresponds to an image region with a different grayscale range. For any binarized image, the Canny edge detection algorithm is used to extract the boundary contour features of the binarized image. The boundary contour features include the set of contour coordinate points of the target, bounding box information, and geometric features (area, aspect ratio, perimeter, etc.). Then, the YOLO target detection algorithm, which is commonly used in existing target recognition and classification technologies, is used to identify the target. The model predicts the target category and location information based on the boundary contour features and outputs the bounding box coordinates, confidence score, and category label of each identified target. For multiple identified targets, non-maximum suppression processing can be further performed to remove overlapping or repeatedly detected targets, resulting in the final information of multiple identified targets. Each identified target includes its category, boundary contour information, bounding box coordinates, and related geometric features.
[0057] Optionally, in some embodiments, before performing target recognition on the original imaging image to obtain multiple recognized targets, the method further includes: performing grayscale processing on the original imaging image;
[0058] Optionally, in some embodiments, the identified target includes target category, location information, and boundary contour information.
[0059] In step S103, multiple recognition targets are filtered according to rules to obtain regularized recognition targets. The pixel restoration matrix of the regularized recognition targets is extracted based on the regularized target library. The corresponding region of the original imaging image is reconstructed according to the pixel restoration matrix. Radial distortion correction parameters and tangential distortion correction parameters are extracted from the reconstructed image region.
[0060] Preferably, in some embodiments, rule-based filtering is performed on multiple identification targets to obtain rule-based identification targets, specifically including:
[0061] For any target to be identified, extract the geometric shape features corresponding to that target.
[0062] Obtain the target category corresponding to the identified target, obtain the standard geometric shape parameters corresponding to the target category, and extract feature contrast based on the standard geometric shape parameters and the geometric shape features corresponding to the identified target;
[0063] Iterate through each recognition target and select the recognition target with the lowest feature contrast as the regularized recognition target.
[0064] In specific implementation, for each target to be identified, its geometric shape features are calculated using boundary contour information. These geometric shape features have multiple dimensions, including area, perimeter, aspect ratio, contour convexity, roundness, and rectangularity. Rectangularity is calculated by the ratio of the contour area to the area of the smallest bounding rectangle, and convexity is calculated by the ratio of the contour area to the area of the convex hull. This application will not elaborate further on these details. Then, based on the category to which the target belongs, the standard geometric shape parameters corresponding to that category are obtained from a regularized target library. For example, the roundness of a standard circle is 1, the aspect ratio of a standard rectangle is within a preset range, and the convexity and rectangularity of a standard polygon are preset values. The actual geometric shape features of the target are then... The shape features are compared with the standard geometric shape parameters of the corresponding category, and the feature deviation is calculated as the feature contrast. The feature contrast can be a weighted sum of multiple geometric feature errors, where the weight of each geometric feature dimension can be set according to the actual application requirements. In some other embodiments, after feature normalization, feature vectors corresponding to the standard geometric shape parameters and the geometric shape features corresponding to the recognition target can be constructed respectively, and the cosine similarity between the feature vectors can be obtained as the feature contrast. This application does not limit this. The recognition target with the lowest feature contrast, that is, the target whose shape is closest to the standard geometric shape, is selected as the regularized recognition target.
[0065] It should be noted that the pixel reconstruction matrix records the offset information of each pixel in the regularized recognition target, and is used to reconstruct the corresponding region of the original imaging image. Preferably, in some embodiments, extracting the pixel reconstruction matrix of the regularized recognition target based on the regularized target library specifically includes:
[0066] Obtain a rule-based target library, and match the boundary contour information of the rule-based recognition target with the standard geometric template of the corresponding category in the rule-based target library;
[0067] Based on the matching results, the position of each pixel of the target in the original image is mapped to the standard template coordinate position to generate the pixel reconstruction matrix of the regularized target.
[0068] In practical implementation, a mapping relationship for a regularized target library is established. During this process, various methods can be used to acquire and store regularized targets. Specifically, on the one hand, regularized target information can be collected through experimental measurement. For example, in a controlled experimental environment, a high-precision calibrated imaging device can be used to image standard geometric objects (such as circular targets, rectangular targets, polygonal reference plates, etc., corresponding to different object types). By performing distortion correction and geometric analysis on the acquired images, the standard geometric parameters of various regularized targets and their pixel distribution information can be measured, and a corresponding pixel mapping table can be constructed. This ensures that the reference information in the regularized target library has high precision and high consistency, making it suitable for factory calibration of imaging systems or precision applications in professional scenarios.
[0069] On the other hand, the system can also support users to upload standard images of commonly used objects, allowing users to directly provide reference images of the target category during use. After receiving the standard image uploaded by the user, the system can automatically generate a standard geometric shape template for the target category through image preprocessing and geometric feature extraction algorithms (such as contour detection, shape fitting and normalization transformation), and extract the pixel coordinate mapping relationship. This makes the regularized target library more adaptive and scalable, meeting the personalized needs of different users in different application scenarios.
[0070] The process of extracting pixel coordinate mapping relationships is as follows: After the user uploads a standard image and completes preprocessing, the system performs grayscale and binarization on the standard image, extracts the target contour using an edge detection algorithm, uniformly samples or extracts key feature points on the contour, including corner points, convex hull vertices, and endpoints of contour segments, forming a set of contour feature points. For the contour feature points, the system performs shape normalization processing through scale normalization, making them conform to the size and orientation of a preset standard geometric shape in the coordinate system. For example, aligning the longest side horizontally, moving the centroid to the origin of the coordinate system, and scaling according to the standard size. Based on the normalized contour feature points, the system maps them one-to-one with the pixel coordinates of the standard template, constructs a preliminary pixel mapping table, and calculates the corresponding coordinates in the standard template for each pixel point inside the contour using bilinear interpolation, thereby forming a pixel coordinate mapping relationship.
[0071] In some other embodiments, in order to improve mapping accuracy, the system can also divide the internal region of the contour into pixel units according to the grid, perform mapping calculations on each unit separately, and perform smoothing or interpolation processing on continuous image regions to eliminate errors caused by discrete pixels. Finally, the system stores the generated pixel coordinate mapping relationship into a regularized target library, so that the subsequent reconstruction and distortion correction of the imaging region can accurately adjust the position of each pixel according to the mapping relationship, thereby achieving high-precision geometric correction and image restoration.
[0072] In practical implementation, the system can be designed to support a dual-channel construction mechanism. This means it can load existing standard target library information from experimental measurements, and also automatically perform standardization processing and updates after users upload new target images, ultimately forming a unified mapping storage format in the regularized target library. This allows the regularized target library to not only maintain a high-precision standard reference but also to dynamically expand, meeting the needs of diverse regularized targets in real-time distortion correction. For example, if a user needs to perform regularized identification of common screws on a production line, the user uploads a clear standard image of a screw through the client. After receiving the image, the system first processes the image... The system performs grayscale conversion and edge detection to extract the outer contour features of the screw cap. The data processing chip calculates the geometric parameters of the target, including the circumcircle diameter, roundness, and edge concavity / convexity, and normalizes these parameters to generate a standard geometric template for the screw cap category. Based on the registration relationship between the screw cap contour and the standard template, a pixel coordinate mapping table is established, ultimately generating the screw cap's pixel reconstruction matrix and storing it in a regularized target library. In subsequent imaging processes, when the system detects a target category as a screw cap, it can call the mapping relationship in the regularized target library for rapid pixel reconstruction and region reconstruction, thereby achieving efficient distortion correction.
[0073] The regularized target library stores standard geometric shape templates for each target category, including the ideal position coordinates of each pixel in the standard target. For each target category, a pixel mapping table is pre-constructed to form a pixel-level mapping relationship between the actual image coordinates and the standard target template coordinates. Then, the boundary contour information of the regularized recognition target is matched with the corresponding standard template in the regularized target library, and the actual contour coordinates of the recognition target are mapped to the standard template coordinates through affine transformation or thin plate spline transformation methods to achieve spatial correction of the target pixel position. Based on the matching results, a pixel reconstruction matrix is generated for each pixel of the regularized recognition target according to its corresponding coordinates in the standard template. Each element in the matrix represents the mapping relationship from the actual pixel position to the standard template position. The pixel reconstruction matrix can be represented as a two-dimensional matrix or a coordinate mapping table. Preferably, the element values in the matrix store the offset information of each pixel (the pixel offsets corresponding to the X and Y axes, respectively).
[0074] Optionally, in some embodiments, during the process of generating the pixel reconstruction matrix of the regularized recognition target, the pixel mapping is interpolated, for example, bilinear interpolation or bicubic interpolation is used to enhance the mapping accuracy and reduce the error caused by discrete pixels. For large-sized or irregularly shaped recognition targets, the region within the contour can also be divided into grids, and the pixel mapping can be calculated for each grid unit to obtain a higher resolution pixel reconstruction matrix and improve the accuracy of subsequent region reconstruction and optical correction.
[0075] Optionally, in some embodiments, region reconstruction is performed on the corresponding region of the original imaging image based on the pixel restoration matrix, including:
[0076] Obtain the corresponding region pixels of the regularized target in the original imaging image;
[0077] Each pixel is mapped to a standard template coordinate position based on the offset in the pixel reconstruction matrix. For non-integer coordinate positions, the pixel value is calculated by interpolation. All mapped pixels are then used to form a reconstructed region.
[0078] The reconstructed region is integrated into the original imaging image to obtain the reconstructed image region.
[0079] In specific implementation, the corresponding region of the original image is obtained, that is, the image region where the regularized recognition target is located is extracted from the original imaging image, including the target contour and its internal pixels. The pixel coordinates of this region are mapped to the pixel reconstruction matrix to form the input set of the region to be reconstructed. For each input pixel, its original coordinates are mapped to the target coordinate position of the standard template according to the offset recorded in the pixel reconstruction matrix. For non-integer coordinate positions, interpolation methods, such as bilinear interpolation or bicubic interpolation, can be used to calculate the gray value or color value of the corresponding pixel. All mapped pixels are filled into the reconstruction region of the standard geometric shape to obtain the image segment after geometric correction. Optionally, the reconstruction region is smoothed or edge-enhanced to correct edge discontinuities or artifacts generated during interpolation or mapping, thereby improving image quality. Finally, the reconstructed image region is backfilled to the corresponding position of the original imaging image. Among them, the reconstruction regions of multiple regularized recognition targets can be integrated sequentially according to position order or priority to form a complete region reconstruction result.
[0080] Preferably, in some embodiments, the process of extracting radial distortion correction parameters and tangential distortion correction parameters based on the reconstructed image region is consistent with the process of extracting distortion features from the original imaging image in this application, and will not be described in detail here.
[0081] In step S104, an optical correction model is constructed based on the radial distortion correction parameters and the tangential distortion correction parameters. The original imaging image is then distorted using the optical correction model to obtain the target imaging image.
[0082] It should be noted that this application, through regularized screening of multiple recognition targets, can select targets from the original image whose shapes are closest to the standard template and whose geometric features are most regular as regularized recognition targets. The regularized recognition targets themselves possess predictable geometric shapes and stable pixel distribution characteristics, making them a reliable basis for accurately calculating pixel mapping and distortion parameters. By extracting a pixel restoration matrix based on the regularized target library and mapping the actual pixels to the standard template pixels, the ideal geometric shape of the target region can be accurately restored after region reconstruction, thereby eliminating the interference of local distortion on parameter calculation. Furthermore, radial distortion correction can be further extracted based on the reconstructed image region. The parameters and tangential distortion correction parameters enable the obtained distortion parameters to reflect the dynamic distortion characteristics under the current acquisition conditions. Compared with traditional preset parameters or fixed calibration methods, it is more real-time and adaptive. It can be directly used to construct an optical correction model and correct the original imaging image. Finally, the original image is mapped and corrected at the pixel level through the optical correction model to obtain the target imaging image, realizing real-time distortion correction. This scheme uses regularized target identification as the benchmark for distortion parameter extraction. It can not only automatically adapt to lens distortion under different acquisition conditions, but also perform real-time optical correction through dynamically extracted correction parameters, thereby significantly improving the real-time performance and accuracy of the imaging system.
[0083] Preferably, in some embodiments, the process of constructing an optical correction model based on the radial distortion correction parameters and the tangential distortion correction parameters can be achieved by substituting the radial distortion correction parameters and the tangential distortion correction parameters into a preset camera distortion model to construct a pixel-level optical correction function.
[0084] In a specific implementation, the radial distortion correction parameters and tangential distortion correction parameters are substituted into the distortion equation corresponding to the optical correction camera lens. Based on the radial distance of each pixel relative to the optical center, the radial distortion variable and tangential distortion variable corresponding to each pixel are determined, and the correction position corresponding to each pixel is obtained. The mapping relationship is saved as a pixel-level optical correction function, which can be stored in the form of a two-dimensional matrix in a specific implementation.
[0085] Preferably, in some embodiments, the optical correction model is applied to the original imaging image to obtain the corrected target imaging image. During the pixel mapping process, the corrected pixel coordinates are usually non-integer values. In this regard, this application uses interpolation methods (such as bilinear interpolation and bicubic interpolation) to calculate gray values, so that the corrected image is smooth and continuous, avoiding phenomena such as discontinuity and jaggedness in the target imaging image during the correction process.
[0086] Optionally, in some embodiments, after the original imaging image is distorted by the optical correction model to obtain the target imaging image, the method further includes: outputting the target imaging image.
[0087] Preferably, in some embodiments, the output of the target imaging image includes multiple implementation methods; the corrected target imaging image can be saved in a common image format, such as JPEG, PNG, TIFF or RAW file, and the image can be saved to local storage, SD card or remote server for subsequent processing or archiving; the corrected target imaging image can be displayed through a display device, including a liquid crystal display, OLED screen or monitoring terminal. In real-time imaging applications, the corrected image can be displayed synchronously for practical purposes such as operator observation and quality inspection.
[0088] Furthermore, the target imaging image can be output to an image processing module, machine vision system, or artificial intelligence recognition module for further image analysis, feature extraction, and target recognition. Image data transmission can be achieved through memory sharing, image buffers, or standard communication interfaces (such as USB, Ethernet, CameraLink). Before output, the calibrated image can also undergo additional processing, including grayscale normalization, contrast enhancement, noise reduction, or edge enhancement, to improve image quality and subsequent recognition results. For multi-frame image sequences, each frame can be calibrated and output to form a continuous video stream or image sequence.
[0089] Furthermore, in another aspect of this application, in some embodiments, this application provides an optical correction camera lens module, the system including an imaging processing unit, referenced... Figure 2 The figure is a schematic diagram of the exemplary hardware and / or software structure of an imaging processing unit according to some embodiments of this application. The imaging processing unit 200 includes: an imaging data extraction module 201, an imaging data processing module 202, and an imaging distortion correction module 203, which are described below:
[0090] The imaging data extraction module 201 is used to acquire the original imaging image of the optically corrected camera; and to extract distortion features from the original imaging image, wherein the distortion features include radial distortion parameters and tangential distortion parameters.
[0091] The imaging data processing module 202 is used to perform target recognition on the original imaging image when the radial distortion parameter and the tangential distortion parameter meet the preset distortion correction conditions, and obtain multiple recognized targets.
[0092] The imaging data processing module 202 is also used to perform regularized filtering on multiple recognition targets to obtain regularized recognition targets, extract the pixel restoration matrix of the regularized recognition targets based on the regularized target library, reconstruct the corresponding region of the original imaging image according to the pixel restoration matrix, and extract radial distortion correction parameters and tangential distortion correction parameters according to the reconstructed image region.
[0093] The imaging distortion correction module 203 is used to construct an optical correction model using the radial distortion correction parameters and the tangential distortion correction parameters, and to perform distortion correction on the original imaging image using the optical correction model to obtain the target imaging image.
[0094] The foregoing has provided a detailed example of an optical correction camera lens module and its imaging method provided in the embodiments of this application. It is understood that the corresponding device includes hardware structures and / or software modules for performing each function in order to achieve the above functions.
[0095] Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a certain function in the application is executed in a manner that drives hardware or computer software depends on the specific application and design constraints of the technical solution. Therefore, those skilled in the art can use different methods to implement the described function for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0096] In addition, this application also provides a computer terminal device, which includes a memory and a processor. The memory stores code, and the processor is configured to acquire the code and execute the above-described optical correction camera lens imaging method.
[0097] In some embodiments, reference Figure 3 The figure is a schematic diagram of the structure of a computer terminal device implementing an optical correction camera lens imaging method according to some embodiments of this application; the optical correction camera lens imaging method in the above embodiments can be implemented through... Figure 3 The computer terminal device 300 shown is used to implement this, and the computer terminal device 300 includes at least one communication bus 301, communication interface 302, processor 303 and memory 304.
[0098] The processor 303 may be a general-purpose central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more devices used to control the execution of an optical correction camera lens imaging method as described in this application.
[0099] The communication bus 301 may include a path for transmitting information between the aforementioned components.
[0100] The memory 304 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disks or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto; the memory 304 may exist independently and be connected to the processor 303 via the communication bus 301; the memory 304 may also be integrated with the processor 303.
[0101] The memory 304 is used to store program code that executes the scheme of this application, and the execution is controlled by the processor 303; the processor 303 is used to execute the program code stored in the memory 304; the program code may include one or more software modules; the determination of distortion features in the above embodiments can be achieved by the processor 303 and one or more software modules in the program code in the memory 304.
[0102] Communication interface 302 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.
[0103] Optionally, the computer terminal device 300 may also include a power supply 305 for providing power to various devices or circuits in the real-time computer terminal device.
[0104] In a specific implementation, as one example, a computer terminal device may include multiple processors, each of which may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor; the processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0105] The aforementioned computer terminal device can be a general-purpose computer terminal device or a dedicated computer terminal device; in specific implementations, the computer terminal device can be a desktop computer, a portable computer, a network server, a handheld computer (personal digital assistant, PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, or an embedded device; the embodiments of this application do not limit the type of computer terminal device.
[0106] In addition, other aspects of this application provide a computer-readable storage medium storing at least one computer program that is loaded and executed by a processor to perform the operations performed by the above-described optical correction camera lens imaging method.
[0107] In summary, the optical correction camera lens module and its imaging method disclosed in this application first acquire the original imaging image of the optical correction camera; then, distortion features are extracted from the original imaging image, including radial distortion parameters and tangential distortion parameters; when the radial distortion parameters and tangential distortion parameters meet preset distortion correction conditions, target recognition is performed on the original imaging image to obtain multiple recognition targets; the multiple recognition targets are then subjected to regularized filtering to obtain regularized recognition targets; pixel restoration matrices of the regularized recognition targets are extracted based on the regularized target library; the corresponding regions of the original imaging image are reconstructed based on the pixel restoration matrices; radial distortion correction parameters and tangential distortion correction parameters are extracted based on the reconstructed image regions; an optical correction model is constructed based on the radial distortion correction parameters and tangential distortion correction parameters; and distortion correction is performed on the original imaging image using the optical correction model to obtain the target imaging image. This method can extract regularized recognition targets from the original imaging image and extract dynamic distortion correction parameters through the regularized recognition targets, thereby improving the real-time performance of imaging distortion correction.
[0108] The above description is merely an embodiment of this application. Common knowledge such as specific technical solutions or characteristics in the solution is not described in detail here. It should be noted that for those skilled in the art, several modifications and improvements can be made without departing from the technical solution of this application. These modifications and improvements should also be considered within the scope of protection of this application. These modifications and improvements will not affect the implementation effect of this application or the practicality of the patent.
[0109] The scope of protection claimed in this application shall be determined by the content of its claims. The specific embodiments described in the specification can be used to interpret the content of the claims. Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of the invention. Therefore, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.
Claims
1. A method for optically correcting camera lens imaging, characterized in that, include: Acquire the raw imaging image from the optically corrected camera; extract distortion features from the raw imaging image, the distortion features including radial distortion parameters and tangential distortion parameters; When the radial distortion parameter and the tangential distortion parameter meet the preset distortion correction conditions, target recognition is performed on the original imaging image to obtain multiple recognized targets; Multiple recognition targets are subjected to rule-based filtering to obtain rule-based recognition targets. The pixel reconstruction matrix of the rule-based recognition targets is then extracted based on the rule-based target library. Specifically, this includes: Obtain a rule-based target library, and match the boundary contour information of the rule-based recognition target with the standard geometric template of the corresponding category in the rule-based target library; Based on the matching results, the position of each pixel of the target in the original image is mapped to the coordinate position of the standard template to generate the pixel reconstruction matrix of the regularized target. The pixel reconstruction matrix records the offset information of each pixel in the regularized recognition target. Region reconstruction is performed on the corresponding region of the original imaging image based on the pixel reconstruction matrix, including: Obtain the corresponding region pixels of the regularized target in the original imaging image; Each pixel is mapped to a standard template coordinate position based on the offset in the pixel reconstruction matrix. For non-integer coordinate positions, the pixel value is calculated by interpolation. All mapped pixels are then used to form a reconstructed region. The reconstructed region is integrated into the original imaging image to obtain the reconstructed image region; Radial distortion correction parameters and tangential distortion correction parameters are extracted from the reconstructed image region; An optical correction model is constructed based on the radial and tangential distortion correction parameters. Specifically, this includes: substituting the radial and tangential distortion correction parameters into the distortion equation corresponding to the optical correction camera lens; determining the radial and tangential distortion variables corresponding to each pixel based on the radial distance of each pixel relative to the optical center; obtaining the correction position corresponding to each pixel; saving the mapping relationship as a pixel-level optical correction function as the optical correction model; and performing distortion correction on the original imaging image using the optical correction model to obtain the target imaging image.
2. The method as described in claim 1, characterized in that, Raw image data is acquired by the image sensor corresponding to the optically corrected camera, and the raw image data is output to the image processing module through the camera driver interface to form a raw imaging image.
3. The method as described in claim 1, characterized in that, Target recognition is performed on the original imaging image to obtain multiple recognized targets, specifically including: The original imaging image is subjected to multi-level binarization processing to obtain multiple binarized images; Boundary contours are extracted from each binarized image to obtain multiple boundary contour features. A pre-trained target detection model is then used to identify targets for each boundary contour feature, resulting in multiple identified targets.
4. The method as described in claim 1, characterized in that, Before performing target recognition on the original imaging image to obtain multiple recognized targets, the method further includes: performing grayscale processing on the original imaging image.
5. The method as described in claim 1, characterized in that, By performing rule-based filtering on multiple identification targets, the specific rule-based identification targets include: For any target to be identified, extract the geometric shape features corresponding to that target. Obtain the target category corresponding to the identified target, obtain the standard geometric shape parameters corresponding to the target category, and extract feature contrast based on the standard geometric shape parameters and the geometric shape features corresponding to the identified target; Iterate through each recognition target and select the recognition target with the lowest feature contrast as the regularized recognition target.
6. An optical correction camera lens module, comprising an imaging processing unit, said imaging processing unit being used to execute the optical correction camera lens imaging method according to any one of claims 1 to 5, characterized in that, The imaging processing unit includes: An imaging data extraction module is used to acquire the original imaging image of an optically corrected camera; and to extract distortion features from the original imaging image, wherein the distortion features include radial distortion parameters and tangential distortion parameters. An imaging data processing module is used to perform target recognition on the original imaging image when the radial distortion parameter and the tangential distortion parameter meet preset distortion correction conditions, thereby obtaining multiple recognized targets. The imaging data processing module is also used to perform regularized filtering on multiple recognition targets to obtain regularized recognition targets, extract the pixel restoration matrix of the regularized recognition targets based on the regularized target library, reconstruct the corresponding region of the original imaging image according to the pixel restoration matrix, and extract radial distortion correction parameters and tangential distortion correction parameters according to the reconstructed image region. An imaging distortion correction module is used to construct an optical correction model using the radial distortion correction parameters and the tangential distortion correction parameters, and to perform distortion correction on the original imaging image using the optical correction model to obtain the target imaging image.
7. A computer terminal device, characterized in that, The computer terminal device includes a memory and a processor, the memory storing code, and the processor being configured to acquire the code and execute an optical correction camera lens imaging method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing at least one computer program, characterized in that, The computer program is loaded and executed by a processor to perform the operations of an optically corrected camera lens imaging method as described in any one of claims 1 to 5.