Image correction method, device, computer equipment and storage medium

By identifying and correcting the mutation interval in the lens distortion image, the mutation of the correction result caused by the denominator value being 0 is avoided, the accuracy of image correction is improved, and the problem of low correction accuracy in the existing technology is solved.

CN118096607BActive Publication Date: 2024-09-24ZHUHAI OUYEEL SEMICON CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311762661.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-20
Publication Date
2024-09-24
Estimated Expiration
2043-12-20

AI Technical Summary

Technical Problem

Existing lens distortion correction technology cannot effectively avoid sudden changes in calculation results, resulting in low accuracy of distortion image correction.

Method used

By obtaining the target optical center distance of the image to be corrected, generate the curve to be processed, determine the points to be processed, calculate the derivative value, identify the mutation starting point and ending point, calculate the geometric features, meet the mutation interval conditions, perform correction, and avoid the denominator value being 0 The resulting image correction result changes suddenly, and the correction accuracy is improved through the interpolation algorithm.

Benefits of technology

It improves the correction accuracy of distorted images, avoids sudden changes in correction results, ensures data accuracy, and significantly improves the final image correction effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118096607B
    Figure CN118096607B
Patent Text Reader

Abstract

The present application relates to an image correction method, device, computer equipment and storage medium. The method comprises: obtaining the target optical center distance corresponding to the image to be corrected and the image to be corrected; determining the reference point from the points to be processed based on the comparison result between the derivative values ​​of each point to be processed calculated by the curve to be processed, and determining the mutation start point and the mutation end point from the points to be processed in turn, wherein the reference point is located between the mutation start point and the mutation end point; if the relationship between the geometric features of the line between the mutation start point and the mutation end point, the derivative value of the mutation start point and the derivative value of the mutation end point satisfies the mutation interval condition, then the interval between the mutation start point and the mutation end point that satisfies the mutation interval condition is used as the target mutation interval; based on the corrected target curve obtained by correcting the curve to be processed of the target mutation interval and the distortion correction model, the target corrected image is corrected by correcting the image to be corrected. The use of this method can improve the accuracy of correcting distorted images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, computer equipment and storage medium for image correction. Background Art

[0002] When shooting images, the manufacturing precision of the lens and the deviation of the installation operation will cause imaging distortion, resulting in image distortion. In order to correct the imaging of the lens, more and more lens image distortion correction technologies have emerged. However, the existing distortion correction technology cannot avoid the situation where the calculation results suddenly change when the distortion correction is performed on the distorted image, resulting in low accuracy in correcting the distorted image. Summary of the invention

[0003] Based on this, it is necessary to provide an image correction method, device, computer equipment and storage medium that can accurately correct distorted images in response to the above technical problems, thereby improving the accuracy of correcting distorted images.

[0004] In a first aspect, the present application provides an image correction method. The method comprises:

[0005] Acquire an image to be corrected, acquire a target optical center distance corresponding to the image to be corrected, generate a curve to be processed based on the target optical center distance and a distortion correction model, and determine a plurality of points to be processed from the curve to be processed. The target optical center distance is used to characterize the distance from some standard points corresponding to some distortion points in the image to be corrected to the optical center point. The some standard points refer to points after some distortion points are initially corrected by the distortion correction model.

[0006] Based on the curve to be processed, the derivative value corresponding to each point to be processed is calculated, and based on the comparison results between the derivative values ​​corresponding to each point to be processed, a reference point is determined from the points to be processed, and the mutation start point and the mutation end point are determined from the points to be processed respectively, and the reference point is located between the mutation start point and the mutation end point;

[0007] Calculate the geometric features of the line between the mutation start point and the mutation end point. If the relationship between the geometric features, the derivative value corresponding to the mutation start point and the derivative value corresponding to the mutation end point satisfies the mutation interval condition, then take the interval between the mutation start point and the mutation end point that satisfies the mutation interval condition as the target mutation interval;

[0008] The to-be-processed curve corresponding to the target mutation interval is corrected to obtain a corrected target curve. Based on the target curve and the distortion correction model, the to-be-corrected image is corrected to obtain a target corrected image.

[0009] In one embodiment, obtaining the target optical center distance corresponding to the image to be corrected includes:

[0010] Determine a first distortion point set from the image to be corrected, where the first distortion point set includes coordinate information of each vertex and coordinate information of a midpoint of each edge of the image to be corrected;

[0011] Based on the coordinate information of each distortion point in the first distortion point set and the distortion correction model, determine the coordinate information of the standard point corresponding to each distortion point in the first distortion point set to obtain a first standard point set;

[0012] The first distance between each standard point in the first standard point set and the optical center point is calculated, and the largest first distance is used as the target optical center distance.

[0013] In one embodiment, the geometric feature includes the slope of a straight line connecting a mutation start point and a mutation end point; if the relationship between the geometric feature, the derivative value corresponding to the mutation start point, and the derivative value corresponding to the mutation end point satisfies the mutation interval condition, then the interval between the mutation start point and the mutation end point that satisfies the mutation interval condition is taken as the target mutation interval including:

[0014] If the derivative value corresponding to the mutation start point is less than or equal to the slope of the line, and the derivative value corresponding to the mutation end point is greater than or equal to the slope of the line, then the interval between the mutation start point and the mutation end point is taken as the target mutation interval; or,

[0015] If the derivative value corresponding to the mutation starting point is greater than or equal to the slope of the straight line, and the derivative value corresponding to the mutation ending point is less than or equal to the slope of the straight line, the interval between the mutation starting point and the mutation ending point is taken as the target mutation interval.

[0016] In one embodiment, correcting the to-be-processed curve corresponding to the target mutation interval to obtain the corrected target curve includes:

[0017] If the number of to-be-processed points in the target mutation interval is greater than or equal to a preset number, an interpolation curve is generated based on a preset interpolation algorithm and curve information of the to-be-processed curve other than the curve corresponding to the target mutation interval, and a second distortion point set is determined from the image to be corrected, where the second distortion point set includes coordinate information of each point on each edge of the image to be corrected;

[0018] Based on the second distortion point set, the interpolation curve and the distortion correction model, coordinate information of the standard points corresponding to each distortion point in the second distortion point set is determined to obtain the second standard point set;

[0019] Calculate the second distance between each standard point in the second standard point set and the optical center point, take the largest second distance as the update distance, generate an updated curve to be processed based on the update distance and the distortion correction model, and determine a plurality of updated points to be processed from the updated curve to be processed;

[0020] An update mutation starting point and an update mutation ending point are determined from multiple update points to be processed, an interval between the update mutation starting point and the update mutation ending point is used as the update mutation interval, and a corrected target curve is generated based on a preset interpolation algorithm and curve information in the update curve to be processed except for the curve corresponding to the update mutation interval.

[0021] In one embodiment, based on the second distortion point set, the interpolation curve and the distortion correction model, the coordinate information of the standard points corresponding to each distortion point in the second distortion point set is determined, and the second standard point set is obtained, including:

[0022] Based on the coordinate information of each distortion point in the second distortion point set, calculating the distance to be analyzed between each distortion point in the second distortion point set and the optical center point;

[0023] If the distance to be analyzed is within the range of the target mutation interval, the coordinate information of the standard point corresponding to the distortion point is calculated based on the coordinate information of the distortion point corresponding to the distance to be analyzed and the interpolation curve;

[0024] If the distance to be analyzed is outside the range of the target mutation interval, the coordinate information of the standard point corresponding to the distortion point is calculated based on the coordinate information of the distortion point corresponding to the distance to be analyzed and the distortion correction model;

[0025] Based on the coordinate information of the standard points corresponding to each distorted point in the second distorted point set, a second standard point set is obtained.

[0026] In one embodiment, based on the target curve and the distortion correction model, the image to be corrected is corrected to obtain a target corrected image corresponding to the image to be corrected, including:

[0027] Obtaining a set of standard points to be processed, and calculating the distance between each standard point in the set of standard points to be processed and the optical center point to be processed; the coordinate information of each standard point in the set of standard points to be processed is obtained by determining the area to be corrected within the area represented by the second set of standard points, and calculating based on the preset correction resolution information corresponding to the area to be corrected;

[0028] If the optical center distance to be processed is within the update mutation interval, the distortion point corresponding to the standard point in the image to be corrected is determined based on the coordinate information of the standard point corresponding to the optical center distance to be processed and the target curve, and the pixel value corresponding to the distortion point is used as the pixel value of the standard point;

[0029] If the optical center distance to be processed is not within the update mutation interval, based on the coordinate information of the standard point corresponding to the optical center distance to be processed and the distortion correction model, the distortion point corresponding to the standard point in the image to be corrected is determined, and the pixel value corresponding to the distortion point is used as the pixel value of the standard point;

[0030] Based on the coordinate information and pixel value of each standard point in the standard point set to be processed, a target corrected image corresponding to the area to be corrected is generated.

[0031] In one embodiment, the method further comprises:

[0032] If the number of points to be processed in the target mutation interval is less than the preset number, a set of standard points to be processed is obtained, and the coordinate information of each standard point in the set of standard points to be processed is determined by determining the area to be corrected within the area represented by the second set of standard points, based on the preset correction resolution information corresponding to the area to be corrected;

[0033] Based on the coordinate information of each standard point in the standard point set to be processed and the distortion correction model, the distortion point corresponding to each standard point in the standard point set to be processed is determined, and the pixel value corresponding to the distortion point is used as the pixel value of the standard point;

[0034] Based on the coordinate information and pixel value of each standard point in the standard point set to be processed, a target corrected image corresponding to the area to be corrected is generated.

[0035] In a second aspect, the present application also provides an image correction device. The device comprises:

[0036] An acquisition module is used to acquire an image to be corrected, acquire a target optical center distance corresponding to the image to be corrected, generate a curve to be processed based on the target optical center distance and a distortion correction model, and determine a plurality of points to be processed from the curve to be processed. The target optical center distance is used to characterize the distance from some standard points corresponding to some distortion points in the image to be corrected to the optical center point. The some standard points refer to points after some distortion points are initially corrected by the distortion correction model.

[0037] A derivative module is used to calculate the derivative value corresponding to each point to be processed based on the curve to be processed, determine the reference point from the points to be processed based on the comparison results between the derivative values ​​corresponding to the points to be processed, and determine the mutation start point and the mutation end point from the points to be processed respectively, and the reference point is located between the mutation start point and the mutation end point;

[0038] A judgment module is used to calculate the geometric features of the line between the mutation starting point and the mutation ending point. If the relationship between the geometric features, the derivative value corresponding to the mutation starting point and the derivative value corresponding to the mutation ending point meets the mutation interval condition, the interval between the mutation starting point and the mutation ending point that meets the mutation interval condition is used as the target mutation interval;

[0039] The correction module is used to correct the to-be-processed curve corresponding to the target mutation interval to obtain a corrected target curve, and based on the target curve and the distortion correction model, correct the to-be-corrected image to obtain a target corrected image.

[0040] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in the above method when executing the computer program.

[0041] A computer-readable storage medium stores a computer program, which implements the steps in the above method when executed by a processor.

[0042] The above-mentioned image correction method, device, computer equipment and storage medium obtain an image to be corrected, obtain a target optical center distance corresponding to the image to be corrected, generate a curve to be processed based on the target optical center distance and the distortion correction model, and determine multiple points to be processed from the curve to be processed. The target optical center distance is used to characterize the distance from some standard points corresponding to some distortion points in the image to be corrected to the optical center point. The some standard points refer to the points after the initial correction of some distortion points through the distortion correction model; based on the curve to be processed, the derivative values ​​corresponding to each point to be processed are calculated, based on the comparison results between the derivative values ​​corresponding to each point to be processed, the reference point is determined from the point to be processed, and the mutation starting point and the mutation ending point are determined from the point to be processed respectively, and the reference point is located between the mutation starting point and the mutation ending point; the geometric features of the line between the mutation starting point and the mutation ending point are calculated, and if the geometric features, If the relationship between the derivative value corresponding to the mutation starting point and the derivative value corresponding to the mutation ending point satisfies the mutation interval condition, the interval between the mutation starting point and the mutation ending point that satisfies the mutation interval condition is taken as the target mutation interval; the to-be-processed curve corresponding to the target mutation interval is corrected to obtain the corrected target curve; based on the target curve and the distortion correction model, the to-be-corrected image is corrected to obtain the target corrected image, thereby avoiding the situation in which the denominator value corresponding to the distortion correction model is 0 during the distortion correction process, resulting in a mutation in the image correction result; and in the process of determining the mutation interval corresponding to the distortion correction model, the accuracy of the data is controlled layer by layer to ensure the accuracy of the data ultimately used to correct the image to be corrected, so that the final corrected image has a better effect, thereby greatly improving the accuracy of correcting the distorted image. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] FIG1 is a diagram of an application environment of an image correction method in one embodiment;

[0044] Figure 2 is a schematic diagram of a flow chart of an image correction method in an embodiment;

[0045] Figure 3 A schematic diagram of distortion correction data in one embodiment;

[0046] Figure 4 A schematic diagram of a model curve in one embodiment;

[0047] Figure 5 A schematic diagram of correction effect comparison in one embodiment;

[0048] Figure 6 is a structural block diagram of an image correction device in one embodiment;

[0049] FIG7 is a diagram showing the internal structure of a computer device in one embodiment;

[0050] FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0051] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0052] The image correction method provided in the embodiment of the present application can be applied to the application environment as shown in Figure 1. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 is used to obtain the image to be corrected, obtain the target optical center distance corresponding to the image to be corrected, generate a curve to be processed based on the target optical center distance and the distortion correction model, and determine a plurality of points to be processed from the curve to be processed. The target optical center distance is used to characterize the distance from some standard points corresponding to some distorted points in the image to be corrected to the optical center point. Some standard points refer to points after the initial correction of some distorted points through the distortion correction model; based on the curve to be processed, the derivative values ​​corresponding to each point to be processed are calculated, and based on the comparison results between the derivative values ​​corresponding to each point to be processed, the reference point is determined from the point to be processed, and the reference points are determined from the points to be processed in turn. The reference point is located between the mutation starting point and the mutation ending point; the geometric features of the line between the mutation starting point and the mutation ending point are calculated; if the relationship between the geometric features, the derivative value corresponding to the mutation starting point and the derivative value corresponding to the mutation ending point satisfies the mutation interval condition, the interval between the mutation starting point and the mutation ending point that satisfies the mutation interval condition is used as the target mutation interval; the to-be-processed curve corresponding to the target mutation interval is corrected to obtain a corrected target curve, and the to-be-corrected image is corrected based on the target curve and the distortion correction model to obtain a target corrected image. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented as an independent server or a server cluster consisting of multiple servers.

[0053] In one embodiment, Figure 2 As shown, an image correction method is provided, which is described by taking the method applied to the server in FIG1 as an example, and includes the following steps:

[0054] Step S200, obtain the image to be corrected, obtain the target optical center distance corresponding to the image to be corrected, generate a curve to be processed based on the target optical center distance and the distortion correction model, and determine multiple points to be processed from the curve to be processed. The target optical center distance is used to characterize the distance from some standard points corresponding to some distorted points in the image to be corrected to the optical center point. Some standard points refer to points after initial correction of some distorted points through the distortion correction model.

[0055] The image to be corrected refers to the distorted image captured by the lens. The target optical center distance refers to the maximum distance from the partial standard points corresponding to the partial distortion points in the image to be corrected to the optical center point; the partial distortion points here can be the midpoints of each vertex and each edge in the image to be corrected, and the partial standard points refer to the points after the initial correction of each partial distortion point based on the distortion correction model. The distortion correction model refers to a model used to correct the distorted image, which can be a model in which the denominator may be equal to 0, for example, the distortion correction model can be but is not limited to ,in, is the distance from the standard point to the optical center. The curve to be processed refers to the curve corresponding to the interval from zero to the target optical center distance based on the distortion correction model. The target optical center distance corresponds to the independent variable in the distortion correction model. The point to be processed refers to the point on the curve to be processed; it can be a point selected at equal distances from the curve to be processed.

[0056] Specifically, in order to find out the mutation interval generated when the denominator of the distortion correction model is 0, some distortion points can be first determined from the image to be corrected, and based on the distortion correction model and the coordinate information corresponding to the distortion points, the coordinate information of some standard points corresponding to the distortion points can be calculated, and based on the coordinate information of each standard point in the standard points and the coordinate information of the optical center, the distance between each standard point in the standard points and the optical center can be calculated, and the maximum distance can be used as the target optical center distance. Among them, the coordinate information of the distortion point needs to be converted from the pixel coordinates of the pixel point corresponding to the distortion point in the image to be corrected, that is, the coordinate information of the distortion point is not the pixel coordinate, but the coordinate information of the preset plane coordinate system, which is equivalent to the conversion from the pixel coordinate (u, v) to the plane coordinate (x, y). The preset plane coordinate system can be a plane coordinate system generated based on the camera intrinsic parameters corresponding to the image to be corrected; in addition, the relevant formula for calculating the coordinate information of the standard point based on the distortion correction model and the coordinate information of the distortion point can be seen in formula (1). In formula (1), Represents the coordinate information of the distortion point, Represents the coordinate information of the standard point. represents the distortion correction model, About and The relationship is used to characterize the distance from the standard point to the optical center. When the coordinate information of the distortion point is known, the coordinate information of the standard point can be solved based on the distortion correction model and the coordinate information of the distortion point through an iterative method or a solution method, thereby obtaining the coordinate information of some standard points corresponding to the initial correction.

[0057]

[0058] Furthermore, in order to determine the mutation interval generated when the denominator of the distortion correction model is 0, so as to include the range of the distance from the standard point to the optical center point corresponding to the distortion point in the image to be corrected as much as possible, a processing curve corresponding to the distance from zero to the target optical center can be drawn based on the distortion correction model, and multiple processing points can be equally divided from the processing curve. The more processing points there are, the higher the accuracy of determining the mutation starting point and the mutation ending point from the processing points. However, since the more processing points there are, the computing power of the corresponding data analysis is too large. Therefore, the specific number of processing points can be determined by actual needs, and 1024 processing points can be equally divided from the processing curve.

[0059] Step S202, based on the curve to be processed, the derivative value corresponding to each point to be processed is calculated, based on the comparison results between the derivative values ​​corresponding to each point to be processed, a reference point is determined from the points to be processed, and the mutation start point and the mutation end point are determined from the points to be processed respectively, and the reference point is located between the mutation start point and the mutation end point.

[0060] The reference point is the point to be processed with the largest absolute value of the reference point guidance value, and is the point with the largest mutation. The mutation starting point refers to the starting point where the mutation occurs in the curve to be processed. The mutation ending point refers to the ending point where the mutation occurs in the curve to be processed.

[0061] Specifically, the derivative value of each point to be processed can reflect the degree of change of the curve at the location of the point to be processed. The derivative value of each point to be processed can be calculated based on the curve to be processed, and the point to be processed with the largest absolute value of the derivative value is used as a reference point. The larger the absolute value corresponding to the derivative value, the greater the degree of change of the curve at the location of the point to be processed, and the more likely it is that a mutation will occur, because when the denominator of the distortion correction model is 0, the dependent variable value of the distortion correction model will become very large or very small, resulting in a curve mutation. Furthermore, in order to confirm the interval of the mutation, and that the reference point and the processing point are both on the curve to be processed, the mutation start point and the mutation end point can be determined along the curve to be processed in the processing points on the curve to be processed on both sides of the reference point. The reference point can be used as the starting position, and then the processing point forward of the reference point is used as the mutation start point, and the processing point backward of the reference point is used as the mutation end point. Then, it is determined whether the interval between the mutation start point and the mutation end point is the target mutation interval. If not, the processing point forward of the mutation start point is used as the mutation start point, and the processing point backward of the mutation end point is used as the mutation end point. It is determined again whether the interval between the mutation start point and the mutation end point is the target mutation interval, and so on, until the target mutation interval of the curve to be processed is found. Among them, the forward direction refers to the direction toward the start of the coordinate axis, and the backward direction refers to the direction away from the coordinate axis, such as Figure 4 As shown in (a), Figure 4The dotted box in (a) is the curve part of the mutation. The direction to the left of the mutation, that is, the direction of the coordinate axis origin (0,0), is the forward direction, and the direction away from the coordinate axis origin (0,0) is the backward direction.

