Camera image correction method and system based on artificial intelligence
By using an AI-based camera image correction method, the distortion patterns and degrees are identified, and the correction model is updated adaptively. This solves the problems of cumbersome camera image correction and poor generalization ability in existing technologies, and achieves high-quality image correction results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-03-31
AI Technical Summary
In existing technologies, camera image correction methods require precise measurement of optical parameters, which is a cumbersome process with high environmental requirements. Traditional machine learning models have poor generalization ability, resulting in unstable correction effects in different scenarios.
An AI-based camera image correction method is adopted. By acquiring the image to be corrected, identifying the distortion pattern and degree, and adaptively updating the correction model, distortion correction is performed using the adaptively updated image correction model.
It improves the quality and adaptability of image correction, and can dynamically adjust the correction logic in complex and ever-changing real-world scenarios, reducing the risk of overfitting and significantly improving image quality and usability.
Smart Images

Figure CN121074348B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image correction technology, specifically to an artificial intelligence-based camera image correction method and system. Background Technology
[0002] In today's imaging applications, cameras are widely used. However, images captured by cameras often suffer from distortion, which severely affects image quality and subsequent analysis. Existing technologies offer various methods for camera image correction. Early methods were primarily based on traditional optical principles and geometric transformations, using complex mathematical models to describe and correct image distortion. These methods require precise measurement and calibration of the camera's optical parameters, a cumbersome process with stringent environmental requirements, significantly limiting their practical application.
[0003] With the development of computer technology, some existing technologies can utilize machine learning for image correction. These technologies train models by collecting large amounts of image data, allowing the models to learn the characteristics of image distortion and correction rules. However, traditional machine learning models can usually only handle a limited type of distortion and scene. For complex and varied real-world situations, their generalization ability is poor, and they are prone to overfitting, resulting in unstable correction effects in different scenarios. Summary of the Invention
[0004] This invention provides a camera image correction method and system based on artificial intelligence.
[0005] In a first aspect, embodiments of the present invention provide an artificial intelligence-based camera image correction method, applied to an artificial intelligence-based camera image correction system, the method comprising:
[0006] Acquire a camera image to be corrected, wherein the camera image to be corrected is image data containing distorted regions acquired by the camera;
[0007] The camera image to be corrected is input into a trained first image correction model. The first image correction model identifies the distortion patterns and degrees present in the camera image to be corrected, and obtains distortion state features. The distortion state features are used to describe the morphological and distribution features of the distorted regions in the camera image to be corrected.
[0008] The first image correction model is adaptively updated by calling the appropriate correction strategy and parameters based on the distortion state characteristics to obtain the second image correction model. The second image correction model is the image correction model after adjusting the correction logic based on the distortion state characteristics.
[0009] The second image correction model is used to perform distortion correction processing on the camera image to be corrected to obtain a corrected image, which is the image data after eliminating the distortion area.
[0010] Secondly, embodiments of the present invention provide an artificial intelligence-based camera image correction system, comprising:
[0011] processor;
[0012] Storage device, on which computer programs are stored,
[0013] When the computer program is executed by the processor, the processor implements any of the described artificial intelligence-based camera image correction methods.
[0014] This invention provides a readable storage medium storing a program or instructions, which, when executed by a processor, implement the steps of the AI-based camera image correction method.
[0015] This invention improves the quality and adaptability of camera image correction. First, by acquiring the camera image to be corrected and inputting it into a trained first image correction model, the distortion patterns and degrees present in the image can be accurately identified, resulting in distortion state features that describe the morphology and distribution characteristics of the distorted regions. This accurate identification capability makes the subsequent correction process more targeted. Compared with traditional methods, it can more accurately locate distortion problems in the image, avoiding over-processing of normal areas or under-processing of distorted areas.
[0016] Secondly, based on the distortion characteristics, an appropriate correction strategy and parameters are applied to adaptively update the first image correction model, resulting in the second image correction model. This adaptive update mechanism enhances the model's flexibility and versatility, enabling it to dynamically adjust according to different distortion conditions. When faced with complex and varied real-world scenarios, such as different lighting conditions, shooting angles, and lens characteristics, the model can automatically adjust its correction logic, avoiding poor correction results due to scene differences. This effectively improves the model's generalization ability and reduces the risk of overfitting.
[0017] Finally, the second image correction model is used to perform distortion correction on the camera image to be corrected, resulting in a corrected image after eliminating the distortion areas. This high-precision correction process significantly improves the image quality and usability. For example, in fields such as security monitoring, industrial inspection, and medical imaging, the corrected image can more clearly display target information, which can be used to improve the accuracy and efficiency of decision-making. Attached Figure Description
[0018] Figure 1This is a flowchart of an artificial intelligence-based camera image correction method provided in an embodiment of the present invention.
[0019] Figure 2 This is a schematic diagram of the basic structure of an artificial intelligence-based camera image correction system provided in an embodiment of the present invention. Detailed Implementation
[0020] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0021] See Figure 1 As shown, this figure is a flowchart of an artificial intelligence-based camera image correction method provided by an embodiment of the present invention. This method can be applied to an artificial intelligence-based camera image correction system. Figure 1 As shown, the method exemplarily includes steps 110-140.
[0022] Step 110: Obtain the camera image to be corrected, wherein the camera image to be corrected is image data containing distorted regions acquired by the camera.
[0023] In camera image correction scenarios, the first step is to acquire the camera image to be corrected. When a camera acquires an image, factors such as the lens's optical characteristics and installation angle can cause distortion. For example, in an indoor security monitoring scenario, an image captured by a camera installed in a corner may exhibit edge distortion, stretching, and other distortions. The camera's image acquisition device collects image data according to a preset sampling frequency and resolution, resulting in the camera image to be corrected, which includes the distorted areas. This image data is stored digitally, containing the grayscale or color values of multiple pixels; these values constitute the basic features of the image.
[0024] Step 120: Input the camera image to be corrected into the trained first image correction model, and use the first image correction model to identify the distortion pattern and degree in the camera image to be corrected to obtain distortion state features. The distortion state features are used to describe the morphological and distribution features of the distorted region in the camera image to be corrected.
[0025] The acquired camera image to be corrected is input into a pre-trained first image correction model. This model is trained on a large amount of image data with distortion labels and has the ability to identify distortion patterns and degrees in the image. The model contains multiple layers and modules. Through feature extraction, analysis, and judgment of the input image, it ultimately determines the distortion patterns present in the image, such as radial distortion, tangential distortion, etc., and the degree of distortion. For example, for radial distortion, the model can determine whether it is concave or convex distortion, and whether the distortion is slight, moderate, or severe. The obtained distortion state features include the morphological features of the distorted region, such as whether the distorted region is circular, elliptical, or irregular in shape, and the distribution features, such as the location of the distorted region in the image, whether it is concentrated at the image edge or scattered throughout the image.
[0026] Step 121: Input the camera image to be corrected into the image block layer of the first image correction model, perform uniform grid division processing on the camera image to be corrected, and generate multiple image block units, each image block unit containing a preset number of pixels.
[0027] After the camera image to be corrected enters the image segmentation layer of the first image correction model, it undergoes uniform grid partitioning. The image segmentation layer divides the entire image into multiple image block units of the same size according to a preset grid size and partitioning rules. Each image block unit contains a certain number of pixels; this preset number is determined based on the model design and actual needs. For example, in indoor security monitoring images, the image segmentation layer may divide the image into several small square image block units, each containing a certain number of pixels. This simplifies the complex image data, facilitating subsequent individual analysis and processing of each image block unit. Through this segmentation process, the features of different regions in the image can be more precisely extracted, improving the model's accuracy in identifying distortion.
[0028] Step 122: Perform edge contour detection processing on each image block unit and extract the edge contour features of each image block unit. The edge contour features are used to describe the boundary features of pixel gray value changes in the image block unit.
[0029] After generating multiple image block units, edge contour detection is performed on each image block unit. Edge contour detection uses a predefined algorithm to identify regions within the image block unit where pixel grayscale values change significantly; these regions constitute the edge contour of the image block unit. For example, in an image block unit of an indoor security monitoring image, there may be object edges or boundaries between different colored areas, where pixel grayscale values will vary considerably. The edge contour detection algorithm can extract these edge contours, obtaining the edge contour features of each image block unit. These features are represented in the form of pixel coordinates and grayscale value changes, reflecting the shape and boundary conditions of objects within the image block unit. This is crucial for distortion detection, as distortion often alters the edge contours of the image.
[0030] Step 123: Input the edge contour features of all image block units into the feature fusion layer of the first image correction model for cross-block feature association analysis to generate global contour association features of the camera image to be corrected. The global contour association features are used to describe the edge connection relationship between different image block units.
[0031] Optionally, the edge contour features of all image block units are input into the feature fusion layer of the first image correction model. The feature fusion layer performs cross-block feature association analysis on these edge contour features. In indoor security monitoring images, different image block units may have edge connections; for example, the edges of adjacent image block units may be continuous, representing different parts of the same object. The feature fusion layer analyzes the similarity, continuity, and other relationships between these edge contour features, and determines the edge connections between different image block units by comparing information such as pixel coordinates and grayscale value change trends. For example, if the edge contours of two adjacent image block units have a preset continuity in pixel coordinates and similar grayscale value change trends, then they can be considered connected. Through the above cross-block feature association analysis, a global contour association feature is generated. This feature reflects the overall edge structure of the entire camera image to be corrected and can be used to more comprehensively identify the distortion patterns and degrees in the image.
[0032] Step 124: Call the distortion recognition layer of the first image correction model to perform distortion pattern classification processing on the global contour association features, identify the distortion patterns and degrees existing in the camera image to be corrected, and obtain distortion state features to describe the morphological features and distribution features of the distorted region in the camera image to be corrected.
[0033] Optionally, the distortion recognition layer of the first image correction model performs distortion pattern classification processing on the global contour association features. The distortion recognition layer contains various classification algorithms and rules, which determine the distortion patterns and degrees present in the image through analysis and judgment of the global contour association features. For example, for radial distortion, the distortion recognition layer determines whether it is concave or convex distortion, and the severity of the distortion, based on features such as the curvature and symmetry of the edges in the global contour association features. For tangential distortion, it makes judgments based on the tilt and twisting of the edges. Through the above classification processing, distortion state features are obtained. Distortion state features include the morphological features of the distorted region, such as whether the distorted region is circular, elliptical, or irregular in shape, and distribution features, such as the specific location of the distorted region in the image, whether it is concentrated in a corner of the image or scattered across multiple areas.
[0034] Step 130: Based on the distortion state characteristics, call the appropriate correction strategy and parameters to adaptively update the first image correction model to obtain the second image correction model. The second image correction model is the image correction model after adjusting the correction logic based on the distortion state characteristics.
[0035] Furthermore, based on the obtained distortion state features, the first image correction model needs to be adaptively updated by invoking appropriate correction strategies and parameters. Different distortion state features correspond to different correction strategies and parameters. For example, in indoor security monitoring images, if the distortion state features indicate severe radial distortion, then a correction strategy and corresponding parameters for radial distortion need to be invoked. These correction strategies and parameters are stored in a preset database. Based on the specific information of the distortion state features, the most suitable correction strategy and parameters are selected from the database. These appropriate correction strategies and parameters are then applied to the first image correction model, adjusting the model's correction logic, including adjusting the processing methods and parameter settings of various levels and modules within the model. Finally, a second image correction model is obtained, which can better correct the distortion of the current camera image to be corrected.
[0036] Step 131: Input the distortion state features into a preset strategy matching library, and calculate the feature matching degree between the distortion state features and multiple candidate correction strategies stored in the strategy matching library. The strategy matching library is a database containing correction strategies corresponding to different distortion types. The feature matching degree is used to represent the degree of fit between the distortion state features and the candidate correction strategies.
[0037] The strategy matching library is a pre-built database storing correction strategies for different distortion types. These strategies are derived from extensive experiments and experience, and each has a different approach for different distortion patterns and degrees. In indoor security monitoring images, the strategy matching library may contain correction strategies for different distortion types, such as radial distortion, tangential distortion, and mixed distortion. By calculating the feature matching degree between the distortion state features and multiple candidate correction strategies in the strategy matching library, the most suitable candidate correction strategy for the current distortion situation is determined. The feature matching degree is calculated by comparing the distortion state features and the relevant features of the candidate correction strategies, such as comparing the type, degree, and distribution characteristics of the distortion. A higher matching degree indicates that the candidate correction strategy is more suitable for the current distortion state features.
[0038] Step 132: Select the candidate correction strategy with the highest matching degree from the strategy matching library as the target correction strategy based on the feature matching degree. The target correction strategy is the correction logic used to process the distortion type corresponding to the current distortion state feature.
[0039] After calculating the feature matching degree between the distortion state features and multiple candidate correction strategies, the candidate correction strategy with the highest matching degree is selected from the strategy matching library as the target correction strategy based on these feature matching degrees. In indoor security monitoring images, if a candidate correction strategy for radial distortion is found to have the highest matching degree with the current distortion state features, then that candidate correction strategy is determined as the target correction strategy. The target correction strategy contains specific correction logic for the current distortion type. For example, for radial distortion, it may include radial stretching or shrinking of the image, as well as corresponding parameter settings, such as the magnitude of stretching or shrinking, center position, etc.
[0040] Step 133: Call the parameter adjustment rules corresponding to the target correction strategy, and perform initial adjustment processing on the correction parameters of the first image correction model based on the distribution features in the distortion state features to obtain the intermediate image correction model after parameter adjustment.
[0041] In this embodiment of the invention, parameter adjustment rules corresponding to the target correction strategy are invoked. These rules are formulated based on the characteristics of the target correction strategy and the distortion state features, and are used to guide how to adjust the correction parameters of the first image correction model. In indoor security monitoring images, based on the distribution characteristics in the distortion state features, such as the location distribution and area proportion of the distorted region in the image, the correction parameters of the first image correction model are initially adjusted. For example, if the distorted region is mainly concentrated at the edge of the image, then the parameters related to edge correction in the model may be adjusted, such as the magnitude of edge stretching or shrinking, the correction weight, etc. Through the above initial adjustment, an intermediate image correction model with adjusted parameters is obtained. This intermediate image correction model has optimized the correction parameters to a certain extent according to the current distortion situation, but may still need further adjustment.
[0042] Step 1331: Extract the distribution features of the distorted region from the distortion state features. The distribution features include the position distribution and area ratio of the distorted region in the camera image to be corrected. The position distribution is used to describe the coordinate range of the distorted region, and the area ratio is used to describe the ratio of the number of pixels in the distorted region to the total number of pixels in the image.
[0043] In indoor security surveillance images, the location distribution and area proportion of distorted regions in the image are determined by analyzing relevant information in the distortion characteristics. Location distribution is described by coordinate ranges; for example, a distorted region might be located in the upper left corner of the image, and its coordinate range can be represented by the minimum and maximum pixel coordinates. Area proportion refers to the ratio of the number of pixels in the distorted region to the total number of pixels in the entire image. The area proportion is calculated by statistically analyzing the number of pixels in the distorted region and the total number of pixels in the image. These distribution characteristics reflect the specific situation of the distorted region in the image.
[0044] Step 1332: Determine the densely distorted regions in the camera image to be corrected based on the location distribution, and calculate the distortion severity index of the densely distorted regions based on the area ratio. The distortion severity index is positively correlated with the area ratio.
[0045] In indoor security surveillance images, if distorted areas are concentrated in a localized region—meaning multiple distorted areas are close to or overlap each other—this area can be identified as a densely distorted region. Then, a distortion severity index is calculated based on the area proportion of this densely distorted region. Since the distortion severity index is positively correlated with the area proportion, the larger the area proportion, the higher the distortion severity index. For example, if the area proportion of a densely distorted region is large, it indicates severe distortion in that area, and the corresponding distortion severity index will also be high. By calculating this index, the distortion situation in densely distorted regions can be understood more quantitatively.
[0046] Step 1333: Call the parameter adjustment rules corresponding to the target correction strategy, and perform graded adjustment processing on the correction intensity parameters of the first image correction model according to the distortion severity index to generate an initial set of correction parameters. The correction intensity parameters are used to control the amplitude of distortion correction.
[0047] In indoor security monitoring images, the correction intensity parameters of the first image correction model are adjusted in stages according to the distortion severity index. If the distortion severity index is high, the correction intensity parameters are appropriately increased to correct the distortion more significantly; if the distortion severity index is low, the correction intensity parameters are decreased to avoid overcorrection. For example, for radial distortion, if the distortion severity index is high, the radial stretching or shrinkage may be increased; if the index is low, the amplitude is decreased. Through the above staged adjustment process, an initially adjusted set of correction parameters is generated. This set of correction parameters is the result of optimizing the model correction intensity based on the current distortion situation and includes the specific values of multiple correction parameters.
[0048] Step 1334: Input the initially adjusted set of correction parameters into the parameter update interface of the first image correction model to replace the original correction parameters in the first image correction model, and obtain the intermediate image correction model with adjusted parameters. The parameter update interface is a functional interface for modifying the internal parameters of the model.
[0049] Optionally, the initially adjusted set of correction parameters is input into the parameter update interface of the first image correction model. The parameter update interface is a specially designed functional interface within the model for modifying internal parameters. In indoor security monitoring images, this interface replaces the original correction parameters in the first image correction model with the parameter values from the initially adjusted set of correction parameters. For example, the adjusted radial stretching amplitude and edge correction weight values replace the original parameter values. After parameter replacement, an intermediate image correction model with adjusted parameters is obtained. The correction parameters of this intermediate image correction model have been preliminarily optimized based on the current distortion situation.
[0050] Step 1335: Perform performance testing on the intermediate image correction model. Use a preset set of test images to evaluate the correction effect of the intermediate image correction model and generate a correction effect evaluation index. The correction effect evaluation index is used to describe the ability of the intermediate image correction model to eliminate distorted areas. The correction effect evaluation index includes distortion reduction rate and image detail retention.
[0051] In this step, the intermediate image correction model with adjusted parameters undergoes performance testing. A pre-set set of test images, containing images of different types and degrees of distortion, is used, exhibiting similar characteristics to the actual camera images to be corrected. These test images are input into the intermediate image correction model from indoor security monitoring images for correction, and the corrected results are then evaluated. Evaluation metrics for the correction effect are generated through this evaluation, including distortion reduction rate and image detail retention. The distortion reduction rate reflects the model's ability to eliminate distorted regions; it is calculated by comparing the area change of distorted regions in the images before and after correction. Image detail retention reflects the model's ability to preserve the original image details during correction; it is evaluated by analyzing the similarity between the texture, edge, and other detail features of the corrected image and the original image.
[0052] Step 1336: Determine whether the correction effect evaluation index meets the preset termination condition. The termination condition is that the distortion elimination rate in the correction effect evaluation index reaches the preset elimination threshold and the image detail retention reaches the preset retention threshold.
[0053] Optionally, it can be determined whether the evaluation indicators of the correction effect meet the preset termination conditions. In indoor security monitoring images, the preset termination conditions are that the distortion reduction rate reaches a preset elimination threshold and the image detail retention reaches a preset retention threshold. These thresholds are determined based on actual application needs and experience. For example, the distortion reduction rate elimination threshold may be set to a high value to ensure that most distortions are eliminated; the image detail retention threshold will also be set to an appropriate value to ensure that the detail information of the corrected image is well preserved. By comparing the distortion reduction rate and image detail retention with the corresponding thresholds, if both meet the requirements, it indicates that the correction effect of the intermediate image correction model has reached the expected standard; if not, the model parameters need to be further adjusted.
[0054] Step 1337: If the correction effect evaluation index meets the termination condition, the intermediate image correction model is determined as the second image correction model; if the correction effect evaluation index does not meet the termination condition, the process returns to the step of extracting the distribution features of the distortion region from the distortion state features until the correction effect evaluation index meets the termination condition.
[0055] If the correction effect evaluation index meets the preset termination condition, the intermediate image correction model is determined as the second image correction model. In indoor security monitoring images, this means that the model can already effectively correct the current distortion while preserving sufficient image details. If the correction effect evaluation index does not meet the termination condition, the process returns to the step of extracting the distribution features of the distorted region from the distortion state features, re-analyzing the distribution of the distorted region, and adjusting the model's correction parameters again according to the severity of the distortion, performing iterative optimization until the correction effect evaluation index meets the termination condition. Through this iterative adjustment method, the correction effect of the model can be continuously optimized.
[0056] Step 140: Use the second image correction model to perform distortion correction processing on the camera image to be corrected to obtain a corrected image, wherein the corrected image is the image data after eliminating the distortion area.
[0057] In this step, an optimized second image correction model is used to perform distortion correction on the camera image to be corrected. In indoor security monitoring images, the second image correction model corrects distorted areas in the image according to the previously adjusted correction logic and parameters. The model performs a series of processing operations on the image, such as stretching, shrinking, and rotating distorted areas to eliminate distortion. At the same time, it tries to preserve image details as much as possible to avoid over-correction that could lead to image distortion. Through these processing steps, the corrected image is finally obtained. This corrected image eliminates distorted areas from the original image, restores the normal shape and details of the image, and better reflects the real-world situation.
[0058] Step 141: Input the camera image to be corrected into the region division layer of the second image correction model, and divide the camera image to be corrected into multiple correction regions according to the position distribution in the distortion state features. Each correction region contains at least one distorted region or non-distorted region. The size and number of correction regions are determined according to the distribution density of the distorted regions.
[0059] In indoor security surveillance images, the region segmentation layer divides the entire image into multiple correction regions based on the positional distribution of distortion features. Each correction region may contain one or more distorted regions, or it may contain undistorted regions. The size and number of correction regions are determined by the distribution density of the distorted regions. If the distorted regions are densely distributed, smaller correction regions may be defined for more precise correction; if the distorted regions are sparsely distributed, larger correction regions can be defined to improve correction efficiency. For example, if the edges of the image have more and denser distorted regions, then the edge areas can be divided into multiple smaller correction regions, while the central part of the image has less distortion and can be divided into a larger correction region.
[0060] Step 142: For each correction region, call the corresponding region correction sub-model in the second image correction model to perform targeted correction processing, and generate the region correction result for each correction region. The region correction sub-model is a correction logic unit configured according to the distortion type of the correction region.
[0061] Optionally, for each correction region, the corresponding region correction sub-model in the second image correction model is invoked for targeted correction processing. In indoor security monitoring images, different correction regions may have different types of distortion, such as radial distortion and tangential distortion. Each region correction sub-model is configured according to the distortion type of the correction region and contains specific correction logic for that distortion type. For example, for a correction region with radial distortion, the invoked region correction sub-model will include radial stretching or shrinkage correction algorithms and corresponding parameter settings; for a correction region with tangential distortion, the invoked region correction sub-model will include tangential rotation or translation correction algorithms. By invoking these region correction sub-models, each correction region is individually corrected, generating region correction results for each correction region. These region correction results have, to a certain extent, corrected the distortion within their respective regions.
[0062] Step 1421: Obtain a region correction sub-model from the second image correction model that matches the distortion type of each correction region. The region correction sub-model contains the correction algorithm and parameter configuration corresponding to the distortion type. Different distortion types correspond to different region correction sub-models.
[0063] Furthermore, a regional correction sub-model matching the distortion type of each correction region is obtained from the second image correction model. In indoor security monitoring images, a suitable regional correction sub-model is selected from the model based on the distortion type of each correction region. Each regional correction sub-model contains the correction algorithm and parameter configuration for the corresponding distortion type. For example, for a correction region with radial distortion, the obtained regional correction sub-model includes a radial distortion correction algorithm, such as correcting distortion by radially transforming the position of pixels, and also includes corresponding parameter configurations, such as the magnitude of radial stretching or shrinking, and the center position. Different distortion types correspond to different regional correction sub-models, ensuring accurate correction of distortion in each correction region.
[0064] Step 1422: Input the image data of the correction area into the corresponding region correction sub-model, and locate the set of distorted pixels in the correction area through the distortion detection sub-model in the region correction sub-model. The set of distorted pixels is the set of pixel coordinates that deviate from the normal pixel value range.
[0065] Optionally, the image data of the correction area is input into the corresponding area correction sub-model. In indoor security monitoring images, the distortion detection sub-model within the area correction sub-model analyzes the input image data and locates the set of distorted pixels within the correction area. The distortion detection sub-model identifies pixels that deviate from the normal range by comparing the grayscale or color values of pixels with the normal pixel value range. For example, if the grayscale value of a pixel is significantly higher or lower than the normal range, or its color value differs greatly from surrounding pixels, then this pixel can be considered a distorted pixel, and the coordinates of these distorted pixels constitute the set of distorted pixels. By accurately locating these distorted pixels...
[0066] Step 1423: Based on the distribution density and grayscale value change trend of the distorted pixel set, call the pixel adjustment sub-model in the region correction sub-model to perform grayscale value correction and position adjustment processing on the distorted pixel set, and generate corrected region pixel data. The grayscale value correction is used to adjust the brightness and color values of the distorted pixels, and the position adjustment is used to correct the coordinate position of the distorted pixels.
[0067] Furthermore, based on the distribution density and grayscale value variation trend of the distorted pixel set, the pixel adjustment sub-model within the region correction sub-model is invoked. In indoor security monitoring images, a high distribution density of distorted pixels indicates severe distortion in that area, potentially requiring more extensive correction. The grayscale value variation trend reflects the type and degree of distortion; for example, a gradual increase or decrease in grayscale values may indicate stretching or shrinkage distortion. The pixel adjustment sub-model performs grayscale value correction and position adjustment on the distorted pixel set. Grayscale value correction adjusts the brightness and color values of the distorted pixels to bring them closer to normal pixel values. Position adjustment corrects the coordinate positions of the distorted pixels based on the type and degree of distortion; for example, for radial distortion, the distorted pixels are moved a preset distance towards the center or edge. Through these processes, corrected region pixel data is generated, achieving initial correction of distortion within the correction area.
[0068] Step 1424: Perform local contrast enhancement processing on the corrected region pixel data to compensate for the image detail information lost during the correction process, and generate a region correction result containing the corrected pixel data and detail enhancement information, wherein the detail enhancement information is used to describe the enhanced image detail features.
[0069] In this embodiment of the invention, local contrast enhancement processing is performed on the corrected regional pixel data. In indoor security monitoring images, some image detail information may be lost during the correction of distorted pixels, resulting in a blurred image. Local contrast enhancement processing highlights the image's detailed features by adjusting the contrast of local areas. For example, for details such as textures and edges in the image, the contrast difference between them and the surrounding areas is increased. Through the above processing, the image detail information lost during the correction process can be compensated, generating a regional correction result that includes corrected pixel data and detail enhancement information. The detail enhancement information describes the enhanced image detail features, such as texture clarity and edge sharpness, making the corrected image clearer and more realistic.
[0070] Step 143: Input the region correction results of all correction regions into the region fusion layer of the second image correction model for edge smoothing and region consistency adjustment to generate an initial correction image, which is the image data obtained by stitching together the corrections of each correction region.
[0071] Furthermore, the regional correction results of all corrected regions are input into the region fusion layer of the second image correction model. In indoor security monitoring images, the region fusion layer performs edge smoothing and region consistency adjustment on these regional correction results. Edge smoothing eliminates edge differences between different corrected regions, making the image transition at the stitching point more natural. Region consistency adjustment unifies the color space parameters and brightness distribution characteristics of each corrected region, making the color and brightness of the entire image more harmonious. For example, by performing weighted averaging on the edge pixels of adjacent corrected regions, the edge transition is made smoother; by adjusting the color channel parameters and brightness values of different corrected regions, the color and brightness of each region are made consistent. Through these processes, an initial corrected image is generated, which is the result of stitching together the corrected regions, initially restoring the overall shape of the image.
[0072] Step 1431: Extract the edge pixel data of the correction result for each region, wherein the edge pixel data is the set of pixel values at the boundary of the correction region.
[0073] Optionally, edge pixel data can be extracted from the correction results of each region. In indoor security monitoring images, edge pixel data refers to the set of pixel values at the boundary of the correction region. This edge pixel data reflects the pixel characteristics of the correction region boundary and is crucial for subsequent edge smoothing processing. By scanning the region correction results row by row and column by column, the pixels located at the boundary of the correction region are identified, and their grayscale or color value information is recorded to form edge pixel data. This data contains detailed information about the boundary of the correction region, such as grayscale changes and color transitions at the edges.
[0074] Step 1432: Calculate the gray value difference and gradient direction difference of the edge pixel data of adjacent correction regions to generate an edge difference matrix. The edge difference matrix is used to describe the degree of inconsistency of the edges of adjacent regions. The element values in the edge difference matrix are positively correlated with the degree of difference.
[0075] In this embodiment of the invention, the grayscale value difference and gradient direction difference of edge pixel data in adjacent correction regions are calculated. In indoor security monitoring images, an edge difference matrix is generated by comparing the grayscale values and gradient directions of edge pixels in adjacent correction regions. The grayscale value difference can be obtained by calculating the difference in grayscale values between adjacent edge pixels, and the gradient direction difference can be obtained by analyzing the direction of grayscale value change of edge pixels. For example, if the grayscale value difference of edge pixels in two adjacent correction regions is large, or the gradient direction difference is significant, it indicates that the inconsistency between the edges of these two regions is high. The element values in the edge difference matrix are positively correlated with the degree of difference; the larger the element value, the greater the difference between the edges of adjacent regions. By generating the edge difference matrix, the inconsistency of the edges of adjacent regions can be quantified.
[0076] Step 1433: Determine the edge regions that need to be smoothed based on the edge difference matrix, and call the edge smoothing algorithm in the region fusion layer to perform weighted averaging on the pixel values of the edge regions. The weights of the weighted averaging are adjusted according to the element values in the edge difference matrix.
[0077] In this embodiment of the invention, edge regions requiring smoothing are determined based on the edge difference matrix. In indoor security monitoring images, regions with larger element values in the edge difference matrix indicate a higher degree of inconsistency between adjacent edges; these regions are those requiring smoothing. The edge smoothing algorithm in the region fusion layer is invoked to perform a weighted average of the pixel values in these edge regions. The weights of the weighted average are adjusted according to the element values in the edge difference matrix; the larger the element value, the lower the weight. For example, for regions with large edge differences, the weight of the edge pixels in that region is reduced, while the weight of the edge pixels in adjacent regions is increased, resulting in a more natural edge transition. Through the above weighted average processing, the differences between adjacent edge regions are reduced, making the image stitching smoother.
[0078] Step 1434: Perform color consistency adjustment on all corrected areas after smoothing to unify the color space parameters and brightness distribution characteristics of each area, and generate a color-balanced stitched image. The color space parameters include color gamut range and color channel configuration.
[0079] Optionally, color consistency adjustment is performed on all corrected areas after smoothing. In indoor security monitoring images, different corrected areas may differ in color space parameters and brightness distribution characteristics, leading to inconsistencies in color and brightness in the stitched image. Color consistency adjustment adjusts the color space parameters of each corrected area, such as color gamut and color channel configuration, as well as brightness distribution characteristics, to make the overall image more balanced in color and brightness. For example, by adjusting the gain of the color channels in each corrected area, the colors in different areas become more consistent; by adjusting the brightness values, the brightness distribution in each area becomes more uniform. Through these adjustments, a color-balanced stitched image is generated, improving the overall image quality.
[0080] Step 1435: Use the color-balanced stitched image as the initial correction image, which contains complete image data that has undergone region correction and edge smoothing.
[0081] The stitched image with color balance adjusted for color consistency is used as the initial calibration image. In indoor security monitoring images, this initial calibration image contains complete image data that has undergone area correction and edge smoothing, which has eliminated distortion in the image to a certain extent and made the transition between different calibrated areas more natural and the colors more harmonious. However, some residual distortion and stitching marks may still exist, requiring further optimization.
[0082] Step 144: Perform overall optimization processing on the initial corrected image to eliminate regional splicing traces and residual distortion areas, and obtain the corrected image.
[0083] In indoor security monitoring images, although the initial corrected image has undergone region correction and edge smoothing, some splicing marks and residual distortion areas may still exist. Overall optimization processing includes secondary correction of these residual distortion areas and global image contrast adjustment and sharpening. For example, residual distortion areas are re-detected and corrected more precisely; global image contrast is adjusted to enhance image clarity; and sharpening highlights image edges and details. Through these processing steps, a corrected image is finally obtained, which is clearer, more realistic, and meets the requirements of the actual scene.
[0084] Step 1441: Perform residual distortion detection processing on the initial corrected image. Scan each pixel region in the initial corrected image using a preset distortion recognition algorithm to locate residual distortion regions that have not been completely eliminated. The residual distortion regions are image regions that still have distortion features after correction.
[0085] Optionally, residual distortion detection processing is performed on the initially calibrated image. In indoor security monitoring images, a preset distortion recognition algorithm is used to scan each pixel region in the initially calibrated image. The distortion recognition algorithm analyzes information such as pixel grayscale values, color values, and edge features to determine whether there are distortion features in the region. For example, if the pixel grayscale values of a certain region are unevenly distributed, or if there is a distortion at the edges, it may indicate that there is residual distortion in that region. By scanning the entire initially calibrated image, residual distortion regions that have not been completely eliminated are located. These residual distortion regions are image areas that still have distortion features after calibration and require further calibration.
[0086] Step 1442: Calculate the area ratio and location distribution of the residual distortion region. If the area ratio exceeds a preset residual threshold, then the residual distortion region is subjected to secondary correction processing by calling the fine correction sub-model in the second image correction model to generate the residual region correction result. The fine correction sub-model is a correction logic unit used to process residual distortion.
[0087] In indoor security monitoring images, the area percentage is calculated by statistically analyzing the number of pixels within the residual distortion area and the total number of pixels in the image. The location distribution is determined by recording the pixel coordinate range of the residual distortion area. If the area percentage exceeds a preset residual threshold, it indicates severe residual distortion, requiring further correction. In this case, the fine correction sub-model in the second image correction model is invoked to perform secondary correction processing on the residual distortion area. The fine correction sub-model is specifically designed for handling residual distortion and includes more refined correction algorithms and parameter configurations. For example, for minor residual distortion, a more precise pixel adjustment algorithm may be used for correction. Through this secondary correction processing, a residual area correction result is generated, further eliminating residual distortion.
[0088] Step 1443: Perform pixel-level fusion processing on the residual region correction result and the initial correction image, replace the pixel data of the corresponding residual distortion region in the initial correction image, and generate an optimized intermediate image. The pixel-level fusion processing is an image synthesis method that replaces pixels by pixel position.
[0089] In this embodiment of the invention, the residual region correction result and the initial corrected image are fused at the pixel level. In indoor security monitoring images, pixel-level fusion processing is an image synthesis method that replaces pixels according to their positions. The pixel data in the residual region correction result replaces the pixel data of the corresponding residual distortion area in the initial corrected image. For example, if the residual distortion area is located in the upper left corner of the image, the pixel data of the corrected area replaces the pixel data of the corresponding position in the upper left corner of the initial corrected image. Through the above replacement, the result of the secondary correction is integrated into the initial corrected image to generate an optimized intermediate image. This optimized intermediate image further eliminates residual distortion to a certain extent and improves the image quality.
[0090] Step 1444: Perform global contrast adjustment and sharpening on the optimized intermediate image to generate image data with enhanced clarity. Use the image data with enhanced clarity as the corrected image. The corrected image is the final image data after eliminating regional stitching traces and residual distortion areas.
[0091] Optionally, global contrast adjustment and sharpening are performed on the optimized intermediate image. In indoor security monitoring images, global contrast adjustment enhances image clarity by adjusting the overall contrast of the image. For example, it increases the contrast difference between bright and dark areas in the image, making the image more vivid. Sharpening enhances the edges and details of the image, highlighting its contours and textures. For example, it enhances edge pixels to make them sharper. Through these processes, image data with enhanced clarity is generated, which serves as the corrected image. This corrected image eliminates regional stitching artifacts and residual distortion areas, achieving a better correction effect and more closely reflecting the real-world situation.
[0092] Step 1445: Perform quality assessment processing on the sharpness-enhanced image data using preset image quality evaluation indicators, and calculate the distortion reduction rate, detail retention, and color fidelity of the sharpness-enhanced image data. The distortion reduction rate is used to represent the proportion of the distorted area eliminated to the original distorted area. The detail retention is used to describe the degree to which the corrected image retains the details of the original image. The color fidelity is used to measure the consistency between the corrected image and the colors of the real scene.
[0093] Furthermore, preset image quality evaluation metrics are used to assess the quality of the sharpness-enhanced image data. In indoor security surveillance images, the distortion reduction rate, detail retention, and color fidelity of the sharpness-enhanced image data are calculated. The distortion reduction rate is calculated by comparing the area of distorted regions in the corrected image and the original image, determining the proportion of distorted regions eliminated compared to the original distorted region. Detail retention is evaluated by analyzing the similarity between the texture, edges, and other detail features of the corrected image and the original image; for example, by comparing the high-frequency components of the image to determine the degree of detail retention. Color fidelity is measured by comparing the similarity between the colors of the corrected image and the colors of the real scene; for example, by analyzing the values and distribution of color channels. Through the calculation of these metrics, the quality of the corrected image can be comprehensively evaluated.
[0094] Step 1446: Determine whether the distortion reduction rate, detail retention and color fidelity have all reached the corresponding preset quality thresholds. The preset quality thresholds are the minimum quality standards set according to the image correction application scenario. Different application scenarios correspond to different preset quality thresholds.
[0095] In this step, it is determined whether the distortion reduction rate, detail retention, and color fidelity all reach their respective preset quality thresholds. In indoor security monitoring images, the preset quality thresholds are the minimum quality standards set according to the image correction application scenario. Different application scenarios have different image quality requirements. For example, for security monitoring scenarios, more emphasis may be placed on distortion reduction rate and detail retention to ensure clear identification of objects in the image; for artistic photography scenarios, more emphasis may be placed on color fidelity to reproduce realistic color atmosphere. If the distortion reduction rate, detail retention, and color fidelity all reach their respective preset quality thresholds, it indicates that the quality of the corrected image meets the requirements; if any one of them fails to meet the threshold, further optimization is required.
[0096] Step 1447: If all of them reach the corresponding preset quality threshold, the image data with enhanced sharpness is determined as the corrected image; if at least one of them does not reach the corresponding preset quality threshold, the process returns to the step of performing overall optimization processing on the initially corrected image until all quality evaluation indicators reach the preset quality threshold.
[0097] If the distortion reduction rate, detail retention, and color fidelity all reach the corresponding preset quality thresholds, the image data with enhanced sharpness is identified as the corrected image. In indoor security monitoring images, this means the corrected image already meets the quality requirements of the application scenario and can be used for subsequent image analysis and applications. If at least one of the preset quality thresholds is not met, the process returns to the step of performing overall optimization on the initially corrected image. The initially corrected image undergoes residual distortion detection, secondary correction, global contrast adjustment, and sharpening, iteratively optimizing until all quality evaluation indicators reach the preset quality thresholds, ensuring a high-quality corrected image is ultimately obtained.
[0098] As a non-limiting embodiment, the method further includes:
[0099] Step 210: Perform contour comparison processing between the corrected image and the morphological features of the distorted region described in the distortion state features to generate image data to be labeled. The image data to be labeled is comparison data containing pixel data of the corrected image and contour information of the original distorted region.
[0100] The corrected image is compared with the morphological features of the distorted region described in the distortion state characteristics. In indoor security monitoring images, the differences between the two are identified by comparing the edge contours of the corrected image with the morphological features of the original distorted region. For example, it is used to detect whether there are any abnormal contours in the corrected image that are similar in shape to the original distorted region. Through the above comparison process, image data to be labeled is generated, which contains the pixel data of the corrected image and the contour information of the original distorted region. The image data to be labeled is stored in a defined format, combining the pixel values of the corrected image and the contour coordinates of the original distorted region.
[0101] Step 211: Perform region contour matching analysis on the image data to be labeled, and locate the regions in the corrected image that have morphological differences from the original distorted region contour as potential residual distortion regions. The potential residual distortion regions are a set of image regions that still have distortion features after correction.
[0102] Region contour matching analysis is performed on the image data to be labeled. In indoor security monitoring images, by comparing the contours of each region in the corrected image with the contours of the original distorted region, regions with morphological differences are identified. These regions may be potential residual distortion regions that still exhibit distortion characteristics after correction. During the analysis, factors such as the shape, size, and position of the contours are considered. By calculating the similarity or difference between contours, potential residual distortion regions are determined. For example, if the contour of a certain region is significantly similar to the contour of the original distorted region in shape but differs in position or size, then this region can be marked as a potential residual distortion region. Through the above region contour matching analysis, potential residual distortion regions can be located more accurately.
[0103] Step 212: Extract the gray value distribution features and edge gradient features of the potential residual distortion region to generate a residual distortion feature vector. The residual distortion feature vector is used to describe the degree of pixel value deviation and boundary irregularity of the potential residual distortion region.
[0104] This study extracts the grayscale distribution features and edge gradient features of potential residual distortion regions. In indoor security monitoring images, the grayscale distribution features reflect the distribution of pixel values within the potential residual distortion region, obtained by statistically analyzing the frequency distribution of grayscale values within the region. Edge gradient features reflect the irregularity of the region's boundary, calculated by measuring the rate of change of grayscale values in edge pixels. For example, drastic changes in the grayscale values of edge pixels indicate a high degree of boundary irregularity. Combining the grayscale distribution features and edge gradient features generates a residual distortion feature vector. This vector is represented as a numerical vector, with each element corresponding to a feature index describing the degree of pixel value deviation and boundary irregularity within the potential residual distortion region. Analyzing the residual distortion feature vector provides a deeper understanding of the characteristics of the potential residual distortion region.
[0105] Step 213: Input the residual distortion feature vector into the preset annotation rule library, call the annotation template matching the residual distortion feature vector to perform structured annotation processing on the potential residual distortion region, and generate residual distortion annotation results containing the location coordinates, morphological category and confidence index of the residual distortion region. The residual distortion annotation results are a set of annotation data used to describe the distortion regions that are not completely eliminated in the corrected image.
[0106] The residual distortion feature vector is input into a pre-defined annotation rule library. This library stores multiple annotation templates, each corresponding to a specific residual distortion feature vector. In indoor security monitoring images, the annotation template with the highest matching degree is found by comparing the residual distortion feature vector with the templates in the library. Then, this template is used to perform structured annotation processing on potential residual distortion regions. During annotation, the position coordinates of the residual distortion region are recorded, and its specific location in the image is determined by pixel coordinates; its shape category is determined, such as circular, elliptical, or irregular shape; and a confidence index is provided to indicate the reliability of the annotation. Through this structured annotation processing, residual distortion annotation results are generated. These results are stored in a structured data format, containing multiple annotation information to describe the distortion regions in the corrected image that were not completely eliminated.
[0107] In yet another non-limiting embodiment, the method further includes:
[0108] Step 310: Obtain residual distortion annotation results, and map the residual distortion region position coordinates in the residual distortion annotation results to the pixel coordinate system of the corrected image to generate residual region pixel mapping data. The residual region pixel mapping data is a set of precise pixel coordinates of the residual distortion region in the corrected image.
[0109] In indoor security monitoring images, the location coordinates of the residual distortion region in the residual distortion annotation results are mapped to the pixel coordinate system of the corrected image. Since the location coordinates in the residual distortion annotation results may be relative coordinates or other forms of coordinate representation, they need to be converted to precise coordinates in the pixel coordinate system of the corrected image. Using a preset coordinate transformation algorithm, based on information such as the size and resolution of the corrected image, the location coordinates of the residual distortion region are mapped to the pixel coordinate system, generating residual region pixel mapping data. This dataset contains the precise pixel coordinates of the residual distortion region in the corrected image.
[0110] Step 311: Perform density clustering analysis on the pixel mapping data of the residual region to identify the clustering distribution characteristics of the residual distortion region and generate a residual distribution density matrix. The residual distribution density matrix is used to describe the degree of clustering of residual distortion pixels in different image regions, and the matrix element values are positively correlated with the degree of clustering.
[0111] Density clustering analysis is performed on the pixel mapping data of the residual distortion region. By analyzing the pixel coordinate distribution of the residual distortion region, clusters of residual distorted pixels are identified. The density clustering analysis algorithm groups adjacent pixels with high density into a cluster based on the distance and density relationship between pixels. Through this analysis, the clustering distribution characteristics of the residual distortion region are identified. Then, a residual distribution density matrix is generated based on the clustering distribution characteristics. Each element of the matrix corresponds to a region in the image, and the element value represents the degree of clustering of residual distorted pixels in that region. The larger the element value, the higher the degree of clustering of residual distorted pixels in that region. The residual distribution density matrix provides a clearer understanding of the distribution of residual distorted regions in the image.
[0112] Step 312: Perform a correlation analysis between the residual distribution density matrix and the set of correction parameters of the second image correction model, and determine the model parameters associated with the high-value regions in the residual distribution density matrix as parameters to be adjusted. The parameters to be adjusted are the internal parameters of the model that affect the correction effect of the corresponding regions.
[0113] A correlation analysis was performed between the residual distribution density matrix and the set of correction parameters of the second image correction model. In indoor security monitoring images, the relationship between high-value regions in the residual distribution density matrix and the model correction parameters was analyzed to identify model parameters associated with these high-value regions. These parameters are likely key factors affecting the correction effect in the corresponding regions. For example, if a region in the residual distribution density matrix has a high value, it indicates severe residual distortion in that region, which may be related to the correction intensity parameters for that region in the model, the weights of the correction algorithm, etc. Through correlation analysis, these associated model parameters were identified as parameters to be adjusted. These parameters are important parameters within the model and directly affect the correction effect in the corresponding regions.
[0114] Step 313: Call the preset parameter fine-tuning rules, perform gradient adjustment processing on the parameters to be adjusted based on the clustering distribution characteristics in the residual distribution density matrix, and generate a third image correction model after parameter fine-tuning. The third image correction model is an optimized updated model used to improve the residual distortion elimination effect in image correction.
[0115] In indoor security monitoring images, gradient adjustment is performed on the determined parameters to be adjusted based on the clustering distribution characteristics in the residual distribution density matrix. Gradient adjustment is a stepwise optimization method that makes small adjustments to the parameters according to the severity and distribution of residual distortion. For example, if the value in a certain region of the residual distribution density matrix is high, the correction intensity parameter corresponding to that region is appropriately increased. Through the above gradient adjustment, the correction parameters of the model are continuously optimized, generating a third image correction model with fine-tuned parameters. This optimized third image correction model can better improve the elimination effect of residual distortion in image correction and further improve the image quality.
[0116] This invention improves the quality and adaptability of camera image correction. First, by acquiring the camera image to be corrected and inputting it into a trained first image correction model, the distortion patterns and degrees present in the image can be accurately identified, resulting in distortion state features that describe the morphology and distribution characteristics of the distorted regions. This accurate identification capability makes the subsequent correction process more targeted. Compared with traditional methods, it can more accurately locate distortion problems in the image, avoiding over-processing of normal areas or under-processing of distorted areas.
[0117] Secondly, based on the distortion characteristics, an appropriate correction strategy and parameters are applied to adaptively update the first image correction model, resulting in the second image correction model. This adaptive update mechanism enhances the model's flexibility and versatility, enabling it to dynamically adjust according to different distortion conditions. When faced with complex and varied real-world scenarios, such as different lighting conditions, shooting angles, and lens characteristics, the model can automatically adjust its correction logic, avoiding poor correction results due to scene differences. This effectively improves the model's generalization ability and reduces the risk of overfitting.
[0118] Finally, the second image correction model is used to perform distortion correction on the camera image to be corrected, resulting in a corrected image after eliminating the distortion areas. This high-precision correction process significantly improves the image quality and usability. For example, in fields such as security monitoring, industrial inspection, and medical imaging, the corrected image can more clearly display target information, which can be used to improve the accuracy and efficiency of decision-making.
[0119] See Figure 2As shown in the figure, this is a schematic diagram of the basic structure of an artificial intelligence-based camera image correction system 200 provided in an embodiment of the present invention. The artificial intelligence-based camera image correction system 200 includes:
[0120] Processor 201;
[0121] Storage device 202, on which computer program 2020 is stored;
[0122] When the computer program 2020 is executed by the processor 201, the processor 201 implements any of the described artificial intelligence-based camera image correction methods.
[0123] Based on the above, a readable storage medium is provided, on which a program or instructions are stored, and when the program or instructions are executed by a processor, the steps of the above method are implemented.
[0124] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the systems or apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and relevant parts can be referred to the method section.
Claims
1. An artificial intelligence-based camera image correction method, characterized by, The method comprises the following steps: obtaining a camera image to be corrected, the camera image to be corrected being image data containing a distortion region collected by a camera; inputting the camera image to be corrected into a trained first image correction model, identifying a distortion mode and degree existing in the camera image to be corrected by the first image correction model, and obtaining a distortion state feature, the distortion state feature being used to describe morphological features and distribution features of the distortion region in the camera image to be corrected; performing adaptive updating on the first image correction model according to the distortion state feature to obtain a second image correction model, the second image correction model being an image correction model after correction logic is adjusted based on the distortion state feature; performing distortion correction processing on the camera image to be corrected by using the second image correction model to obtain a corrected image, the corrected image being image data after the distortion region is eliminated; the step of performing distortion correction processing on the camera image to be corrected by using the second image correction model to obtain a corrected image comprises the following steps: dividing the camera image to be corrected into a region division layer of the second image correction model, dividing the camera image to be corrected into a plurality of correction regions according to position distribution in the distortion state feature, each correction region containing at least one distortion region or non-distortion region, and the size and number of the correction regions being determined according to distribution density of the distortion region; calling a corresponding regional correction sub-model in the second image correction model to perform targeted correction processing on each correction region to generate a regional correction result of each correction region, the regional correction sub-model being a correction logic unit configured according to a distortion type of the correction region; inputting the regional correction results of all the correction regions into a region fusion layer of the second image correction model to perform edge smoothing processing and region consistency adjustment, and generating a preliminary correction image, the preliminary correction image being image data obtained by splicing the correction regions after correction; performing overall optimization processing on the preliminary correction image to eliminate region splicing traces and residual distortion regions, and obtaining a corrected image.
2. The method of claim 1, wherein, the step of inputting the camera image to be corrected into a trained first image correction model, identifying a distortion mode and degree existing in the camera image to be corrected by the first image correction model, and obtaining a distortion state feature comprises the following steps: inputting the camera image to be corrected into an image block layer of the first image correction model, performing uniform grid division processing on the camera image to be corrected, and generating a plurality of image block units, each image block unit containing a preset number of pixel points; performing edge contour detection processing on each image block unit, and extracting edge contour features of each image block unit, the edge contour features being used to describe boundary features of pixel gray value changes in the image block unit; Edge contour features of all image block units are input into a feature fusion layer of the first image correction model for cross-block feature correlation analysis processing, to generate global contour correlation features of the camera image to be corrected, which are used to describe edge connection relationships between different image block units; A distortion recognition layer of the first image correction model is called to perform distortion mode classification processing on the global contour correlation features, to identify a distortion mode and degree existing in the camera image to be corrected, to obtain distortion state features for describing shape features and distribution features of a distortion region in the camera image to be corrected.
3. The method of claim 1, wherein, The first image correction model is adaptively updated according to the distortion state features to obtain a second image correction model, including: The distortion state features are input into a preset strategy matching library, and feature matching degrees of the distortion state features and a plurality of candidate correction strategies stored in the strategy matching library are calculated, the strategy matching library being a database containing correction strategies corresponding to different distortion types, and the feature matching degrees being used to represent adaptation degrees of the distortion state features and the candidate correction strategies; A candidate correction strategy with the highest matching degree is selected from the strategy matching library as a target correction strategy according to the feature matching degrees, the target correction strategy being a correction logic used to process a distortion type corresponding to the current distortion state features; A parameter adjustment rule corresponding to the target correction strategy is called, and correction parameters of the first image correction model are preliminarily adjusted based on distribution features in the distortion state features, to obtain an intermediate image correction model after parameter adjustment.
4. The method of claim 3, wherein, The parameter adjustment rule corresponding to the target correction strategy is called, and the correction parameters of the first image correction model are preliminarily adjusted based on the distribution features in the distortion state features, to obtain the intermediate image correction model after parameter adjustment, including: Distribution features of the distortion region are extracted from the distortion state features, the distribution features including position distribution and area proportion of the distortion region in the camera image to be corrected, the position distribution being used to describe a coordinate range of the distortion region, and the area proportion being used to describe a proportional relationship between a pixel number of the distortion region and a total pixel number of the image; A distortion-intensive region in the camera image to be corrected is determined according to the position distribution, and a distortion severity index of the distortion-intensive region is calculated based on the area proportion, the distortion severity index being in a positive correlation relationship with the area proportion; The parameter adjustment rule corresponding to the target correction strategy is called, and a correction strength parameter of the first image correction model is hierarchically adjusted according to the distortion severity index, to generate a preliminarily adjusted correction parameter set, the correction strength parameter being used to control a magnitude of distortion correction; The preliminarily adjusted correction parameter set is input into a parameter update interface of the first image correction model, to replace original correction parameters in the first image correction model, to obtain the intermediate image correction model after parameter adjustment, the parameter update interface being a functional interface used to modify internal parameters of the model.
5. The method of claim 4, wherein, The parameter updating interface of the first image correction model is used to input the initial adjusted correction parameter set, replace original correction parameters in the first image correction model, and obtain an intermediate image correction model with adjusted parameters. The intermediate image correction model is subjected to performance test processing, a preset test image set is used to evaluate correction effects of the intermediate image correction model, and a correction effect evaluation index is generated, the correction effect evaluation index is used to describe an ability of the intermediate image correction model to eliminate a distortion area, and the correction effect evaluation index includes a distortion elimination rate and an image detail retention degree. It is judged whether the correction effect evaluation index meets a preset termination condition, the termination condition is that the distortion elimination rate in the correction effect evaluation index reaches a preset elimination threshold and the image detail retention degree reaches a preset retention threshold. If the correction effect evaluation index meets the termination condition, the intermediate image correction model is determined as a second image correction model. If the correction effect evaluation index does not meet the termination condition, the step of extracting the distribution feature of the distortion area from the distortion state feature is returned to be executed until the correction effect evaluation index meets the termination condition.
6. The method of claim 1, wherein, The second image correction model is used to call a corresponding regional correction submodel of each correction area to perform targeted correction processing, and a regional correction result of each correction area is generated. A regional correction submodel matched with a distortion type of each correction area is obtained from the second image correction model, the regional correction submodel includes a correction algorithm and parameter configuration of the corresponding distortion type, and different distortion types correspond to different regional correction submodels. Image data of the correction area is input into the corresponding regional correction submodel, a distortion pixel point set in the correction area is located by a distortion detection submodel in the regional correction submodel, and the distortion pixel point set is a pixel point coordinate set deviating from a normal pixel value range. According to a distribution density and a gray value change trend of the distortion pixel point set, a pixel adjustment submodel in the regional correction submodel is called to perform gray value correction and position adjustment processing on the distortion pixel point set, and regional pixel data after correction is generated, the gray value correction is used to adjust brightness and color values of the distortion pixel point, and the position adjustment is used to correct a coordinate position of the distortion pixel point. The regional pixel data after correction is subjected to local contrast enhancement processing, image detail information lost in the correction process is compensated, and a regional correction result including the pixel data after correction and detail enhancement information is generated, and the detail enhancement information is used to describe enhanced image detail features.
7. The method of claim 1, wherein, Edge pixel data of each regional correction result is extracted, and the edge pixel data is a pixel value set at a boundary of the correction area. The gray value difference and gradient direction difference of the edge pixel data of the adjacent correction region are calculated to generate an edge difference matrix, which is used to describe the inconsistency degree of the edge of the adjacent region, and the element value in the edge difference matrix is positively correlated with the difference degree; According to the edge difference matrix, the edge region that needs to be smoothed is determined, and an edge smoothing algorithm in the region fusion layer is called to perform weighted average processing on the pixel value of the edge region, and the weight of the weighted average processing is adjusted according to the element value in the edge difference matrix; The color consistency of all the corrected regions after the smoothing processing is adjusted, the color space parameters and the brightness distribution characteristics of each region are unified, and a color-balanced spliced image is generated, wherein the color space parameters include the color gamut range and the color channel configuration; The color-balanced spliced image is taken as a preliminary correction image, and the preliminary correction image contains complete image data after the region correction and the edge smoothing processing.
8. The method of claim 7, wherein, The preliminary correction image is subjected to overall optimization processing to eliminate the region splicing traces and the residual distortion region, and a corrected image is obtained, including: The preliminary correction image is subjected to residual distortion detection processing, each pixel region in the preliminary correction image is scanned through a preset distortion recognition algorithm, and a residual distortion region that is not completely eliminated is located, and the residual distortion region is an image region that still has distortion characteristics after correction; The area proportion and the position distribution of the residual distortion region are calculated, if the area proportion exceeds a preset residual threshold, a fine correction sub-model in a second image correction model is called to perform secondary correction processing on the residual distortion region, a residual region correction result is generated, and the fine correction sub-model is a correction logic unit for processing residual distortion; The residual region correction result and the preliminary correction image are subjected to pixel-level fusion processing, the pixel data of the corresponding residual distortion region in the preliminary correction image is replaced, an optimized intermediate image is generated, and the pixel-level fusion processing is an image synthesis method of replacing pixel positions; The optimized intermediate image is subjected to global contrast adjustment and sharpening processing, image data with enhanced clarity is generated, and the image data with enhanced clarity is taken as a corrected image, and the corrected image is the final image data after the region splicing traces and the residual distortion region are eliminated; Before the image data with enhanced clarity is taken as the corrected image, it further includes: The image data with enhanced clarity is subjected to quality evaluation processing through a preset image quality evaluation index, the distortion elimination rate, the detail retention degree and the color fidelity of the image data with enhanced clarity are calculated, the distortion elimination rate is used to represent the proportion of the eliminated distortion region to the original distortion region, the detail retention degree is used to describe the degree of retaining the original image details of the corrected image, and the color fidelity is used to measure the consistency degree of the corrected image and the color of the real scene; It is judged whether the distortion elimination rate, the detail retention degree and the color fidelity all reach corresponding preset quality thresholds, the preset quality thresholds are the lowest quality standards set according to the image correction application scene, and different application scenes correspond to different preset quality thresholds; If all the corresponding preset quality thresholds are reached, the image data with the enhanced definition is determined as the corrected image; If at least one of the corresponding preset quality thresholds is not reached, the step of performing the overall optimization processing on the primary corrected image is returned to be executed until all the quality evaluation indexes reach the preset quality thresholds. 9.A camera image correction system based on artificial intelligence, characterized in that, Comprise: a processor; a storage device having a computer program stored thereon, when the computer program is executed by the processor, the processor implements the artificial intelligence-based camera image correction method according to any one of claims 1-8.
Citation Information
Patent Citations
Distortion image correction method based on optical imaging
CN120374466A
Image geometric distortion intelligent control method based on machine vision and image projector
CN120897041A