CN115802173A - Image processing method and device, electronic equipment and storage medium - Google Patents

Image processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115802173A
CN115802173A CN202310065372.1A CN202310065372A CN115802173A CN 115802173 A CN115802173 A CN 115802173A CN 202310065372 A CN202310065372 A CN 202310065372A CN 115802173 A CN115802173 A CN 115802173A
Authority
CN
China
Prior art keywords
correction
chromatic aberration
channel
lookup table
corrected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310065372.1A
Other languages
Chinese (zh)
Other versions
CN115802173B (en
Inventor
张佳敏
王淑艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202310065372.1A priority Critical patent/CN115802173B/en
Publication of CN115802173A publication Critical patent/CN115802173A/en
Application granted granted Critical
Publication of CN115802173B publication Critical patent/CN115802173B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present disclosure provides an image processing method, an image processing apparatus, an electronic device and a storage medium, which relate to the field of images, and the method of the present disclosure mainly includes: acquiring a nonuniform chromatic aberration correction lookup table; searching a preset number of target grid points from the nonuniform chromatic aberration correction lookup table, wherein the distance from the target grid points to the current pixel to be corrected meets a preset distance condition; and correcting the color difference value of the current pixel to be corrected according to the offsets of the preset number of target grid point correction channels in the vertical direction and the horizontal direction. According to the method, for the lens to be detected, correction color difference values of different color channels in the vertical and horizontal directions are calculated and obtained firstly, and then the correction color difference values are stored in the non-uniform color difference correction lookup table, so that the lookup table can be called to assist in calculation and correction during image correction. Compared with the traditional method for correcting chromatic aberration, the method optimizes the complexity of chromatic aberration correction calculation and improves the speed of correcting the chromatic aberration of the image.

Description

Image processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of image processing, and in particular, to an image processing method and apparatus, an electronic device, and a storage medium.
Background
In the field of image processing, aberration refers to deviation from an ideal situation when a ray traces in an actual optical system. For a color image generally composed of color channels, such as an RGB image composed of three color channels of R, G, and B, the color channels of the color image are not aligned with each other due to the existence of aberration, and color stripes appear at the edges and around high contrast areas of the color image, thereby resulting in poor image display quality. Therefore, how to adopt a reasonable method to correct the image aberration so as to ensure the final image quality of the imaging system is a problem to be solved at present.
Disclosure of Invention
The present disclosure provides an image processing method, an image processing apparatus, an electronic device, and a storage medium, so as to solve the problems in the related art and improve the effect of color image display.
An embodiment of a first aspect of the present disclosure provides an image processing method, where the method includes: acquiring a non-uniform chromatic aberration correction lookup table, wherein the non-uniform chromatic aberration correction lookup table is acquired by processing at least two calibration images shot by a lens to be detected at different angles and comprises offsets of correction channels of grid points in the vertical direction and the horizontal direction; searching a preset number of target grid points from the nonuniform chromatic aberration correction lookup table, wherein the distance from the target grid points to the current pixel to be corrected meets a preset distance condition; and correcting the color difference value of the current pixel to be corrected according to the offsets of the preset number of target grid point correction channels in the vertical direction and the horizontal direction.
In some embodiments of the present disclosure, correcting the color difference value of the current pixel to be corrected according to the offsets of the predetermined number of target grid point correction channels in the vertical direction and the horizontal direction includes: acquiring the offset of the preset number of target grid points in the vertical direction and the horizontal direction of a correction channel; respectively carrying out interpolation calculation on the offsets of the preset number of target grid point correction channels in the vertical direction and the horizontal direction to obtain the correction offsets of the current pixel to be corrected in the vertical direction and the horizontal direction; calculating according to the correction offset of the current pixel to be corrected in the vertical direction and the horizontal direction to obtain the correction coordinate of the current pixel to be corrected; carrying out interpolation processing on the basis of pixel values in a preset range around the correction coordinate of the current pixel to be corrected to obtain a correction color difference value; and correcting the color difference value of the current pixel to be corrected according to the corrected color difference value.
In some embodiments of the present disclosure, before obtaining the nonuniform chromatic aberration correction lookup table, the method further includes: and constructing the non-uniform chromatic aberration correction lookup table according to at least two calibration images shot by the lens to be detected at different angles.
In some embodiments of the disclosure, constructing the non-uniform chromatic aberration correction lookup table according to at least two calibration images captured by the lens to be measured at different angles includes: acquiring at least two calibration images shot by the lens to be detected at different angles; obtaining a reference channel center distance and a correction channel radial scaling coefficient of each key point of a plurality of calibration images, wherein the key point is a point meeting a preset condition in the calibration image, and the reference channel center distance is a distance from a reference channel coordinate to a calibration image center coordinate; and generating the non-uniform chromatic aberration correction lookup table according to the reference channel center distances of all key points of the plurality of calibration images, the correction channel radial scaling coefficients and the non-uniform grid point coordinates of the correction images, wherein the non-uniform chromatic aberration correction lookup table comprises offsets of the correction channel in the vertical direction and the horizontal direction.
In some embodiments of the present disclosure, obtaining the reference channel center distance and the correction channel radial scaling factor of each keypoint of the multiple calibration images includes: obtaining the center distance of the reference channel of each key point according to the reference channel coordinate of each key point and the center coordinate of the calibration image corresponding to each key point; and obtaining the correction channel radial scaling coefficient of each key point according to the correction channel coordinate of each key point, the central coordinate of the calibration image corresponding to each key point and the reference channel coordinate.
In some embodiments of the present disclosure, obtaining the calibration channel radial scaling factor of each keypoint according to the calibration channel coordinate of each keypoint, the center coordinate of the calibration image corresponding to each keypoint, and the reference channel coordinate includes: calculating the correction channel coordinates of each key point and the central coordinates of the calibration image to obtain corresponding first vector values; adjusting the first vector value by using an adjusting coefficient within a threshold value range to obtain a second vector value; and when the distance between the second vector value and the reference channel coordinate is the minimum distance after adjustment, determining the current adjustment coefficient as the correction channel radial scaling coefficient.
In some embodiments of the present disclosure, generating a non-uniform chromatic aberration correction lookup table according to the reference channel center distances and the correction channel radial scaling coefficients of all the key points of the plurality of calibration images and non-uniform grid point coordinates of correction images includes: according to a reference channel, calculating a polynomial fitting function according to the reference channel center distances of all key points of the plurality of calibration images and the correction channel radial scaling coefficients to obtain parameter values of the polynomial fitting function; generating a non-uniform grid in a non-uniform manner; mapping the non-uniform grid to the calibration image to obtain grid points; calculating according to the coordinates of each grid point and the parameter values of the polynomial fitting function to obtain a grid point center distance, a grid point radial scaling coefficient and an included angle from the grid point to the center of the calibration image, which correspond to each grid point; acquiring the offset of a correction channel in the vertical direction and the horizontal direction of each grid point according to the center distance of the grid point corresponding to each grid point, the radial scaling coefficient of the grid point and the included angle from the grid point to the center of the calibration image; and storing the offset of the correction channel in the vertical direction and the offset of the correction channel in the horizontal direction of each grid point in the corresponding grid point to generate a non-uniform chromatic aberration correction lookup table.
A second aspect of the present disclosure provides an image processing apparatus, including: the acquiring unit is used for acquiring a nonuniform chromatic aberration correction lookup table, and the nonuniform chromatic aberration correction lookup table is acquired by processing at least two calibration images shot by the lens to be detected at different angles and comprises offsets of correction channels of each grid point in the vertical direction and the horizontal direction; the searching unit is used for searching a preset number of target grid points from the nonuniform chromatic aberration correction lookup table, and the distance from the target grid points to the current pixel to be corrected meets a preset distance condition; and the correcting unit is used for correcting the color difference value of the current pixel to be corrected according to the offset of the preset number of target grid point correction channels in the vertical direction and the horizontal direction.
A third aspect of the present disclosure provides an electronic device, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method described in embodiments of the first aspect of the disclosure.
A fourth aspect of the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the first aspect of the present disclosure.
A fifth aspect embodiment of the present disclosure proposes a computer program product comprising a computer program which, when executed by a processor, performs the method described in the first aspect embodiment of the present disclosure.
The image processing method, the image processing device, the electronic equipment and the storage medium provided by the disclosure comprise the following steps: acquiring a non-uniform chromatic aberration correction lookup table, wherein the non-uniform chromatic aberration correction lookup table is acquired by processing at least two calibration images shot by a lens to be detected at different angles and comprises offsets of correction channels of grid points in the vertical direction and the horizontal direction; searching a preset number of target grid points from the nonuniform chromatic aberration correction lookup table, wherein the distance from the target grid points to the current pixel to be corrected meets a preset distance condition; and correcting the color difference value of the current pixel to be corrected according to the offsets of the preset number of target grid point correction channels in the vertical direction and the horizontal direction. According to the method, for the lens to be detected, correction color difference values of different color channels in the vertical and horizontal directions are calculated and obtained firstly, and then the correction color difference values are stored in the non-uniform color difference correction lookup table, so that the lookup table can be called to assist in calculation and correction during image correction. Compared with the traditional method for correcting chromatic aberration, the method optimizes the complexity of chromatic aberration correction calculation and improves the speed of correcting the chromatic aberration of the image.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as unduly limiting the disclosure.
Fig. 1 is a flowchart of an image processing method according to an embodiment of the present disclosure;
fig. 2 is a flowchart of an image processing method according to an embodiment of the disclosure;
fig. 3 is a flowchart of an image processing method according to an embodiment of the disclosure;
fig. 4 is a flowchart of an image processing method according to an embodiment of the present disclosure;
fig. 5 is a flowchart of an image processing method according to an embodiment of the disclosure;
fig. 6 is a flowchart of an image processing method according to an embodiment of the disclosure;
fig. 7 is a flowchart of an image processing method according to an embodiment of the present disclosure;
fig. 8 is a schematic flowchart of a chromatic aberration correction method according to an embodiment of the present disclosure;
FIG. 9 is a schematic diagram of a calibration image provided by an embodiment of the present disclosure;
FIG. 10 is a schematic diagram illustrating a calibration model calculation according to an embodiment of the disclosure;
FIG. 11 is a schematic diagram of a non-uniform grid provided by an embodiment of the present disclosure;
fig. 12 is a block diagram illustrating an image processing apparatus according to an embodiment of the present disclosure;
fig. 13 is a block diagram illustrating an image processing apparatus according to an embodiment of the present disclosure;
fig. 14 is a block diagram illustrating an image processing apparatus according to an embodiment of the present disclosure;
fig. 15 is a block diagram illustrating an image processing apparatus according to an embodiment of the present disclosure;
fig. 16 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are illustrative and intended to explain the present disclosure, and should not be construed as limiting the present disclosure.
In the field of image processing, aberration refers to deviation from an ideal situation when a ray traces in an actual optical system. For a color image generally composed of color channels, such as an RGB image composed of three color channels of R, G, and B, the color channels of the color image are not aligned with each other due to the existence of aberration, and color stripes appear at the edges and around high contrast areas of the color image, thereby resulting in poor image display quality. Therefore, how to adopt a reasonable method to correct the image aberration so as to ensure the final image quality of the imaging system is a problem to be solved at present.
The current methods for correcting aberration can be mainly divided into correction at the lens end and correction after imaging. For the method of correction at the lens end, it is often necessary to consider the hardware characteristics in the lens group, such as the refractive index of each lens, and the like, resulting in a complicated and costly method. However, for the method of correction after imaging, polynomial fitting is usually required to be performed on the chromatic aberration of the whole image, and there are inevitable problems of excessive calculation amount and long correction time.
In order to solve the problems in the related art, the method firstly calculates and acquires the correction color difference values of different color channels in the vertical and horizontal directions aiming at the lens to be detected, and then stores the correction color difference values in the non-uniform color difference correction lookup table, so that the lookup table can be called to assist in calculation and correction during image correction. Compared with the conventional method for correcting chromatic aberration, the method optimizes the complexity of chromatic aberration correction calculation and improves the speed of correcting the chromatic aberration of the image.
Fig. 1 is a flowchart of an image processing method according to an embodiment of the present disclosure. As shown in fig. 1, steps 101-103 are included.
Step 101, obtaining a nonuniform chromatic aberration correction lookup table.
It should be noted that, in the embodiment of the present disclosure, the nonuniform chromatic aberration correction lookup table is obtained by processing at least two calibration images captured by the lens to be measured at different angles, and includes offsets of the correction channels of each grid point in the vertical direction and the horizontal direction, where the correction channels are other selected color channels except for the reference channel. For example, if the image a is an image in RGB format, when the G color channel is selected as the reference channel, the R color channel and the G color channel are correction channels, and the specific color format and which channel is specifically selected as the reference channel are not limited in this embodiment of the disclosure.
In addition, when storing, the non-uniform chromatic aberration correction lookup table may be stored as a lookup table, or may be stored as another data structure having a function of storing and looking up, and a specific format of the non-uniform chromatic aberration correction lookup table is not limited in this embodiment of the present disclosure.
Step 102, searching a predetermined number of target grid points from the nonuniform chromatic aberration correction lookup table.
It should be noted that, in the embodiment of the present disclosure, a distance from the target grid point to the current pixel to be corrected meets a preset distance condition, that is, the target grid point is obtained based on the current pixel to be corrected, and may refer to a grid point meeting the preset distance condition within a certain range around the current pixel to be corrected, or may refer to a grid point selected in other selection manners, that is, a specific manner of selecting a target grid point, which is not limited in the embodiment of the present disclosure. The predetermined number may be 4, 8, or other self-defined number, and the specific number is not limited in this disclosure.
Step 103, correcting the color difference value of the current pixel to be corrected according to the offset of the preset number of target grid point correction channels in the vertical direction and the horizontal direction.
It should be noted that, in the embodiment of the present disclosure, during the correction, the correction may be performed based on a unit of pixel, or may also be performed based on other image units, and a specific correction unit is not limited in this regard. When the color difference value of the current pixel point to be corrected is corrected, the corrected color difference value of the pixel point is obtained through calculation according to the offset in the vertical direction and the horizontal direction for different color channels, so that the pixel point is corrected, and a specific calculation and correction sequence are obtained.
In summary, the image processing method provided by the present disclosure includes: acquiring a non-uniform chromatic aberration correction lookup table, wherein the non-uniform chromatic aberration correction lookup table is acquired by processing at least two calibration images shot by a lens to be detected at different angles and comprises offsets of correction channels of grid points in the vertical direction and the horizontal direction; searching a preset number of target grid points from the nonuniform chromatic aberration correction lookup table, wherein the distance from the target grid points to the current pixel to be corrected meets a preset distance condition; and correcting the color difference value of the current pixel to be corrected according to the offsets of the preset number of target grid point correction channels in the vertical direction and the horizontal direction. According to the method, for the lens to be detected, correction color difference values of different color channels in the vertical and horizontal directions are calculated and obtained firstly, and then the correction color difference values are stored in the non-uniform color difference correction lookup table, so that the lookup table can be called to assist in calculation and correction during image correction. Compared with the traditional method for correcting chromatic aberration, the method optimizes the complexity of chromatic aberration correction calculation and improves the speed of correcting the chromatic aberration of the image.
Further, in some embodiments of the present disclosure, when step 103 is executed to correct the color difference value of the current pixel to be corrected according to the offsets of the predetermined number of target grid point correction channels in the vertical direction and the horizontal direction, the method may be implemented by, but is not limited to, the following method, specifically as shown in fig. 2, including the following steps:
step 201, acquiring the offset of the predetermined number of target grid points in the correction channel vertical direction and horizontal direction.
It should be noted that, in the embodiment of the present disclosure, the obtaining the offset is obtained from the non-uniform color difference correction lookup table, and when obtaining the offset, the obtaining may first perform lookup according to the target grid point, and then extract offset values in the vertical direction and the horizontal direction corresponding to the target grid point in the non-uniform color difference correction table, and a specific lookup and extraction manner is not limited in this respect.
Step 202, respectively performing interpolation calculation on the offsets of the predetermined number of target grid point correction channels in the vertical direction and the horizontal direction to obtain correction offsets of the current pixel to be corrected in the vertical direction and the horizontal direction.
It should be noted that, in the embodiment of the present disclosure, the interpolation calculation may be a bilinear interpolation algorithm, may also be a nearest neighbor interpolation algorithm, may also be other interpolation calculation methods, and a specific interpolation algorithm, which is not limited in this respect.
Step 203, calculating according to the correction offset of the current pixel to be corrected in the vertical direction and the horizontal direction to obtain the correction coordinate of the current pixel to be corrected.
The embodiments of the present disclosure are not limited to the above-mentioned steps, which need to be described herein, and are not described herein again.
And 204, performing interpolation processing based on pixel values in a preset range around the correction coordinate of the current pixel to be corrected to obtain a corrected color difference value.
It should be noted that, in the embodiment of the present disclosure, the pixel value refers to a color value of a pixel to be corrected, and in the predetermined range, a peripheral range of the pixel to be corrected, which is selected through a window with a size of 4 × 4, may also be a range selected through other selection manners, which is a specific range selection manner, which is not limited in this embodiment of the present disclosure. The interpolation processing may use a bicubic interpolation algorithm, may also be a bicubic interpolation algorithm, or may be other interpolation algorithms, a specific interpolation algorithm, which is not limited in this embodiment of the present disclosure.
Step 205, correcting the color difference value of the current pixel to be corrected according to the corrected color difference value.
The steps that need to be described in the present disclosure are already described in the above, and are not described herein again, and the embodiments of the present disclosure are not limited thereto.
In some embodiments of the present disclosure, the method first obtains the nonuniform chromatic aberration correction lookup table, and then obtains a predetermined number of target grid points according to the nonuniform chromatic aberration correction lookup table, so as to correct the chromatic aberration value of the pixel to be corrected. Before obtaining the non-uniform color difference correction lookup table, the method further includes constructing the non-uniform color difference lookup table, which can be implemented by, but not limited to, the following method, specifically as shown in fig. 3, including the following steps:
step 301, constructing the non-uniform chromatic aberration correction lookup table according to at least two calibration images shot by the lens to be measured at different angles.
It should be noted that in the embodiment of the present disclosure, the shooting at different angles refers to shooting different calibration images by using the lens to be measured to perform different shooting on the selected calibration plate during shooting. When shooting, different visual angles of the lens to be measured can be adjusted, such as upward shooting or downward shooting, different calibration positions of the lens to be measured can also be adjusted, such as a calibration plate can be placed above the visual angle of the lens, or the calibration plate can be placed below, or to the left, or to the right, specific shooting modes and specific calibration image quantities, and the embodiment of the disclosure is not limited to this.
Further, in some embodiments of the present disclosure, when step 301 is executed to construct the non-uniform chromatic aberration correction lookup table according to at least two calibration images captured by the lens to be measured at different angles, the method may be implemented by, but is not limited to, the following method, specifically as shown in fig. 4, including the following steps:
step 401, acquiring at least two calibration images shot by the lens to be measured at different angles.
The steps that need to be described in the present disclosure have been described above, and are not described herein again, and the embodiment of the present disclosure is not limited to this.
Step 402, obtaining the center distance of each key point reference channel and the radial scaling coefficient of the correction channel of the plurality of calibration images.
It should be noted that, in the embodiment of the disclosure, the key point is a point that meets a preset condition in the calibration image, and the preset condition may refer to a selected specific point in the calibration image, for example, if the calibration image is acquired according to a checkerboard calibration board, the specific point may refer to an intersection point of checkerboards, that is, the preset condition is an intersection point of checkerboards in the calibration image, and the specific preset condition may be set according to different calibration manners, which is not limited in the embodiment of the disclosure.
In addition, the reference channel center distance is a distance from a reference channel coordinate to the calibration image center coordinate, and the reference channel is a color channel selected as a reference, for example, if the image a is an image in an RGB format, if the G color channel is selected as a reference, the reference channel is a G channel, if the R color channel is selected as a reference, the reference channel is an R channel, and a specific reference channel may be selected by itself. And the correction channel radial scaling coefficient is obtained by calculating the comprehensive correction channel coordinate, the central coordinate of the calibration image corresponding to each key point and the reference channel coordinate.
Step 403, generating the non-uniform chromatic aberration correction lookup table according to the reference channel center distances of all key points of the plurality of calibration images, the correction channel radial scaling coefficients, and the coordinates of non-uniform grid points of the correction images.
The steps that need to be described in this disclosure have been described above, and are not described herein again, the non-uniform chromatic aberration correction lookup table includes offsets of the correction channel in the vertical direction and the horizontal direction, and specifically, the contents of the non-uniform chromatic aberration correction lookup table are not limited in this respect.
Further, in some embodiments of the present disclosure, when the step 402 is executed to obtain the center distance of the reference channel of the keypoint and the radial scaling coefficient of the correction channel of the multiple calibration images, the method may be implemented by, but is not limited to, the following method, specifically as shown in fig. 5, including the following steps:
and step 501, obtaining the center distance of the reference channel of each key point according to the reference channel coordinate of each key point and the center coordinate of the calibration image corresponding to each key point.
It should be noted that, in the embodiment of the present disclosure, when the center of the reference channel is obtained, the distance from the reference channel coordinate of the key point to the center coordinate of the corresponding calibration image may be calculated, and a specific calculation manner is not limited in this respect.
Step 502, obtaining a correction channel radial scaling factor of each key point according to the correction channel coordinates of each key point, the central coordinates of the calibration image corresponding to each key point, and the reference channel coordinates.
It should be noted at this point that in obtaining the correction channel radial scaling factor, the calculation is performed separately for different correction channels. For example, if the image a is an image in RGB format, and the G channel is selected as the reference channel, then its correction channels are the R channel and the B channel, and during the calculation, the R channel and the B channel are calculated separately to obtain their correction channel radial scaling coefficients. A specific order of channel calculation, which is not limited by the embodiments of the present disclosure.
Further, in some embodiments of the present disclosure, when the step 502 is executed to obtain the corrected channel radial scaling factor of each keypoint according to the corrected channel coordinate of each keypoint, the center coordinate of the calibration image corresponding to each keypoint, and the reference channel coordinate, the method may be implemented by, but is not limited to, the following method, specifically as shown in fig. 6, including the following steps:
step 601, calculating the correction channel coordinates of each key point and the center coordinates of the calibration image to obtain corresponding first vector values.
It should be noted that in this embodiment of the present disclosure, the first vector value is a vector from the correction channel coordinate of the key point to the center coordinate of the corresponding calibration image.
Step 602, adjusting the first vector value by using an adjustment coefficient within a threshold range to obtain a second vector value.
It should be noted that, in the embodiment of the present disclosure, the threshold range may be a predetermined numerical range, a numerical range from 0.9 to 1.2 may be selected, or other numerical ranges, and a specific numerical range may also be selected, which is not limited in this respect.
Step 603, when the distance between the second vector value and the reference channel coordinate is the minimum distance after adjustment, determining the correction channel radial scaling factor from the current adjustment factor.
It should be noted that, in the embodiment of the present disclosure, the first vector is continuously adjusted to obtain the second vector according to different adjustment coefficients within the threshold range, and when the distance from the endpoint coordinate of the adjusted second vector to the reference channel coordinate is the minimum within the threshold range, the adjustment coefficient is retained as the correction channel radial scaling coefficient, which is a specific adjustment method.
Further, in some embodiments of the present disclosure, when step 403 is executed to generate a nonuniform chromatic aberration correction lookup table according to the reference channel center distances and the correction channel radial scaling coefficients of all key points of the multiple calibration images and the coordinates of nonuniform grid points of the corrected images, the method may be implemented by, but is not limited to, the following method, as specifically shown in fig. 7, including the following steps:
step 701, according to a reference channel, calculating a polynomial fitting function according to the reference channel center distances of all key points of the plurality of calibration images and the correction channel radial scaling coefficients, and obtaining parameter values of the polynomial fitting function.
It should be noted that, in the embodiment of the present disclosure, the polynomial fitting function may be a fourth-order polynomial, and may also be other kinds of polynomials, specifically, which kind of polynomial is not limited in this respect. The parameter values of the polynomial fitting function may include coefficient values or may include constant values, and the specific parameter values constitute, which is not limited in this embodiment of the disclosure.
Step 702, generating a non-uniform grid in a non-uniform manner.
It should be noted that, when the non-uniform grid is generated in a non-uniform manner, different generation methods, specifically generation methods, may be used, which is not limited in this embodiment of the present disclosure.
Step 703, mapping the non-uniform grid onto the calibration image to obtain grid points.
It should be noted that, in the embodiment of the present disclosure, the non-uniform grid generated in the foregoing is mapped onto the calibration image to obtain the grid points, where the manner of obtaining the grid points may be obtained by non-uniform grid mapping, or may be obtained by other types of grids, and the specific manner of obtaining the grid points is not limited in this embodiment of the present disclosure.
Step 704, calculating according to the coordinates of each grid point and the parameter values of the polynomial fitting function, to obtain a grid point center distance, a grid point radial scaling coefficient, and an included angle from the grid point to the center of the calibration image, which correspond to each grid point.
It should be noted that, in the embodiment of the present disclosure, by using the obtained polynomial parameter values and grid point coordinates, a grid point center distance and a grid point radial scaling coefficient corresponding to a grid point may be obtained, and an included angle value of the center of the calibration image may also be obtained according to the grid point coordinates, and a specific calculation order is not limited in this embodiment of the present disclosure.
Step 705, obtaining the offset of the correction channel in the vertical direction and the horizontal direction of each grid point according to the grid point center distance and the grid point radial scaling factor corresponding to each grid point and the included angle from the grid point to the center of the calibration image.
The steps that need to be described in the present disclosure have been described above, and are not described herein again, and the specific calculation sequence is not limited in this regard.
Step 706, storing the offset of the correction channel in the vertical direction and the horizontal direction of each grid point in the corresponding grid point, and generating a non-uniform chromatic aberration correction lookup table.
In the embodiment of the present disclosure, when storing the offset amounts of the correction channel in the vertical direction and the horizontal direction of each grid point, when obtaining the stored content of the lookup table, the calculation may be obtained by, but is not limited to, equation 1, where equation 1 may be expressed as the following equation:
Figure SMS_1
where (Y0, X0) are the coordinates of the image center, θ is the angle from the calibration image center to the grid points acquired in step 704, r is the center distance of the grid points acquired in step 704, δ is the radial scaling factor of the grid points acquired in step 704, and X and Y are the coordinates of the grid points.
In summary, according to the method, for the lens to be detected, the corrected color difference values of different color channels in the vertical and horizontal directions are calculated and obtained, and then are stored in the non-uniform color difference correction lookup table, so that the lookup table can be called to assist in calculating and correcting during image correction. Compared with the traditional method for correcting chromatic aberration, the method optimizes the complexity of chromatic aberration correction calculation and improves the speed of correcting the chromatic aberration of the image.
Based on the above method, when correcting the color of the image, the correction value may be calculated according to the non-uniform correction lookup table, so as to correct the pixel of the image to be corrected, as shown in fig. 8, which is a schematic flow chart of the color difference correction method of the present disclosure, the present disclosure takes an RGB format image, and takes a calibration board image — a checkerboard calibration board as an example, and when performing the color difference correction, the method may include, but is not limited to, the following steps:
firstly, calibrating a lens to be measured by using a checkerboard calibration board.
As shown in fig. 9, in the embodiment of the present disclosure, a checkerboard calibration board can be shot at different angles by using a lens to be measured, a plurality of calibration images are obtained, then intersection points of checkerboards in three color channels of R, G, and B in each calibration image are detected, and the intersection points are used as key points of each color channel and coordinates of the key points are recorded.
And secondly, solving the radial scaling coefficient of the RB correction channel of the key point.
In the embodiment of the present disclosure, the G channel is selected as the reference channel, and when the RB correction channel radial scaling factor is obtained, the correction channel radial scaling factors of the R channel and the B channel are respectively obtained, as shown in fig. 10, the following operations are performed for each key point:
1) And calculating the distance r from the G reference channel coordinate in the key point to the corresponding calibration image center coordinate.
2) And calculating a vector a of R (B) correction channel coordinates corresponding to the key points from the image center coordinates.
3) And (3) setting the included angle between the vector a and the x horizontal direction as theta, keeping the vector angle unchanged, and changing the modular length of the vector by multiplying different coefficients delta.
4) And (3) calculating coordinates (x ', y') of a vector end point position corresponding to each coefficient delta and a distance d from the end point coordinates to G reference channel coordinates.
5) The coefficient delta corresponding to the minimum distance d is retained as the correction channel radial scaling coefficient delta.
And thirdly, fitting a space scaling model.
According to the embodiment of the disclosure, separate fitting model calculation is respectively carried out on different correction channels, images of all correction channels are calibrated during fitting, and corresponding key points are obtained
Figure SMS_2
And a radial scaling factor δ, for which functional form to use, the fitting will be described according to an example below: since the radial scaling factor δ represents the ratio of the distance from the keypoint coordinate to the center coordinate on the R (B) plane of the corrected channel after correction to the distance from the keypoint coordinate to the center coordinate before correction, the radial scaling factor δ represents the ratio of the distance from the keypoint coordinate to the center coordinate on the R (B) plane of the corrected channel after correction to the distance from the keypoint coordinate to the center coordinate before correctionThe closer to the center of the image, the closer the value of δ should be to 1. Thus, when fitting a polynomial, a constant term should exist, where a fourth order polynomial is used as the fitting model:
Figure SMS_3
in fitting the model, the coefficients α and constants C preceding each term in the selected polynomial, i.e. the parameter values of the polynomial, are calculated.
And fourthly, acquiring a correction lookup table.
When the digital image signal is processed, the offset of the transverse chromatic aberration is calculated in advance for each point at each position in the picture, and then the correction is carried out, which is a very resource-consuming process. Usually, a set of a predetermined number of specific points in the screen is selected, the offset is calculated for the points in the set, and the coordinates and the offset of the points in the set are stored separately. The lateral chromatic aberration has the characteristics that the offset is larger when the lateral chromatic aberration is closer to the lens edge, and the offset is smaller when the lateral chromatic aberration is closer to the image center, so that some feature points can be selected from pictures close to the lens edge. The embodiment of the present disclosure may specifically be divided into the following steps:
1) A mesh of 17 x 31, i.e. the mesh shown in fig. 11, is generated in a non-uniform manner.
2) The mesh is mapped onto the entire calibration image to obtain 18 x 32 mesh vertex coordinates.
3) Using the polynomial space scaling model fitted in the third step and the obtained parameter values of the polynomial space scaling model, calculating the radius r at each grid point coordinate, i.e. the distance from the grid point coordinate to the central coordinate of the calibration image, calculating the scaling factor δ, i.e. the radial scaling factor of the grid point, and calculating the angle θ from the current grid point coordinate to the image central coordinate vector.
4) Calculating a difference between the corrected coordinates and the coordinates before correction according to the obtained parameters, and storing the difference into the LUT table to obtain the corrected lookup tables, wherein the stored contents of each corrected lookup table are as follows, i.e. the calculation process described in formula 1 mentioned in the previous step 706:
Figure SMS_4
wherein (Y0, X0) is the coordinates of the center of the image, θ is the angle between the acquired grid point and the center of the calibration image, r is the distance between the acquired grid point coordinates and the center coordinates of the calibration image, δ is the radial scaling factor of the acquired grid point, and X and Y are the difference between the corrected coordinates and the coordinates before correction.
For the correction lookup tables, there may be stored, but not limited to, 4 lookup tables of 18 × 32, each of which stores R correction channel radial correction magnitude in x-direction, y-direction component, and B correction channel radial correction magnitude in x-direction, y-direction component, respectively.
And fifthly, correcting the lateral chromatic aberration.
According to the embodiment of the disclosure, after the lookup table is calculated, the correction of the lateral chromatic aberration can be performed, and for each pixel in the image, the correction of the R (B) correction channel is performed respectively, which can be divided into the following steps:
1) Reading the correction lookup table constructed by the steps
2) And determining four grid points with coordinates closest to the coordinates of the pixel to be corrected in the correction lookup table according to the position coordinates of the current pixel to be corrected.
3) And performing bilinear interpolation by using the correction offset of the four grid points in the correction lookup table to obtain the correction offset x and y of the current pixel to be corrected in the horizontal direction and the vertical direction.
4) According to the correction offset, the corrected coordinates (x +. Δ x, y +. Δ y) of the current grid point are calculated.
5) And selecting an interpolation window with the size of 4 multiplied by 4 consisting of points of the same channel around the corrected grid point coordinates (x +. DELTA.x, y +. DELTA.y), calculating by using a bicubic interpolation method to obtain a corrected pixel value of the grid point pixel, and correcting the grid point pixel value according to the corrected pixel value.
Therefore, the scheme has the following beneficial effects: according to the scheme, the non-uniform chromatic aberration correction lookup tables of different color channels are obtained according to the lens to be detected, so that the image chromatic aberration is corrected according to the non-uniform chromatic aberration correction lookup tables. On one hand, the method avoids large calculation amount in the past chromatic aberration calculation, on the other hand, the method is more practical, and the calculation speed of image chromatic aberration correction is improved by using the non-uniform correction lookup table.
Fig. 12 is a schematic structural diagram of an image processing apparatus 1200 according to an embodiment of the disclosure. As shown in fig. 12, the image processing apparatus includes:
the acquiring unit 1201 acquires a nonuniform chromatic aberration correction lookup table, which is obtained by processing at least two calibration images shot by the lens to be measured at different angles and includes offsets of correction channels of each grid point in the vertical direction and the horizontal direction;
a searching unit 1202, configured to search a predetermined number of target grid points from the non-uniform chromatic aberration correction lookup table, where a distance from the target grid point to a current pixel to be corrected meets a preset distance condition;
a correcting unit 1203 corrects the color difference value of the current pixel to be corrected according to the offsets of the predetermined number of target grid point correction channels in the vertical direction and the horizontal direction.
In some embodiments of the present disclosure, as shown in fig. 13, the correcting unit 1203 includes:
a first obtaining module 12031, obtaining the offset of the predetermined number of target grid points correcting channel vertical direction and horizontal direction;
a second obtaining module 12031, which performs interpolation calculation on the offsets in the vertical direction and the horizontal direction of the target grid point correction channels of the predetermined number respectively to obtain correction offsets in the vertical direction and the horizontal direction of the current pixel to be corrected;
the first calculating module 12033 performs calculation according to the correction offset of the current pixel to be corrected in the vertical direction and the horizontal direction to obtain a correction coordinate of the current pixel to be corrected;
a third obtaining module 12034, which performs interpolation processing based on the pixel values in the predetermined range around the correction coordinate of the current pixel to be corrected to obtain a corrected color difference value;
the correcting module 12035 corrects the color difference value of the current pixel to be corrected according to the corrected color difference value.
In some embodiments of the present disclosure, as shown in fig. 14, before obtaining the non-uniform chromatic aberration correction look-up table, the method further includes:
the constructing unit 1204 is configured to construct the non-uniform chromatic aberration correction lookup table according to at least two calibration images shot by the lens to be measured at different angles.
In some embodiments of the present disclosure, as shown in fig. 15, the building unit 1204 includes:
a fourth obtaining module 12041, obtaining at least two calibration images shot by the lens to be measured at different angles;
a fifth obtaining module 12042, configured to obtain a reference channel center distance and a correction channel radial scaling coefficient of each key point of the multiple calibration images, where the key point is a point in the calibration image that meets a preset condition, and the reference channel center distance is a distance from a reference channel coordinate to a calibration image center coordinate;
a generating module 12043, configured to generate the non-uniform chromatic aberration correction lookup table according to the reference channel center distances of all the keypoints of the multiple calibration images, the correction channel radial scaling coefficients, and non-uniform grid point coordinates of a corrected image, where the non-uniform chromatic aberration correction lookup table includes offsets in the vertical direction and the horizontal direction of the correction channel.
In some embodiments of the present disclosure, the fifth obtaining module 12042 is further configured to:
obtaining the center distance of the reference channel of each key point according to the reference channel coordinate of each key point and the center coordinate of the calibration image corresponding to each key point;
and obtaining the correction channel radial scaling coefficient of each key point according to the correction channel coordinate of each key point, the central coordinate of the calibration image corresponding to each key point and the reference channel coordinate.
In some embodiments of the present disclosure, the fifth obtaining module 12042 is further configured to:
calculating the correction channel coordinates of each key point and the central coordinates of the calibration image to obtain corresponding first vector values;
adjusting the first vector value by using an adjusting coefficient in a threshold value range to obtain a second vector value;
and when the distance between the second vector value and the reference channel coordinate is the minimum distance after adjustment, determining the current adjustment coefficient as the correction channel radial scaling coefficient.
In some embodiments of the present disclosure, the generating module 12043 is further configured to:
according to a reference channel, calculating a polynomial fitting function according to the reference channel center distances of all key points of the plurality of calibration images and the correction channel radial scaling coefficients to obtain parameter values of the polynomial fitting function;
generating a non-uniform grid in a non-uniform manner;
mapping the non-uniform grid to the calibration image to obtain grid points;
calculating according to the coordinates of each grid point and the parameter values of the polynomial fitting function to obtain a grid point center distance, a grid point radial scaling coefficient and an included angle from the grid point to the center of the calibration image, which correspond to each grid point;
acquiring the offset of a correction channel in the vertical direction and the horizontal direction of each grid point according to the center distance of the grid point corresponding to each grid point, the radial scaling factor of the grid point and the included angle from the grid point to the center of the calibration image;
and storing the offsets of the correction channel in the vertical direction and the horizontal direction of each grid point in the corresponding grid point to generate a nonuniform chromatic aberration correction lookup table.
According to the embodiment of the disclosure, when an image is corrected, a non-uniform chromatic aberration correction lookup table is obtained firstly, and the non-uniform chromatic aberration correction lookup table is obtained by processing at least two calibration images shot by a lens to be measured at different angles and contains offsets of correction channels of grid points in the vertical direction and the horizontal direction; searching a preset number of target grid points from the nonuniform chromatic aberration correction lookup table, wherein the distance from the target grid points to the current pixel to be corrected meets a preset distance condition; and correcting the color difference value of the current pixel to be corrected according to the offsets of the preset number of target grid point correction channels in the vertical direction and the horizontal direction. According to the method, for the lens to be detected, correction color difference values of different color channels in the vertical and horizontal directions are calculated and obtained firstly, and then the correction color difference values are stored in the non-uniform color difference correction lookup table, so that the lookup table can be called to assist in calculation and correction during image correction. Compared with the conventional method for correcting chromatic aberration, the method optimizes the complexity of chromatic aberration correction calculation and improves the speed of correcting the chromatic aberration of the image.
In the embodiments provided in the present application, the method and apparatus provided in the embodiments of the present application are introduced. In order to implement the functions in the method provided by the embodiment of the present application, the electronic device may include a hardware structure and a software module, and the functions are implemented in the form of a hardware structure, a software module, or a hardware structure and a software module. Some of the above-described functions may be implemented by a hardware configuration, a software module, or a combination of a hardware configuration and a software module.
Fig. 16 is a block diagram illustrating an electronic device 1600 for implementing the image data acquisition method described above, according to an example embodiment. For example, the electronic device 1600 may be a mobile phone, a computer, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and so forth.
Referring to fig. 16, electronic device 1600 may include one or more of the following components: processing component 1602, memory 1604, power component 1606, multimedia component 1608, audio component 1610, input/output (I/O) interface 1612, sensor component 1614, and communications component 1616.
The processing component 1602 generally controls overall operation of the electronic device 1600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 1602 may include one or more processors 1620 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 1602 can include one or more modules that facilitate interaction between the processing component 1602 and other components. For example, the processing component 1602 can include a multimedia module to facilitate interaction between the multimedia component 1608 and the processing component 1602.
The memory 1604 is configured to store various types of data to support operation at the electronic device 1600. Examples of such data include instructions for any application or method operating on the electronic device 1600, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1604 may be implemented by any type or combination of volatile or non-volatile storage devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 1606 provides power to the various components of the electronic device 1600. The power components 1606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 1600.
The multimedia component 1608 includes a screen that provides an output interface between the electronic device 1600 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1608 comprises a front-facing camera and/or a rear-facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 1600 is in an operational mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 1610 is configured to output and/or input an audio signal. For example, the audio component 1610 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 1600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 1604 or transmitted via the communications component 1616. In some embodiments, audio component 1610 further comprises a speaker for outputting audio signals.
The I/O interface 1612 provides an interface between the processing component 1602 and peripheral interface modules, such as keyboards, click wheels, buttons, and the like. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
Sensor assembly 1614 includes one or more sensors for providing various aspects of status assessment for electronic device 1600. For example, sensor assembly 1614 may detect an open/closed state of electronic device 1600, the relative positioning of components, such as a display and keypad of electronic device 1600, a change in position of electronic device 1600 or a component of electronic device 1600, the presence or absence of user contact with electronic device 1600, orientation or acceleration/deceleration of electronic device 1600, and a change in temperature of electronic device 1600. The sensor assembly 1614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communications component 1616 is configured to facilitate communications between the electronic device 1600 and other devices in a wired or wireless manner. The electronic device 1600 may access a wireless network based on a communication standard, such as WiFi,2G or 3g,4g LTE, 5G NR (New Radio), or a combination thereof. In an exemplary embodiment, the communication component 1616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 1616 also includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 1600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 1604 comprising instructions, executable by the processor 320 of the electronic device 1600 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Embodiments of the present disclosure also propose a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the image processing method described in the above embodiments of the present disclosure.
Embodiments of the present disclosure also provide a computer program product comprising a computer program which, when executed by a processor, performs the image processing method described in the above embodiments of the present disclosure.
Embodiments of the present disclosure also provide a chip that includes one or more interface circuits and one or more processors; the interface circuit is configured to receive a signal from a memory of the electronic device and send the signal to the processor, where the signal includes computer instructions stored in the memory, and when the processor executes the computer instructions, the electronic device is configured to perform the image processing method described in the above-described embodiment of the present disclosure.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
In the description of the present specification, reference to the description of "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples", etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps in the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processing module-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection having one or more wires (a control method), a portable computer diskette (a magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of embodiments of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following technologies, which are well known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, and the program may be stored in a computer readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may also be stored in a computer readable storage medium. The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
While embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are exemplary and not to be construed as limiting the present invention and that variations, modifications, substitutions and alterations in the above embodiments may be made by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. An image processing method, comprising:
acquiring a non-uniform chromatic aberration correction lookup table, wherein the non-uniform chromatic aberration correction lookup table is acquired by processing at least two calibration images shot by a lens to be detected at different angles and comprises offsets of correction channels of grid points in the vertical direction and the horizontal direction;
searching a preset number of target grid points from the nonuniform chromatic aberration correction lookup table, wherein the distance from the target grid points to the current pixel to be corrected meets a preset distance condition;
and correcting the color difference value of the current pixel to be corrected according to the offsets of the preset number of target grid point correction channels in the vertical direction and the horizontal direction.
2. The method according to claim 1, wherein the correcting the color difference value of the current pixel to be corrected according to the offsets of the predetermined number of target grid point correction channels in the vertical and horizontal directions comprises:
acquiring the offset of the preset number of target grid points in the vertical direction and the horizontal direction of a correction channel;
respectively carrying out interpolation calculation on the offsets of the preset number of target grid point correction channels in the vertical direction and the horizontal direction to obtain the correction offsets of the current pixel to be corrected in the vertical direction and the horizontal direction;
calculating according to the correction offset of the current pixel to be corrected in the vertical direction and the horizontal direction to obtain the correction coordinate of the current pixel to be corrected;
carrying out interpolation processing on the basis of pixel values in a preset range around the correction coordinate of the current pixel to be corrected to obtain a correction color difference value; and correcting the color difference value of the current pixel to be corrected according to the corrected color difference value.
3. The method according to claim 1 or 2, further comprising, before obtaining the nonuniform chromatic aberration correction look-up table:
and constructing the non-uniform chromatic aberration correction lookup table according to at least two calibration images shot by the lens to be detected at different angles.
4. The method as claimed in claim 3, wherein the constructing the non-uniform chromatic aberration correction lookup table according to at least two calibration images captured by the lens to be tested at different angles comprises:
acquiring at least two calibration images shot by the lens to be detected at different angles;
obtaining a reference channel center distance and a correction channel radial scaling coefficient of each key point of a plurality of calibration images, wherein the key point is a point meeting a preset condition in the calibration image, and the reference channel center distance is a distance from a reference channel coordinate to a calibration image center coordinate;
and generating the non-uniform chromatic aberration correction lookup table according to the reference channel center distances of all key points of the plurality of calibration images, the correction channel radial scaling coefficients and the non-uniform grid point coordinates of the correction images, wherein the non-uniform chromatic aberration correction lookup table comprises offsets of the correction channel in the vertical direction and the horizontal direction.
5. The method according to claim 4, wherein the obtaining of the keypoint reference channel center distance and the correction channel radial scaling factor for the multiple calibration images comprises:
obtaining the center distance of the reference channel of each key point according to the reference channel coordinate of each key point and the center coordinate of the calibration image corresponding to each key point;
and obtaining the correction channel radial scaling coefficient of each key point according to the correction channel coordinate of each key point, the central coordinate of the calibration image corresponding to each key point and the reference channel coordinate.
6. The method according to claim 5, wherein the obtaining the calibration channel radial scaling factor of each keypoint according to the calibration channel coordinate of each keypoint, the center coordinate of the calibration image corresponding to each keypoint, and the reference channel coordinate comprises:
calculating the correction channel coordinates of each key point and the central coordinates of the calibration image to obtain corresponding first vector values;
adjusting the first vector value by using an adjusting coefficient within a threshold value range to obtain a second vector value;
and when the distance between the second vector value and the reference channel coordinate is the minimum distance after adjustment, determining the current adjustment coefficient as the correction channel radial scaling coefficient.
7. The method of claim 4, wherein said generating a non-uniform chromatic aberration correction look-up table from the reference channel center distances and the correction channel radial scaling coefficients of all keypoints of the plurality of calibration images, and corrected image non-uniform grid point coordinates comprises:
according to a reference channel, calculating a polynomial fitting function according to the reference channel center distances of all key points of the plurality of calibration images and the correction channel radial scaling coefficients to obtain parameter values of the polynomial fitting function;
generating a non-uniform grid in a non-uniform manner;
mapping the non-uniform grid to the calibration image to obtain grid points;
calculating according to the coordinates of each grid point and the parameter values of the polynomial fitting function to obtain a grid point center distance, a grid point radial scaling coefficient and an included angle from the grid point to the center of the calibration image, which correspond to each grid point;
acquiring the offset of a correction channel in the vertical direction and the horizontal direction of each grid point according to the center distance of the grid point corresponding to each grid point, the radial scaling coefficient of the grid point and the included angle from the grid point to the center of the calibration image;
and storing the offset of the correction channel in the vertical direction and the offset of the correction channel in the horizontal direction of each grid point in the corresponding grid point to generate a non-uniform chromatic aberration correction lookup table.
8. An image processing apparatus characterized by comprising:
the device comprises an acquisition unit, a correction unit and a correction unit, wherein the acquisition unit is used for acquiring a nonuniform chromatic aberration correction lookup table, and the nonuniform chromatic aberration correction lookup table is obtained by processing at least two calibration images shot by a lens to be detected at different angles and comprises offsets of correction channels of grid points in the vertical direction and the horizontal direction;
the searching unit is used for searching a preset number of target grid points from the nonuniform chromatic aberration correction lookup table, and the distance from the target grid points to the current pixel to be corrected meets a preset distance condition;
and the correcting unit is used for correcting the color difference value of the current pixel to be corrected according to the offset of the preset number of target grid point correction channels in the vertical direction and the horizontal direction.
9. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
CN202310065372.1A 2023-02-06 2023-02-06 Image processing method and device, electronic equipment and storage medium Active CN115802173B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310065372.1A CN115802173B (en) 2023-02-06 2023-02-06 Image processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310065372.1A CN115802173B (en) 2023-02-06 2023-02-06 Image processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115802173A true CN115802173A (en) 2023-03-14
CN115802173B CN115802173B (en) 2023-04-25

Family

ID=85429940

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310065372.1A Active CN115802173B (en) 2023-02-06 2023-02-06 Image processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115802173B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006121530A (en) * 2004-10-22 2006-05-11 Sharp Corp Color conversion apparatus, image forming apparatus, color conversion method and computer program
CN102129674A (en) * 2010-12-17 2011-07-20 北京优纳科技有限公司 Self-adaptation color balance correction method for color image
CN108141507A (en) * 2015-10-02 2018-06-08 Vid拓展公司 Color correction is carried out using look-up table
CN110035199A (en) * 2017-12-19 2019-07-19 奥林巴斯株式会社 Color of image conversion equipment, color of image conversion method
CN112202986A (en) * 2020-09-30 2021-01-08 安谋科技(中国)有限公司 Image processing method, image processing apparatus, readable medium and electronic device thereof
CN113989131A (en) * 2021-09-17 2022-01-28 中国科学院空天信息创新研究院 Image dispersion correction method, device, electronic equipment and storage medium
CN114219736A (en) * 2021-12-21 2022-03-22 爱芯元智半导体(上海)有限公司 Image chromatic aberration correction method and device, electronic equipment and storage medium
CN114463196A (en) * 2021-12-28 2022-05-10 浙江大学嘉兴研究院 Image correction method based on deep learning
CN114968153A (en) * 2022-05-07 2022-08-30 华显光电技术(惠州)有限公司 Color reproduction method, device, terminal equipment and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006121530A (en) * 2004-10-22 2006-05-11 Sharp Corp Color conversion apparatus, image forming apparatus, color conversion method and computer program
CN102129674A (en) * 2010-12-17 2011-07-20 北京优纳科技有限公司 Self-adaptation color balance correction method for color image
CN108141507A (en) * 2015-10-02 2018-06-08 Vid拓展公司 Color correction is carried out using look-up table
CN110035199A (en) * 2017-12-19 2019-07-19 奥林巴斯株式会社 Color of image conversion equipment, color of image conversion method
CN112202986A (en) * 2020-09-30 2021-01-08 安谋科技(中国)有限公司 Image processing method, image processing apparatus, readable medium and electronic device thereof
CN113989131A (en) * 2021-09-17 2022-01-28 中国科学院空天信息创新研究院 Image dispersion correction method, device, electronic equipment and storage medium
CN114219736A (en) * 2021-12-21 2022-03-22 爱芯元智半导体(上海)有限公司 Image chromatic aberration correction method and device, electronic equipment and storage medium
CN114463196A (en) * 2021-12-28 2022-05-10 浙江大学嘉兴研究院 Image correction method based on deep learning
CN114968153A (en) * 2022-05-07 2022-08-30 华显光电技术(惠州)有限公司 Color reproduction method, device, terminal equipment and storage medium

Also Published As

Publication number Publication date
CN115802173B (en) 2023-04-25

Similar Documents

Publication Publication Date Title
KR101873658B1 (en) Method and device for adjusting colour temperature
KR101766867B1 (en) Color adjustment method and device
JP7166171B2 (en) INTERFACE IMAGE DISPLAY METHOD, APPARATUS AND PROGRAM
CN110958401B (en) Super night scene image color correction method and device and electronic equipment
JP2017532609A (en) Color gamut mode switching method and apparatus
JP6170626B2 (en) Composition changing method, composition changing apparatus, terminal, program, and recording medium
CN105100764A (en) Photographing method and device
CN106651777B (en) Image processing method and device and electronic equipment
JP2019505101A (en) Method and apparatus for controlling screen emission, program and recording medium
CN108198148B (en) Image processing method and device
EP3770859B1 (en) Image processing method, image processing apparatus, and storage medium
CN111696479B (en) Color gamut adjusting method and device
CN110876014B (en) Image processing method and device, electronic device and storage medium
US9665925B2 (en) Method and terminal device for retargeting images
CN115802173B (en) Image processing method and device, electronic equipment and storage medium
CN113920083A (en) Image-based size measurement method and device, electronic equipment and storage medium
CN113542708A (en) Projection surface parameter confirmation method and device, storage medium and projection equipment
CN116017171B (en) Image processing method and device, electronic equipment, chip and storage medium
CN108538261B (en) Display control method and device and display equipment
WO2024040398A1 (en) Correction function generation method and apparatus, and image correction method and apparatus
CN116847037A (en) Color calibration method, device, storage medium and display equipment
CN115375555A (en) Image processing method and device
CN117176878A (en) Color correction method, device and storage medium
CN116801112A (en) Color calibration method, device, storage medium and display equipment
CN116795317A (en) Image display method, device and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant