Image data processing method and device, electronic equipment and storage medium

By fitting the brightness attenuation function of the reference image and filling the invalid pixels at the edge of the image, the problem of compensation coefficient abnormality in the LSC algorithm is solved, and the image imaging effect and compensation accuracy are improved.

CN120020863APending Publication Date: 2025-05-20BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311542523.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-17
Publication Date
2025-05-20

AI Technical Summary

Technical Problem

Existing LSC algorithms are prone to cause abnormal compensation coefficients at the edges of the image, resulting in poor image imaging effects, bright edges, unbalanced edge brightness and noise.

Method used

By acquiring the reference image data collected by the camera, the brightness attenuation function from the center of the image to the edge is fitted, and the invalid pixels at the edge of the image are filled based on this function to obtain a more accurate lens shadow compensation coefficient.

Benefits of technology

Improve the accuracy of the lens shadow compensation coefficient, improve image imaging effect, and reduce bright edges, edge brightness imbalance and noise problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120020863A_ABST
    Figure CN120020863A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of image processing, and particularly provides an image data processing method and device, electronic equipment and a storage medium. According to the image data processing method provided by the embodiment of the invention, the brightness attenuation function of the Lens Shading effect of the image is fitted, and pixel filling is performed on the edge of the reference image based on the brightness attenuation function, so that the problem of compensation coefficient abnormity caused by invalid pixels of an edge grid is eliminated or relieved, a more accurate lens shadow compensation coefficient LSC Table is obtained, and the image quality is improved. Therefore, the LSC correction effect of the image is improved, and the problems of bright edges, unbalanced edge brightness, edge noisy points and the like of the image are relieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technologies, and particularly relates to an image data processing method, apparatus, electronic device, and storage medium. Background Art

[0002] LSC (Lens Shading Correction) is an algorithm for correcting the Lens Shading problem of a camera. Lens Shading refers to the shadow (or vignetting) problem of camera imaging, which is manifested as the brightness of the captured image gradually darkening from the center to the periphery, or the colors of the image center and the periphery being inconsistent.

[0003] In the related art, the LSC algorithm mainly performs brightness compensation on the captured image based on the LSC Table (lens shading compensation coefficient) to eliminate or alleviate the Lens Shading problem. However, the LSC algorithm in the related art is prone to cause abnormal brightness at the image edge and has a poor imaging effect. Summary of the Invention

[0004] In order to improve the accuracy of the lens shading compensation coefficient in the LSC algorithm and further improve the camera imaging effect, embodiments of the present disclosure provide an image data processing method, apparatus, electronic device, and storage medium.

[0005] In a first aspect, embodiments of the present disclosure provide an image data processing method, including:

[0006] Obtaining image data obtained by a camera collecting a reference image, where the image data includes the pixel coordinates and brightness values of each pixel;

[0007] Based on the pixel coordinates and brightness values of the pixels from the center to the edge on the reference image, fitting a brightness attenuation function from the center to the edge of the reference image;

[0008] Based on the brightness attenuation function, filling brightness values for the pixels outside the image range of the reference image to obtain a target reference image;

[0009] Based on the image data of the target reference image, determining the lens shading compensation coefficient of the camera.

[0010] In some embodiments, the based on the pixel coordinates and brightness values of the pixels from the center to the edge on the reference image, fitting a brightness attenuation function from the center to the edge of the reference image includes:

[0011] Collecting at least one pixel sequence within the image range of the reference image, where the pixel sequence includes the pixels from the center to the edge of the reference image;

[0012] Based on the pixel coordinates and luminance values of each pixel in the pixel sequence, a luminance attenuation function from the center to the edge of the reference image is fitted.

[0013] In some embodiments, collecting at least one pixel sequence within the image range of the reference image includes:

[0014] Determine the located image range based on the image range of the reference image, where the boundary of the preset image range is within the boundary of the image range of the reference image;

[0015] Within the preset image range, the pixel sequence is collected in an arbitrary direction from the center to the boundary.

[0016] In some embodiments, the reference image includes multiple color channels; based on the pixel coordinates and luminance values of the pixels from the center to the edge on the reference image, fitting a luminance attenuation function from the center to the edge of the reference image includes:

[0017] Perform channel separation on the reference image to obtain the image data corresponding to each channel image included in the reference image;

[0018] For each channel image, based on the pixel coordinates and luminance values of the pixels from the center to the edge on the channel image, fit a luminance attenuation function corresponding to the channel image.

[0019] In some embodiments, based on the luminance attenuation function, filling luminance values for the pixels outside the image range of the reference image to obtain a target reference image includes:

[0020] For each channel image, based on the luminance attenuation function corresponding to the channel image, fill luminance values for the pixels outside the image range of the channel image to obtain a target channel image;

[0021] Based on the target channel images corresponding to each color channel, synthesize to obtain the target reference image.

[0022] In some embodiments, based on the pixel coordinates and luminance values of the pixels from the center to the edge on the reference image, fitting a luminance attenuation function from the center to the edge of the reference image includes:

[0023] Determine a preset attenuation relationship characterizing the luminance attenuation of the pixels from the center to the edge of the image;

[0024] Based on the pixel coordinates and luminance values of the pixels from the center to the edge on the reference image, perform function fitting on the preset attenuation relationship to obtain the luminance attenuation function.

[0025] In some embodiments, filling the brightness values for the pixels outside the image range of the reference image based on the brightness attenuation function to obtain a target reference image includes:

[0026] Determining the pixel coordinates of the pixels to be filled based on a preset filling width and the image range of the reference image;

[0027] Determining the brightness value corresponding to the pixel to be filled based on the pixel coordinates of the pixel to be filled and the brightness attenuation function;

[0028] Assigning the brightness value to the pixel to be filled to obtain the target reference image.

[0029] In a second aspect, embodiments of the present disclosure provide an image data processing apparatus, including:

[0030] An image acquisition module configured to acquire image data obtained by a camera capturing a reference image, where the image data includes the pixel coordinates and brightness values of each pixel;

[0031] A function fitting module configured to fit a brightness attenuation function from the center to the edge of the reference image based on the pixel coordinates and brightness values of the pixels from the center to the edge on the reference image;

[0032] A pixel filling module configured to fill the brightness values for the pixels outside the image range of the reference image based on the brightness attenuation function to obtain a target reference image;

[0033] A shadow compensation module configured to determine a lens shadow compensation coefficient of the camera based on the image data of the target reference image.