[0062] Step S204, calculate the geometric features of the line between the mutation starting point and the mutation ending point. If the relationship between the geometric features, the derivative value corresponding to the mutation starting point and the derivative value corresponding to the mutation ending point meets the mutation interval condition, then the interval between the mutation starting point and the mutation ending point that meets the mutation interval condition is used as the target mutation interval.

[0063] Among them, the geometric feature refers to the feature used to characterize the line between the mutation start point and the mutation end point, including the slope of the line between the mutation start point and the mutation end point. The mutation interval condition refers to the condition used to determine whether it belongs to the maximum mutation interval. The target mutation interval refers to the largest mutation interval that appears in the curve to be processed.

[0064] Specifically, in order to determine whether the interval between the currently selected mutation starting point and the mutation ending point is the target mutation interval corresponding to the curve to be processed, the slope of the straight line connecting the mutation starting point and the mutation ending point can be calculated first, and the slope of the straight line connecting the mutation starting point and the mutation ending point can be used as the geometric feature of the line. When the derivative value of the mutation starting point is less than or equal to the slope of the straight line, and the slope of the straight line is less than or equal to the derivative value of the mutation ending point, or when the derivative value of the mutation starting point is greater than or equal to the slope of the straight line, and the slope of the straight line is greater than or equal to the derivative value of the mutation ending point, it indicates that the relationship between the geometric feature, the derivative value corresponding to the mutation starting point, and the derivative value corresponding to the mutation ending point meets the mutation interval condition, and the interval between the mutation starting point and the mutation ending point that meets the mutation interval condition can be used as the target mutation interval on the curve to be processed.

[0065] Step S206, correcting the to-be-processed curve corresponding to the target mutation interval to obtain a corrected target curve, and correcting the to-be-corrected image based on the target curve and the distortion correction model to obtain a target corrected image corresponding to the to-be-corrected image.

[0066] The target curve refers to the correction curve obtained by interpolating the curve related to the distortion correction model. The target correction image refers to the image after the image to be corrected is corrected; it can be the image corresponding to the correction of only a certain area in the image to be corrected, while the other parts are not corrected. The specific area or area of ​​the image to be corrected can be determined according to specific needs.

[0067] Specifically, in order to avoid the situation that when correcting the image to be corrected, the data information calculated based on the distortion correction model of the target mutation interval is used as the data basis for correction, resulting in the final corrected target corrected image to appear as follows: Figure 5 In the case of (a), that is, when the denominator is 0 during the distortion correction model calculation, the corrected position of some image content is inconsistent with the actual position, resulting in the appearance of Figure 5 The image content in the white quadrilateral frame in (a) appears outside the white quadrilateral frame. The to-be-processed curve corresponding to the target mutation interval can be interpolated based on the interpolation algorithm to obtain an interpolated curve, wherein the curve interpolated for the mutation interval can be as follows: Figure 4 As shown, Figure 4 The horizontal axis in corresponds to the , the vertical axis corresponds to the , Figure 4 (a) can be the curve to be processed, where Figure 4 The dotted-line protrusion in (a) is the result mutation when the denominator of the distortion correction model is 0. Figure 4 (c) Figure 4 The enlarged view of the protrusion in (a) Figure 4 The two points in the dashed box in (b) are the mutation start point and mutation end point of the target mutation interval corresponding to the curve to be processed. The curve interpolated between the mutation start point and the mutation end point can be specifically as follows: Figure 4 As shown in (d), Figure 4 (d) Figure 4(b) is an enlarged view of the mutation part, and the horizontal smooth line between the mutation start point and the mutation end point is the interpolation curve; since the standard point for calculating the target optical center distance is also calculated based on the distortion correction model, it is possible that the denominator of the calculated distortion correction model is 0, making the coordinate information of the calculated standard point inaccurate; therefore, some distortion points can be selected from the image to be corrected again. In order to ensure that the curve for judging the mutation interval this time can characterize the points in the image to be corrected as much as possible, all distortion points on the edge of the image to be corrected can be selected, and the distance between each selected distortion point and the optical center point can be calculated. When the distance is within the range of the target mutation interval, based on the interpolation curve and the coordinate information of the distortion point, the coordinate information of the current standard point corresponding to the distortion point under the current iteration operation is calculated; when the distance is within the range of the target mutation interval, based on the distortion correction model and the coordinate information of the distortion point, the coordinate information of the current standard point corresponding to the distortion point under the current iteration operation is calculated. information, and the current standard point is used as the intermediate distortion point; continuously, the distance between the intermediate distortion point and the optical center point is calculated. When the distance between the intermediate distortion point and the optical center point is within the target mutation interval, the coordinate information of the standard point corresponding to the intermediate distortion point under the current iteration operation is calculated based on the interpolation curve and the coordinate information of the intermediate distortion point, and the calculated standard point is used as the intermediate distortion point; when the distance between the intermediate distortion point and the optical center point is not within the target mutation interval, the coordinate information of the standard point corresponding to the intermediate distortion point under the current iteration operation is calculated based on the distortion correction model and the coordinate information of the intermediate distortion point, and the calculated standard point is used as the intermediate distortion point, and so on, until the loop termination condition is met, and the coordinate information of the standard point corresponding to the intermediate distortion point when the loop termination condition is met is used as the coordinate information of the standard point corresponding to the distortion point, so that the accuracy of the coordinate information of the standard point corresponding to the distortion point at each edge of the image to be corrected is higher, providing a higher precision data basis for subsequent steps.

[0068] Furthermore, the distance between the standard point corresponding to the distortion point at each edge of the image to be corrected and the optical center point is calculated, the maximum distance is used as the update distance, and the updated curve to be processed is drawn based on the update distance and the distortion correction model. Similarly, the mutation interval in the updated curve to be processed is judged again, that is, a plurality of updated points to be processed are determined from the updated curve to be processed in equal parts, the derivative value of each updated point to be processed is calculated based on the updated curve to be processed, the updated point to be processed with the largest absolute value of the derivative value is used as the update reference point, and the update mutation starting point and the update mutation ending point are determined from the update points to be processed in turn, and the update reference point is between the update mutation starting point and the update mutation ending point The slope of the line connecting the update mutation starting point and the update mutation ending point is calculated. If the derivative value of the update mutation starting point is less than or equal to the slope of the line, and the slope of the line is less than or equal to the derivative value of the update mutation ending point, or if the derivative value of the update mutation starting point is greater than or equal to the slope of the line, and the slope of the line is greater than or equal to the derivative value of the update mutation ending point, then the interval between the update mutation starting point and the update mutation interval ending point is used as the update mutation interval; and based on the interpolation algorithm and the curve information of the updated curve except the curve corresponding to the update mutation interval, the curve corresponding to the update mutation interval is interpolated and used as the target curve; and from the second The area to be corrected is determined within the area represented by the standard point set, and the preset correction resolution information corresponding to the area to be corrected is obtained. The standard point set to be processed corresponding to the area to be corrected is determined based on the preset correction resolution information. Since the resolution of the area to be corrected after correction can be set, the coordinate information of each standard point after correction can be determined according to the resolution information of the area to be corrected. Therefore, the distance between each standard point in the standard point set to be processed and the optical center point can be calculated. If the distance is within the update mutation interval, the distortion point corresponding to the standard point is determined based on the target curve and the coordinate information of the standard point, and the pixel value of the distortion point is used as the pixel value of the standard point; if If the distance is not within the update mutation interval, the distortion point corresponding to the standard point is determined based on the distortion correction model and the coordinate information of the standard point, and the pixel value of the distortion point is used as the pixel value of the standard point; finally, based on the pixel values ​​of each standard point, the target corrected image corresponding to the area to be corrected is determined. At this time, the target corrected image only contains part of the image content in the image to be corrected. If the area to be corrected corresponds to the entire area of ​​the image to be corrected, all the distortion contents of the image to be corrected are corrected. The setting of the area to be corrected can avoid the situation where the computing power is increased when the parts beyond the actual correction requirements are also corrected, thereby helping to reduce computing power and improve the efficiency of distortion correction processing.

[0069] The above-mentioned image correction method obtains the image to be corrected, obtains the target optical center distance corresponding to the image to be corrected, generates a curve to be processed based on the target optical center distance and the distortion correction model, and determines multiple points to be processed from the curve to be processed. The target optical center distance is used to characterize the distance from some standard points corresponding to some distortion points in the image to be corrected to the optical center point. The some standard points refer to the points after the initial correction of some distortion points through the distortion correction model; based on the curve to be processed, the derivative values ​​corresponding to each point to be processed are calculated, based on the comparison results between the derivative values ​​corresponding to each point to be processed, the reference point is determined from the point to be processed, and the mutation starting point and the mutation ending point are determined from the point to be processed respectively, and the reference point is located between the mutation starting point and the mutation ending point; the geometric features of the line between the mutation starting point and the mutation ending point are calculated, if the geometric features and the derivative values ​​corresponding to the mutation starting point are If the relationship between the derivative values ​​corresponding to the starting point and the mutation end point satisfies the mutation interval condition, the interval between the mutation starting point and the mutation end point that satisfies the mutation interval condition is taken as the target mutation interval; the curve to be processed corresponding to the target mutation interval is corrected to obtain the corrected target curve; based on the target curve and the distortion correction model, the image to be corrected is corrected to obtain the target corrected image corresponding to the image to be corrected, thereby avoiding the situation in which the denominator value corresponding to the distortion correction model is 0 during the distortion correction process, resulting in a mutation in the image correction result; and in the process of determining the mutation interval corresponding to the distortion correction model, the accuracy of the data is controlled layer by layer to ensure the accuracy of the data ultimately used to correct the image to be corrected, so that the final corrected image has a better effect, thereby greatly improving the accuracy of correcting the distorted image.

