Camera image correction method and system based on artificial intelligence

By using an AI-based camera image correction method, distortion patterns and degrees are identified and adaptively updated, solving the problems of cumbersome and poor generalization ability in traditional methods, and achieving high-quality image correction in different scenarios.

CN121074348AActive Publication Date: 2025-12-05SHENZHEN KEYITAI OPTOELECTRONICS CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202511603992.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-05
Publication Date
2025-12-05
Estimated Expiration
2045-11-05

AI Technical Summary

Technical Problem

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.

Method used

An AI-based camera image correction method is adopted. By acquiring the image to be corrected, a trained image correction model is used to identify the distortion pattern and degree, adaptively update the correction strategy and parameters, generate an adaptive image correction model, and perform distortion correction.

Benefits of technology

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.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121074348A_ABST
    Figure CN121074348A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a camera image correction method and system based on artificial intelligence, and the method comprises the steps: obtaining a to-be-corrected camera image which is collected by a camera and contains a distortion region, inputting the to-be-corrected camera image into a trained first image correction model, recognizing the distortion mode and degree in the image, and obtaining a corrected image; and obtaining distortion state characteristics describing the distortion area form and distribution characteristics. And then, according to the distortion state characteristics, calling an adaptive correction strategy and parameters to carry out adaptive updating on the first image correction model, and obtaining a second image correction model after correction logic adjustment. And finally, performing distortion correction processing on the image by using the second image correction model to obtain a corrected image after the distortion region is eliminated. In this way, the image can be accurately corrected in different scenes, the model generalization ability is improved, overfitting is avoided, and the image quality and usability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The embodiment of the application relates to the technical field of image correction, and particularly relates to a camera image correction method and system based on artificial intelligence. BACKGROUND

[0002] In the field of image application today, the use of cameras is extremely widespread, but the images collected by the cameras often have distortion problems, which seriously affect the quality of the images and subsequent analysis and application. In the prior art, there are many methods for camera image correction. Early methods are mainly based on traditional optical principles and geometric transformations, and complex mathematical models are established to describe the rules of image distortion and correct them. These methods require accurate measurement and calibration of the optical parameters of the camera, which is tedious and has high requirements for the environment, and is greatly limited in actual application.

[0003] With the development of computer technology, some existing technologies can use machine learning for image correction. These technologies collect a large amount of image data for training, so that the model learns the characteristics and correction rules of image distortion. However, traditional machine learning models can usually only handle a set type of distortion and scene, and have poor generalization ability for complex and variable actual situations, which is prone to overfitting, resulting in unstable correction effect in different scenes. SUMMARY

[0004] The embodiment of the application provides a camera image correction method and system based on artificial intelligence.

[0005] In a first aspect, the embodiment of the application provides a camera image correction method based on artificial intelligence, applied to a camera image correction system based on artificial intelligence, and the method comprises the following steps: obtaining a camera image to be corrected, wherein the camera image to be corrected is 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 the distortion mode and degree existing in the camera image to be corrected through the first image correction model, obtaining a distortion state feature, and the distortion state feature is used to describe the morphological features and distribution features of the distortion region in the camera image to be corrected; adapting the correction strategy and parameters according to the distortion state feature to perform adaptive updating on the first image correction model, obtaining a second image correction model, and the second image correction model is an image correction model after adjusting the correction logic based on the distortion state feature; performing distortion correction processing on the camera image to be corrected by using the second image correction model, and obtaining a corrected image, wherein the corrected image is image data after eliminating the distortion region.

[0006] In a second aspect, an embodiment of the present application provides a camera image correction system based on artificial intelligence, comprising: a processor; a storage device having a computer program stored thereon, When the computer program is executed by the processor, the processor implements any of the camera image correction methods based on artificial intelligence.

[0007] An embodiment of the present application provides a readable storage medium, the readable storage medium has a program or instructions stored thereon, the program or instructions are executed by a processor to implement the steps of the camera image correction method based on artificial intelligence.

[0008] An embodiment of the present application improves the quality and adaptability of camera image correction. First, by obtaining the camera image to be corrected and inputting the trained first image correction model, the distortion mode and degree existing in the image can be accurately identified, and the distortion state feature describing the shape and distribution characteristics of the distortion region is obtained. The above-mentioned accurate identification capability makes the subsequent correction process more targeted, compared with the traditional method, the distortion problem in the image can be more accurately located, and the excessive processing of normal region or the insufficient processing of distortion region is avoided.

[0009] Secondly, according to the distortion state feature, the adaptive updating of the first image correction model is called to obtain the second image correction model, and the adaptive updating mechanism enhances the flexibility and universality of the model, so that the model can be dynamically adjusted according to different distortion conditions. When facing complex and variable actual scenes, such as different light conditions, shooting angles and lens characteristics, the model can automatically adjust the correction logic, avoid the problem of poor correction effect caused by scene difference, effectively improve the generalization ability of the model, and reduce the risk of overfitting.

[0010] Finally, the second image correction model is used for distortion correction processing of the camera image to be corrected, and a corrected image after eliminating the distortion region is obtained. The above-mentioned high-precision correction processing significantly improves the quality and usability of the image. For example, in the fields of security monitoring, industrial detection, medical imaging, etc., the corrected image can clearly display the target information, which can be used to improve the accuracy and efficiency of decision-making. BRIEF DESCRIPTION OF DRAWINGS

[0011] Figure 1 A flowchart of a camera image correction method based on artificial intelligence provided by an embodiment of the present application.

[0012] Figure 2 A schematic diagram of the basic structure of a camera image correction system based on artificial intelligence provided by an embodiment of the present application. DETAILED DESCRIPTION

[0013] In order to make the above objectives, characteristics and advantages of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below with reference to the drawings and specific embodiments.

[0014] Referring to Figure 1 As shown in the figure, the figure is a flow chart of a camera image correction method based on artificial intelligence provided by an embodiment of the present application, and the method can be applied to a camera image correction system based on artificial intelligence. As shown in the figure, Figure 1 As shown in the figure, the method exemplarily includes steps 110-140.

[0015] Step 110: obtaining a camera image to be corrected, the camera image to be corrected being image data containing a distortion region collected by a camera.

[0016] In the camera image correction scene, first, the camera image to be corrected is obtained. When the camera collects the image, due to the optical characteristics of the lens, the installation angle and other factors, the collected image may appear distortion. For example, in an indoor security monitoring scene, the camera installed in the corner may collect an image with edge distortion, stretching and other distortion phenomena. Through the image collection device of the camera, the image data is collected according to the preset sampling frequency and resolution to obtain the camera image to be corrected containing the distortion region. The image data is stored in digital form and contains the gray value or color value information of multiple pixels, which constitutes the basic features of the image.

[0017] Step 120: inputting the camera image to be corrected into a trained first image correction model, identifying the distortion mode and degree existing in the camera image to be corrected through the first image correction model, and obtaining a distortion state feature, the distortion state feature being used to describe the morphological features and distribution features of the distortion region in the camera image to be corrected.

[0018] The obtained camera image to be corrected is input into the trained first image correction model. The model is trained based 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 levels and modules inside, which can determine the distortion patterns and degrees in the image through feature extraction, analysis and judgment of the input image. For example, for radial distortion, the model can determine whether it is inward or outward, and the severity of the distortion is slight, moderate or severe. The obtained distortion state features include the shape features of the distortion region, such as circular, elliptical or irregular shape, and the distribution features, such as the position distribution of the distortion region in the image, whether it is concentrated on the image edge or scattered throughout the image.