[0034] In some embodiments, the function fitting module is configured to:

[0035] Acquire at least one pixel sequence within the image range of the reference image, where the pixel sequence includes the pixels from the center to the edge of the reference image;

[0036] Fitting a brightness attenuation function from the center to the edge of the reference image based on the pixel coordinates and brightness values of the pixels in the pixel sequence.

[0037] In some embodiments, the function fitting module is configured to:

[0038] Determine a located image range based on the image range of the reference image, where the boundary of the preset image range is within the boundary of the image range of the reference image;

[0039] Acquire the pixel sequence in any direction from the center to the boundary within the preset image range.

[0040] In some embodiments, the reference image includes a plurality of color channels, and the function fitting module is configured to:

[0041] Separate the channels of the reference image to obtain the image data corresponding to each channel image included in the reference image;

[0042] For each channel image, based on the pixel coordinates and brightness values of the pixels from the center to the edge on the channel image, fit to obtain the brightness attenuation function corresponding to the channel image.

[0043] In some embodiments, the pixel filling module is configured to:

[0044] For each channel image, based on the brightness attenuation function corresponding to the channel image, fill the brightness values for the pixels outside the image range of the channel image to obtain a target channel image;

[0045] Based on the target channel images corresponding to each color channel, synthesize to obtain the target reference image.

[0046] In some embodiments, the function fitting module is configured to:

[0047] Determine a preset attenuation relationship characterizing the brightness attenuation of the pixels from the center to the edge of the image;

[0048] Based on the pixel coordinates and brightness values of the pixels from the center to the edge on the reference image, perform function fitting on the preset attenuation relationship to obtain the brightness attenuation function.

[0049] In some embodiments, the pixel filling module is configured to:

[0050] Based on a preset filling width and the image range of the reference image, determine the pixel coordinates of the pixels to be filled;

[0051] Based on the pixel coordinates of the pixels to be filled and the brightness attenuation function, determine the brightness value corresponding to the pixels to be filled;

[0052] Based on the brightness value, assign a value to the pixels to be filled to obtain the target reference image.

[0053] In a third aspect, embodiments of the present disclosure provide an electronic device, including:

[0054] A processor; and

[0055] A memory storing computer instructions for causing the processor to execute the method according to any embodiment of the first aspect.

[0056] Fourthly, an embodiment of the present disclosure provides a storage medium storing computer instructions for causing a computer to execute the method according to any embodiment of the first aspect.

[0057] The image data processing method according to the embodiment of the present disclosure includes obtaining image data collected by a camera for a reference image, fitting a luminance attenuation function based on the pixel coordinates and luminance values of pixels from the center to the edge on the reference image, filling luminance values for pixels outside the image range of the reference image based on the luminance attenuation function to obtain a target reference image, and determining a lens shading compensation coefficient of the camera based on the image data of the target reference image. In the embodiment of the present disclosure, by fitting the luminance attenuation function of the image Lens Shading effect and filling pixels at the edge of the reference image based on the luminance attenuation function, the problem of abnormal compensation coefficients caused by invalid pixels in the edge grid is eliminated or alleviated, a more accurate lens shading compensation coefficient LSC Table is obtained, and further, the effect of image LSC correction is improved, and problems such as bright edges, uneven edge luminance, and edge noise in the image are alleviated. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0059] Figure 1 It is an effect diagram of image LSC processing in the related art.

[0060] Figure 2 It is an effect diagram of image LSC processing in the related art.

[0061] Figure 3 It is a principle image of the LSC algorithm in the related art.

[0062] Figure 4 It is a flowchart of the image data processing method according to some embodiments of the present disclosure.

[0063] Figure 5 It is a schematic diagram of the image data processing method according to some embodiments of the present disclosure.

[0064] Figure 6 It is a flowchart of the image data processing method according to some embodiments of the present disclosure.

[0065] Figure 7 It is a schematic diagram of the image data processing method according to some embodiments of the present disclosure.

[0066] Figure 8 is a flowchart of an image data processing method according to some embodiments of the present disclosure.

[0067] Figure 9 is a schematic diagram of an image data processing method according to some embodiments of the present disclosure.

[0068] Figure 10 is a flowchart of an image data processing method according to some embodiments of the present disclosure.

[0069] Figure 11 is a flowchart of an image data processing method according to some embodiments of the present disclosure.

[0070] Figure 12 is a flowchart of an image data processing method according to some embodiments of the present disclosure.

[0071] Figure 13 is a schematic diagram of an image data processing method according to some embodiments of the present disclosure.

[0072] Figure 14 is a block diagram of the structure of an image data processing apparatus according to some embodiments of the present disclosure.

[0073] Figure 15 is a block diagram of the structure of an electronic device according to some embodiments of the present disclosure. Detailed Embodiments

[0074] The technical solutions of the present disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments in the present disclosure belong to the scope of protection of the present disclosure. In addition, the technical features involved in the different embodiments of the present disclosure described below can be combined with each other as long as they do not conflict with each other.

[0075] Lens Shading refers to the problem of shading (or vignetting), which means that due to the influence of the optical characteristics of the lens, when a camera terminal such as a mobile phone or a camera takes a picture, the shading effect shown in the captured image reduces the image quality.

[0076] Lens Shading includes Luma Shading and Color Shading. Luma Shading means that the brightness of the captured image gradually darkens from the center to the periphery of the image, showing that the brightness in the center of the image is higher and the brightness in the four corners and edges is darker. Color Shading means that the colors in the center and the periphery of the captured image are inconsistent, showing color deviation between the center and the four corners and edges of the image.

[0077] In the related art, to solve the Lens Shading problem of a camera, an LSC (Lens Shading Correction) algorithm is used to correct the image. Currently, most LSC algorithms use an LSC Table (lens shading compensation coefficient) based on a Mesh grid to correct and compensate the image, and the method process includes a calibration stage and an operation stage.

[0078] In the calibration stage, since the performance of Lens Shading is different under different light sources, it is necessary to pre-calibrate the LSC Table under several common light sources. Specifically, the camera can be used to capture a calibration image, and then the captured original image is divided into n*m grids. A compensation coefficient is calculated based on the average brightness value of the pixels within each grid, so each LSC Table includes the compensation coefficients of n*m grids, and then the camera stores these LSC Tables.