[0070] In some embodiments, obtaining the target optical center distance corresponding to the image to be corrected in step S200 includes:

[0071] Step S300: determining a first distortion point set from the image to be corrected, wherein the first distortion point set includes coordinate information of each vertex and coordinate information of a midpoint of each edge of the image to be corrected.

[0072] Step S302: based on the coordinate information of each distortion point in the first distortion point set and the distortion correction model, determine the coordinate information of the standard point corresponding to each distortion point in the first distortion point set to obtain a first standard point set.

[0073] Step S304, calculating the first distance between each standard point in the first standard point set and the optical center point, and taking the largest first distance as the target optical center distance.

[0074] Among them, the first distortion point set refers to the set of coordinate information of coordinate points obtained by converting the pixel coordinates of the pixel points corresponding to each vertex in the image to be corrected and the pixel coordinates of the pixel points corresponding to the midpoints of each edge; whether it is the pixel coordinates of each vertex, the midpoint of each edge, the pixel points corresponding to each point in the image to be corrected, or the coordinate information of the coordinate points corresponding to each point, they are all used to characterize some distorted points in the image to be corrected, and different coordinate forms are used only to complete related operations. The first standard point set refers to the set of standard points obtained after the initial correction of each distorted point in the first distortion set through the distortion correction model. The first distance refers to the distance between the standard point in the first standard point set and the optical center point.

[0075] Specifically, when it is initially determined that the distortion correction model has a mutation interval with a denominator of 0, a small number of more representative points can be first obtained from the image to be corrected as points in the first distortion point set, that is, the set of coordinate information corresponding to each vertex and the midpoint of each edge in the image to be corrected can be used as the first distortion point set. When initially judging the mutation interval, the coordinate information of the standard points corresponding to each distortion point in the first distortion point set can be calculated based on the distortion correction model and the coordinate information of each distortion point in the first distortion point set to obtain the first standard point set for initial partial correction, and the first distance between each standard point in the first standard point set and the optical center point is calculated, and the largest first distance is used as the target optical center distance, so as to provide a data basis with higher accuracy and a larger range for subsequent judgment of the mutation interval on the curve to be processed.

[0076] In the above embodiment, by taking the set of coordinate information of each vertex of the image to be corrected and the coordinate information of the midpoints of each edge as the first distortion point set, and calculating the first standard point set based on the distortion correction model and the coordinate information of each distortion point in the first distortion point set, and taking the maximum distance between the standard point and the optical center point in the first point set as the target optical center distance, it is beneficial for the subsequent processing curve drawn based on the target optical center distance to characterize the distance from the standard point corresponding to each distortion point in the image to be corrected to the largest extent possible, thereby reducing the missed analysis rate of the distortion points in the image to be corrected.

[0077] In some embodiments, the geometric feature includes the slope of a line connecting a mutation start point and a mutation end point, and step S204 includes:

[0078] Step S400: If the derivative value corresponding to the mutation start point is less than or equal to the slope of the straight line, and the derivative value corresponding to the mutation end point is greater than or equal to the slope of the straight line, the interval between the mutation start point and the mutation end point is used as the target mutation interval.

[0079] Alternatively, in step S402, if the derivative value corresponding to the mutation start point is greater than or equal to the slope of the straight line, and the derivative value corresponding to the mutation end point is less than or equal to the slope of the straight line, the interval between the mutation start point and the mutation end point is used as the target mutation interval.

[0080] Specifically, the curve to be processed corresponding to the distortion correction model is a relatively smooth and regularly changing curve under normal circumstances without mutation. If a mutation occurs in a certain interval of the curve, the derivative value of the starting point of the interval, the derivative value of the ending point and the slope of the line between the starting point and the ending point satisfy a certain mutation law, that is, if the derivative value of the mutation starting point is greater than or equal to the slope of the straight line between the mutation starting point and the mutation ending point, and the slope of the straight line is greater than or equal to the derivative value of the mutation ending point, or if the derivative value of the mutation starting point is less than or equal to the slope of the straight line between the mutation starting point and the mutation ending point, and the slope of the straight line is less than or equal to the derivative value of the mutation ending point, then it means that the interval between the mutation starting point and the mutation ending point on the curve to be processed has a mutation, and the interval between the mutation starting point and the mutation ending point can be used as the target mutation interval.

[0081] In the above embodiment, whether the interval between the mutation starting point and the mutation ending point is the mutation interval in the curve to be processed is judged by the relationship between the derivative value corresponding to the mutation starting point, the slope of the straight line connecting the mutation starting point and the mutation ending point, and the derivative value of the mutation ending point, which is helpful to avoid using erroneous data to correct the image to be corrected, thereby ensuring the accuracy of the image finally corrected.

[0082] In some embodiments, in step S206, correcting the to-be-processed curve corresponding to the target mutation interval to obtain the corrected target curve includes:

[0083] Step S500: If the number of points to be processed in the target mutation interval is greater than or equal to a preset number, an interpolation curve is generated based on a preset interpolation algorithm and curve information of the curve to be processed except the curve corresponding to the target mutation interval, and a second distortion point set is determined from the image to be corrected, where the second distortion point set includes coordinate information of each point on each edge of the image to be corrected.

[0084] Step S502: Based on the second distortion point set, the interpolation curve and the distortion correction model, coordinate information of the standard points corresponding to each distortion point in the second distortion point set is determined to obtain the second standard point set.

[0085] Step S504, calculate the second distance between each standard point in the second standard point set and the optical center point, take the largest second distance as the update distance, generate an updated curve to be processed based on the update distance and the distortion correction model, and determine multiple updated points to be processed from the updated curve to be processed.

[0086] Step S506, determining an update mutation start point and an update mutation end point from the multiple update points to be processed, taking the interval between the update mutation start point and the update mutation end point as the update mutation interval, and generating a corrected target curve based on a preset interpolation algorithm and curve information in the update curve to be processed except for the curve corresponding to the update mutation interval.

[0087] Among them, the preset number refers to a preset number value; it is used to measure whether it is necessary to interpolate the curve corresponding to the target mutation interval to obtain a more accurate curve; it can be 2, that is, when the number of points to be processed in the target mutation interval is greater than or equal to 2, it means that the various curve values ​​corresponding to the mutation interval have a more obvious impact on the correction effect of the image to be corrected, and it is necessary to interpolate the curve corresponding to the target mutation interval to obtain a more accurate curve to improve the correction effect of the final image. The preset interpolation algorithm refers to an algorithm used to interpolate the curve corresponding to the target mutation interval; it can be but not limited to a linear interpolation algorithm, a Newton interpolation algorithm, etc. The interpolation curve refers to the curve corresponding to the target mutation interval interpolated by the interpolation algorithm. The second distortion point set refers to the set of coordinate information of the coordinate points obtained by converting the pixel coordinates of the pixel points corresponding to the points on each edge of the image to be corrected; whether it is the pixel coordinates of the points on each edge of the image to be corrected, the pixel coordinates of the pixel points corresponding to the points on each edge, or the coordinate information of the coordinate points corresponding to the edge points, they are all used to characterize the distortion points on the edge of the image to be corrected, and different coordinate forms are used only to complete related operations. The second standard point set refers to the set of standard points obtained by correcting the points in the second distortion set through the interpolation curve and the distortion correction model. The second distance refers to the distance between the standard point in the second standard point set and the optical center point. The update distance refers to the maximum second distance. The updated curve to be processed refers to the curve between zero and the update distance drawn by the distortion correction model. The updated points to be processed refer to the points on the updated curve to be processed; they can be the updated points to be processed determined at equal distances on the updated curve to be processed, that is, each updated point to be processed is determined by equally dividing the updated curve to be processed. The update mutation starting point refers to the starting point where the mutation occurs in the updated curve to be processed. The update mutation ending point refers to the ending point where the mutation occurs in the updated curve to be processed. The update mutation interval refers to the largest mutation interval that appears in the updated curve to be processed.

[0088] Specifically, in order to ensure a higher accuracy in judging the mutation interval when dividing the points to be processed on the curve to be processed, a larger number of points to be processed are generally divided so that the distribution of the points to be processed is denser and more even. Therefore, the degree of mutation of the curve to be processed can be determined by the number of points to be processed in the target mutation interval. If the number of points to be processed in the target mutation interval is greater than or equal to the preset number, it means that the degree of mutation on the curve to be processed is relatively large, which has a greater impact on the correction effect of the final image. At this time, based on the preset interpolation algorithm and the curve information of the curve to be processed other than the curve corresponding to the target mutation interval, the curve interpolation can be performed to generate an interpolation curve. Since the interpolation curve also uses the data information of the standard points calculated based on the distortion correction model when initially determining the mutation interval, there may be a situation where the distance from the standard point to the optical center point is within the mutation interval of the distortion correction model, thereby making the calculated standard point remote. Specifically, it can be as follows: Figure 3 As shown, Figure 3 The most central point in the image is the optical center, the points in the black rectangular box are the distortion points, and the points in the gray box and Figure 3 The middle gray point is the standard point calculated by the distortion correction model. Figure 3The point in the small box in the upper left corner, i.e., the calculated standard point, also has a large deviation from the actual standard point position. Therefore, when the accuracy of the initial corrected standard point is not enough, the accuracy of the target mutation interval and the generated interpolation curve obtained by subsequent judgment is not good enough. In order to ensure that the accuracy of the data information used for subsequent image correction is further improved, the set of coordinate information of the points on each edge of the image to be corrected can be used as the second distortion point set, and based on the coordinate information of each distortion point in the second distortion point set, the interpolation curve and the distortion correction model, the coordinate information of the standard point corresponding to each distortion point in the second distortion point set is calculated; wherein, the distance from each distortion point in the first distortion point set to the optical center point can be used as the basis for determining whether to use the interpolation curve or the distortion correction model to calculate the standard point corresponding to the distortion point. If the distance is within the target mutation interval, the interpolation curve and the coordinate information of the distortion point are used to determine the coordinate information of the standard point corresponding to the distortion point under the current operation. If the distance is outside the target mutation interval, the distortion correction model and the coordinate information of the distortion point are used to determine The coordinate information of the standard point corresponding to the distortion point under the current operation is used as the intermediate distortion point; then the distance between the intermediate distortion point and the optical center point is calculated. If the distance is within the target mutation interval, the interpolation curve and the coordinate information of the intermediate distortion point are used again to determine the coordinate information of the standard point corresponding to the intermediate distortion point under the current operation. Then the standard point corresponding to the current operation is used as the intermediate distortion point, and the distance between the intermediate distortion point and the optical center point and the inclusion relationship of the target mutation interval are judged again, and so on, until the loop termination condition is met, and the coordinate information of the standard point corresponding to the current operation corresponding to the loop termination condition is used as the coordinate information of the standard point corresponding to the distortion point in the second distortion point set, thereby obtaining the second standard point set corresponding to the second distortion point set.

