Image color difference correction method, device, equipment and medium
By employing a two-way color difference correction method that first corrects axial and then lateral color differences, the problems of unsatisfactory lateral color difference correction and axial color difference deterioration in existing technologies are solved, achieving higher image color difference correction accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XG TECHNOLOGIES PTE LTD
- Filing Date
- 2026-03-27
- Publication Date
- 2026-06-05
AI Technical Summary
Existing lens lateral chromatic aberration correction methods that only consider RGB three-channel offset alignment result in unsatisfactory lateral chromatic aberration correction effects and may further worsen axial chromatic aberration.
By acquiring the lens's axial and lateral chromatic aberration calibration information, the image to be calibrated is first axially calibrated, then laterally calibrated, and finally the target image is calibrated bidirectionally by combining the axial and lateral chromatic aberration calibration information.
It effectively eliminates residual color difference in one direction, reduces the accumulation of axial color difference caused by lateral color difference correction, and improves the accuracy of image color difference correction.
Smart Images

Figure CN122160635A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image signal processing technology, and in particular to an image color difference correction method, apparatus, device, and medium. Background Technology
[0002] In image chromatic aberration correction techniques, some techniques for eliminating lateral chromatic aberration in lenses only consider the offset alignment of the RGB (Red, Green, Blue) three channels, resulting in unsatisfactory correction effects for lateral chromatic aberration, with residual lateral chromatic aberration remaining. Furthermore, it can lead to further deterioration of axial chromatic aberration. Summary of the Invention
[0003] To address the aforementioned technical problems, this disclosure provides an image color difference correction method, apparatus, device, and medium.
[0004] A first aspect of this disclosure provides an image color difference correction method, comprising: Acquire the image to be corrected captured through the lens; Based on the predetermined axial chromatic aberration calibration information of the lens, axial chromatic aberration correction is performed on the image to be corrected to obtain the target image; Based on the predetermined lateral chromatic aberration calibration information of the lens, lateral chromatic aberration correction is performed on the target image.
[0005] A second aspect of this disclosure provides an image color difference correction apparatus, comprising: The acquisition unit is configured to acquire the image to be corrected captured by the lens; The first correction unit is configured to perform axial chromatic aberration correction on the image to be corrected based on the predetermined axial chromatic aberration calibration information of the lens, so as to obtain the target image; The second correction unit is configured to perform lateral chromatic aberration correction on the target image based on predetermined lateral chromatic aberration calibration information of the lens.
[0006] A third aspect of this disclosure provides an electronic device comprising: Memory, used to store computer programs; A processor is configured to execute a computer program stored in a memory, wherein, when the computer program is executed, it implements the method of any embodiment of the image color difference correction method of the first aspect of the present disclosure.
[0007] A fourth aspect of this disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method of any embodiment of the image color difference correction method of the first aspect described above.
[0008] A fifth aspect of this disclosure provides a computer program including computer-readable code, wherein the computer program instructions, when executed by a processor, implement the method of any embodiment of the image color difference correction method of the first aspect described above.
[0009] Based on the embodiments of this disclosure, an image to be corrected can be acquired through a lens. Then, based on predetermined axial chromatic aberration calibration information of the lens, axial chromatic aberration correction is performed on the image to be corrected to obtain a target image. Next, based on predetermined lateral chromatic aberration calibration information of the lens, lateral chromatic aberration correction is performed on the target image. Therefore, after axial chromatic aberration correction of the image to be corrected, further lateral chromatic aberration correction is performed on the obtained target image. Compared to single-direction chromatic aberration correction that only performs axial or lateral chromatic aberration correction, the residual chromatic aberration from single-direction correction can be eliminated. Furthermore, since lateral chromatic aberration correction typically uses interpolation algorithms, which are essentially low-pass filters, lateral chromatic aberration correction usually leads to blurring of the R and B channels, thus further deteriorating axial chromatic aberration. Therefore, compared to further performing axial chromatic aberration correction on the obtained image based on lateral chromatic aberration correction, the accumulation and transmission of axial chromatic aberration caused by lateral chromatic aberration correction can be reduced, thereby ensuring that axial chromatic aberration correction can be more effectively performed based on axial chromatic aberration calibration information. This improves the accuracy of image chromatic aberration correction. Attached Figure Description
[0010] Figure 1 This is an exemplary application scenario diagram to which this disclosure applies.
[0011] Figure 2 This is a schematic flowchart of an image color difference correction method provided in an exemplary embodiment of this disclosure.
[0012] Figure 3 This is a schematic diagram of a color difference formation process provided in an exemplary embodiment of this disclosure.
[0013] Figure 4 This is a schematic flowchart of an image color difference correction method provided in another exemplary embodiment of this disclosure.
[0014] Figure 5 This is a schematic flowchart of a method for correcting lateral color difference provided in an exemplary embodiment of this disclosure.
[0015] Figure 6 This is a schematic flowchart of an image color difference correction method provided in another exemplary embodiment of this disclosure.
[0016] Figure 7 This is a schematic diagram of a first image provided in an exemplary embodiment of this disclosure.
[0017] Figure 8This is a schematic diagram of a second image provided in an exemplary embodiment of this disclosure.
[0018] Figure 9 This is a schematic diagram of a process for determining channel gradient information of a first image acquired by a lens, provided by an exemplary embodiment of this disclosure.
[0019] Figure 10 This is a schematic flowchart illustrating the process of determining the centroid coordinates of an image patch in a second image captured by a lens, provided by an exemplary embodiment of this disclosure.
[0020] Figure 11 This is a schematic flowchart of an axial chromatic aberration correction method for an image to be corrected, provided in an exemplary embodiment of this disclosure.
[0021] Figure 12 This is a schematic flowchart of a method for correcting lateral color difference in a target image according to an exemplary embodiment of the present disclosure.
[0022] Figure 13 This is a flowchart illustrating the process of determining the corrected pixel coordinates of a target channel of a target image, provided by an exemplary embodiment of this disclosure.
[0023] Figure 14 This is a schematic flowchart illustrating the process of determining the corrected pixel values of a target channel of a target image, provided by an exemplary embodiment of this disclosure.
[0024] Figure 15 This is a schematic diagram of the structure of an image color difference correction device provided in an exemplary embodiment of the present disclosure.
[0025] Figure 16 This is a schematic diagram of the structure of an image color difference correction device provided in another exemplary embodiment of this disclosure.
[0026] Figure 17 This is a structural diagram of an electronic device provided in an exemplary embodiment of this disclosure. Detailed Implementation
[0027] To explain this disclosure, exemplary embodiments of the disclosure will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the disclosure, and not all of them. It should be understood that the disclosure is not limited to exemplary embodiments.
[0028] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of this disclosure.
[0029] Application Overview In the process of realizing this disclosure, the inventors discovered that the wavelength range of visible light perceived by the human eye is approximately 380 nanometers (nm) to 760 nanometers, of which the wavelength of blue light is 450–495 nm, the wavelength of green light is 495–570 nm, and the wavelength of red light is 620–760 nm.
[0030] When visible light passes through a camera lens, the longer the wavelength, the greater the refractive index. Different wavelengths of light have different refractive indices when passing through a lens. For most lenses, blue light has the highest refractive index, followed by green and red light.
[0031] Light of different wavelengths focuses at different locations, causing a shift in the focal points of blue, green, and red light. This shift can be either parallel to the focal plane or perpendicular to it. The chromatic aberration caused by the shift parallel to the focal plane is called lateral chromatic aberration, while the chromatic aberration caused by the shift perpendicular to the focal plane is called longitudinal chromatic aberration.
[0032] Generally speaking, lateral chromatic aberration is the most common and obvious, but axial chromatic aberration also has a significant impact, and as the focal length of the lens continues to increase, the impact of axial chromatic aberration becomes more and more significant.
[0033] Some techniques for eliminating lateral chromatic aberration in lenses only consider the offset alignment of the RGB (Red, Green, Blue) channels, resulting in unsatisfactory correction effects and residual lateral chromatic aberration. Furthermore, these techniques can further worsen axial chromatic aberration. Other techniques for removing axial chromatic aberration address the problem through lens design and correction, or simply treat chromatic aberration as purple fringing and remove it in the YUV (Luminance Chrominance) domain by removing purple fringing.
[0034] Exemplary Overview Figure 1 This is an exemplary application scenario diagram to which this disclosure applies.
[0035] In any scenario requiring image color difference correction, such as autonomous driving, industrial inspection, security monitoring, and medical imaging, the image color difference correction method disclosed herein can be used to correct the color difference of the image to be corrected, thereby improving image quality.
[0036] Specifically, taking autonomous driving scenarios as an example, the axial color difference calibration information and lateral color difference calibration information of the lens set on the vehicle's camera can be determined in advance, and any image captured by the lens can be used as the image to be calibrated. After the vehicle's camera in the autonomous driving scenario acquires the image to be calibrated, it can first perform axial color difference correction on the image to be calibrated based on the aforementioned axial color difference calibration information to obtain the target image. Then, the vehicle can perform lateral color difference correction on the target image based on the aforementioned lateral color difference calibration information to obtain the calibrated image.
[0037] In some alternative implementations, image color difference correction methods can be implemented using ASIC (Application-Specific Integrated Circuit), FPGA (Field-Programmable Gate Array), or CPU (Central Processing Unit).
[0038] Optionally, the vehicle can further perform visual environment perception, vehicle localization, multi-sensor fusion, path planning, and vehicle control based on the corrected images, thereby achieving autonomous driving.
[0039] Therefore, after performing axial chromatic aberration correction on the image to be corrected, further lateral chromatic aberration correction is applied to the resulting target image. Compared to single-direction chromatic aberration correction that only performs axial or lateral chromatic aberration correction, this eliminates residual chromatic aberration from single-direction correction. Furthermore, since lateral chromatic aberration correction typically uses interpolation algorithms, which are essentially low-pass filters, it often leads to blurring of the R and B channels, further exacerbating axial chromatic aberration. Therefore, by performing axial chromatic aberration correction on the resulting image after lateral chromatic aberration correction, the accumulation and propagation of axial chromatic aberration caused by lateral correction can be reduced. This ensures that axial chromatic aberration correction can be more effectively based on axial chromatic aberration calibration information, thus improving the accuracy of image chromatic aberration correction.
[0040] Exemplary methods Figure 2 This is a schematic flowchart of an image color difference correction method provided in an exemplary embodiment of this disclosure. This embodiment can be applied to electronic devices such as intelligent driving vehicles, etc. Figure 2 As shown, it includes the following steps: Step 201: Acquire the image to be corrected captured by the lens.
[0041] The lens can be any camera lens. When visible light passes through the lens, the longer the wavelength of light, the greater the refractive index. Different wavelengths of light have different refractive indices when passing through the lens. For most lenses, blue light has the highest refractive index, followed by green and red light. In some optional embodiments, the lens can be mounted on a camera in a smart driving vehicle.
[0042] The image to be corrected can be any image captured by the lens that requires chromatic aberration correction (including lateral chromatic aberration correction and axial chromatic aberration correction). In some optional embodiments, the image to be corrected can be an RGB image. Typically, the image to be corrected may contain both lateral and axial chromatic aberration.
[0043] Here, combined Figure 3 The causes of color difference are explained below: Figure 3 In this context, Lateral CA represents lateral color difference, while Axial CA represents axial color difference. According to... Figure 3 It can be seen that lateral chromatic aberration is caused by different wavelengths focusing at different positions on the imaging plane, with the lateral chromatic aberration being particularly pronounced at the image edges compared to the center. Generally, the farther away from the center point, the more severe the lateral chromatic aberration. Axial chromatic aberration, on the other hand, is caused by different wavelengths focusing at different positions along the lens axis. Generally, the G channel is preferentially focused, while the RB channel is not. Generally, the axial chromatic aberration is the same at different positions in the image.
[0044] In some optional embodiments, after the lens captures the image to be corrected, the image can be directly transmitted to the aforementioned electronic device, thereby allowing the electronic device to directly obtain the image to be corrected captured by the lens. Alternatively, after the lens captures the image to be corrected, the image can be transmitted to a preset storage space, thereby allowing the electronic device to indirectly obtain the image to be corrected captured by the lens from the aforementioned storage space.
[0045] Step 202: Based on the predetermined axial chromatic aberration calibration information of the lens, perform axial chromatic aberration correction on the image to be corrected to obtain the target image.
[0046] Axial color difference calibration information can be used for axial color difference correction of images (including images to be corrected). Axial color difference calibration information represents the sharpness difference caused by axial color difference in different color channels (R and B channels relative to the G channel). As an example, axial color difference calibration information can be determined based on the high-frequency component HF_R of the R channel, the high-frequency component HF_G of the G channel, and the high-frequency component HF_B of the B channel. For example, axial color difference calibration information may include at least one of the following: HF_G / HF_R, HF_G / HF_B.
[0047] Axial chromatic aberration correction can be used to correct the sharpness of the R and B channels, bringing them closer to the sharpness of the G channel. Here, because the G channel is usually required to be in sharp focus when the lens is focusing, the R and B channels are difficult to focus clearly due to axial chromatic aberration. Therefore, axial chromatic aberration correction can be performed on the R and B channels to bring their sharpness closer to that of the G channel.
[0048] The target image can be obtained directly or indirectly after axial chromatic aberration correction of the image to be corrected.
[0049] In some optional implementations, when the axial color difference calibration information includes HF_G / HF_R, axial color difference correction can be performed on the image to be corrected using HF_G / HF_R to obtain the target image. For example, the pixel value of the R channel in the target image = the pixel value of the R channel in the image to be corrected + the high-frequency component of the R channel HF_R_Local × HF_G / HF_R. Here, HF_R_Local is referred to as the fourth high-frequency component.
[0050] In some optional implementations, when the axial color difference calibration information includes HF_G / HF_B, axial color difference correction can be performed on the image to be corrected using HF_G / HF_B to obtain the target image. For example, the pixel value of the B channel in the target image = the pixel value of the B channel in the image to be corrected + the high-frequency component of the B channel HF_B_Local × HF_G / HF_B. Here, HF_B_Local is referred to as the fifth high-frequency component.
[0051] Step 203: Based on the predetermined lateral chromatic aberration calibration information of the lens, perform lateral chromatic aberration correction on the target image.
[0052] Lateral chromatic aberration calibration information can be used for lateral chromatic aberration correction of images (including images to be corrected). Lateral chromatic aberration calibration information can represent the pixel position offset on the imaging plane caused by lateral chromatic aberration for different color channels (R and B channels relative to the G channel). As an example, lateral chromatic aberration calibration information may include at least one of the following: the coordinate difference between the centroid of the R channel and the centroid of the G channel, and the coordinate difference between the centroid of the B channel and the centroid of the G channel.
[0053] Lateral color difference correction can be used to correct the coordinate offset of each pixel in the target image.
[0054] In some alternative implementations, a block-based approach can be used to correct lateral color differences in the target image.
[0055] In some alternative implementations, such as Figure 4As shown, the input RGB image can be used as the image to be corrected. First, its axial color difference is corrected, and then the lateral color difference is further corrected based on the axial color difference correction, so as to output the corrected RGB image.
[0056] In some alternative implementations, see [link to relevant documentation]. Figure 5 By performing lateral color difference calibration, fitting coefficients (i.e., lateral color difference calibration information) can be obtained. Thus, an RGB image that has undergone axial color difference calibration can be used as the input RGB image, and lateral color difference correction can be performed on it based on the above fitting coefficients, thereby outputting a corrected RGB image.
[0057] Based on the embodiments of this disclosure, an image to be corrected can be acquired through a lens. Then, based on predetermined axial chromatic aberration calibration information of the lens, axial chromatic aberration correction is performed on the image to be corrected to obtain a target image. Next, based on predetermined lateral chromatic aberration calibration information of the lens, lateral chromatic aberration correction is performed on the target image. Therefore, after axial chromatic aberration correction of the image to be corrected, further lateral chromatic aberration correction is performed on the obtained target image. Compared to single-direction chromatic aberration correction that only performs axial or lateral chromatic aberration correction, the residual chromatic aberration from single-direction correction can be eliminated. Furthermore, since lateral chromatic aberration correction typically uses interpolation algorithms, which are essentially low-pass filters, lateral chromatic aberration correction usually leads to blurring of the R and B channels, thus further deteriorating axial chromatic aberration. Therefore, compared to further performing axial chromatic aberration correction on the obtained image based on lateral chromatic aberration correction, the accumulation and transmission of axial chromatic aberration caused by lateral chromatic aberration correction can be reduced, thereby ensuring that axial chromatic aberration correction can be more effectively performed based on axial chromatic aberration calibration information. This improves the accuracy of image chromatic aberration correction.
[0058] In some alternative embodiments, such as Figure 6 As shown above, in the above Figure 2 Based on the illustrated embodiment, the following steps may be included before step 202: Step 204: Determine the channel gradient information of the first image acquired through the lens; based on the channel gradient information, determine the axial chromatic aberration calibration information of the lens.
[0059] The first image can be used for axial color difference calibration. The first image can be any image. In some optional implementations, the first image can be an image acquired using an ISO 12233 resolution card, such as... Figure 7 As shown.
[0060] Channel gradient information can represent the gradient of a channel. As an example, channel gradient information can include at least one of the following: the gradient of the R channel, the gradient of the G channel, and the gradient of the B channel.
[0061] In some alternative implementations, the gradients of a channel (including the gradients of the R channel, G channel, and B channel) can be calculated using a Laplacian sharpening operator (e.g., [0,-1,0;-1,4,-1;0,-1,0]) to obtain the high-frequency components of that channel.
[0062] In some alternative implementations, the gradients of the channels (including the gradients of the R channel, G channel, and B channel) can also be obtained using the Sobel operator or the Cannibal operator.
[0063] In some alternative implementations, the channel gradient information can be used to determine the lens's axial chromatic aberration calibration information. Alternatively, the lens's axial chromatic aberration calibration information can be calculated based on the channel gradient information.
[0064] Step 205: Determine the centroid coordinates of the image patch in the second image acquired through the lens; based on the centroid coordinates, determine the lateral chromatic aberration calibration information of the lens.
[0065] The second image can be used for lateral color difference calibration. The second image can be any image. The second image can be the same as or different from the first image. In some optional implementations, the second image can be... Figure 8 The diagram shown is a circle of black dots.
[0066] An image block can be an image region obtained by dividing a second image.
[0067] Centroid coordinates can represent the centroid position of an image patch.
[0068] In some alternative implementations, the centroid coordinates of an image patch can be determined based on the pixel values of one or more pixels within the patch.
[0069] In some alternative implementations, the coordinate deviation between channels can be determined based on the centroid coordinates, and then the lateral chromatic aberration calibration information of the lens can be determined based on the coordinate deviation.
[0070] Some methods employ polynomial fitting to correct lateral chromatic aberration based on the image radius. However, lenses are not strictly symmetrical horizontally or vertically. Therefore, this embodiment uses a block-based method for lateral chromatic aberration correction. This allows for precise calibration of the lateral chromatic aberration characteristics of different image blocks. Considering the non-strict symmetry of lenses, the block-based calibration method improves the accuracy of lateral chromatic aberration calibration and correction compared to the overall polynomial fitting method.
[0071] In some alternative embodiments, in the above... Figure 6 Based on the illustrated embodiment, step 205, which determines the lateral chromatic aberration calibration information of the lens based on the centroid coordinates, may include the following steps: Step 1: Based on the centroid coordinates, determine the horizontal and vertical offsets of the target channel of the image block in the lens. The target channel is either the red channel or the blue channel.
[0072] The horizontal coordinate offset can be the offset between the horizontal coordinate of the target channel and the horizontal coordinate of the green channel in the centroid coordinates of the image patch.
[0073] The ordinate offset can be the offset between the ordinate of the target channel's centroid coordinates and the ordinate of the green channel's centroid coordinates.
[0074] In some optional implementations, the difference between the x-coordinate of the centroid coordinates of the target channel and the x-coordinate of the centroid coordinates of the green channel can be determined as the x-coordinate offset. The difference between the y-coordinate of the centroid coordinates of the target channel and the y-coordinate of the centroid coordinates of the green channel can be determined as the y-coordinate offset.
[0075] In some optional implementations, the horizontal coordinate offset can also be determined based on the difference between the horizontal coordinate of the target channel and the horizontal coordinate of the green channel, and a pre-determined horizontal coordinate calibration amount. Similarly, the vertical coordinate offset can be determined based on the difference between the vertical coordinate of the target channel and the vertical coordinate of the green channel, and a pre-determined vertical coordinate calibration amount.
[0076] Step 2: Determine the lateral color difference calibration information of the image block based on the horizontal and vertical coordinate offsets.
[0077] In some optional implementations, the horizontal and vertical coordinate offsets can be used as the lateral color difference calibration information for the image patch.
[0078] In some optional implementations, the horizontal and vertical coordinate offsets can be calibrated using predetermined calibration values to obtain the horizontal color difference calibration information of the image patch.
[0079] Based on the embodiments of this disclosure, the horizontal and vertical coordinate offsets corresponding to the target channels of the image blocks in the lens are determined by using centroid coordinates. This allows for the quantification of the positional offsets of the red and blue channels relative to the green channel within each image block. Based on these horizontal and vertical coordinate offsets, the lateral chromatic aberration calibration information of the image blocks is determined. By associating this lateral chromatic aberration calibration information with the spatial position of specific image blocks, a block-based correction strategy can be supported. This approach adapts to the spatial variation characteristics of lateral chromatic aberration caused by lens asymmetry, improving the targeting and accuracy of lateral chromatic aberration correction and avoiding correction errors caused by lens asymmetry in the overall polynomial fitting method.
[0080] In some optional embodiments, the centroid coordinates include: the first centroid x-coordinate and the first centroid y-coordinate of the red channel, the second centroid x-coordinate and the second centroid y-coordinate of the green channel, and the third centroid x-coordinate and the third centroid y-coordinate of the blue channel.
[0081] Here, the first centroid x-coordinate is the x-coordinate of the centroid coordinates of the red channel, which can be denoted as Xr.
[0082] The first centroid ordinate can be the ordinate of the centroid coordinates in the red channel, and can be denoted as Yr.
[0083] The second centroid's x-coordinate can be the x-coordinate of the centroid coordinates of the green channel, and can be denoted as Xg.
[0084] The second centroid ordinate can be the ordinate of the centroid coordinate of the green channel, and can be denoted as Yg.
[0085] The third centroid's x-coordinate can be the x-coordinate of the centroid coordinates in the blue channel, and can be denoted as Xb.
[0086] The third centroid ordinate can be the ordinate of the centroid coordinates in the blue channel, and can be denoted as Yb.
[0087] Based on this, determining the horizontal and vertical offsets of the target channel of the image block using centroid coordinates can include the following steps: Step 1: Based on the first and second centroid abscissas, determine the first abscissa offset of the red channel of the image block of the lens.
[0088] The first horizontal coordinate offset can represent the offset of the first centroid horizontal coordinate relative to the second centroid horizontal coordinate.
[0089] In some alternative implementations, the first horizontal coordinate offset deltaXr = Xr - Xg.
[0090] Step 2: Based on the first centroid ordinate and the second centroid ordinate, determine the first ordinate offset of the red channel of the image block.
[0091] The first ordinate offset can represent the offset of the first centroid ordinate relative to the second centroid ordinate.
[0092] In some alternative implementations, the first ordinate offset deltaYr = Yr - Yg.
[0093] Step 3: Based on the abscissa of the third centroid and the abscissa of the second centroid, determine the second abscissa offset of the blue channel of the image block.
[0094] The second horizontal coordinate offset can represent the offset of the third centroid horizontal coordinate relative to the second centroid horizontal coordinate.
[0095] In some alternative implementations, the second horizontal coordinate offset deltaXb = Xb - Xg.
[0096] Step 4: Based on the second centroid ordinate and the third centroid ordinate, determine the second ordinate offset of the blue channel of the image block.
[0097] The second ordinate offset can represent the offset of the second centroid ordinate relative to the third centroid ordinate.
[0098] In some alternative implementations, the second ordinate offset deltaYb = Yb - Yg.
[0099] In some optional implementations, the first horizontal coordinate offset and the first vertical coordinate offset are both in the range of [-7, 7], which are decimals. Seven decimal places can be retained for precision. That is, if the floating-point color difference value is magnified 128 times and stored in the range of [-512, 511], 10 bits are required. Since the image has M*N blocks, there are M×N×4 calibration values.
[0100] Based on the embodiments of this disclosure, by determining the first abscissa offset of the red channel of the image block using the first and second centroid abscissas, the horizontal offset of the red channel relative to the green channel can be calculated more accurately. This offset reflects the horizontal position deviation of the red channel caused by lateral chromatic aberration. Similarly, by determining the first ordinate offset of the red channel of the image block based on the first and second centroid ordinates, the vertical offset of the red channel relative to the green channel can be calculated more accurately. This offset reflects the vertical position deviation of the red channel caused by lateral chromatic aberration. Likewise, by determining the second abscissa offset of the blue channel of the image block based on the third and second centroid abscissas, the horizontal offset of the blue channel relative to the green channel can be calculated more accurately. This offset reflects the horizontal position deviation of the blue channel caused by lateral chromatic aberration. Finally, by determining the second ordinate offset of the blue channel of the image block based on the second and third centroid ordinates, the vertical offset of the blue channel relative to the green channel can be calculated more accurately. This offset reflects the vertical position deviation of the blue channel caused by lateral chromatic aberration. Furthermore, by calculating the horizontal and vertical coordinate offsets of the red and blue channels relative to the green channel, the lateral color difference characteristics of each image block can be fully quantified. The lateral color difference is decomposed into independent parameters in the horizontal and vertical directions, thereby achieving more refined correction processing. This can eliminate color edge phenomena caused by lens optical characteristics to a greater extent and improve image edge sharpness and color accuracy.
[0101] In some alternative embodiments, such as Figure 9 As shown above, in the above Figure 6 Based on the illustrated embodiment, step 204 may include the following steps: Step 2041: Determine the first high-frequency component of the red channel, the second high-frequency component of the green channel, and the third high-frequency component of the blue channel in the central region of the first image acquired by the lens.
[0102] The central region of the first image can be the region of the central coordinate range of the first image (e.g., the horizontal coordinate range (10, 50) and the vertical coordinate range (10, 50)). This region is chosen because the axial color difference is global and the lateral color difference has little influence in this region, thus avoiding the influence of the lateral color difference on the axial color difference.
[0103] The first high-frequency component can be a high-frequency component of the red channel, denoted as HF_R. In some alternative implementations, the first high-frequency component HF_R can be calculated using the Laplacian sharpening operator.
[0104] The second high-frequency component can be a high-frequency component of the green channel, denoted as HF_G. In some alternative implementations, the second high-frequency component HF_G can be calculated using the Laplacian sharpening operator.
[0105] The third high-frequency component can be a high-frequency component of the blue channel, denoted as HF_B. In some alternative implementations, the third high-frequency component HF_B can be calculated using the Laplacian sharpening operator.
[0106] Step 2042: Determine the channel gradient information of the first image based on the first high-frequency component, the second high-frequency component, and the third high-frequency component.
[0107] In some alternative implementations, the first high-frequency component, the second high-frequency component, and the third high-frequency component can be used as the channel gradient information of the first image. Alternatively, the channel gradient information of the first image can be calculated using the first high-frequency component, the second high-frequency component, and the third high-frequency component.
[0108] Based on the embodiments of this disclosure, by determining the first high-frequency component of the red channel, the second high-frequency component of the green channel, and the third high-frequency component of the blue channel in the central region of the first image acquired through the lens, high-frequency detail information of each channel in the central region of the first image can be obtained. Since the lateral color difference in the central region has a smaller impact, these high-frequency components can more accurately reflect the axial color difference characteristics. By determining the channel gradient information of the first image based on the first, second, and third high-frequency components, the high-frequency components (first, second, and third high-frequency components) can be used as indicators to measure the sharpness of each channel, providing a basis for axial color difference correction. Since axial color difference is mainly manifested as differences in sharpness between different channels, the method of the embodiments of this disclosure allows for more targeted correction.
[0109] In some alternative embodiments, such as Figure 10 As shown above, in the above Figure 6 Based on the illustrated embodiment, step 205 may include the following steps: Step 2051: Divide the second image captured by the lens into multiple image blocks, each image block including at least one calibration reference object.
[0110] An image patch can be an image region obtained by dividing a second image. In some alternative implementations, each image patch contains one and only one calibration reference object.
[0111] The calibration reference object can be the reference object in the second image used for lateral color difference calibration.
[0112] In some alternative embodiments, it is possible to Figure 8 The image shown is used as the second image. Therefore, it can be divided into 7×10 image blocks, ensuring that each image block has a black dot.
[0113] Step 2052: For any image block among multiple image blocks, determine the centroid coordinates of the calibration reference object for each channel of the image block.
[0114] Centroid coordinates can be the coordinates of the centroid position of the calibration reference object for each channel in the image block.
[0115] In some alternative embodiments, the block image can be binarized, for example, by setting a threshold to distinguish between the target and the background, with the target area having a pixel value of 1 and the background having a value of 0, thereby calculating the centroid coordinates of the calibration reference object for each channel of the image block by means of the average coordinates.
[0116] Based on the embodiments of this disclosure, by dividing the image into blocks and calculating the centroid coordinates of each channel, a mapping relationship between the spatial position of the lens and the lateral chromatic aberration can be established, avoiding the correction error caused by lens asymmetry in the polynomial fitting method.
[0117] In some alternative embodiments, in the above... Figure 10 Based on the embodiment shown, the centroid coordinates of the calibration reference object for each channel of any image block in step 2052 may include the following steps: determining the centroid coordinates of the calibration reference object for each channel of any image block based on the coordinates and pixel values of the pixels in any image block.
[0118] The coordinates of a pixel can be the position coordinates (x, y) of each pixel in the image block in the image coordinate system.
[0119] Pixel values can be the raw channel values of each pixel in an image block.
[0120] In some alternative implementations, the centroid coordinates (x c y c The formula for calculating x is: c =Σ x,y x×I(x,y) / Σ x,y I(x,y), y c =Σ x,y y×I(x,y) / Σ x,y I(x,y), where x represents the x-coordinate of a pixel within the image patch, y represents the y-coordinate of that pixel, and I(x,y) represents the weight value of that pixel. I(x,y) = 256 - the actual pixel value, where the actual pixel value is the original pixel value of the RGB channel, used to highlight black areas (the smaller the pixel value, the higher the weight). Σ x,y x×I(x,y) represents the sum of the products of the x-coordinates and corresponding weights of all pixels within the image patch, Σ x,y I(x,y) represents the sum of the weights of all pixels within an image patch. The subscript C in the formula indicates a specific channel, i.e., a specific RGB channel. x is the horizontal coordinate, and y is the vertical coordinate. In some cases, a coordinate range covering the black dot can be selected. For example, if the coordinate range of the black dot is [98:108, 98:108], then the selected x and y values are [94:112, 94:112], which are 4 greater than the black dot's coordinates in all directions. I(x,y) = 256 - the actual pixel value. This transformation process gives the calibration reference area (such as the black dot) a higher weight in the calculation, effectively suppressing the effects of background noise and uneven illumination.
[0121] Based on the embodiments of this disclosure, by determining the centroid coordinates of the calibration reference object for each channel of any image block based on the coordinates and pixel values of pixels in any image block, the visual perception center of each channel within each image block relative to the calibration reference object can be accurately calculated. The centroid coordinates are the position of the image's center of gravity; the smaller the pixel value, the closer the centroid is to the black dot, thereby improving the accuracy and robustness of the centroid coordinate calculation. Furthermore, since lateral color difference manifests as the difference in the perception of the calibration reference object's position by different channels, accurate centroid coordinate calculation can improve the precision of lateral color difference calibration.
[0122] In some alternative embodiments, such as Figure 11 As shown above, in the above Figure 9 Based on the illustrated embodiment, step 202 may include the following steps: Step 2021: Based on the predetermined axial chromatic aberration calibration information of the lens, determine the first high-frequency component, the second high-frequency component, and the third high-frequency component.
[0123] In some alternative implementations, the values of the first, second, and third high-frequency components calculated during the calibration phase can be read from pre-stored axial color difference calibration information. Alternatively, the first, second, and third high-frequency components can be calculated using the axial color difference calibration information.
[0124] Step 2022: Based on the second high-frequency component, the first high-frequency component, the pixel value before correction of the red channel of the image to be corrected, and the fourth high-frequency component of the red channel of the image to be corrected, determine the pixel value after correction of the red channel of the image to be corrected, and obtain the pixel value after correction of the red channel of the target image.
[0125] The fourth high-frequency component can be the high-frequency component of the current pixel in the red channel of the image to be calibrated, calculated using the same high-frequency extraction operator as in the calibration stage (e.g., Laplacian sharpening operator, Sobel operator, Canney operator), and can be denoted as HF_R_Local.
[0126] The uncorrected pixel value of the red channel can be the original pixel value of the red channel in the image to be corrected before axial color difference correction.
[0127] The corrected pixel value of the red channel can be the pixel value of the red channel obtained after axial color difference correction calculation.
[0128] In some alternative implementations, the corrected pixel value of the red channel = the uncorrected pixel value of the red channel + HF_R_Local × HF_G / HF_R. HF_R represents the first high-frequency component, and HF_G represents the second high-frequency component.
[0129] Step 2023: Based on the second high-frequency component, the third high-frequency component, the uncorrected pixel value of the blue channel of the image to be corrected, and the fifth high-frequency component of the blue channel of the image to be corrected, determine the corrected pixel value of the blue channel of the image to be corrected, and obtain the corrected pixel value of the blue channel of the target image.
[0130] The uncorrected pixel values of the blue channel can be the original pixel values of the blue channel in the image to be corrected before axial color difference correction.
[0131] The corrected pixel value of the blue channel can be the pixel value of the blue channel obtained after axial color difference correction calculation.
[0132] The fifth high-frequency component can be the high-frequency component of the current pixel in the blue channel of the image to be calibrated, calculated using the same high-frequency extraction operator as in the calibration stage, and can be denoted as HF_B_Local.
[0133] In some alternative implementations, the corrected pixel value of the blue channel = the uncorrected pixel value of the blue channel + HF_B_Local × HF_G / HF_B. HF_B represents the third high-frequency component, and HF_G represents the second high-frequency component.
[0134] Step 2024: Based on the uncorrected pixel values of the green channel of the image to be corrected, determine the corrected pixel values of the green channel of the image to be corrected, and obtain the corrected pixel values of the green channel of the target image.
[0135] In some alternative implementations, the uncorrected pixel values of the green channel of the image to be corrected can be used as the corrected pixel values of the green channel of the image to be corrected, thus obtaining the corrected pixel values of the green channel of the target image.
[0136] Based on the embodiments of this disclosure, by performing targeted corrections on the R channel and B channel based on high-frequency components, the difference in clarity between channels caused by axial chromatic aberration can be effectively eliminated, thereby improving the overall image clarity.
[0137] In some optional embodiments, the lateral chromatic aberration calibration information includes the horizontal and vertical coordinate offsets of the target channel corresponding to the image block of the lens, where the target channel is either the red channel or the blue channel.
[0138] The horizontal coordinate offset corresponding to the red channel is also known as the first horizontal coordinate offset.
[0139] The vertical coordinate offset corresponding to the red channel is also known as the first vertical coordinate offset.
[0140] The horizontal axis offset corresponding to the blue channel is also known as the second horizontal axis offset.
[0141] The vertical coordinate offset corresponding to the blue channel is also known as the second vertical coordinate offset.
[0142] Based on this, such as Figure 12 As shown above, in the above Figure 2 Based on the illustrated embodiment, step 203 may include the following steps: Step 2031: Based on the pixel coordinates, horizontal offset, and vertical offset of the target channel of the target image before correction, determine the corrected pixel coordinates of the target channel of the target image.
[0143] The pixel coordinates before correction can represent the original coordinate positions of the target channel pixels in the target image before the correction process.
[0144] The corrected pixel coordinates can represent the coordinate positions that the target channel pixel should be mapped to after the lateral color difference correction calculation.
[0145] In some optional implementations, the corrected pixel coordinates of the target channel can be denoted as (X_correct, Y_correct), the uncorrected pixel coordinates of the target channel can be denoted as (X_uncorrect, Y_uncorrect), the horizontal coordinate offset can be denoted as deltaX, and the vertical coordinate offset can be denoted as deltaY. Thus, X_correct = X_uncorrect - deltaX, Y_correct = Y_uncorrect - deltaY.
[0146] Step 2032: Determine the corrected pixel value of the target channel of the target image based on the corrected pixel coordinates of the target channel.
[0147] In some alternative implementations, the corrected pixel values of the target channel of the target image can be determined by interpolation methods based on the corrected pixel coordinates of the target channel.
[0148] Based on the embodiments of this disclosure, by performing coordinate correction based on the horizontal and vertical coordinate offsets, the color edge phenomenon caused by horizontal color difference can be effectively eliminated, thereby improving the image edge clarity and color accuracy.
[0149] In some alternative embodiments, such as Figure 13 As shown above, in the above Figure 12 Based on the illustrated embodiment, step 2031 may include the following steps: Step 20311: For any pixel in the target image to be corrected, perform the following steps 111-113.
[0150] Step 111: Based on the pixel coordinates of any pixel to be corrected, determine the target image block containing the pixel to be corrected.
[0151] The pixel to be corrected can be a pixel in the target image that needs to undergo lateral color difference correction.
[0152] The target image block can be an image block containing the pixels to be corrected.
[0153] Step 112: Based on the horizontal coordinate offset, the vertical coordinate offset, the horizontal color difference calibration information of the target image block, and the horizontal color difference calibration information of the adjacent image blocks of the target image block, determine the horizontal color difference calibration information of the pixel to be corrected.
[0154] Adjacent image blocks can be image blocks that are spatially adjacent to the target image block.
[0155] The lateral color difference calibration information of the pixel to be corrected can include the horizontal coordinate offset and the vertical coordinate offset of the pixel's location.
[0156] In some alternative implementations, the lateral color difference calibration information of the pixel to be corrected can be calculated using bilinear interpolation based on the lateral color difference calibration information (horizontal and vertical coordinate offset) of the target image block and its adjacent image blocks.
[0157] Step 113: Based on the lateral color difference calibration information of the pixels to be corrected, determine the corrected pixel coordinates of the target channel of the target image.
[0158] In some optional implementations, the corrected pixel coordinates of the target channel of the target image can be obtained by subtracting the horizontal and vertical coordinate offsets in the horizontal color difference calibration information from the original pixel coordinates of the pixel to be corrected.
[0159] Based on this, such as Figure 14 As shown above, in the above Figure 13 Based on the illustrated embodiment, step 2032 may include the following steps: Step 20321: Based on the corrected pixel coordinates of the target channel of the target image, determine the neighboring pixels of the pixel to be corrected.
[0160] In some alternative implementations, the pixels at integer coordinates around the corrected pixel (e.g., pixels in the four-neighbor or eight-neighbor domains) can be determined based on the corrected pixel coordinates, thereby identifying the neighboring pixels of the pixel to be corrected.
[0161] Step 20322: Determine the corrected pixel value of the target channel of the target image based on the pixel values of the target channel of adjacent pixels.
[0162] In some alternative implementations, the corrected pixel values of the target channel of the target image can be obtained by calculating the corrected pixel values based on the weighted pixel values of adjacent pixels using bilinear interpolation.
[0163] In some alternative implementations, the position of the image block in which the pixel to be corrected is located can be calculated first.
[0164] For example, if the coordinates of the pixel to be corrected in the target image are (1212, 1808), and the size of each image block is 120×160, then 1221 / 120=10.1, 1808 / 160=11.3. We can then take the corresponding horizontal color difference values of the image blocks in the 10th row and 11th column, the 11th row and 12th column, the 11th row and 11th column, and the 10th row and 12th column. Using bilinear interpolation, we can calculate the weights of each image block as 0.9×0.7=0.63, 0.1×0.3=0.03, 0.1×0.7=0.07, and 0.9×0.3=0.27.
[0165] Each image patch corresponds to four lateral color differences (i.e., deltaXr=Xr-Xg, deltaYr=Yr-Yg, deltaXb=Xb-Xg, deltaYb=Yb-Yg). Assume the lateral color difference values (integers magnified 128 times) of the four image patches are: 10 rows and 11 columns: deltaXr=-280, deltaYr=-672; 10 rows and 12 columns: deltaXr=-300, deltaYr=-720; 11 rows and 11 columns: deltaXr=-290, deltaYr=-696; 11 rows and 12 columns: deltaXr=-310, deltaYr=-744; Interpolation is used to calculate the final color difference value for pixel (1212, 1808): deltaXr=(-280×0.63)+(-300×0.27)+(-290×0.07)+(-310×0.03)≈-294 deltaYr=(-672×0.63)+(-720×0.27)+(-696×0.07)+(-744×0.03)≈-704 After obtaining the lateral color difference value of the current pixel, the correction value of that point is calculated using bilinear interpolation. For example, if the original coordinates of R (the current pixel coordinates) are (1600, 1600), and the final lateral color difference values calculated by interpolation of four image blocks are -294 and -704, then the corrected coordinates are 1600 - (-294 / 128) and 1600 - (-704 / 128), which is (1602.3, 1605.5). Therefore, the R values of the four points (1602, 1605), (1603, 1605), (1602, 1606), and (1603, 1606) can be taken and weighted according to distance weights (0.3 and 0.5) to obtain the final corrected R value. The corrected x-coordinate (e.g., 1602.3) has a decimal part of 0.3, indicating that the weight ratio of the point's distance from the left integer coordinate (1602) in the x-axis direction is 0.7 (1-0.3), and the weight ratio of its distance from the right integer coordinate (1603) is 0.3. The corrected y-coordinate (e.g., 1605.5) has a decimal part of 0.5, indicating that the weight ratio of the point's distance from the upper integer coordinate (1605) and the lower integer coordinate (1606) in the y-axis direction is 0.5.
[0166] Among them, 128 is the factor that amplifies the floating-point value of the horizontal color difference, and is used to convert the floating-point color difference value into integer form for storage.
[0167] Specifically, assume the R values for the four pixels are: 200, 205, 210, and 215. Weight calculation: For pixel (1602, 1605): the weight is 0.7 × 0.5 = 0.35; For pixel (1603, 1605): the weight is 0.3 × 0.5 = 0.15; For pixel (1602, 1606): the weight is 0.7 × 0.5 = 0.35; For pixel (1603, 1606): the weight is 0.3 × 0.5 = 0.15; The final corrected R value is: 200×0.35+205×0.15+210×0.35+215×0.15, which is 70+30.75+73.5+32.25=206.5.
[0168] Based on the embodiments of this disclosure, by processing the target image block and its adjacent image blocks, the accuracy and smoothness of lateral color difference correction can be improved, effectively avoiding the block effect that may be caused by block correction, while maintaining the integrity of image details, so that the corrected image presents a more natural and continuous visual effect in the edge area and transition area.
[0169] Any of the image color difference correction methods provided in this disclosure can be executed by any suitable device with data processing capabilities, including but not limited to: terminal devices and servers. Alternatively, any of the image color difference correction methods provided in this disclosure can be executed by a processor, such as by a processor executing any of the image color difference correction methods mentioned in this disclosure by calling corresponding instructions stored in memory. Further details will not be elaborated below.
[0170] Exemplary device Figure 15 This is a schematic diagram of an image color difference correction apparatus provided in an exemplary embodiment of this disclosure. The image color difference correction apparatus of this disclosure can be used to implement the image color difference correction method of any of the above embodiments. Figure 15 As shown, the image color difference correction device in this embodiment includes: The acquisition unit 510 is configured to acquire the image to be corrected captured by the lens; The first correction unit 520 is configured to perform axial chromatic aberration correction on the image to be corrected based on the predetermined axial chromatic aberration calibration information of the lens, so as to obtain the target image. The second correction unit 530 is configured to perform lateral chromatic aberration correction on the target image based on predetermined lateral chromatic aberration calibration information of the lens.
[0171] Figure 16 This is a schematic diagram of the structure of an image color difference correction device provided in another exemplary embodiment of this disclosure. For example... Figure 16 As shown, in Figure 15 Based on the illustrated embodiment, in some possible implementations, the device further includes: The first determining unit 540 is configured to determine the channel gradient information of the first image acquired through the lens; and based on the channel gradient information, determine the axial chromatic aberration calibration information of the lens. The second determining unit 550 is configured to determine the centroid coordinates of an image patch in a second image acquired through the lens; and based on the centroid coordinates, determine the lateral chromatic aberration calibration information of the lens.
[0172] In some alternative implementations, the first determining unit 540 includes: The first determining subunit 541 is configured to determine the first high-frequency component of the red channel, the second high-frequency component of the green channel, and the third high-frequency component of the blue channel of the central region of the first image acquired by the lens. The second determining subunit 542 is configured to determine the channel gradient information of the first image based on the first high-frequency component, the second high-frequency component, and the third high-frequency component.
[0173] In some alternative implementations, the second determining unit 550 includes: The third determining subunit 551 is configured to divide the second image captured by the lens into multiple image blocks, each image block including at least one calibration reference object; The fourth determining subunit 552 is configured to determine the centroid coordinates of the calibration reference object for each channel of any image block among multiple image blocks.
[0174] In some alternative implementations, the first correction unit 520 includes: The fifth determining subunit 521 is configured to determine the first high-frequency component, the second high-frequency component, and the third high-frequency component based on the predetermined axial chromatic aberration calibration information of the lens. The sixth determining subunit 522 is configured to determine the corrected pixel value of the red channel of the image to be corrected based on the second high-frequency component, the first high-frequency component, the pixel value before correction of the red channel of the image to be corrected, and the fourth high-frequency component of the red channel of the image to be corrected, thereby obtaining the corrected pixel value of the red channel of the target image. The seventh determining subunit 523 is configured to determine the corrected pixel value of the blue channel of the image to be corrected based on the second high-frequency component, the third high-frequency component, the pre-correction pixel value of the blue channel of the image to be corrected, and the fifth high-frequency component of the blue channel of the image to be corrected, thereby obtaining the corrected pixel value of the blue channel of the target image. The eighth determining subunit 524 is configured to determine the corrected pixel value of the green channel of the image to be corrected based on the uncorrected pixel value of the green channel of the image to be corrected, and obtain the corrected pixel value of the green channel of the target image.
[0175] In some optional implementations, the lateral chromatic aberration calibration information includes the horizontal and vertical coordinate offsets of the target channel corresponding to the image block of the lens, where the target channel is either the red channel or the blue channel. The second correction unit 530 includes: The ninth determining subunit 531 is configured to determine the corrected pixel coordinates of the target channel of the target image based on the pixel coordinates before correction, the horizontal coordinate offset, and the vertical coordinate offset of the target channel of the target image. The tenth determining subunit 532 is configured to determine the corrected pixel value of the target channel of the target image based on the corrected pixel coordinates of the target channel.
[0176] In some alternative implementations, the ninth determining subunit 531 includes: The third determining module 5311 is configured to target any pixel in the target image that needs to be corrected. Based on the pixel coordinates of any pixel to be corrected, determine the target image block containing the pixel to be corrected; Based on the horizontal coordinate offset, the vertical coordinate offset, the horizontal color difference calibration information of the target image block, and the horizontal color difference calibration information of the adjacent image blocks of the target image block, the horizontal color difference calibration information of the pixel to be corrected is determined. Based on the lateral color difference calibration information of the pixels to be corrected, the corrected pixel coordinates of the target channel of the target image are determined; and The tenth defined subunit 532 includes: The first determining module 5321 is configured to determine the neighboring pixels of the pixel to be corrected based on the corrected pixel coordinates of the target channel of the target image. The second determining module 5322 is configured to determine the corrected pixel value of the target channel of the target image based on the pixel value of the target channel of the adjacent pixel points.
[0177] The exemplary embodiments of this device correspond to the exemplary method section described above in terms of implementation. The corresponding content between the two can be referenced, combined, and cited, and will not be repeated here. The beneficial technical effects corresponding to the exemplary embodiments of this device can be found in the corresponding beneficial technical effects of the exemplary method section described above, and will not be repeated here.
[0178] Exemplary electronic devices Figure 17 A structural diagram of an electronic device provided in an embodiment of this disclosure includes at least one processor 111 and a memory 112.
[0179] The processor 111 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0180] The memory 112 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 111 may execute one or more computer program instructions to implement the image color difference correction methods and / or other desired functions of the various embodiments of this disclosure described above.
[0181] In one example, the electronic device may also include an input device 113 and an output device 114, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).
[0182] The input device 113 may also include, for example, a keyboard, a mouse, etc.
[0183] The output device 114 can output various information to the outside, including, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0184] Of course, for the sake of simplicity, Figure 17 Only some of the components of the electronic device relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device may include any other suitable components depending on the specific application.
[0185] Exemplary computer program products and computer-readable storage media In addition to the methods and apparatus described above, embodiments of this disclosure may also provide a computer program product, including computer program instructions that, when executed by a processor, cause the processor to perform the steps in the image color difference correction methods of the various embodiments of this disclosure described in the "Exemplary Methods" section above.
[0186] Computer program products can be written in any combination of one or more programming languages to perform the operations of embodiments of this disclosure. These programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0187] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps in the image color difference correction methods of the various embodiments of this disclosure described in the "Exemplary Methods" section above.
[0188] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, but is not limited to, systems, apparatuses, or devices that are electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0189] The basic principles of this disclosure have been described above with reference to specific embodiments. However, the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0190] Various modifications and variations can be made to this disclosure without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this disclosure and their equivalents, this disclosure is also intended to include such modifications and variations.
Claims
1. An image color difference correction method, comprising: Acquire the image to be corrected captured through the lens; Based on the predetermined axial chromatic aberration calibration information of the lens, the image to be corrected is subjected to axial chromatic aberration correction to obtain the target image; Based on the predetermined lateral chromatic aberration calibration information of the lens, the target image is subjected to lateral chromatic aberration correction.
2. The method according to claim 1, wherein, Before performing axial chromatic aberration correction on the image to be corrected based on the pre-determined axial chromatic aberration calibration information of the lens, the method further includes: Determine the channel gradient information of the first image acquired through the lens; based on the channel gradient information, determine the axial chromatic aberration calibration information of the lens; Determine the centroid coordinates of the image patch in the second image captured by the lens; based on the centroid coordinates, determine the lateral chromatic aberration calibration information of the lens.
3. The method according to claim 2, wherein, The determination of the channel gradient information of the first image acquired through the lens includes: The first high-frequency component of the red channel, the second high-frequency component of the green channel, and the third high-frequency component of the blue channel of the central region of the first image acquired through the lens are determined. Based on the first high-frequency component, the second high-frequency component, and the third high-frequency component, the channel gradient information of the first image is determined.
4. The method according to claim 2, wherein, Determining the centroid coordinates of an image patch in the second image captured by the lens includes: The second image captured by the lens is divided into multiple image blocks, and each image block includes at least one calibration reference object; For any one of the plurality of image blocks, determine the centroid coordinates of the calibration reference object for each channel of the image block.
5. The method according to claim 3, wherein, The step of performing axial chromatic aberration correction on the image to be corrected based on the pre-determined axial chromatic aberration calibration information of the lens to obtain the target image includes: Based on the predetermined axial chromatic aberration calibration information of the lens, the first high-frequency component, the second high-frequency component, and the third high-frequency component are determined; Based on the second high-frequency component, the first high-frequency component, the pixel value of the red channel of the image to be corrected before correction, and the fourth high-frequency component of the red channel of the image to be corrected, the pixel value of the red channel of the image to be corrected after correction is determined, and the pixel value of the red channel of the target image after correction is obtained. Based on the second high-frequency component, the third high-frequency component, the uncorrected pixel value of the blue channel of the image to be corrected, and the fifth high-frequency component of the blue channel of the image to be corrected, the corrected pixel value of the blue channel of the image to be corrected is determined, and the corrected pixel value of the blue channel of the target image is obtained. Based on the uncorrected pixel values of the green channel of the image to be corrected, the corrected pixel values of the green channel of the image to be corrected are determined, and the corrected pixel values of the green channel of the target image are obtained.
6. The method according to any one of claims 1-5, wherein, The lateral chromatic aberration calibration information includes the horizontal and vertical coordinate offsets of the target channel of the image block of the lens, where the target channel is either the red channel or the blue channel. The step of correcting the lateral chromatic aberration of the target image based on the predetermined lateral chromatic aberration calibration information of the lens includes: Based on the uncorrected pixel coordinates, the horizontal coordinate offset, and the vertical coordinate offset of the target channel of the target image, the corrected pixel coordinates of the target channel of the target image are determined. Based on the corrected pixel coordinates of the target channel of the target image, the corrected pixel value of the target channel of the target image is determined.
7. The method according to claim 6, wherein, Determining the corrected pixel coordinates of the target channel of the target image based on the uncorrected pixel coordinates of the target channel, the horizontal coordinate offset, and the vertical coordinate offset of the target image includes: For any pixel in the target image that needs to be corrected: Based on the pixel coordinates of any of the pixels to be corrected, a target image block containing the pixels to be corrected is determined; Based on the horizontal coordinate offset, the vertical coordinate offset, the horizontal color difference calibration information of the target image block, and the horizontal color difference calibration information of the adjacent image blocks of the target image block, the horizontal color difference calibration information of the pixel to be corrected is determined. Based on the lateral color difference calibration information of the pixels to be corrected, the corrected pixel coordinates of the target channel of the target image are determined; and Determining the corrected pixel value of the target channel of the target image based on the corrected pixel coordinates of the target channel includes: Based on the corrected pixel coordinates of the target channel of the target image, determine the neighboring pixels of the pixel to be corrected; Based on the pixel values of the target channel of the adjacent pixels, the corrected pixel values of the target channel of the target image are determined.
8. An image color difference correction device, comprising: The acquisition unit is used to acquire the image to be corrected captured by the lens; The first correction unit is used to perform axial chromatic aberration correction on the image to be corrected based on the predetermined axial chromatic aberration calibration information of the lens, so as to obtain the target image; The second correction unit is used to perform lateral chromatic aberration correction on the target image based on the predetermined lateral chromatic aberration calibration information of the lens.
9. A computer-readable storage medium storing a computer program, which, when executed, performs the method according to any one of claims 1-7.
10. An electronic device, the electronic device comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1-7.