[0019] Step 121: input the camera image to be corrected into the image blocking layer of the first image correction model, and perform uniform grid division processing on the camera image to be corrected to generate a plurality of image block units, each image block unit containing a preset number of pixel points.

[0020] After the camera image to be corrected enters the image blocking layer of the first image correction model, it will be processed by uniform grid division. The image blocking layer divides the entire image into a plurality of image block units of the same size according to the preset grid size and division rule. Each image block unit contains a certain number of pixel points, and the preset number is determined according to the design of the model and actual needs. For example, in indoor security monitoring images, the image blocking layer may divide the image into a plurality of small square image block units, each unit containing a certain number of pixels, which can simplify complex image data for subsequent individual analysis and processing of each image block unit. Through the above blocking processing, the features of different regions in the image can be more carefully mined, and the accuracy of the model in identifying distortion can be improved.

[0021] Step 122: perform edge contour detection processing on each image block unit to extract the edge contour features of each image block unit, and the edge contour features are used to describe the boundary features of the change in pixel gray value in the image block unit.

[0022] After generating the plurality of image block units, edge contour detection processing is performed on each image block unit. The edge contour detection is performed by a set algorithm to find regions in the image block unit where the pixel grayscale values change significantly. These regions constitute the edge contour of the image block unit. For example, in a certain image block unit of an indoor security monitoring image, there can be edges of objects or boundaries of regions of different colors, and the pixel grayscale values of these regions change significantly. Through the edge contour detection algorithm, these edge contours can be extracted to obtain the edge contour features of each image block unit. These features are represented in the form of pixel coordinates and grayscale value change information, reflecting the shape and boundary conditions of the objects in the image block unit, which is very important for identifying distortion because distortion often causes changes in the edge contour of the image.

[0023] 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 correlation analysis processing to generate global contour correlation features of the camera image to be corrected. The global contour correlation features are used to describe the edge connection relationship between different image block units.

[0024] 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 correlation analysis processing on these edge contour features. In an indoor security monitoring image, different image block units can have edge connection relationships, such as the edges of adjacent image block units can 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, compares information such as pixel coordinates and grayscale value change trends, and determines the edge connection conditions between different image block units. For example, if the edge contours of two adjacent image block units have a predetermined continuity in pixel coordinates and similar grayscale value change trends, they can be considered to be connected. Through the above cross-block feature correlation analysis, global contour correlation features are generated, which reflect the overall edge structure of the entire camera image to be corrected and can be used to more comprehensively identify the distortion pattern and degree in the image.

[0025] Step 124: call the distortion identification layer of the first image correction model to perform distortion pattern classification processing on the global contour correlation features to identify the distortion pattern and degree present in the camera image to be corrected, and obtain distortion state features that describe the shape features and distribution features of the distorted regions in the camera image to be corrected.

[0026] Optionally, the distortion identification layer of the first image correction model classifies the global contour associated features into different distortion patterns. The distortion identification layer contains multiple classification algorithms and rules, which determine the distortion pattern and degree in the image by analyzing and judging the global contour associated features. For example, for radial distortion, the distortion identification layer determines whether it is a concave or convex distortion and the severity of the distortion according to the bending degree and symmetry of the edges in the global contour associated features. For tangential distortion, it is determined according to the inclination degree and distortion of the edges. Through the above classification process, the distortion state features are obtained. The distortion state features include the shape features of the distortion region, such as whether the distortion region is circular, elliptical or irregular, and the distribution features, such as the specific position distribution of the distortion region in the image, whether it is concentrated in a corner of the image or scattered in multiple regions.

[0027] Step 130: According to the distortion state features, the adaptive update of the first image correction model is performed by calling the adaptive correction strategy and parameters, and the second image correction model is obtained. The second image correction model is an image correction model adjusted based on the correction logic of the distortion state features.

[0028] Further, according to the obtained distortion state features, the adaptive update of the first image correction model is required by calling the adaptive correction strategy and parameters. Different distortion state features correspond to different correction strategies and parameters. For example, in the indoor security monitoring image, if the distortion state features show that there is a serious radial distortion in the image, the correction strategy and corresponding parameters for radial distortion need to be called. These correction strategies and parameters are stored in a preset database, and the most suitable correction strategy and parameters are selected from the database according to the specific information of the distortion state features. These adaptive correction strategies and parameters are applied to the first image correction model to adjust the correction logic of the model, including adjusting the processing mode and parameter setting of each level and module in the model, and finally obtaining the second image correction model. The second image correction model can better correct the distortion of the current camera image to be corrected.

[0029] Step 131: The distortion state features are input into a preset strategy matching library, and the feature matching degree between the distortion state features and the multiple candidate correction strategies stored in the strategy matching library is calculated. The strategy matching library is a database containing correction strategies corresponding to different distortion types, and the feature matching degree is used to represent the adaptation degree of the distortion state features and the candidate correction strategies.

[0030] It can be understood that the strategy matching library is a pre-constructed database in which correction strategies corresponding to different distortion types are stored. The correction strategies are summarized from a large number of experiments and experience, and different distortion modes and degrees have different processing methods. In indoor security monitoring images, the strategy matching library may include correction strategies for different distortion types such as radial distortion, tangential distortion, and mixed distortion. By calculating the feature matching degree of the distortion state feature and the feature of multiple candidate correction strategies in the strategy matching library, it is determined which candidate correction strategy is most suitable for the current distortion condition. The calculation of the feature matching degree is based on the comparison of the related features of the distortion state feature and the candidate correction strategy, for example, comparing the type, degree, distribution characteristics, and other information of the distortion. The higher the matching degree, the more suitable the candidate correction strategy is for the current distortion state feature.

[0031] Step 132: Select the candidate correction strategy with the highest matching degree from the strategy matching library as the target correction strategy according to 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.

[0032] After calculating the feature matching degree of the distortion state feature 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 according to the feature matching degree. In indoor security monitoring images, if it is calculated that a certain candidate correction strategy for radial distortion has the highest matching degree with the current distortion state feature, then the 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 operations such as radial stretching or contraction of the image, and corresponding parameter settings such as the amplitude, center position, etc. of stretching or contraction.

[0033] Step 133: Call the parameter adjustment rule corresponding to the target correction strategy, and perform preliminary adjustment processing on the correction parameters of the first image correction model based on the distribution characteristics in the distortion state feature, to obtain an intermediate image correction model after parameter adjustment.

[0034] In the embodiments of the present application, the parameter adjustment rules corresponding to the target correction strategy are called, and these rules are formulated according to 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 the indoor security monitoring image, according to the distribution characteristics in the distortion state features, such as the position distribution and area proportion of the distortion region in the image, the correction parameters of the first image correction model are preliminarily adjusted. For example, if the distortion region is mainly concentrated in the edge of the image, then the parameters related to the edge correction in the model can be adjusted, such as the amplitude of edge stretching or contraction, the weight of correction, etc. Through the above preliminary adjustment, the intermediate image correction model after parameter adjustment is obtained, which has been optimized to a certain extent according to the current distortion situation, but may still need further adjustment.

[0035] Step 1331: Extract the distribution characteristics of the distortion region from the distortion state features, the distribution characteristics including the position distribution and area proportion of the distortion region in the camera image to be corrected, the position distribution being used to describe the coordinate range of the distortion region, and the area proportion being used to describe the proportional relationship between the pixel number of the distortion region and the total pixel number of the image.