[0079] In the operation stage, the camera can calculate a new LSC Table based on the LSC Table stored in the calibration stage according to information such as the environmental parameters and debugging parameters during the current shooting process. Then, according to the coordinates of each pixel on the image, it is determined which grid the pixel is located in, and based on the compensation coefficient corresponding to the grid in the LSC Table, the brightness value of each pixel is compensated.

[0080] For example Figure 1 in (a) is the original image, Figure 1 in (b) is the image after being processed by the above LSC algorithm. By comparing the two, it can be found that the original image shows a Lens Shading effect with brighter in the middle and darker around, while after being processed by the LSC algorithm, the overall brightness of the image is uniform and the Lens Shading problem is well corrected. It should be noted that Figure 1 the images in have been grayscale processed, and in fact, the comparison effect is more obvious.

[0081] The above LSC algorithm can achieve a good shadow correction effect in most scenarios, but in some scenarios, the compensation coefficient may be abnormally large, especially at the edge of the image, resulting in the brightness at the edge of the image exceeding the center of the image, causing the problem of bright edges; or the noise at the edge of the image is large; or the brightness around the image is not balanced, etc. Especially for scenarios such as action cameras that require multi-image stitching, obvious color difference seams appear on the stitched image. For example Figure 2 the stitched image shown in, there are obvious color difference bars forming seams on the image, reducing the image quality.

[0082] Further research revealed that this was due to the abnormal compensation coefficient of the edge grid in the LSC Table obtained during the calibration phase.

[0083] For example Figure 3 (a) shows an example scene of calibrating the LSC Table. The circular area in the figure is the lens field of view, and the rectangular area is the range of the photosensitive element. During the calibration process, the entire image range needs to be divided into n*m grids, for example, it can generally be divided into 17*13 grids.

[0084] For the grid area outside the lens field of view, the grid does not contain valid pixels or has very few valid pixels, so the algorithm defaults the compensation coefficient Gain value in the grid to 1, that is, no compensation is done. For the grid area within the lens field of view, the compensation coefficient of the grid needs to be calculated based on the average brightness of all pixels in the grid. At this time, the compensation coefficient at the edge of the image will be abnormal.

[0085] For example Figure 3 As shown in (b), for a grid 1 at the edge of the image, the grid contains both valid pixels and invalid pixels. Therefore, the existence of invalid pixels will lower the average brightness of the entire grid, resulting in a larger calculated compensation coefficient. Therefore, in the calibrated LSC Table, the compensation coefficient at the edge of the lens field of view will generally be larger, which will easily cause bright bars, noise, and uneven brightness on the edge of the image during operation. When stitching images, the color transition of the stitched image will be abrupt, forming a seam effect.

[0086] To solve this problem, one option is to divide the Mesh grid more finely, for example, doubling the grid density from the original 17*13 to 34*26, so as to reduce the compensation coefficient error of the edge grid, but at the same time, the calculation cost will also double, and it is limited by the hardware design of the platform. Another option is to optimize or replace the original LSC algorithm, but it requires increased R&D costs and additional calculation costs.

[0087] Based on this, the embodiments of the present disclosure provide an image data processing method, device, electronic device and storage medium, which aims to eliminate or alleviate the problem of abnormal image edge compensation coefficients by pre-filling pixels on the image edge without changing the original LSC algorithm, thereby obtaining a more accurate LSC Table, thereby improving the LSC correction effect and image quality.

[0088] ​In some embodiments, the present disclosure provides an image data processing method, which can be used in camera calibration to obtain a more accurate lens shading compensation coefficient (LSC Table), providing a high-precision data basis for subsequent image LSC correction.

[0089] As Figure 4 shown, in some embodiments, the image data processing method exemplified by the present disclosure includes:

[0090] S410. Obtain the image data acquired by the camera for the reference image.

[0091] It can be understood that in the LSC calibration stage, it is necessary to use the camera to capture reference images under a variety of common light sources, and respectively calibrate and store the corresponding LSC Table for each light source effect based on the reference images.

[0092] The method of the embodiments of the present disclosure can be applied to this process. After capturing the reference image, first perform edge pixel filling on the reference image, and then calibrate the LSC Table based on the filled image. It can be understood that multiple LSC Tables under different light sources need to be calibrated in the LSC calibration stage, and their principles are exactly the same. Therefore, the present disclosure only takes any one of the LSC Tables as an example to illustrate the calibration process.

[0093] In some embodiments, the image data of the reference image can be acquired by the camera. The reference image can be an image obtained by using the camera to capture a preset calibration image. The present disclosure places no restrictions on the image content of this reference image.

[0094] The image data of the reference image refers to the RAW data captured by the camera. The RAW data refers to the unprocessed original data obtained by the camera, which includes the pixel coordinates of each pixel on the reference image and the brightness value corresponding to each pixel. The brightness value is also the pixel value of the pixel.

[0095] It is worth noting that the photosensitive element generally includes multiple color channels, that is, each pixel on the photosensitive element includes multiple sub-pixels. For example Figure 5 shows a schematic diagram of a photosensitive element with a common RGGB pixel arrangement. Thus, the image captured by this photosensitive element includes a total of 4 channels, namely the R channel, the G channel, the G channel, and the B channel. Of course, it can be understood that the pixel arrangement of the photosensitive element is not limited to Figure 5 the RGGB shown, and can also be, for example, RYYB, RGBW, etc. The principle is similar, and the present disclosure will not elaborate further.

[0096] Thus, in some embodiments of the present disclosure, the image data of the reference image, that is, the image data including multiple color channels, and the image data of each color channel includes the aforementioned pixel coordinates and corresponding luminance values.

[0097] S420. Based on the pixel coordinates and luminance values of the pixels from the center to the edge of the reference image, a luminance attenuation function from the center to the edge of the reference image is fitted.

[0098] It can be understood that due to the existence of the aforementioned Lens Shading problem, the captured reference image will also have the Lens Shading problem, that is, it is manifested as high luminance in the center of the image and low luminance at the four edges, showing an effect of gradually decreasing luminance from the center to the edge of the image.

[0099] Therefore, in the embodiments of the present disclosure, it is necessary to fit a luminance attenuation function based on the pixels from the center to the edge of the reference image, and this luminance attenuation function can express the luminance attenuation law from the center to the edge of the image. The independent variable of the luminance attenuation function is the pixel coordinate, and the dependent variable is the luminance value, that is, given the pixel coordinate of any pixel, its corresponding luminance value can be estimated through the luminance attenuation function.