[0089] Furthermore, in order to determine a higher precision mutation interval corresponding to the distortion correction model, the maximum distance between the standard point and the optical center point in the second standard point set can be used as the second distance, and the curve corresponding to the distortion correction model between zero and the second distance can be used as the updated curve to be processed. Similarly, a plurality of updated points to be processed are equally divided from the updated curve to be processed, and the derivative value of each updated point to be processed is calculated based on the updated curve to be processed, and the updated point to be processed with the largest absolute value of the derivative value is used as the updated reference point, and the mutation starting point and the mutation ending point are determined in turn from the updated reference point along two directions on the updated curve to be processed, and the mutation starting point and the mutation ending point are calculated. If the derivative value of the mutation starting point is less than or equal to the slope of the line, and the slope of the line is less than or equal to the derivative value of the mutation ending point, or if the derivative value of the mutation starting point is greater than or equal to the slope of the line, and the slope of the line is greater than or equal to the derivative value of the mutation ending point, then the interval between the mutation starting point and the mutation ending point is used as the update mutation interval, and based on the preset interpolation algorithm and the curve information of the updated curve to be processed except the curve corresponding to the update mutation interval, the corrected target curve corresponding to the update mutation interval is interpolated, and the accuracy of the interpolated target curve is higher than the accuracy of the interpolated curve. Among them, the preset interpolation algorithm can be determined according to the specific situation, and there is no limitation on which interpolation algorithm is used.

[0090] In the above embodiment, when the number of points to be processed in the target mutation interval is greater than or equal to a preset number, the second standard point set corresponding to the second distortion point set reselected from the image to be corrected is determined based on the interpolation curve and the distortion correction model, and based on the maximum distance between the standard points and the optical center in the second standard point set, the updated curve to be processed is regenerated with the distortion correction model, and then the updated mutation interval on the updated curve to be processed is redetermined, and the corrected target curve corresponding to the updated mutation interval is interpolated, thereby further improving the accuracy of the curve used to replace the mutation interval corresponding to the distortion correction model, which is beneficial to improving the effect of the final correction of the image to be corrected.

[0091] In some embodiments, step S502 includes:

[0092] Step S600: Calculate the distance to be analyzed between each distortion point in the second distortion point set and the optical center point based on the coordinate information of each distortion point in the second distortion point set.

[0093] Step S602: If the distance to be analyzed is within the range of the target mutation interval, the coordinate information of the standard point corresponding to the distortion point is calculated based on the coordinate information of the distortion point corresponding to the distance to be analyzed and the interpolation curve.

[0094] Step S604: if the distance to be analyzed is outside the range of the target mutation interval, the coordinate information of the standard point corresponding to the distortion point is calculated based on the coordinate information of the distortion point corresponding to the distance to be analyzed and the distortion correction model.

[0095] Step S606: obtaining a second standard point set based on the coordinate information of the standard points corresponding to each distortion point in the second distortion point set.

[0096] The distance to be analyzed refers to the distance between the distortion point in the second distortion point set and the optical center point.

[0097] Specifically, since during the initial correction, a mutation in which the denominator of the distortion correction model is 0 may occur during the calculation of the standard points by the distortion correction model, in order to further improve the accuracy of the data, the distance to be analyzed between each distortion point in the second distortion point set and the optical center point can be calculated first. If the distance to be analyzed between the distortion point and the optical center point is within the target mutation interval, the coordinate information of the standard point corresponding to the distortion point under the current operation is calculated based on the coordinate information of the distortion point and the interpolation curve. If the distance to be analyzed between the distortion point and the optical center point is not within the target mutation interval, the coordinate information of the standard point corresponding to the distortion point under the current operation is calculated based on the coordinate information of the distortion point and the distortion correction model. In order to ensure that the calculated coordinate information of the standard point is more accurate, the calculated standard point can be used as the coordinate information of the current operation. The intermediate distortion point under the operation is then calculated, and the distance between the intermediate distortion point and the optical center point is continued to be calculated. If the distance between the intermediate distortion point and the optical center point is in the target mutation interval, the interpolation curve and the coordinate information of the intermediate distortion point are used to calculate the coordinate information of the standard point corresponding to the intermediate distortion point under the current operation. If the distance between the intermediate distortion point and the optical center point is not in the target mutation interval, the distortion correction model and the coordinate information of the intermediate distortion point are used to calculate the coordinate information of the standard point corresponding to the intermediate distortion point under the current operation; and the coordinate information of the standard point corresponding to the current operation is used as the intermediate distortion point under the backward operation, and so on, until the loop termination condition is reached, and the coordinate information of the standard point corresponding to the intermediate distortion point when the loop termination condition is met is used as the coordinate information of the standard point corresponding to the distortion point in the second distortion point set.

[0098] In the above embodiment, the coordinate information of the standard points corresponding to each distortion point in the second distortion point set is calculated through switching iterative operations of the interpolation curve and the distortion correction model, thereby avoiding the situation in which the denominator is 0 in the calculation process of the distortion correction model, resulting in inaccurate calculation results, thereby further improving the data accuracy of the calculated second standard point set.

[0099] In some embodiments, in step S206, based on the target curve and the distortion correction model, the image to be corrected is corrected to obtain a target corrected image corresponding to the image to be corrected, including:

[0100] Step S700, obtain the set of standard points to be processed, and calculate the distance between each standard point in the set of standard points to be processed and the optical center point to be processed; the coordinate information of each standard point in the set of standard points to be processed is determined by determining the area to be corrected within the area represented by the second standard point set, and is determined based on the preset correction resolution information corresponding to the area to be corrected.

[0101] Step S702, if the optical center distance to be processed is within the range of the update mutation interval, based on the coordinate information of the standard point corresponding to the optical center distance to be processed and the target curve, determine the distortion point corresponding to the standard point in the image to be corrected, and use the pixel value corresponding to the distortion point as the pixel value of the standard point.

[0102] Step S704, if the optical center distance to be processed is not within the range of the update mutation interval, based on the coordinate information of the standard point corresponding to the optical center distance to be processed and the distortion correction model, determine the distortion point corresponding to the standard point in the image to be corrected, and use the pixel value corresponding to the distortion point as the pixel value of the standard point.

[0103] Step S706: Generate a target corrected image corresponding to the area to be corrected based on the coordinate information and pixel value of each standard point in the standard point set to be processed.

[0104] Among them, the standard point set to be processed refers to the set of coordinate information of the standard points corresponding to each pixel point in the area to be corrected, which is determined based on the preset correction resolution information corresponding to the area to be corrected defined within the area represented by the second standard point set. The optical center distance to be processed refers to the distance from the standard point to the optical center point in the standard point set to be processed. The area to be corrected refers to the correction area specified within the area represented by the second standard point set based on actual needs, and the image content in the area to be corrected is not yet known at this time. The preset correction resolution refers to the resolution information of the area to be corrected after correction set based on actual needs.

[0105] Specifically, the resolution of the corrected image is determined, and the pixel coordinates of the corresponding pixel points of the corrected image are also determined. The pixel coordinates can be converted into the coordinate information corresponding to the standard point in the preset plane coordinate system. Therefore, the area to be corrected can be determined from the area represented by the second standard point set, and the set of standard points to be processed corresponding to the area to be corrected can be determined based on the preset correction resolution information corresponding to the area to be corrected. At this time, it is not known which standard point in the standard point set to be processed corresponds to which distortion point in the image to be corrected. The distance between the optical center point to be processed and the optical center point can be calculated. When the distance to be processed is within the update mutation interval, the update mutation is adopted. The target curve and the coordinate information of the standard point corresponding to the optical center distance to be processed are used to determine the distortion point corresponding to the standard point in the image to be corrected, and the pixel value corresponding to the distortion point is used as the pixel value of the standard point; when the optical center distance to be processed is not within the update mutation interval, the distortion correction model and the coordinate information of the standard point corresponding to the optical center distance to be processed are used to determine the distortion point corresponding to the standard point in the image to be corrected, and the pixel value corresponding to the distortion point is used as the pixel value corresponding to the standard point, and then the pixel value of each standard point in the standard point set to be processed is used as the pixel value of the pixel point corresponding to each standard point, so as to obtain the target corrected image corresponding to the area to be corrected. At this time, the image content in the target corrected image is only part of the image content in the image to be corrected. Among them, formulas (2) and (3) represent the process of calculating the coordinate information of the standard point in the standard point set to be processed. In formula (2), Indicates the camera intrinsic parameters calibrated by the camera that captured the image to be corrected. Indicates the camera intrinsic parameters corresponding to the area to be corrected. represents the coordinate information of the upper left corner of the area to be corrected in the preset plane coordinate system. In formula (3), Indicates the coordinate information of the standard points in the set of standard points to be processed on the preset plane coordinate system. Represents the pixel coordinates of each pixel point in the area to be corrected. The preset plane coordinate system can be a plane coordinate system generated based on the camera intrinsic parameters corresponding to the image to be corrected.

[0106]