[0036] In the indoor security monitoring image, by analyzing the related information in the distortion state features, the position distribution and area proportion of the distortion region in the image are determined. The position distribution is described by the coordinate range, for example, the distortion region can be located at the upper left corner of the image, and its coordinate range can be represented by the minimum and maximum values of the pixel coordinates. The area proportion refers to the proportional relationship between the pixel number of the distortion region and the total pixel number of the image, which is calculated by counting the pixel number in the distortion region and the total pixel number of the image. These distribution characteristics reflect the specific situation of the distortion region in the image.

[0037] Step 1332: Determine the distortion dense region in the camera image to be corrected according to the position distribution, and calculate the distortion severity index of the distortion dense region based on the area proportion, the distortion severity index being positively correlated with the area proportion.

[0038] In the indoor security monitoring image, if the positions of the distortion regions are relatively concentrated in a local area of the image, that is, multiple distortion regions are close to or overlap with each other, then this area can be determined as the distortion dense region. Then, the distortion severity index of the distortion dense region is calculated based on the area proportion. Since the distortion severity index is positively correlated with the area proportion, that is, the larger the area proportion, the higher the distortion severity index. For example, if the area proportion of the distortion dense region is large, it means that the distortion in this region is relatively serious, and the corresponding distortion severity index will also be high. By calculating this index, the distortion situation of the distortion dense region can be more quantitatively understood.

[0039] Step 1333: Call the parameter adjustment rule corresponding to the target correction strategy, and perform hierarchical adjustment processing on the correction intensity parameter of the first image correction model according to the distortion severity index to generate a preliminary adjusted correction parameter set, wherein the correction intensity parameter is used to control the magnitude of distortion correction.

[0040] In the indoor security monitoring image, the correction intensity parameter of the first image correction model is hierarchically adjusted according to the distortion severity index. If the distortion severity index is high, the correction intensity parameter is appropriately increased to correct the distortion to a greater extent; if the distortion severity index is low, the correction intensity parameter is reduced to avoid over-correction. For example, for radial distortion, if the distortion severity index is high, the magnitude of radial stretching or contraction can be increased; if the index is low, the magnitude is reduced. Through the above hierarchical adjustment processing, a preliminary adjusted correction parameter set is generated, which is the result of optimizing the model correction intensity according to the current distortion condition and contains the specific values of multiple correction parameters.

[0041] Step 1334: Input the preliminary adjusted correction parameter set 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 a parameter-adjusted intermediate image correction model, wherein the parameter update interface is a functional interface for modifying internal parameters of the model.

[0042] Optionally, the preliminary adjusted correction parameter set is input into the parameter update interface of the first image correction model. The parameter update interface is a functional interface specially designed in the model to modify internal parameters. In the indoor security monitoring image, through this interface, each parameter value in the preliminary adjusted correction parameter set is replaced with the original correction parameter in the first image correction model. For example, the adjusted radial stretching magnitude, edge correction weight, and other parameter values are replaced with the original parameter values. After parameter replacement, a parameter-adjusted intermediate image correction model is obtained, and the correction parameters of the intermediate image correction model have been preliminarily optimized according to the current distortion condition.

[0043] Step 1335: Perform performance testing processing on the intermediate image correction model, use a preset test image set to evaluate the correction effect of the intermediate image correction model, and generate a correction effect evaluation index, wherein the correction effect evaluation index is used to describe the ability of the intermediate image correction model to eliminate distortion regions, and the correction effect evaluation index includes distortion elimination rate and image detail retention degree.

[0044] In this step, the intermediate image correction model after parameter adjustment is tested for performance. A set of pre-set test images are used, which contain different types and degrees of distortion images, similar to the actual camera images to be corrected. In indoor security monitoring images, these test images are input into the intermediate image correction model for correction, and then the corrected results are evaluated. Through evaluation, a correction effect evaluation index is generated, including distortion elimination rate and image detail retention degree. The distortion elimination rate reflects the ability of the model to eliminate distortion areas, and is calculated by comparing the area changes of the distortion areas in the images before and after correction. The image detail retention degree reflects the ability of the model to retain the original details of the image during the correction process, and is evaluated by analyzing the similarity of the texture, edge and other detail features of the corrected image with the original image.

[0045] Step 1336: Determine whether the correction effect evaluation index meets the pre-set termination condition, which is that the distortion elimination rate in the correction effect evaluation index reaches the pre-set elimination threshold and the image detail retention degree reaches the pre-set retention threshold.

[0046] Optionally, it is determined whether the correction effect evaluation index meets the pre-set termination condition. In indoor security monitoring images, the pre-set termination condition is that the distortion elimination rate reaches the pre-set elimination threshold and the image detail retention degree reaches the pre-set retention threshold. These thresholds are determined according to actual application requirements and experience, for example, the elimination threshold of the distortion elimination rate can be set to a higher value to ensure that most of the distortion is eliminated, and the retention threshold of the image detail retention degree is also set to a suitable value to ensure that the details of the corrected image are well retained. By comparing the distortion elimination rate and the image detail retention degree with the corresponding thresholds, if both meet the requirements, it means 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.

[0047] 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, return to execute the step of extracting the distribution characteristics of the distortion areas from the distortion state characteristics until the correction effect evaluation index meets the termination condition.

[0048] 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 the indoor security monitoring image, that is, the model can already well correct the current distortion condition, and while eliminating distortion, sufficient image details are retained. If the correction effect evaluation index does not meet the termination condition, return to perform the step of extracting the distribution feature of the distortion region from the distortion state feature, reanalyze the distribution of the distortion region, and adjust the correction parameters of the model again according to the distortion severity, and iteratively optimize until the correction effect evaluation index meets the termination condition. Through the above iterative adjustment, the correction effect of the model can be continuously optimized.

[0049] Step 140: performing distortion correction processing on the camera image to be corrected using the second image correction model to obtain a corrected image, the corrected image being image data after eliminating the distortion region.

[0050] In this step, the second image correction model optimized is used to perform distortion correction processing on the camera image to be corrected. In the indoor security monitoring image, the second image correction model will correct the distortion region in the image according to the previously adjusted correction logic and parameters. The model will perform a series of processing operations on the image, such as stretching, shrinking, rotating, and other transformations on the distortion region, to eliminate distortion. At the same time, it will try to retain the details of the image and avoid over-correction that leads to image distortion. Through these processing steps, the corrected image is finally obtained, which eliminates the distortion region in the original image, restores the normal form and detail information of the image, and is more consistent with the actual scene.

[0051] Step 141: inputting 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 the 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 the distribution density of the distortion region.

[0052] In the indoor security monitoring image, the region division layer divides the entire image into multiple correction regions according to the position distribution in the distortion state feature. Each correction region may contain one or more distortion regions, or may contain a non-distortion region. The size and number of correction regions are determined according to the distribution density of distortion regions. If the distortion regions are relatively dense, smaller correction regions can be divided to correct more finely; if the distortion regions are relatively sparse, larger correction regions can be divided to improve the efficiency of correction. For example, if the edge part of the image has more and denser distortion regions, the edge part can be divided into multiple small correction regions, and the middle part of the image has fewer distortions, which can be divided into a larger correction region.

[0053] Step 142: calling a corresponding regional correction sub-model in the second image correction model for targeted correction processing for each correction region to generate a regional correction result for each correction region, the regional correction sub-model being a correction logic unit configured according to the distortion type of the correction region.