[0100] The purpose of fitting the luminance attenuation function is to fill the pixels outside the image range of the reference image. For example Figure 3 as shown in (b) in the figure, Grid 1 contains both invalid pixels and valid pixels. Due to the existence of the invalid pixels, the average luminance of the entire grid is pulled down, resulting in an abnormally large compensation coefficient calibrated for Grid 1. Therefore, if the invalid pixels in Grid 1 can be filled with valid pixels, that is, Grid 1 will no longer contain invalid pixels, and the calibrated compensation coefficient will be more accurate.

[0101] Based on this, in order to perform pixel filling on the invalid pixels in the edge grid Grid 1, it is necessary to estimate the luminance value of each invalid pixel. In the embodiments of the present disclosure, a luminance attenuation function is fitted based on the known pixel luminance change on the reference image, and then using the luminance attenuation function, given the pixel coordinate of any invalid pixel, its corresponding luminance value can be estimated, and then the luminance value is assigned to the pixel to complete the pixel filling of the invalid pixel.

[0102] In some embodiments of the present disclosure, a luminance attenuation function can be fitted based on the lens luminance attenuation rate cos 4 θ, or other fitting functions can also be used to obtain the luminance attenuation function, such as a binary polynomial function, etc. The present disclosure does not limit this.

[0103] In some embodiments of the present disclosure, by collecting the pixel sequence from the center to the edge of the reference image, and based on the pixel coordinates and brightness values of the pixels in the pixel sequence, the above-mentioned brightness attenuation function can be fitted. The process of function fitting will be described below in the present disclosure.

[0104] In some embodiments, after collecting the pixel sequence, the edge pixels of the reference image can be screened out, that is, the acquisition range of the pixel sequence is not the entire reference image, but the pixels at the edge of the reference image are removed. The purpose of this is to reduce or eliminate the calculation errors caused by factors such as occlusion and increased attenuation degree at the edge of the lens. This will be described below in the present disclosure.

[0105] S430. Based on the brightness attenuation function, fill the brightness values for the pixels outside the image range of the reference image to obtain the target reference image.

[0106] As can be seen from the foregoing, after fitting the brightness attenuation function, the brightness attenuation function represents the brightness attenuation law from the center to the periphery of the image. Thus, given the pixel coordinates of any pixel, the brightness value corresponding to this pixel can be estimated through the brightness attenuation function.

[0107] Combined with Figure 3 As shown, for the grid at the edge of the image, it may include both valid pixels and invalid pixels. In the embodiments of the present disclosure, the brightness attenuation function obtained above can be used to fill the pixels outside the image range of the reference image, so that only valid pixels are included in the edge grid.

[0108] For example, given the pixel coordinates of any invalid pixel, its corresponding brightness value can be estimated through the brightness attenuation function, and then the estimated brightness value is assigned to this pixel, thus realizing the pixel filling of the invalid pixel.

[0109] In some embodiments, pixel filling can be performed on all invalid pixels on the photosensitive element. In other embodiments, to reduce the calculation amount, only one circle of pixels can be filled outside the edge of the reference image, and the width of pixel filling can be selected according to the specific pixel density, as long as it is ensured that all the grids at the edge position of the reference image are valid pixels. This will be described in the following embodiments of the present disclosure.

[0110] In the embodiments of the present disclosure, after filling the invalid pixels outside the image range of the reference image, an image with a larger image range can be obtained, that is, the target reference image described in the present disclosure.

[0111] S440. Based on the image data of the target reference image, determine the lens shadow compensation coefficient of the camera.

[0112] As described above, the purpose of calibration is to obtain the LSC Table corresponding to the camera, that is, the lens shading compensation coefficient. The LSC Table includes the compensation coefficients corresponding to each grid, and the compensation coefficient of each grid needs to be calculated based on the average brightness of all pixels within the grid.

[0113] Therefore, in the embodiments of the present disclosure, after obtaining the target reference image, the average brightness of pixels in each grid can be calculated based on the target reference image, and then the compensation coefficient corresponding to each grid can be calculated based on the average brightness to obtain the lens shading compensation coefficient LSC Table.

[0114] It can be understood that in the embodiments of the present disclosure, since all invalid pixels in the grids at the edge positions of the original reference image are filled with valid pixels, the abnormal average brightness of the grids caused by the original invalid pixels will be corrected to the normal level. As a result, the calculated compensation coefficients are more accurate, and a more accurate LSC Table can be obtained. During the operation phase, when performing LSC correction based on the LSC Table of the present disclosure, the brightness at the edge positions of the image will be better corrected, avoiding or reducing risks such as bright edges, uneven edge brightness, and edge noise.

[0115] In addition, it is worth noting that in the embodiments of the present disclosure, for the process of calculating the LSC Table based on the target reference image and the process of performing LSC correction based on the LSC Table during the operation phase, the existing LSC algorithm can be used. The present disclosure does not interfere with the original LSC algorithm, thus avoiding a lot of additional costs. In the related art, the LSC algorithm of the camera is generally encapsulated in the platform hardware. Taking the Qualcomm platform as an example, if one wants to abandon or optimize the LSC algorithm provided by Qualcomm, not only does it require increasing the cost of self-developed algorithms, but also cooperation with the Qualcomm platform needs to be solved, which requires a huge investment in cost and is restricted by the platform hardware.

[0116] In the embodiments of the present disclosure, only during the calibration phase, after the camera outputs the image data of the reference image and before the LSC algorithm runs, the above-mentioned pixel filling process is completed based on the image data of the reference image, and the filled target reference image is output to the LSC algorithm. There is no need to change the original LSC algorithm, thus avoiding the aforementioned costs and achieving the optimization of the LSC effect at a very small cost.

[0117] In addition, for the process of calculating the LSC Table based on the target reference image and the process of performing LSC correction based on the LSC Table during the operation phase, those skilled in the art can understand and fully implement them by referring to the LSC algorithm of the related art. Therefore, the embodiments of the present disclosure will not elaborate on this.

[0118] As described above, in the embodiments of the present disclosure, by fitting the brightness attenuation function of the Lens Shading effect of the image, pixel filling is performed on the edges of the reference image based on the brightness attenuation function, so as to eliminate or alleviate the problem of abnormal compensation coefficients caused by invalid pixels of the edge grid, obtain a more accurate lens shading compensation coefficient LSC Table, and further improve the effect of image LSC correction, and alleviate problems such as bright edges, uneven edge brightness, and edge noise in the image.

[0119] As Figure 6 shown, in some embodiments, the image data processing method of the present disclosure example includes:

[0120] S411. Perform channel separation on the reference image to obtain the image data corresponding to each channel image included in the reference image.

[0121] S412. For each channel image, based on the pixel coordinates and brightness values of the pixels from the center to the edge on the channel image, fit the brightness attenuation function corresponding to the channel image.

[0122] In some embodiments of the present disclosure, the reference image collected by the camera includes multiple color channels, so the image data corresponding to the reference image, that is, includes the channel image data of each color channel.

[0123] For example Figure 5 in the example, the reference image includes four color channels of RGGB, so first the reference image can be channel-separated to obtain the channel image corresponding to each color channel. For example Figure 7 shown, after the reference image is channel-separated, an R channel image, a G channel image, a G channel image, and a B channel image are obtained respectively. The image data of each channel image, that is, includes the pixel coordinates and brightness values of each pixel in the channel image.

[0124] After channel-separating the reference image, it is necessary to perform edge pixel filling based on each channel image to obtain the target channel image corresponding to each channel image, and then perform image synthesis on each target channel image to obtain the target reference image.

[0125] The process of pixel filling each channel image to obtain the target channel image is exactly the same. Only the fitting of the brightness attenuation function and the pixel filling process of one channel image will be described below.

[0126] As Figure 8 shown, in some embodiments, the image data processing method of the present disclosure example includes:

[0127] S810. Collect at least one pixel sequence within the image range of the reference image.

[0128] In the embodiments of the present disclosure, a pixel sequence refers to a column of pixels from the center to the edge of a reference image. It can be understood that the luminance attenuation function represents the luminance attenuation law from the center to the edge of the image. Therefore, when fitting the luminance attenuation function, at least one column of pixel sequences from the center to the edge of the reference image needs to be collected.

[0129] In an exemplary embodiment, the reference image may be as Figure 9 shown, and the image range of the reference image is a circle with a radius R0.

[0130] In some embodiments, within the image range of radius R0, one column of pixels can be arbitrarily collected from the center to the edge of the image as the pixel sequence. For example Figure 9 in the example, one column of pixels can be collected horizontally or vertically from the center of the circle to the boundary of the image range with radius R0 to obtain the pixel sequence.

[0131] However, in some other embodiments, considering that the pixels at the image edge may have abnormal luminance due to occlusion or excessive luminance attenuation, before collecting the pixel sequence, a preset image range for collecting the pixel sequence can be determined based on the image range of the reference image. The following will be described in conjunction with Figure 10 this.

[0132] As Figure 10 shown, in some embodiments, the image data processing method of the present disclosure example includes:

[0133] S811. Determine a preset image range based on the image range of the reference image.

[0134] S812. Collect a pixel sequence in any direction from the center to the boundary within the preset image range.

[0135] In the embodiments of the present disclosure, considering that the edge of the lens may block light due to device occlusion or the edge luminance attenuation may be aggravated due to an excessive field of view angle, the luminance of the edge pixels of the reference image may be abnormal. If the luminance attenuation function is fitted by combining these pixels with abnormal luminance, relatively large errors may be introduced.

[0136] Therefore, first, a preset image range after removing the edge pixels can be determined based on the image range of the reference image, that is, the image boundary of the preset image range is smaller than the image boundary of the reference image. For example Figure 9 in the example, the image range of the reference image is a circular range with a radius R0, and then a circular range with a radius R1 can be determined as the preset image range within this image range. It can be seen that since R1 is less than R0, the boundary of the preset image range is located within the reference image.

[0137] For the value of (R0 - R1), it can be selected according to the specific scenario requirements, and the present disclosure does not limit this.

[0138] After determining the preset image range of the radius R1, a pixel sequence can be collected within the preset image range. For example, in one example, a column of pixels can be collected in any direction from the image center to the boundary of the radius R1 as the pixel sequence.

[0139] In some embodiments, before collecting the pixel sequence, the reference image can also be filtered to eliminate or reduce image noise and further improve the calculation accuracy. The image filtering method can adopt any filtering method. For example, in one example, the reference image can be subjected to mean filtering.

[0140] As can be seen from the above, in the embodiments of the present disclosure, by collecting a pixel sequence within a preset image range smaller than the reference image range, the brightness error caused by factors such as light occlusion by the device or increased edge brightness attenuation due to an overly large field of view angle can be eliminated or reduced, providing an accurate data basis for subsequent function fitting.

[0141] S820. Based on the pixel coordinates and brightness values of each pixel in the pixel sequence, a brightness attenuation function from the center to the edge of the reference image is fitted.

[0142] Combined with the foregoing, it can be known that the pixel sequence includes a column of pixels from the image center to the edge, so the brightness change of the pixel sequence can reflect the brightness change from the image center to the edge.

[0143] Thus, after the pixel sequence is collected, the pixel coordinates and brightness values of the pixels in the pixel sequence can be used as known quantities for function fitting to obtain the brightness attenuation function. The following will be described in combination with Figure 11 for illustration.

[0144] As Figure 11 shown, in some embodiments, the image data processing method of the present disclosure example includes:

[0145] S821. Determine a preset attenuation relationship representing the brightness attenuation of pixels from the image center to the edge.

[0146] S822. Based on the pixel coordinates and brightness values of the pixels from the center to the edge on the reference image, perform function fitting on the preset attenuation relationship to obtain the brightness attenuation function.

[0147] In the embodiments of the present disclosure, the preset attenuation relationship refers to a functional relationship given to represent the brightness attenuation law of pixels from the image center to the edge. The preset attenuation relationship can adopt various types of functions, and the present disclosure does not limit this. The following will respectively use cos 4Taking θ and a binary cubic polynomial as examples, the function fitting process will be described.

[0148] In some embodiments, it can be understood that generally, the attenuation of lens brightness conforms to f(θ) = cos 4 The attenuation rate of θ, where θ represents the incident light angle, and cos 4 θ is also known as the cos4 law.

[0149] Therefore, in the embodiments of the present disclosure, the attenuation rate of cos 4 θ can be used as the preset attenuation relationship. Based on the pixel coordinates and brightness values of each pixel in the aforementioned pixel sequence, the preset attenuation relationship cos 4 θ is subjected to function fitting, and the obtained brightness attenuation function can be expressed as:

[0150] F = f(x i , y i , z i , Pixel seq , cos 4 θ) (1)