[0107] In more detail, when determining the distortion point corresponding to the standard point based on the coordinate information of the standard point set to be processed, the target area and the distortion correction model, the coordinate information of the distortion point in the preset plane coordinate system is determined. It is also necessary to convert the coordinate information of the distortion point into pixel coordinates, so as to determine the pixel value of the pixel point corresponding to the distortion point in the image to be corrected according to the pixel coordinates. The specific conversion process can be shown in formula (4). In formula (4), (u, v) is the pixel coordinate of the pixel point corresponding to each standard point in the standard point set to be processed in the corrected image corresponding to the area to be corrected. It is the coordinate information of the distortion point in the preset plane coordinate system. Since the camera intrinsic parameters corresponding to the area to be corrected and the image to be corrected are different, when converting the coordinate information of the distortion point in the preset plane coordinate system into pixel coordinates, the calibrated camera intrinsic parameters are used accordingly.

[0108]

[0109] In the above embodiment, the area to be corrected is first determined from the area represented by the second standard point set to reduce the calculation of unnecessary correction areas, thereby improving the data processing speed, and the standard point set to be processed is determined based on the preset correction resolution information corresponding to the area to be corrected, and it is judged whether the distance between each standard point in the standard point set to be processed and the optical center point is within the update image interval. If it is within the update mutation interval, the target curve is used to determine the distortion point corresponding to the standard point in the standard point set to be processed in the image to be corrected. If it is not within the update mutation interval, the distortion correction model is used to determine the distortion point corresponding to the standard point in the standard point set to be processed in the image to be corrected, and the pixel value corresponding to the distortion point is used as the pixel value of the standard point, so that the target corrected image corresponding to the area to be corrected can be determined according to the pixel value of the standard point and the pixel coordinates of the corresponding pixel point, thereby avoiding the situation where the denominator is 0 when the distortion correction model is used for correction, resulting in a biased correction effect, which is conducive to better improving the accuracy of correcting the distorted image.

[0110] In some embodiments, the method further comprises:

[0111] Step S800, if the number of points to be processed in the target mutation interval is less than the preset number, a set of standard points to be processed is obtained, and the coordinate information of each standard point in the set of standard points to be processed is determined by determining the area to be corrected within the area represented by the second standard point set, based on the preset correction resolution information corresponding to the area to be corrected.

[0112] Step S802: based on the coordinate information of each standard point in the standard point set to be processed and the distortion correction model, determine the distortion point corresponding to each standard point in the standard point set to be processed, and use the pixel value corresponding to the distortion point as the pixel value of the standard point.

[0113] Step S804: generating a target corrected image corresponding to the area to be corrected based on the coordinate information and pixel value of each standard point in the standard point set to be processed.

[0114] Specifically, if the data of the to-be-processed points in the target mutation interval is less than a preset number, it means that the points where mutations occur on the to-be-processed curve are very few and can be ignored. In order to improve the correction efficiency of the image, the to-be-corrected area can be directly determined within the area represented by the second standard point set, and the to-be-corrected standard point set corresponding to the to-be-corrected area can be determined according to the preset correction resolution information corresponding to the to-be-corrected area set in advance, and then the to-be-corrected standard point set corresponding to the to-be-corrected area is determined based on the coordinate information corresponding to each standard point in the to-be-processed standard point set and the distortion correction model, and the distortion points corresponding to each standard point in the to-be-processed standard point set on the to-be-corrected image are determined, and the pixel values ​​of the distortion points are used as the pixel values ​​of the standard points, and the pixel coordinates of the pixel points corresponding to each standard point in the to-be-processed standard point set on the image corresponding to the to-be-corrected area are determined, and the pixel values ​​corresponding to the standard points are used as the pixel values ​​of the pixel points corresponding to the standard points, and then the target corrected image after the image content corresponding to the to-be-corrected area is corrected is determined according to the pixel coordinates and pixel values ​​of the pixel points corresponding to each standard point.

[0115] In the above embodiment, when there are fewer points to be processed in the target mutation interval, that is, when the points generating mutations on the curve to be processed have negligible effects on the final image correction, the distortion correction model is directly used to calculate the standard points in the standard point set to be processed corresponding to the area to be corrected, and the corresponding distortion points on the image to be corrected, so that the pixel values ​​of the corresponding distortion points are used as the pixel values ​​of the corresponding standard points, and then the final corrected image is determined according to the coordinate information and pixel values ​​of the standard points, and different correction schemes are formulated for the mutation cases with a denominator of 0 in the distortion correction model, so that the accuracy of the distortion image correction is ensured while the efficiency of the distortion image correction is taken into account.

[0116] In some embodiments, an example of correcting an image captured by a lens using a distortion correction model is described. The image captured by the lens is used as the image to be corrected. In order to avoid the situation where the denominator of the distortion correction model is 0, resulting in poor accuracy of the calculated standard points, when directly calculating the standard points corresponding to each distortion point using the coordinate information of the distortion points corresponding to the image to be corrected and the distortion correction model, the coordinate information of each vertex in the image to be corrected and the coordinate information of the midpoint of each edge can be taken as the first distortion point set, and the coordinate information of the standard points corresponding to each distortion point in the first distortion point set can be calculated using the distortion correction model and the coordinate information of each distortion point in the first distortion point set to obtain the first standard point set. The first distance between each standard point in the first standard point set and the optical center point is calculated, and the largest first distance is used as the target optical center distance. Based on the distortion correction model, a curve to be processed corresponding to the interval between zero and the target optical center distance is drawn. In order to determine the mutation interval in the curve to be processed, the curve to be processed can be obtained from the coordinate information of the standard points corresponding to each distortion point in the first distortion point set. A plurality of points to be processed are determined by equally dividing the line, and the derivative value of each point to be processed is calculated based on the curve to be processed, and then the point to be processed with the largest derivative value is used as the reference point. Therefore, the mutation may be a sudden rise or a sudden drop. Therefore, the reference point is determined by the absolute value of the derivative value, and at the reference point, the mutation starting point and the mutation ending point are determined from the points to be processed in turn along the two directions of the curve to be processed, that is, the reference point is located between the mutation starting point and the mutation ending point, and then the slope of the straight line connecting the mutation starting point and the mutation ending point is calculated. When the derivative value of the mutation starting point is less than or equal to the slope of the straight line, and the slope of the straight line is less than or equal to the derivative value of the mutation ending point, or when the derivative value of the mutation starting point is greater than or equal to the slope of the straight line, and the slope of the straight line is greater than or equal to the derivative value of the mutation ending point, the interval between the mutation starting point and the mutation ending point is used as the target mutation interval.

[0117] Furthermore, when the number of unprocessed points in the target mutation interval is less than a preset number, the area to be corrected is determined within the area represented by the second standard point set, and the preset resolution information corresponding to the preset area to be corrected is obtained, and the standard point set to be processed corresponding to the area to be corrected is determined according to the preset resolution information, and the distortion points corresponding to each standard point in the standard point set to be processed are determined based on the coordinate information of each standard point in the standard point set to be processed and the distortion correction model, and the pixel value of the distortion point is used as the pixel value of the standard point, so that the corrected image content corresponding to the area to be corrected can be determined according to the coordinate information and pixel value of each standard point in the standard point set to be processed, and the target corrected image corresponding to the area to be corrected is obtained.

[0118] Alternatively, when the number of points to be processed in the target mutation interval is greater than or equal to a preset number, an interpolation curve corresponding to the curve to be processed in the target mutation interval is interpolated based on a preset interpolation algorithm. Since the distortion correction model is used when initially calculating the first standard point set, the denominator of the distortion correction model may be 0, resulting in the calculated first standard point set being not accurate enough. Therefore, the coordinate information of each point on each edge of the image to be corrected may be selected as the second distortion point set, and based on the second distortion point set, the interpolation curve and the distortion correction model, the coordinate information of the standard point corresponding to each distortion point in the second distortion point set is calculated in a switching iterative manner, that is, the distance to be analyzed between each distortion point in the second distortion point set and the optical center point is first calculated. When the distance to be analyzed is in the target mutation interval, the coordinate information of the standard point corresponding to the distortion point in the current iterative operation is calculated based on the coordinate information of the distortion point and the interpolation curve. When the distance to be analyzed is not in the target mutation interval, the distortion point is calculated based on the coordinate information of the distortion point and the distortion correction model. The coordinate information of the standard point corresponding to the current iterative operation is obtained; the standard point corresponding to the current iterative operation is used as the intermediate distortion point, and the coordinate information of the standard point corresponding to the current iterative operation is used as the coordinate information of the intermediate distortion point, and then the distance to be analyzed between the intermediate distortion point and the optical center point is continued to be calculated. When the distance to be analyzed is in the target mutation interval, the coordinate information of the standard point corresponding to the intermediate distortion point in the current iterative operation is calculated based on the coordinate information of the intermediate distortion point and the interpolation curve. When the distance to be analyzed is not in the target mutation interval, the coordinate information of the standard point corresponding to the intermediate distortion point in the current iterative operation is calculated based on the coordinate information of the intermediate distortion point and the distortion correction model, and the operation of using the standard point corresponding to the current iterative operation as the intermediate distortion point is returned until the iteration termination condition (i.e., the loop termination condition) is reached, and the coordinate information of the standard point corresponding to the intermediate distortion point when the iteration termination condition is reached is used as the coordinate information of the standard point corresponding to the distortion point in the corresponding second distortion point set, thereby obtaining a second standard point set with higher accuracy.

[0119] Further, the second distance between each standard point in the second standard point set and the optical center point is calculated, the largest second distance is used as the update distance, and an update processing curve corresponding to the zero to update distance is drawn based on the distortion correction model, and then a plurality of processing points are equally divided from the update processing curve, and the derivative value corresponding to each update processing point is calculated based on the update processing curve, and the update processing point with the largest absolute value of the derivative value is used as the update reference point, and the update mutation starting point and the update mutation ending point are determined in turn from the update processing points, and the update reference point is located between the update mutation starting point and the update mutation ending point, and the update mutation starting point is calculated. When the derivative value of the update mutation starting point is less than or equal to the slope of the straight line, and the slope of the straight line is less than or equal to the derivative value of the update mutation ending point, or when the derivative value of the update mutation starting point is greater than or equal to the slope of the straight line, and the slope of the straight line is greater than or equal to the derivative value of the update mutation ending point, the interval between the update mutation starting point and the update mutation ending point is used as each update mutation interval, so as to obtain a mutation interval with higher accuracy, and then based on the preset interpolation algorithm and the curve information of the updated curve to be processed except the curve corresponding to the update mutation interval, a target curve with higher accuracy is interpolated.