[0054] Optionally, for each correction region, a corresponding regional correction sub-model in the second image correction model is called for targeted correction processing. In the indoor security monitoring image, different correction regions may have different types of distortion, such as radial distortion and tangential distortion. Each regional correction sub-model is configured according to the distortion type of the correction region and contains specific correction logic for the distortion type. For example, for a correction region with radial distortion, the called regional correction sub-model contains correction algorithms and corresponding parameter settings for radial stretching or contraction; for a correction region with tangential distortion, the called regional correction sub-model contains correction algorithms for tangential rotation or translation. By calling these regional correction sub-models, each correction region is individually corrected to generate a regional correction result for each correction region, which has been corrected to a certain extent.

[0055] Step 1421: obtaining a regional correction sub-model matching the distortion type of each correction region from the second image correction model, the regional correction sub-model containing correction algorithms and parameter configurations for the corresponding distortion type, and different distortion types corresponding to different regional correction sub-models.

[0056] Further, a region correction sub-model matching the distortion type of each correction region is obtained from the second image correction model. In indoor security monitoring images, according to the distortion type of each correction region, a suitable region correction sub-model is selected from the model. Each region correction sub-model contains a correction algorithm and parameter configuration corresponding to the distortion type. For example, for a correction region with radial distortion, the obtained region correction sub-model contains a radial distortion correction algorithm, such as correcting distortion by performing radial transformation on the position of the pixel point, and also contains corresponding parameter configurations, such as the amplitude of radial stretching or contraction, the center position, etc. Different distortion types correspond to different region correction sub-models, ensuring that the distortion of each correction region can be accurately corrected.

[0057] Step 1422: input the image data of the correction region into the corresponding region correction sub-model, and locate the set of distorted pixel points in the correction region through the distortion detection sub-model in the region correction sub-model, the set of distorted pixel points being a set of pixel point coordinates deviating from the normal pixel value range.

[0058] Optionally, the image data of the correction region is input into the corresponding region correction sub-model. In indoor security monitoring images, the distortion detection sub-model in the region correction sub-model will analyze the input image data and locate the set of distorted pixel points in the correction region. The distortion detection sub-model finds the pixel points deviating from the normal range by comparing the gray value or color value of the pixel point with the normal pixel value range. For example, if the gray value of a certain pixel point is significantly higher or lower than the normal range, or the color value is significantly different from the surrounding pixel points, then the pixel point can be considered as a distorted pixel point, and the coordinates of these distorted pixel points constitute the set of distorted pixel points. These distorted pixel points are accurately located.

[0059] Step 1423: according to the distribution density and gray value change trend of the set of distorted pixel points, call the pixel adjustment sub-model in the region correction sub-model to perform gray value correction and position adjustment processing on the set of distorted pixel points, generate corrected region pixel data, the gray value correction is used to adjust the brightness and color value of the distorted pixel point, and the position adjustment is used to correct the coordinate position of the distorted pixel point.

[0060] Further, according to the distribution density and the gray value change trend of the set of distorted pixel points, a pixel adjustment sub-model in the regional correction sub-model is called. In the indoor security monitoring image, if the distribution density of the set of distorted pixel points is high, it means that the distortion in this region is more serious and may need more substantial correction. The gray value change trend can reflect the type and degree of distortion. For example, if the gray value shows a gradually increasing or decreasing trend, it may indicate that there is stretching or shrinking distortion. The pixel adjustment sub-model will perform gray value correction and position adjustment processing on the set of distorted pixel points. The gray value correction adjusts the brightness and color value of the distorted pixel points to make them closer to the normal pixel value. The position adjustment corrects the coordinate position of the distorted pixel points according to the type and degree of distortion, for example, for radial distortion, the distorted pixel points are moved a predetermined distance towards the center or edge. Through these processes, the corrected regional pixel data is generated, so that the distortion in the correction region is preliminarily corrected.

[0061] Step 1424: Perform local contrast enhancement processing on the corrected regional pixel data to compensate for the loss of image detail information in the correction process, and generate a regional correction result containing corrected pixel data and detail enhancement information, the detail enhancement information being used to describe the enhanced image detail features.

[0062] In the embodiment of the present application, local contrast enhancement processing is performed on the corrected regional pixel data. In the indoor security monitoring image, some image detail information may be lost in the process of correcting the distorted pixel points, resulting in a blurred image. Local contrast enhancement processing highlights the image detail features by adjusting the contrast of local regions of the image. For example, for texture, edges and other detail parts in the image, the contrast difference with the surrounding area is increased. Through the above processing, the loss of image detail information in the correction process can be compensated, and a regional correction result containing corrected pixel data and detail enhancement information is generated. The detail enhancement information describes the enhanced image detail features, such as the clarity of texture and the sharpness of edges, so that the corrected image is clearer and more realistic.

[0063] Step 143: Input the regional correction results of all correction regions into the regional fusion layer of the second image correction model for edge smoothing processing and regional consistency adjustment to generate a preliminary correction image, the preliminary correction image being the image data obtained by splicing the corrected regions.

[0064] Further, the region correction results of all the correction regions are input into a region fusion layer of the second image correction model. In the indoor security monitoring image, the region fusion layer performs edge smoothing processing and region consistency adjustment on the region correction results. The edge smoothing processing can eliminate the edge difference between different correction regions, so that the image transition at the splicing position is more natural. The region consistency adjustment can unify the color space parameters and brightness distribution characteristics of each correction region, so that the color and brightness of the entire image are more coordinated. For example, the edge transition is made smoother by performing weighted average processing on the edge pixels of adjacent correction regions, and the color and brightness of each region are made consistent by adjusting the color channel parameters and brightness values of different correction regions. Through these processes, the preliminary correction image is generated, which is obtained by splicing the correction results of each correction region and preliminarily restores the overall shape of the image.

[0065] Step 1431: Extract edge pixel data of each region correction result, the edge pixel data being a set of pixel values at the boundary of the correction region.

[0066] Optionally, the edge pixel data is extracted from each region correction result. In the indoor security monitoring image, the edge pixel data refers to a set of pixel values at the boundary of the correction region, and these edge pixel data reflect the pixel characteristics of the boundary of the correction region, which is very important for subsequent edge smoothing processing. By scanning the region correction result row by row and column by column, the pixel points located at the boundary of the correction region are found, and the gray value or color value information thereof is recorded to form the edge pixel data. These data contain the detailed information of the boundary of the correction region, such as the gray value change of the edge and the color transition.

[0067] 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 being used to describe the inconsistency degree of the edges of adjacent regions, and the element value in the edge difference matrix being in positive correlation with the difference degree.

[0068] In the embodiment of the present application, the gray value difference and gradient direction difference of the edge pixel data of adjacent correction regions are calculated. In the indoor security monitoring image, the edge difference matrix is generated by comparing the gray values and gradient directions of the edge pixels of adjacent correction regions. The gray value difference can be obtained by calculating the gray value difference of adjacent edge pixels, and the gradient direction difference can be obtained by analyzing the gray value change direction of the edge pixels. For example, if the gray value difference of the edge pixels of two adjacent correction regions is large or the gradient direction difference is obvious, it indicates that the inconsistency degree of the edges of the two regions is high. The element value in the edge difference matrix is in positive correlation with the difference degree, and the larger the element value is, the greater the difference between the edges of adjacent regions is. By generating the edge difference matrix, the inconsistency of the edges of adjacent regions can be quantified.

[0069] Step 1433: Determine the edge region needing smoothing according to the edge difference matrix, and call the edge smoothing algorithm in the region fusion layer to perform weighted average processing on the pixel values of the edge region, and the weight of the weighted average processing is adjusted according to the element value in the edge difference matrix.