[0151] In formula (1), x i and y i represent the pixel coordinates of the i-th pixel in the pixel sequence, z i represents the brightness value of the i-th pixel, Pixel seq represents the pixel sequence, and cos 4 θ represents the preset attenuation relationship. Thus, the brightness attenuation function can be obtained according to formula (1).

[0152] In other embodiments, considering that the operation of cos 4 θ is relatively difficult and the amount of calculation is large, resulting in low calibration efficiency. Therefore, the preset attenuation relationship can adopt a binary cubic polynomial function, and the preset attenuation relationship can be expressed as:

[0153] f(z) = p00 + p10 * x + p01 * y + p20 * x 2 + p11 * x * y + p02 * y 2 + p30 * x 3 + p21 * x 2 * y + p12 * x * y 2 + p03 * y 3 (2)

[0154] In formula (2), x and y represent pixel coordinates, z represents pixel brightness value, and p00, p10, p01, p20, p11, p02, p30, p21, p12, p03 represent polynomial parameters. The goal of function fitting is to determine the values of these polynomial parameters.

[0155] For example, in one example, assume that the size of the reference image is 912 pixels * 684 pixels, that is, x = 1, 2, 3…, 912, y = 1, 2, 3…, 684, and z is the luminance value. Substitute the pixel coordinates and luminance values of each pixel in the pixel sequence into formula (2) for function fitting, and the polynomial parameters obtained by fitting are respectively: p00 = 151.9, p10 = 0.2174, p01 = 0.1525, p20 = -0.0002457, p11 = -1.036e-05, p02 = -0.0002248, p30 = 7.804e-09, p21 = 3.264e-09, p12 = 8.992e-09, p03 = -2.837e-09.

[0156] Therefore, substituting the obtained values of the polynomial parameters into formula (2), the luminance attenuation function can be obtained.

[0157] As can be seen from the above, in the embodiments of the present disclosure, a polynomial function is used to fit the luminance attenuation function, reducing the computational amount of function fitting and improving the calibration efficiency.

[0158] The above only takes the process of fitting the luminance attenuation function for a single-channel image as an example. For multiple-channel images included in the reference image, the above process is sequentially repeated to respectively obtain the luminance attenuation function corresponding to each channel image.

[0159] Still taking a single-channel image as an example, after obtaining the luminance attenuation function, pixel filling can be performed outside the edge range of the channel image. The following is combined with Figure 12 for illustration.

[0160] As Figure 12 shown, in some embodiments, the image data processing method of the present disclosure example includes:

[0161] S431. Determine the pixel coordinates of the pixels to be filled based on the preset filling width and the image range of the reference image.

[0162] Combined with Figure 9 shown, the image range of the reference image is a circular range surrounded by a radius R0, and the preset filling width represents the width of pixel filling required outside the edge range of the reference image, that is, Figure 9 (R2 - R0) in

[0163] It can be understood that the value of the preset filling width can be selected according to specific scenario requirements as long as it ensures that the invalid pixels in the grid at the edge of the reference image can be filled. For example, in one example, the foregoing Figure 3Taking the grid density of the example as an example, the preset filling width can take values from 100 pixels to 300 pixels. That is, the value range of (R2 - R0) is from 100 pixels to 300 pixels, indicating that on the basis of the image range of the original reference image, 100 to 300 pixel units are filled outward.

[0164] After determining the pixel range to be filled based on the preset filling width (R2 - R0), the pixel coordinates of each pixel to be filled in the filling range can be extracted. The pixels to be filled are also Figure 9 the pixels within the annular region between the radius R0 and the radius R2 in

[0165] S432. Determine the brightness value corresponding to the pixel to be filled based on the pixel coordinates of the pixel to be filled and the brightness attenuation function.

[0166] Combined with the foregoing, the brightness attenuation function represents the brightness attenuation law from the center to the edge of the image. The independent variable of the brightness attenuation function is the pixel coordinates, and the dependent variable is the brightness value. Taking the brightness attenuation function described in the foregoing formula (2) as an example, for each pixel to be filled Pixel i , the pixel coordinates (x i , y i ) of this pixel Pixel i can be substituted into formula (2), and the corresponding brightness value z i can be calculated. This brightness value z i is the estimated brightness value of the pixel Pixel i . In this way, the brightness value corresponding to each pixel to be filled Pixel i can be calculated.

[0167] S433. Assign values to the pixels to be filled based on the brightness value to obtain the target reference image.

[0168] Combined with the foregoing, it can be known that after calculating the brightness value z i for each pixel to be filled Pixel i , values can be assigned to the pixels to be filled on the image to achieve pixel filling of the pixels to be filled. The final image effect is taken as an example of the circular range with a radius of R2 in Figure 9 .

[0169] That is Figure 9 In the example, the circular range surrounded by the radius R0 is the image range of the reference image, and the circular range surrounded by the radius R2 is the image range after filling. The image within this image range is the target reference image described in the present disclosure.

[0170] It should be noted that the above description only focuses on one channel image and explains the process of fitting the luminance attenuation function and filling the edge pixels. For the four RGGB channel images, the above process is sequentially repeated to obtain the target channel image corresponding to each channel image respectively.

[0171] As shown in Figure 13 after obtaining the target channel image corresponding to each channel image, the target channel images of each color channel are synthesized to obtain the target reference image including all color channels.

[0172] As shown in Figure 9 it can be understood that the image range of the target reference image is a circular range enclosed by a radius R2, while the image range of the original reference image is a circular range enclosed by a radius R0. It can be seen that after being processed by the embodiment of the present disclosure, pixel filling can be performed at the edge of the original image range, and the original invalid pixels at the edge are filled with appropriate valid pixels.

[0173] In the embodiment of the present disclosure, after obtaining the target reference image, the target reference image can be output to the LSC algorithm module, so as to generate the corresponding lens shading compensation coefficient LSC Table based on the LSC algorithm. The basic principle of the algorithm is that by calculating the average luminance of the pixels in each grid, a corresponding compensation coefficient is determined for each grid based on the average luminance, so as to obtain the LSC Table. For the process of generating the lens shading compensation coefficient LSC Table by the LSC algorithm, those skilled in the art can understand and fully implement it with reference to the related technology, and the present disclosure will not elaborate on this.

[0174] As can be seen from the above, in the embodiment of the present disclosure, by fitting the luminance attenuation function of the image Lens Shading effect and filling the edge of the reference image based on the luminance attenuation function, the problem of abnormal compensation coefficient caused by the invalid pixels of the edge grid is eliminated or alleviated, and a more accurate lens shading compensation coefficient LSC Table is obtained, thereby improving the effect of image LSC correction and alleviating problems such as bright edges, uneven edge luminance, and edge noise of the image.