[0120] Further, the area to be corrected is determined within the area represented by the second standard point set, and the to-be-corrected standard point set corresponding to the to-be-corrected area is determined based on the preset correction resolution information corresponding to the area to be corrected, and the to-be-corrected optical center distance between each standard point in the to-be-corrected standard point set and the optical center point is calculated. When the to-be-corrected optical center distance is within the range of the update mutation interval, the distortion point corresponding to the standard point in the to-be-corrected image is determined based on the coordinate information of the standard point corresponding to the to-be-corrected optical center distance and the target curve, and the pixel value corresponding to the distortion point is used as the pixel value of the standard point; when the to-be-corrected optical center distance is within the range of the update mutation interval, the to-be-corrected optical center distance is within the range of the update mutation interval, and the to-be-corrected optical center distance is within the range of the update mutation interval. When the to-be-corrected optical center distance is within the range of the update mutation interval, the to-be-corrected optical center distance is within the range of the update mutation interval, and ..., and the to-be-corrected optical center distance is within the range of the update mutation interval, and the to-be-corrected optical center distance is within the range of the update mutation interval, and the to-be-corrected optical center distance is within the range of the update mutation interval, and the to-be-corrected optical center distance is within the range of the update mutation interval, and the to-be-corrected optical center distance is within the range of the update mutation When the optical center distance is not within the update mutation interval, the distortion point corresponding to the standard point in the image to be corrected is determined based on the coordinate information of the standard point corresponding to the optical center distance to be processed and the distortion correction model, and the pixel value corresponding to the distortion point is used as the pixel value of the standard point, and then the target corrected image corresponding to the area to be corrected is determined according to the coordinate information and pixel value corresponding to each standard point in the standard point set to be processed, so as to avoid the situation that the denominator of the distortion correction model is 0 when the image to be corrected is corrected directly based on the distortion correction model, which leads to poor image correction effect. Specifically, Figure 5 It can be intuitively seen that the correction effect of directly using the distortion correction model for image correction ( Figure 5 (a) in FIG. 1 ), and the correction effect of image correction according to the present application to avoid the situation where the denominator of the distortion correction model is 0 ( Figure 5It can be seen from the difference between (b) in FIG. 1 and (b) in FIG. 2 that, in this case, while gradually improving the data accuracy, the effect of correcting the distorted image is greatly improved, thereby greatly improving the accuracy of correcting the distorted image.

[0121] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0122] Based on the same inventive concept, the embodiment of the present application also provides an image correction device for implementing the above-mentioned image correction method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations of one or more image correction device embodiments provided below can refer to the limitations of the image correction method above, and will not be repeated here.

[0123] In one embodiment, Figure 6 As shown, an image correction device is provided, including: an acquisition module 600, a derivation module 602, a judgment module 604 and a correction module 606, wherein:

[0124] The acquisition module 600 is used to acquire the image to be corrected, acquire the target optical center distance corresponding to the image to be corrected, generate a curve to be processed based on the target optical center distance and the distortion correction model, and determine multiple points to be processed from the curve to be processed. The target optical center distance is used to characterize the distance from some standard points corresponding to some distorted points in the image to be corrected to the optical center point. The some standard points refer to the points after the initial correction of some distorted points through the distortion correction model.

[0125] The derivative module 602 is used to calculate the derivative value corresponding to each point to be processed based on the curve to be processed, determine the reference point from the points to be processed based on the comparison results between the derivative values ​​corresponding to the points to be processed, and determine the mutation start point and the mutation end point from the points to be processed respectively, and the reference point is located between the mutation start point and the mutation end point.

[0126] The judgment module 604 is used to calculate the geometric features of the line between the mutation starting point and the mutation ending point. If the relationship between the geometric features, the derivative value corresponding to the mutation starting point and the derivative value corresponding to the mutation ending point meets the mutation interval condition, the interval between the mutation starting point and the mutation ending point that meets the mutation interval condition is used as the target mutation interval.

[0127] The correction module 606 is used to correct the to-be-processed curve corresponding to the target mutation interval to obtain a corrected target curve, and to correct the to-be-corrected image based on the target curve and the distortion correction model to obtain a target corrected image.

[0128] In some embodiments, the acquisition module 600 is also used to determine a first distortion point set from the image to be corrected, the first distortion point set including coordinate information of each vertex of the image to be corrected and coordinate information of the midpoints of each edge; based on the coordinate information of each distortion point in the first distortion point set and the distortion correction model, determine the coordinate information of the standard points corresponding to each distortion point in the first distortion point set to obtain the first standard point set; calculate the first distance between each standard point in the first standard point set and the optical center point, and take the largest first distance as the target optical center distance.

[0129] In some embodiments, the judgment module 604 is also used for the geometric features including the slope of the straight line connecting the mutation starting point and the mutation ending point; if the derivative value corresponding to the mutation starting point is less than or equal to the slope of the straight line, and the derivative value corresponding to the mutation ending point is greater than or equal to the slope of the straight line, then the interval between the mutation starting point and the mutation ending point is used as the target mutation interval; or, if the derivative value corresponding to the mutation starting point is greater than or equal to the slope of the straight line, and the derivative value corresponding to the mutation ending point is less than or equal to the slope of the straight line, then the interval between the mutation starting point and the mutation ending point is used as the target mutation interval.

[0130] In some embodiments, the correction module 606 is further used to generate an interpolation curve based on a preset interpolation algorithm and curve information other than the curve corresponding to the target mutation interval in the curve to be processed if the number of the points to be processed in the target mutation interval is greater than or equal to a preset number, determine a second distortion point set from the image to be corrected, the second distortion point set includes coordinate information of each point on each edge of the image to be corrected; determine coordinate information of standard points corresponding to each distortion point in the second distortion point set based on the second distortion point set, the interpolation curve and the distortion correction model, and obtain a second standard point set; calculate a second distance between each standard point in the second standard point set and the optical center point, use the maximum second distance as the update distance, generate an updated curve to be processed based on the update distance and the distortion correction model, and determine multiple updated points to be processed from the updated curve to be processed; determine an update mutation start point and an update mutation end point from the multiple update points to be processed, use the interval between the update mutation start point and the update mutation end point as the update mutation interval, and generate a corrected target curve based on the preset interpolation algorithm and curve information other than the curve corresponding to the update mutation interval in the updated curve to be processed.

[0131] In some embodiments, the correction module 606 is also used to calculate the distance to be analyzed between each distortion point in the second distortion point set and the optical center point based on the coordinate information of each distortion point in the second distortion point set; if the distance to be analyzed is within the range of the target mutation interval, the coordinate information of the standard point corresponding to the distortion point is calculated based on the coordinate information of the distortion point corresponding to the distance to be analyzed and the interpolation curve; if the distance to be analyzed is outside the range of the target mutation interval, the coordinate information of the standard point corresponding to the distortion point is calculated based on the coordinate information of the distortion point corresponding to the distance to be analyzed and the distortion correction model; based on the coordinate information of the standard point corresponding to each distortion point in the second distortion point set, a second standard point set is obtained.

[0132] In some embodiments, the correction module 606 is also used to obtain a set of standard points to be processed, and calculate the distance of the optical center to be processed between each standard point in the set of standard points to be processed and the optical center point; the coordinate information of each standard point in the set of standard points to be processed is determined by determining the area to be corrected within the area represented by the second standard point set, and is determined based on the preset correction resolution information corresponding to the area to be corrected; if the optical center distance to be processed is within the range of the update mutation interval, then based on the coordinate information of the standard point corresponding to the optical center distance to be processed and the target curve, the distortion point corresponding to the standard point in the image to be corrected is determined, and the pixel value corresponding to the distortion point is used as the pixel value of the standard point; if the optical center distance to be processed is not within the range of the update mutation interval, then based on the coordinate information of the standard point corresponding to the optical center distance to be processed and the distortion correction model, the distortion point corresponding to the standard point in the image to be corrected is determined, and the pixel value corresponding to the distortion point is used as the pixel value of the standard point; based on the coordinate information and pixel values ​​of each standard point in the set of standard points to be processed, a target corrected image corresponding to the area to be corrected is generated.

[0133] In some embodiments, the correction module 606 is also used to obtain a set of standard points to be processed if the number of points to be processed in the target mutation interval is less than a preset number, and the coordinate information of each standard point in the set of standard points to be processed is determined by determining the area to be corrected within the area represented by the second set of standard points, based on the preset correction resolution information corresponding to the area to be corrected; based on the coordinate information of each standard point in the set of standard points to be processed and the distortion correction model, the distortion points corresponding to each standard point in the set of standard points to be processed are determined, and the pixel values ​​corresponding to the distortion points are used as the pixel values ​​of the standard points; based on the coordinate information and pixel values ​​of each standard point in the set of standard points to be processed, a target corrected image corresponding to the area to be corrected is generated.

[0134] Each module in the above-mentioned image correction device can be implemented in whole or in part by software, hardware or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0135] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG7. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data related to the execution process. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an image correction method is implemented.

[0136] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an image correction method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.

[0137] Those skilled in the art will understand that the structure shown in FIG. 7 or FIG. 8 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0138] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0139] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0140] In one embodiment, a computer program product or computer program is provided, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in the above-mentioned method embodiments.