[0070] In the embodiment of the application, the edge region needing smoothing is determined according to the edge difference matrix. In the indoor security monitoring image, the region with a larger element value in the edge difference matrix represents a higher degree of inconsistency of the adjacent region edges, and these regions are the edge regions needing smoothing. The edge smoothing algorithm in the region fusion layer is called to perform weighted average processing on the pixel values of these edge regions. The weight of the weighted average processing is adjusted according to the element value in the edge difference matrix, and the larger the element value is, the lower the weight is. For example, for the region with a larger edge difference, the weight of the edge pixel of the region is reduced, and the weight of the edge pixel of the adjacent region is increased, so that the edge transition is more natural. Through the above weighted average processing, the difference between the adjacent region edges is reduced, and the image splicing place is smoother.

[0071] Step 1434: Perform color consistency adjustment on all the corrected regions after smoothing, unify the color space parameters and brightness distribution characteristics of each region, and generate a color-balanced spliced image, and the color space parameters include the color gamut range and color channel configuration.

[0072] Optionally, color consistency adjustment is performed on all the corrected regions after smoothing. In the indoor security monitoring image, different corrected regions may have differences in color space parameters and brightness distribution characteristics, resulting in uncoordinated color and brightness of the spliced image. The color consistency adjustment adjusts the color space parameters such as the color gamut range and the color channel configuration, and the brightness distribution characteristics of each corrected region, so that the color and brightness of the entire image are more balanced. For example, the color of different regions is made more consistent by gain adjustment of the color channels of each corrected region, and the brightness distribution of each region is made uniform by adjusting the brightness value. Through these adjustments, a color-balanced spliced image is generated, and the overall quality of the image is improved.

[0073] Step 1435: Take the color-balanced spliced image as the initial corrected image, and the initial corrected image contains complete image data after region correction and edge smoothing processing.

[0074] The color-balanced spliced image after color consistency adjustment is taken as the preliminary corrected image. In the indoor security monitoring image, the preliminary corrected image contains complete image data after regional correction and edge smoothing processing, and the distortion in the image is eliminated to a certain extent, and the transition between different correction regions is more natural, and the colors are more coordinated. However, there may still be some residual distortion and splicing marks that need to be further optimized.

[0075] Step 144: performing overall optimization processing on the preliminary corrected image to eliminate the region splicing marks and residual distortion regions, and obtaining a corrected image.

[0076] In the indoor security monitoring image, although the preliminary corrected image has been subjected to regional correction and edge smoothing processing, there may still be some region splicing marks and residual distortion regions. The overall optimization processing includes secondary correction of the residual distortion regions and global contrast adjustment, sharpening processing, etc. For example, by detecting the residual distortion regions again, more precise correction is performed; by adjusting the global contrast of the image, the clarity of the image is enhanced; by sharpening processing, the edges and details of the image are highlighted. Through these processing steps, the final corrected image is obtained, which is clearer and more realistic, meeting the requirements of the actual scene.

[0077] Step 1441: performing residual distortion detection processing on the preliminary corrected image, scanning each pixel region in the preliminary corrected image by using a preset distortion recognition algorithm, locating the residual distortion regions that are not completely eliminated, and the residual distortion regions are image regions that still have distortion characteristics after correction.

[0078] Optionally, the preliminary corrected image is subjected to residual distortion detection processing. In the indoor security monitoring image, each pixel region in the preliminary corrected image is scanned using a preset distortion recognition algorithm. The distortion recognition algorithm analyzes the gray value, color value, edge feature, etc. of the pixels to determine whether the region has distortion characteristics. For example, if the pixel gray value distribution of a certain region is uneven, or the edge has a distortion phenomenon, it may indicate that the region has residual distortion. By scanning the entire preliminary corrected image, the residual distortion regions that are not completely eliminated are located, and these residual distortion regions are image regions that still have distortion characteristics after correction and need to be further corrected.

[0079] Step 1442: calculating the area ratio and position distribution of the residual distortion regions, and if the area ratio exceeds a preset residual threshold, invoking a fine correction sub-model in the second image correction model for secondary correction processing of the residual distortion regions to generate a residual region correction result, and the fine correction sub-model is a correction logic unit for processing residual distortion.

[0080] In the indoor security monitoring image, the area ratio is calculated by counting the number of pixels in the residual distortion area and the total number of pixels in the image. The position distribution is determined by recording the pixel coordinate range of the residual distortion area. If the area ratio exceeds the preset residual threshold, it means that the residual distortion is relatively serious and needs to be further corrected. At this time, the fine correction sub-model in the second image correction model is called to perform secondary correction processing on the residual distortion area. The fine correction sub-model is specially designed for processing residual distortion and contains more fine correction algorithms and parameter configurations. For example, for the residual small distortion, a more accurate pixel adjustment algorithm can be used for correction. Through the secondary correction processing, the residual area correction result is generated to further eliminate the residual distortion.

[0081] Step 1443: Perform pixel-level fusion processing on the residual area correction result and the initial correction image to replace the pixel data of the corresponding residual distortion area in the initial correction image, and generate an optimized intermediate image. The pixel-level fusion processing is an image synthesis method of replacing pixel positions.

[0082] In the embodiment of the present application, the residual area correction result and the initial correction image are subjected to pixel-level fusion processing. In the indoor security monitoring image, the pixel-level fusion processing is an image synthesis method of replacing pixel positions. The pixel data in the residual area correction result replaces the pixel data of the corresponding residual distortion area in the initial correction image. For example, if the residual distortion area is located at the upper left corner of the image, the pixel data of the corrected area replaces the pixel data at the corresponding position of the upper left corner of the initial correction image. Through the above replacement, the result of the secondary correction is integrated into the initial correction image to generate an optimized intermediate image, which further eliminates the residual distortion to a certain extent and improves the quality of the image.

[0083] Step 1444: Perform global contrast adjustment and sharpening processing on the optimized intermediate image to generate image data with enhanced clarity. The image data with enhanced clarity is used as the corrected image, which is the final image data after eliminating the area splicing traces and residual distortion area.

[0084] Optionally, the optimized intermediate image is subjected to global contrast adjustment and sharpening processing. In indoor security monitoring images, global contrast adjustment enhances the clarity of the image by adjusting the overall contrast of the image. For example, increasing the contrast difference between the bright and dark parts of the image makes the image more vivid. Sharpening processing highlights the contours and textures of the image by enhancing the edges and details of the image. For example, the edge pixels of the image are enhanced to make them more sharp. Through these processes, the image data with enhanced clarity is generated as the corrected image, which eliminates the region stitching traces and residual distortion areas, achieves good correction effect, and is more consistent with the real situation of the actual scene.

[0085] Step 1445: The quality of the image data with enhanced clarity is evaluated by a preset image quality evaluation index, and the distortion elimination rate, detail retention degree and 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 area to the original distortion area. The detail retention degree is used to describe the degree of retaining the original image details in the corrected image. The color fidelity is used to measure the consistency of the corrected image with the color of the real scene.

[0086] Further, the quality of the image data with enhanced clarity is evaluated using a preset image quality evaluation index. In indoor security monitoring images, the distortion elimination rate, detail retention degree and color fidelity of the image data with enhanced clarity are calculated. The distortion elimination rate is calculated by comparing the area size of the distortion area in the corrected image and the original image, and the proportion of the eliminated distortion area to the original distortion area is calculated. The detail retention degree is evaluated by analyzing the similarity of the texture, edge and other detail features of the corrected image with the original image, for example, by comparing the high frequency components of the images to judge the retention of details. The color fidelity is measured by comparing the similarity of the color of the corrected image with the color of the real scene, for example, by analyzing the numerical value and distribution of the color channel. Through the calculation of these indexes, the quality of the corrected image can be comprehensively evaluated.