[0175] In addition, it should be noted that the above-described embodiment method of the present disclosure is not only applicable to cameras with a circular field of view, but also applicable to cameras with other irregular fields of view with the same principle, and the present disclosure does not limit this.

[0176] Moreover, when the method of the embodiment of the present disclosure is used in a multi-image stitching scenario, it can effectively eliminate or alleviate the seam problem of the stitched image caused by abnormal edge luminance of the original image, and improve the image stitching effect of multi-camera systems such as action cameras and monitoring systems.

[0177] The above description is about the calibration process of the LSC Table. For the operation stage of the LSC algorithm, after the camera captures an image, based on information such as environmental parameters and debugging parameters during the current shooting process, a new LSC Table can be calculated based on the LSC Table stored during the calibration stage. Then, according to the coordinates of each pixel on the image, it is determined which grid the pixel is located in, and based on the compensation coefficient corresponding to the grid in the LSC Table, the brightness value of each pixel is compensated to achieve LSC compensation and correction. Regarding the process of LSC compensation, those skilled in the art can undoubtedly understand and fully implement it with reference to the LSC algorithm of related technologies, and the present disclosure will not elaborate on this further.

[0178] In some embodiments, the present disclosure provides an image data processing device, which can be applied to an electronic device to implement the calibration of the LSC Table of the camera of the electronic device.

[0179] As Figure 14 shown, in some embodiments, the image data processing device exemplified in the present disclosure includes:

[0180] An image acquisition module 10, configured to acquire image data obtained by the camera capturing a reference image, where the image data includes the pixel coordinates and brightness values of each pixel;

[0181] A function fitting module 20, configured to fit a brightness attenuation function from the center to the edge of the reference image based on the pixel coordinates and brightness values of the pixels from the center to the edge of the reference image;

[0182] A pixel filling module 30, configured to fill the brightness values of the pixels outside the image range of the reference image based on the brightness attenuation function to obtain a target reference image;

[0183] A shadow compensation module 40, configured to determine the lens shadow compensation coefficient of the camera based on the image data of the target reference image.

[0184] In some embodiments, the function fitting module 20 is configured to:

[0185] Acquire at least one pixel sequence within the image range of the reference image, where the pixel sequence includes the pixels from the center to the edge of the reference image;

[0186] Fit a brightness attenuation function from the center to the edge of the reference image based on the pixel coordinates and brightness values of each pixel in the pixel sequence.

[0187] In some embodiments, the function fitting module 20 is configured to:

[0188] The image range based on the reference image determines the located image range, and the boundaries of the preset image range are within the boundaries of the image range of the reference image;

[0189] Within the preset image range, the pixel sequence is acquired in any direction from the center to the boundary.

[0190] In some embodiments, the reference image includes multiple color channels, and the function fitting module 20 is configured to:

[0191] Perform channel separation on the reference image to obtain the image data corresponding to each channel image included in the reference image;

[0192] For each channel image, based on the pixel coordinates and brightness values of the pixels from the center to the edge on the channel image, a brightness attenuation function corresponding to the channel image is fitted.

[0193] In some embodiments, the pixel filling module 30 is configured to:

[0194] For each channel image, based on the brightness attenuation function corresponding to the channel image, fill the brightness values for the pixels outside the image range of the channel image to obtain a target channel image;

[0195] Based on the target channel images corresponding to each color channel, a target reference image is synthesized.

[0196] In some embodiments, the function fitting module 20 is configured to:

[0197] Determine a preset attenuation relationship characterizing the brightness attenuation of the pixels from the center to the edge of the image;

[0198] Based on the pixel coordinates and brightness values of the pixels from the center to the edge on the reference image, perform function fitting on the preset attenuation relationship to obtain the brightness attenuation function.

[0199] In some embodiments, the pixel filling module 30 is configured to:

[0200] Based on a preset filling width and the image range of the reference image, determine the pixel coordinates of the pixels to be filled;

[0201] Based on the pixel coordinates of the pixels to be filled and the brightness attenuation function, determine the brightness value corresponding to the pixels to be filled;

[0202] Based on the brightness value, assign a value to the pixels to be filled to obtain the target reference image.

[0203] As described above, in the embodiments of the present disclosure, by fitting the luminance attenuation function of the Lens Shading effect of the image and filling the pixels at the edges of the reference image based on the luminance attenuation function, the problem of abnormal compensation coefficients caused by invalid pixels in the edge grid is eliminated or alleviated, a more accurate lens shading compensation coefficient LSC Table is obtained, thereby improving the effect of image LSC correction and alleviating problems such as bright edges, uneven edge brightness, and edge noise in the image.

[0204] In some embodiments, the present disclosure provides an electronic device, which can be any device type with a camera, such as a mobile phone, a tablet computer, an action camera, a monitoring system, etc., and the present disclosure does not limit this.

[0205] In some embodiments, the electronic device exemplified in the present disclosure includes:

[0206] a processor; and

[0207] a memory storing computer instructions for causing the processor to execute the method described in any of the above embodiments.

[0208] In some embodiments, the present disclosure provides a storage medium storing computer instructions for causing a computer to execute the method described in any of the above embodiments.

[0209] Figure 15 The structure of the electronic device in some embodiments of the present disclosure is shown below, and the electronic device in some embodiments of the present disclosure will be described below in conjunction with Figure 15 Reference is made to

[0210] Referring to Figure 15 , the electronic device 1800 may include one or more of the following components: a processing component 1802, a memory 1804, a power component 1806, a multimedia component 1808, an audio component 1810, an input / output (I / O) interface 1812, a sensor component 1816, and a communication component 1818.

[0211] The processing component 1802 generally controls the overall operation of the electronic device 1800, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 1802 may include one or more processors 1820 to execute instructions. In addition, the processing component 1802 may include one or more modules to facilitate the interaction between the processing component 1802 and other components. For example, the processing component 1802 may include a multimedia module to facilitate the interaction between the multimedia component 1808 and the processing component 1802. Also, for example, the processing component 1802 may read executable instructions from the memory to implement functions related to the electronic device.

[0212] The memory 1804 is configured to store various types of data to support the operation of the electronic device 1800. Examples of such data include instructions for any application programs or methods operating on the electronic device 1800, contact data, phone book data, messages, pictures, videos, and the like. The memory 1804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, 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 disks, or optical disks.