[0141] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0142] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0143] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0144] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. An image correction method, characterized in that: The method comprises: Acquire an image to be corrected, acquire a target optical center distance corresponding to the image to be corrected, generate a curve to be processed based on the target optical center distance and a distortion correction model, and determine a plurality of points to be processed from the curve to be processed, wherein the target optical center distance refers to a maximum distance from some standard points corresponding to some distorted points in the image to be corrected to the optical center point, and the some standard points refer to points after some distorted points are initially corrected by the distortion correction model; Based on the curve to be processed, the derivative value corresponding to each point to be processed is calculated, and based on the comparison results between the derivative values ​​corresponding to the points to be processed, a reference point is determined from the points to be processed, and a mutation start point and a mutation end point are determined from the points to be processed in turn, wherein the reference point is located between the mutation start point and the mutation end point; Calculate the slope of the line connecting the mutation start point and the mutation end point. If the comparison relationship between the slope of the line, the derivative value corresponding to the mutation start point and the derivative value corresponding to the mutation end point satisfies the mutation interval condition, then the interval between the mutation start point and the mutation end point that satisfies the mutation interval condition is taken as the target mutation interval. If the number of the to-be-processed points in the target mutation interval is greater than or equal to the preset number, an interpolation curve is generated based on a preset interpolation algorithm and the curve information of the to-be-processed curve other than the curve corresponding to the target mutation interval, and a second distortion point set is determined from the to-be-corrected image, the second distortion point set including the coordinate information of each point on each edge of the to-be-corrected image; based on the second distortion point set, the interpolation curve and the distortion correction model, the coordinate information of the standard points corresponding to each distortion point in the second distortion point set is determined to obtain a second standard point set; the second distance between each standard point in the second standard point set and the optical center point is calculated, the maximum second distance is used as the update distance, and an updated to-be-processed curve is generated based on the update distance and the distortion correction model, and a plurality of updated to-be-processed points are determined from the updated to-be-processed curve; an update mutation start point and an update mutation end point are determined from the plurality of update to-be-processed points, and the interval between the update mutation start point and the update mutation end point is used as the update mutation interval, and a corrected target curve is generated based on a preset interpolation algorithm and the curve information of the to-be-processed curve other than the curve corresponding to the update mutation interval; A set of standard points to be processed is obtained, and the distance of the optical center to be processed between each standard point in the set of standard points to be processed and the optical center point is calculated; the coordinate information of each standard point in the set of standard points to be processed is determined by determining the area to be corrected within the area represented by the second set of standard points, and based on the preset correction resolution information corresponding to the area to be corrected; if the optical center distance to be processed is within the range of the update mutation interval, then based on the coordinate information of the standard point corresponding to the optical center distance to be processed and the target curve, the distortion point corresponding to the standard point in the image to be corrected is determined, and the pixel value corresponding to the distortion point is used as the pixel value of the standard point; if the optical center distance to be processed is not within the range of the update mutation interval, then based on the coordinate information of the standard point corresponding to the optical center distance to be processed and the distortion correction model, the distortion point corresponding to the standard point in the image to be corrected is determined, and the pixel value corresponding to the distortion point is used as the pixel value of the standard point; based on the coordinate information and pixel values ​​of each standard point in the set of standard points to be processed, a target corrected image corresponding to the area to be corrected is generated.

2. The method according to claim 1, characterized in that The step of obtaining the target optical center distance corresponding to the image to be corrected comprises: Determine a first distortion point set from the image to be corrected, where the first distortion point set includes coordinate information of each vertex and coordinate information of a midpoint of each edge of the image to be corrected; Based on the coordinate information of each distortion point in the first distortion point set and the distortion correction model, determine the coordinate information of the standard point corresponding to each distortion point in the first distortion point set to obtain a first standard point set; The first distances between each standard point in the first standard point set and the optical center point are calculated, and the largest first distance is used as the target optical center distance.

3. The method according to claim 1, characterized in that If the comparison relationship between the slope of the straight line, the derivative value corresponding to the mutation starting point, and the derivative value corresponding to the mutation ending point satisfies the mutation interval condition, then the interval between the mutation starting point and the mutation ending point that satisfies the mutation interval condition is taken as the target mutation interval, including: If the derivative value corresponding to the mutation start point is less than or equal to the straight line slope, and the derivative value corresponding to the mutation end point is greater than or equal to the straight line slope, then the interval between the mutation start point and the mutation end point is taken as the target mutation interval; or, If the derivative value corresponding to the mutation starting point is greater than or equal to the straight line slope, and the derivative value corresponding to the mutation ending point is less than or equal to the straight line slope, the interval between the mutation starting point and the mutation ending point is taken as the target mutation interval.

4. The method according to claim 1, characterized in that: The step of determining an update mutation starting point and an update mutation ending point from the plurality of update points to be processed, and taking an interval between the update mutation starting point and the update mutation ending point as an update mutation interval, comprises: Calculating the slope of a line between the updating mutation starting point and the updating mutation ending point; If the derivative value of the update mutation starting point is less than or equal to the straight line slope, and the straight line slope is less than or equal to the derivative value of the update mutation ending point, then the interval between the update mutation starting point and the update mutation ending point is taken as the update mutation interval; or, If the derivative value of the update mutation starting point is greater than or equal to the straight line slope, and the straight line slope is greater than or equal to the derivative value of the update mutation ending point, the interval between the update mutation starting point and the update mutation ending point is taken as the update mutation interval.

5. The method according to claim 1, characterized in that The step of determining coordinate information of standard points corresponding to each distortion point in the second distortion point set based on the second distortion point set, the interpolation curve and the distortion correction model to obtain the second standard point set includes: Calculating the distance to be analyzed between each distortion point in the second distortion point set and the optical center point based on the coordinate information of each distortion point in the second distortion point set; If the distance to be analyzed is within the range of the target mutation interval, the coordinate information of the standard point corresponding to the distortion point is calculated based on the coordinate information of the distortion point corresponding to the distance to be analyzed and the interpolation curve; If the distance to be analyzed is outside the range of the target mutation interval, the coordinate information of the standard point corresponding to the distortion point is calculated based on the coordinate information of the distortion point corresponding to the distance to be analyzed and the distortion correction model; The second standard point set is obtained based on the coordinate information of the standard points corresponding to each distortion point in the second distortion point set.

6. The method according to claim 1, characterized in that The area to be corrected refers to a correction area specified within the area represented by the second standard point set based on actual needs.

7. The method according to claim 1, characterized in that The method further comprises: If the number of points to be processed in the target mutation interval is less than a preset number, a set of standard points to be processed is obtained, wherein the coordinate information of each standard point in the set of standard points to be processed is determined by determining a region to be corrected within the region represented by the second set of standard points, based on preset correction resolution information corresponding to the region to be corrected; Based on the coordinate information of each standard point in the standard point set to be processed and the distortion correction model, determine the distortion point corresponding to each standard point in the standard point set to be processed, and use the pixel value corresponding to the distortion point as the pixel value of the standard point; Based on the coordinate information and pixel value of each standard point in the standard point set to be processed, a target corrected image corresponding to the area to be corrected is generated.

8. An image correction device, characterized in that: The device comprises: An acquisition module is used to acquire an image to be corrected, acquire a target optical center distance corresponding to the image to be corrected, generate a curve to be processed based on the target optical center distance and a distortion correction model, and determine a plurality of points to be processed from the curve to be processed, wherein the target optical center distance refers to a maximum distance from some standard points corresponding to some distorted points in the image to be corrected to the optical center point, and the some standard points refer to points after some distorted points are initially corrected by the distortion correction model; A derivation module, used for calculating the derivative value corresponding to each to-be-processed point based on the to-be-processed curve, determining a reference point from the to-be-processed points based on the comparison results between the derivative values ​​corresponding to the to-be-processed points, and determining the mutation start point and the mutation end point from the to-be-processed points in turn, wherein the reference point is located between the mutation start point and the mutation end point; A judgment module is used to calculate the slope of the line connecting the mutation starting point and the mutation ending point. If the relationship between the slope of the line, the derivative value corresponding to the mutation starting point and the derivative value corresponding to the mutation ending point meets the mutation interval condition, the interval between the mutation starting point and the mutation ending point that meets the mutation interval condition is used as the target mutation interval; A correction module, for generating an interpolation curve based on a preset interpolation algorithm and curve information other than the curve corresponding to the target mutation interval in the curve to be processed if the number of the to-be-processed points in the target mutation interval is greater than or equal to a preset number, determining a second distortion point set from the image to be corrected, the second distortion point set including coordinate information of each point on each edge of the image to be corrected; determining coordinate information of standard points corresponding to each distortion point in the second distortion point set based on the second distortion point set, the interpolation curve and the distortion correction model, and obtaining a second standard point set; calculating a second distance between each standard point in the second standard point set and the optical center point, taking the maximum second distance as an update distance, generating an updated to-be-processed curve based on the update distance and the distortion correction model, determining a plurality of updated to-be-processed points from the updated to-be-processed curve; determining an update mutation start point and an update mutation end point from the plurality of update to-be-processed points, taking an interval between the update mutation start point and the update mutation end point as an update mutation interval, and calculating a second distance between each standard point in the second standard point set and the optical center point based on the preset interpolation algorithm and the curve information other than the curve corresponding to the update mutation interval in the update to-be-processed curve; The method comprises the following steps: obtaining a set of standard points to be processed, and calculating the distance of the optical center to be processed between each standard point in the set of standard points to be processed and the optical center point; the coordinate information of each standard point in the set of standard points to be processed is determined by determining the area to be corrected within the area represented by the second set of standard points, and based on the preset correction resolution information corresponding to the area to be corrected; if the optical center distance to be processed is within the range of the update mutation interval, then based on the coordinate information of the standard point corresponding to the optical center distance to be processed and the target curve, the distortion point corresponding to the standard point in the image to be corrected is determined, and the pixel value corresponding to the distortion point is used as the pixel value of the standard point; if the optical center distance to be processed is not within the range of the update mutation interval, then based on the coordinate information of the standard point corresponding to the optical center distance to be processed and the distortion correction model, the distortion point corresponding to the standard point in the image to be corrected is determined, and the pixel value corresponding to the distortion point is used as the pixel value of the standard point; based on the coordinate information and pixel value of each standard point in the set of standard points to be processed, a target corrected image corresponding to the area to be corrected is generated.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.