[0087] Step 1446: It is judged whether the distortion elimination rate, detail retention degree and color fidelity all reach the corresponding preset quality threshold. The preset quality threshold is the minimum quality standard set according to the image correction application scene, and different application scenes correspond to different preset quality thresholds.

[0088] In this step, it is determined whether the distortion removal rate, the detail retention, and the color fidelity all meet the corresponding preset quality threshold. In indoor security monitoring images, the preset quality threshold is the minimum quality standard set according to the image correction application scene. Different application scenes have different requirements for image quality. For example, for a security monitoring scene, more attention may be paid to the distortion removal rate and the detail retention to ensure that objects in the image can be clearly identified; for an artistic photography scene, more attention may be paid to the color fidelity to restore the true color atmosphere. If the distortion removal rate, the detail retention, and the color fidelity all meet the corresponding preset quality threshold, it indicates that the quality of the corrected image meets the requirements; if any of them does not meet the threshold, further optimization is needed.

[0089] Step 1447: If all meet the corresponding preset quality threshold, the image data with enhanced sharpness is determined as the corrected image; if at least one does not meet the corresponding preset quality threshold, the step of performing overall optimization processing on the preliminary corrected image is returned to be executed until all quality evaluation indexes meet the preset quality threshold.

[0090] If the distortion removal rate, the detail retention, and the color fidelity all meet the corresponding preset quality threshold, the image data with enhanced sharpness is determined as the corrected image. In indoor security monitoring images, that is, the corrected image has met the quality requirements of the application scene and can be used for subsequent image analysis and application. If at least one does not meet the corresponding preset quality threshold, the step of performing overall optimization processing on the preliminary corrected image is returned to be executed. The preliminary corrected image is reprocessed for residual distortion detection, secondary correction, global contrast adjustment, and sharpening, and the like, for iterative optimization until all quality evaluation indexes meet the preset quality threshold, so as to ensure that a high-quality corrected image is finally obtained.

[0091] As a non-limiting embodiment, the method further comprises: Step 210: performing contour comparison processing on the corrected image and the distortion region morphological features described in the distortion state features to generate image data to be labeled, the image data to be labeled being comparison data containing corrected image pixel data and original distortion region contour information.

[0092] The corrected image is compared with the morphological features of the distortion region described in the distortion state feature. In indoor security monitoring images, the edge contours of the corrected image are compared with the morphological features of the original distortion region to find the differences between them. For example, whether there are still abnormal contours similar to the original distortion region morphology in the corrected image is excavated. Through the above comparison process, the to-be-labeled image data is generated, which contains the pixel data of the corrected image and the contour information of the original distortion region. The to-be-labeled image data is stored in a set format, and the pixel values of the corrected image and the contour coordinates of the original distortion region and other information are combined together.

[0093] Step 211: Perform region contour matching analysis on the to-be-labeled image data, and locate the regions in the corrected image that have morphological differences with the original distortion region contour as potential residual distortion regions, which are a set of image regions that still have distortion features after correction.

[0094] The to-be-labeled image data is subjected to region contour matching analysis. In indoor security monitoring images, by comparing the contours of each region in the corrected image with the contours of the original distortion region, regions with morphological differences are found, which may be potential residual distortion regions that still have distortion features after correction. During the analysis process, factors such as the shape, size, and position of the contour are considered, and the similarity or difference between the contours is calculated to determine the potential residual distortion region. For example, if the contour of a certain region has obvious similarity in shape with the contour of the original distortion region, but there are differences in position or size, then this region can be marked as a potential residual distortion region. Through the above region contour matching analysis, the potential residual distortion region can be more accurately located.

[0095] 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, which is used to describe the pixel value deviation degree and boundary irregularity of the potential residual distortion region.

[0096] The gray value distribution feature and the edge gradient feature of the potential residual distortion region are extracted. In the indoor security monitoring image, the gray value distribution feature reflects the distribution of the pixel values in the potential residual distortion region, which is obtained by counting the frequency distribution of the gray values of the pixels in the region. The edge gradient feature reflects the irregularity of the boundary of the region, which is obtained by calculating the gray value change rate of the edge pixels. For example, if the gray value of the edge pixel changes sharply, it means that the boundary irregularity is high. The gray value distribution feature and the edge gradient feature are combined to generate a residual distortion feature vector. The feature vector is in the form of a numerical vector, and each element corresponds to a feature index, which is used to describe the pixel value deviation and boundary irregularity of the potential residual distortion region. By analyzing the residual distortion feature vector, the characteristics of the potential residual distortion region can be better understood.

[0097] Step 213: input the residual distortion feature vector into the preset labeling rule library, call the labeling template matched with the residual distortion feature vector to perform structured labeling processing on the potential residual distortion region, and generate a residual distortion labeling result containing the position coordinates, shape category and confidence index of the residual distortion region. The residual distortion labeling result is a set of labeling data used to describe the distortion region that is not completely eliminated in the corrected image.

[0098] The residual distortion feature vector is input into the preset labeling rule library. The labeling rule library stores a plurality of labeling templates, each of which corresponds to a set residual distortion feature vector. In the indoor security monitoring image, by comparing the residual distortion feature vector with the templates in the labeling rule library, the labeling template with the highest matching degree is found. Then, the labeling template is called to perform structured labeling processing on the potential residual distortion region. During the labeling process, the position coordinates of the residual distortion region are recorded, and the specific position of the residual distortion region in the image is determined by the pixel coordinates; the shape category is determined, such as circular, elliptical, irregular shape, etc.; at the same time, a confidence index is given to represent the reliability of the labeling. Through the above structured labeling processing, the residual distortion labeling result is generated, which is stored in a structured data form and contains a plurality of labeling information used to describe the distortion region that is not completely eliminated in the corrected image.

[0099] In yet another non-limiting embodiment, the method further comprises: Step 310: obtaining the residual distortion labeling result, mapping the position coordinates of the residual distortion region in the residual distortion labeling result with the pixel coordinate system of the corrected image to generate residual region pixel mapping data, and the residual region pixel mapping data is a set of accurate pixel coordinates of the residual distortion region in the corrected image.

[0100] In the indoor security monitoring image, the residual distortion region position coordinates in the residual distortion annotation result are mapped to the pixel coordinate system of the corrected image. Since the position coordinates in the residual distortion annotation result can be relative coordinates or other forms of coordinate representation, they need to be converted to accurate coordinates in the pixel coordinate system of the corrected image. Through a preset coordinate conversion algorithm, the position coordinates of the residual distortion region are mapped to the pixel coordinate system according to the size, resolution and other information of the corrected image, to generate residual region pixel mapping data, which contains accurate pixel coordinates of the residual distortion region in the corrected image.

[0101] Step 311: performing density clustering analysis on the residual region pixel mapping data to identify the clustering distribution characteristics of the residual distortion region, and generating a residual distribution density matrix, which is used to describe the clustering degree of residual distortion pixels in different image regions, and the matrix element value is positively correlated with the clustering degree.