[0213] The power supply component 1806 provides power to various components of the electronic device 1800. The power supply component 1806 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 1800.

[0214] The multimedia component 1808 includes a display screen that provides an output interface between the electronic device 1800 and the user. In some embodiments, the multimedia component 1808 includes a front camera and / or a rear camera. When the electronic device 1800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0215] The audio component 1810 is configured to output and / or input audio signals. For example, the audio component 1810 includes a microphone (MIC) that is configured to receive external audio signals when the electronic device 1800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 1804 or transmitted via the communication component 1818. In some embodiments, the audio component 1810 further includes a speaker for outputting audio signals.

[0216] The I / O interface 1812 provides an interface between the processing component 1802 and the peripheral interface module, and the peripheral interface module can be a keyboard, a click wheel, buttons, and the like. These buttons can include, but are not limited to: a home button, a volume button, a start button, and a lock button.

[0217] The sensor assembly 1816 includes one or more sensors for providing a status assessment of various aspects of the electronic device 1800. For example, the sensor assembly 1816 can detect the on / off state of the electronic device 1800, the relative positioning of components, such as the display and keypad of the electronic device 1800. The sensor assembly 1816 can also detect a change in the position of the electronic device 1800 or a component of the electronic device 1800, the presence or absence of user contact with the electronic device 1800, the orientation or acceleration / deceleration of the electronic device 1800, and the temperature change of the electronic device 1800. The sensor assembly 1816 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1816 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1816 can also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0218] The communication component 1818 is configured to facilitate communication between the electronic device 1800 and other devices in a wired or wireless manner. The electronic device 1800 can access a wireless network based on communication standards, such as Wi-Fi, 2G, 3G, 4G, 5G, or 6G, or a combination thereof. In an exemplary embodiment, the communication component 1818 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1818 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0219] In an exemplary embodiment, the electronic device 1800 can 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, microcontrollers, microprocessors, or other electronic components.

[0220] Obviously, the above embodiments are merely examples for clear illustration and not limitations on the embodiments. For those of ordinary skill in the art, other different forms of changes or variations can be made based on the above description. It is not necessary and impossible to enumerate all embodiments here. And the obvious changes or variations derived therefrom are still within the protection scope of this disclosure.

Claims

1. A method for processing image data, characterized in that: include: Acquire image data obtained by capturing a reference image with a camera, wherein the image data includes pixel coordinates and brightness values ​​of each pixel; Based on the pixel coordinates and brightness values ​​of the pixels from the center to the edge of the reference image, a brightness attenuation function from the center to the edge of the reference image is fitted; Filling brightness values ​​for pixels outside the image range of the reference image based on the brightness attenuation function to obtain a target reference image; Based on the image data of the target reference image, a lens shading compensation coefficient of the camera is determined.

2. The method according to claim 1, characterized in that The step of fitting a brightness attenuation function from the center to the edge of the reference image based on the pixel coordinates and brightness values ​​of the pixels from the center to the edge of the reference image comprises: Collecting at least one pixel sequence within the image range of the reference image, wherein the pixel sequence includes pixels from the center to the edge of the reference image; Based on the pixel coordinates and brightness values ​​of each pixel in the pixel sequence, a brightness attenuation function from the center to the edge of the reference image is fitted.

3. The method according to claim 2, characterized in that The acquiring of at least one pixel sequence within the image range of the reference image comprises: Determining a preset image range based on the image range of the reference image, wherein a boundary of the preset image range is located within an image range boundary of the reference image; The pixel sequence is acquired in any direction from the center to the boundary within the preset image range.

4. The method according to claim 1, characterized in that: The reference image includes a plurality of color channels; the brightness attenuation function from the center to the edge of the reference image is fitted based on the pixel coordinates and brightness values ​​of the pixels from the center to the edge of the reference image, including: Performing channel separation on the reference image to obtain image data corresponding to each channel image included in the reference image; For each channel image, a brightness attenuation function corresponding to the channel image is obtained by fitting based on the pixel coordinates and brightness values ​​of the pixels from the center to the edge of the channel image.

5. The method according to claim 4, characterized in that The step of filling the pixels outside the image range of the reference image with brightness values ​​based on the brightness attenuation function to obtain a target reference image comprises: For each channel image, based on the brightness attenuation function corresponding to the channel image, fill the brightness values ​​of the pixels outside the image range of the channel image to obtain a target channel image; The target reference image is synthesized based on the target channel images corresponding to the respective color channels.

6. The method according to any one of claims 1 to 5, characterized in that: The step of fitting a brightness attenuation function from the center to the edge of the reference image based on the pixel coordinates and brightness values ​​of the pixels from the center to the edge of the reference image comprises: Determine a preset attenuation relationship representing the attenuation of pixel brightness from the center to the edge of the image; Based on the pixel coordinates and brightness values ​​of the pixels from the center to the edge of the reference image, a function fitting is performed on the preset attenuation relationship to obtain the brightness attenuation function.

7. The method according to any one of claims 1 to 5, characterized in that: The step of filling the pixels outside the image range of the reference image with brightness values ​​based on the brightness attenuation function to obtain a target reference image comprises: Determining pixel coordinates of pixels to be filled based on a preset filling width and an image range of the reference image; Determining a brightness value corresponding to the pixel to be filled based on the pixel coordinates of the pixel to be filled and the brightness attenuation function; The pixels to be filled are assigned values ​​based on the brightness values ​​to obtain the target reference image.

8. An image data processing device, characterized in that: include: An image acquisition module is configured to acquire image data obtained by a camera capturing a reference image, wherein the image data includes pixel coordinates and brightness values ​​of each pixel; A function fitting module is configured to fit a brightness attenuation function from the center to the edge of the reference image based on pixel coordinates and brightness values ​​of pixels from the center to the edge of the reference image; A pixel filling module is configured to fill brightness values ​​for pixels outside the image range of the reference image based on the brightness attenuation function to obtain a target reference image; The shading compensation module is configured to determine a shading compensation coefficient of the camera lens based on the image data of the target reference image.

9. An electronic device, characterized in that: include: processor; and A memory storing computer instructions, wherein the computer instructions are used to enable a processor to execute the method according to any one of claims 1 to 7.

10. A storage medium, characterized in that: Computer instructions are stored, and the computer instructions are used to make a computer execute the method according to any one of claims 1 to 7.