[0102] The residual region pixel mapping data is subjected to density clustering analysis, and the clustering region of residual distortion pixels is found out by analyzing the pixel coordinate distribution of the residual distortion region. The density clustering algorithm will divide adjacent pixels with high density into a cluster according to the distance and density relationship between pixels. Through the above analysis, the clustering distribution characteristics of the residual distortion region are identified. Then, a residual distribution density matrix is generated according to the clustering distribution characteristics. Each element of the matrix corresponds to a region in the image, and the element value represents the clustering degree of residual distortion pixels in the region. The larger the element value, the higher the clustering degree of residual distortion pixels in the region. Through the residual distribution density matrix, the distribution of the residual distortion region in the image can be more clearly understood.

[0103] Step 312: performing correlation analysis on the residual distribution density matrix and the correction parameter set of the second image correction model to determine the model parameters associated with the high-value region in the residual distribution density matrix as the parameters to be adjusted, which are the model internal parameters affecting the correction effect of the corresponding region.

[0104] The residual distribution density matrix and the correction parameter set of the second image correction model are subjected to correlation analysis. In the indoor security monitoring image, by analyzing the relationship between the high-value region in the residual distribution density matrix and the model correction parameters, the model parameters associated with the high-value region are found out, which can be the key factors affecting the correction effect of the corresponding region. For example, if the value of a certain region in the residual distribution density matrix is high, it means that the residual distortion of the region is serious, which can be related to the correction strength parameter in the model for the region, the weight of the correction algorithm, etc. Through correlation analysis, these associated model parameters are determined as the parameters to be adjusted, which are important internal parameters of the model and have a direct impact on the correction effect of the corresponding region.

[0105] Step 313: calling preset parameter fine-tuning rules, performing gradient adjustment processing on the to-be-adjusted parameters based on the aggregation distribution characteristics in the residual distribution density matrix, and generating a third image correction model after parameter fine-tuning, the third image correction model being an updated model used to improve the elimination effect of residual distortion in image correction.

[0106] In the indoor security monitoring image, the determined to-be-adjusted parameters are subjected to gradient adjustment processing according to the aggregation distribution characteristics in the residual distribution density matrix. Gradient adjustment is a step-by-step optimization method, and the parameters are adjusted by a small amount according to the severity and distribution of the residual distortion. For example, if the value of a certain region in the residual distribution density matrix is high, the correction intensity parameter corresponding to the region is appropriately increased. Through the above gradient adjustment, the correction parameters of the model are continuously optimized, and a third image correction model after parameter fine-tuning is generated. The third image correction model after optimization can better improve the elimination effect of residual distortion in image correction, and further improve the quality of the image.

[0107] The embodiments of the present application improve the quality and adaptability of camera image correction. First, by obtaining the to-be-corrected camera image and inputting the trained first image correction model, the distortion mode and degree existing in the image can be accurately identified, and the distortion state features describing the shape and distribution characteristics of the distortion region are obtained. The above accurate identification capability makes the subsequent correction process more targeted, and compared with the traditional method, the distortion problem in the image can be more accurately located, and the over-processing of the normal region or the insufficient processing of the distortion region is avoided.

[0108] Secondly, the second image correction model is obtained by calling the adaptive correction strategy and parameters according to the distortion state features to adaptively update the first image correction model. The adaptive updating mechanism enhances the flexibility and universality of the model, so that the model can be dynamically adjusted according to different distortion conditions. When facing complex and variable actual scenes, such as different light conditions, shooting angles and lens characteristics, the model can automatically adjust the correction logic, avoid the problem of poor correction effect caused by scene difference, effectively improve the generalization ability of the model, and reduce the risk of overfitting.

[0109] Finally, the second image correction model is used to perform distortion correction processing on the to-be-corrected camera image, and a corrected image after eliminating the distortion region is obtained. The above high-precision correction processing significantly improves the quality and usability of the image. For example, in the fields of security monitoring, industrial detection, medical imaging, etc., the corrected image can clearly display the target information, and can be used to improve the accuracy and efficiency of decision-making.

[0110] Reference Figure 2As shown in the figure, the figure is a schematic diagram of a basic structure of an artificial intelligence-based camera image correction system 200 provided by an embodiment of the application, and the artificial intelligence-based camera image correction system 200 comprises: a processor 201; a storage device 202, which stores a computer program 2020 thereon; When the computer program 2020 is executed by the processor 201, the processor 201 implements any of the artificial intelligence-based camera image correction methods.

[0111] On the basis of the above, a readable storage medium is provided, and the readable storage medium stores a program or instructions thereon, and the program or instructions are executed by a processor to implement the steps of the above method.

[0112] It should be noted that the embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the system or device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be referred to the method part.

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, which is image data containing a distortion area collected by a camera; inputting the camera image to be corrected into a trained first image correction model, identifying the distortion mode and degree existing in the camera image to be corrected through the first image correction model, and obtaining a distortion state feature, which is used to describe the morphological features and distribution features of the distortion area in the camera image to be corrected; according to the distortion state feature, calling an adaptive correction strategy and parameter to adaptively update the first image correction model, obtaining a second image correction model, which is an image correction model after adjusting the correction logic based on the distortion state feature; using the second image correction model to perform distortion correction processing on the camera image to be corrected, and obtaining a corrected image, which is image data after eliminating the distortion area.

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 the distortion mode and degree existing in the camera image to be corrected through 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 of which contains 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, which are used to describe the boundary features of the pixel gray value change in the image block unit; inputting the edge contour features of all image block units into a feature fusion layer of the first image correction model for cross-block feature correlation analysis processing, and generating global contour correlation features of the camera image to be corrected, which are used to describe the edge connection relationship between different image block units; calling a distortion recognition layer of the first image correction model to perform distortion mode classification processing on the global contour correlation features, identifying the distortion mode and degree existing in the camera image to be corrected, and obtaining a distortion state feature used to describe the morphological features and distribution features of the distortion area in the camera image to be corrected.

3. The method of claim 1, wherein, The step of according to the distortion state feature, calling an adaptive correction strategy and parameter to adaptively update the first image correction model, and obtaining a second image correction model, comprises the following steps: inputting the distortion state feature into a preset strategy matching library, calculating the feature matching degree of the distortion state feature and a plurality of candidate correction strategies stored in the strategy matching library, the strategy matching library being a database containing correction strategies corresponding to different distortion types, and the feature matching degree being used to represent the adaptation degree of the distortion state feature and the candidate correction strategy; according to the feature matching degree, selecting the candidate correction strategy with the highest matching degree from the strategy matching library as a target correction strategy, the target correction strategy being a correction logic used to process the distortion type corresponding to the current distortion state feature. Call the parameter adjustment rule corresponding to the target correction strategy, and perform initial adjustment processing on the correction parameter of the first image correction model based on the distribution feature in the distortion state feature, to obtain an intermediate image correction model after parameter adjustment.

4. The method of claim 3, wherein, The calling the parameter adjustment rule corresponding to the target correction strategy, and performing initial adjustment processing on the correction parameter of the first image correction model based on the distribution feature in the distortion state feature, to obtain an intermediate image correction model after parameter adjustment, comprises: extracting a distribution feature of the distortion region from the distortion state feature, the distribution feature comprising a position distribution and an area proportion of the distortion region in the camera image to be corrected, the position distribution being used to describe the coordinate range of the distortion region, and the area proportion being used to describe the proportional relationship between the number of pixels of the distortion region and the total number of pixels of the image; determining a distortion dense region in the camera image to be corrected according to the position distribution, and calculating a distortion severity index of the distortion dense region based on the area proportion, the distortion severity index being positively correlated with the area proportion; calling the parameter adjustment rule corresponding to the target correction strategy, and performing hierarchical adjustment processing on the correction strength parameter of the first image correction model according to the distortion severity index, to generate a set of initial adjusted correction parameters, the correction strength parameter being used to control the amplitude of distortion correction; inputting the set of initial adjusted correction parameters into a parameter update interface of the first image correction model to replace the original correction parameters in the first image correction model, to obtain an intermediate image correction model after parameter adjustment, the parameter update interface being a functional interface for modifying internal parameters of the model.

5. The method of claim 4, wherein, After the set of initial adjusted correction parameters is input into the parameter update interface of the first image correction model to replace the original correction parameters in the first image correction model, to obtain an intermediate image correction model after parameter adjustment, the method further comprises: performing performance test processing on the intermediate image correction model, using a preset test image set to evaluate the correction effect of the intermediate image correction model, to generate a correction effect evaluation index, the correction effect evaluation index being used to describe the ability of the intermediate image correction model to eliminate distortion regions, and the correction effect evaluation index comprising a distortion elimination rate and an image detail retention degree; determining whether the correction effect evaluation index meets a preset termination condition, the termination condition being 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, determining the intermediate image correction model as a second image correction model; if the correction effect evaluation index does not meet the termination condition, returning to the step of extracting the distribution feature of the distortion region from the distortion state feature, until the correction effect evaluation index meets the termination condition.

6. The method of claim 1, wherein, The distortion correction processing on the camera image to be corrected using the second image correction model to obtain a corrected image comprises: The camera image to be corrected is input into a region division layer of the second image correction model, and the camera image to be corrected is divided into a plurality of correction regions according to the position distribution in the distortion state feature, each correction region containing at least one distortion region or non-distortion region, the size and number of the correction regions being determined according to the distribution density of the distortion regions; Each correction region calls a corresponding regional correction sub-model in the second image correction model for targeted correction processing, to generate a regional correction result of each correction region, the regional correction sub-model being a correction logic unit configured according to the distortion type of the correction region; The regional correction results of all correction regions are input into a regional fusion layer of the second image correction model for edge smoothing processing and regional consistency adjustment, to generate a preliminary correction image, the preliminary correction image being image data obtained by splicing the correction regions after correction; The preliminary correction image is subjected to overall optimization processing to eliminate regional splicing traces and residual distortion regions, to obtain a corrected image.

7. The method of claim 6, wherein, The method for calling a corresponding regional correction sub-model in the second image correction model for targeted correction processing of each correction region, to generate a regional correction result of each correction region, includes: A regional correction sub-model matching the distortion type of each correction region is obtained from the second image correction model, the regional correction sub-model containing a correction algorithm and parameter configuration corresponding to the distortion type, different distortion types corresponding to different regional correction sub-models; Image data of the correction region is input into the corresponding regional correction sub-model, and a distortion pixel point set in the correction region is located by a distortion detection sub-model in the regional correction sub-model, the distortion pixel point set being a pixel coordinate set deviating from a normal pixel value range; According to the distribution density and gray value change trend of the distortion pixel point set, a pixel adjustment sub-model in the regional correction sub-model is called to perform gray value correction and position adjustment processing on the distortion pixel point set, to generate corrected regional pixel data, the gray value correction being used to adjust the brightness and color value of the distortion pixel point, and the position adjustment being used to correct the coordinate position of the distortion pixel point; The corrected regional pixel data is subjected to local contrast enhancement processing to compensate for lost image detail information in the correction process, to generate a regional correction result containing corrected pixel data and detail enhancement information, the detail enhancement information being used to describe enhanced image detail features.

8. The method of claim 7, wherein, The method for inputting the regional correction results of all correction regions into a regional fusion layer of the second image correction model for edge smoothing processing and regional consistency adjustment, to generate a preliminary correction image, includes: Edge pixel data of each regional correction result is extracted, the edge pixel data being a pixel value set at a boundary of the correction region; Gray value difference and gradient direction difference of edge pixel data of adjacent correction regions are calculated, to generate an edge difference matrix, the edge difference matrix being used to describe the inconsistency degree of adjacent region edges, an element value in the edge difference matrix being in a positive correlation relationship with the difference degree; According to the edge difference matrix, an edge region needing smoothing processing is determined, an edge smoothing algorithm in the region fusion layer is called to perform weighted average processing on pixel values of the edge region, and weights of the weighted average processing are adjusted according to element values in the edge difference matrix; Color consistency adjustment is performed on all the corrected regions after the smoothing processing, color space parameters and brightness distribution characteristics of the regions are unified, and a color-balanced spliced image is generated, the color space parameters including a color gamut range and a 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 region correction and edge smoothing processing.

9. The method of claim 8, wherein, The preliminary correction image is subjected to overall optimization processing to eliminate region splicing traces and residual distortion regions, and a corrected image is obtained, including: Residual distortion detection processing is performed on the preliminary correction image, each pixel region in the preliminary correction image is scanned through a preset distortion recognition algorithm, residual distortion regions that are not completely eliminated are located, and the residual distortion regions are image regions that still have distortion characteristics after correction; Area proportions and position distributions of the residual distortion regions are calculated, if the area proportions exceed 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 regions, a residual region correction result is generated, and the fine correction sub-model is a correction logic unit for processing residual distortion; Pixel-level fusion processing is performed on the residual region correction result and the preliminary correction image to replace pixel data of corresponding residual distortion regions in the preliminary correction image, an optimized intermediate image is generated, and the pixel-level fusion processing is an image synthesis method of replacement according to pixel positions; Global contrast adjustment and sharpening processing are performed on the optimized intermediate image, image data with enhanced clarity is generated, and the image data with enhanced clarity is taken as the corrected image, and the corrected image is final image data after elimination of region splicing traces and residual distortion regions; Before the image data with enhanced clarity is taken as the corrected image, further including: Quality evaluation processing is performed on the image data with enhanced clarity through a preset image quality evaluation index, distortion elimination rates, detail retention degrees and color fidelity of the image data with enhanced clarity are calculated, the distortion elimination rates are used to represent proportions of eliminated distortion regions relative to original distortion regions, the detail retention degrees are used to describe degrees of retention of original image details in the corrected image, and the color fidelity is used to measure a consistent degree of the corrected image and a real scene color; It is judged whether the distortion elimination rates, the detail retention degrees and the color fidelity all reach corresponding preset quality thresholds, the preset quality thresholds are minimum quality standards set according to image correction application scenarios, and different application scenarios correspond to different preset quality thresholds; If all the preset quality thresholds are reached, the image data with enhanced clarity is determined as the corrected image. If there is at least one item that does not reach the corresponding preset quality threshold, returning to perform the step of performing overall optimization processing on the preliminary correction image until all quality evaluation indexes reach the preset quality threshold.

10. An artificial intelligence-based camera image correction system, characterized by, Comprise: a processor; a storage device having a computer program stored thereon, when the computer program is executed by the processor, so that the processor implements the artificial intelligence-based camera image correction method according to any one of claims 1-9.

Citation Information

Patent Citations

  • Correction method and device of image distortion, electronic equipment and storage medium

    CN108932698A

  • Distortion image correction method based on optical imaging

    CN120374466A

  • Projection curtain image reconstruction method and system combined with distortion correction, and medium

    CN120563379A

  • Image geometric distortion intelligent control method based on machine vision and image projector

    CN120897041A

  • Image optimization

    US20240161245A1