Image information processing method, device and electronic equipment
By acquiring initial corrected image data and fitting functions, and updating the correction table using color gradient information, the problems of bright center and dark periphery and local color cast in digital camera imaging are solved, achieving fast and effective image correction.
Patent Information
- Application Number
- CN202210943703.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-08
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2042-08-08
AI Technical Summary
Due to the limited imaging space of digital cameras and the different light-gathering capabilities of lenses, the image is bright in the center and dark around the edges, as well as exhibits local color cast, which affects image quality.
By acquiring the initial calibration image data and the corresponding initial calibration table, the calibration values of the regions that meet the preset conditions are determined using the fitting function and color gradient information. The calibration table is then updated and the image is calibrated to eliminate color shadows.
It improves the speed and quality of eliminating color shadows in images and enhances image uniformity.
Smart Images

Figure CN115239687B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of image processing, and particularly relates to an image information processing method and device and electronic equipment. BACKGROUND
[0002] With the increasing intelligence of digital terminal devices, digital cameras have become an essential part of intelligent terminal devices. With the increasing demand of users for the portability of digital terminal devices, the size of terminal devices is becoming smaller and smaller. The imaging space of digital cameras is also limited.
[0003] In addition, there may be certain process errors in the manufacturing and assembly of camera modules, and the influence of different light collection capabilities of different positions of the lens itself, resulting in the imaging of the middle being bright and the surrounding light being dark. At the same time, the degree of refraction and reflection of the lens to different spectral light is different, resulting in the imaging of the local color shift phenomenon to form color shadows. SUMMARY
[0004] This part of the disclosure is provided to briefly introduce the concepts, which will be described in detail in the specific embodiments part. This part of the disclosure is not intended to identify key features or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.
[0005] The embodiments of the present disclosure provide an image information processing method, device and electronic equipment.
[0006] In a first aspect, the embodiments of the present disclosure provide an image information processing method, comprising: obtaining initial correction image data of a to-be-processed image and an initial correction table corresponding to the initial correction image data, the initial correction image being obtained by performing a first correction operation on to-be-processed image data of the to-be-processed image; the initial correction table is used for performing the first correction on the to-be-processed image data; determining a first correction value corresponding to a first region in the to-be-processed image that satisfies a first preset condition based on a fitting function corresponding to the initial correction table and first color gradient information of the to-be-processed image; updating the initial correction table according to the first correction value to obtain a first correction table; processing the initial correction image data based on the first correction table to obtain first correction image data, and determining first image data of the to-be-processed image.
[0007] In a second aspect, the embodiments of the present disclosure provide an image information processing apparatus, which comprises: an acquisition unit configured to acquire initial correction image data of a to-be-processed image and an initial correction table corresponding to the initial correction image data, the initial correction image being obtained by performing a first correction operation on to-be-processed image data of the to-be-processed image, and the initial correction table being configured to perform the first correction on the to-be-processed image data; a first determination unit configured to determine a first correction value corresponding to a first region in the to-be-processed image that satisfies a first preset condition based on a fitting function corresponding to the initial correction table and first color gradient information of the to-be-processed image, and update the initial correction table based on the first correction value to obtain a first correction table; and a second determination unit configured to process the initial correction image data based on the first correction table to obtain first correction image data of the to-be-processed image.
[0008] In a third aspect, the embodiments of the present disclosure provide an electronic device, which comprises: one or more processors; and a storage apparatus configured to store one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the image information processing method according to the first aspect or the second aspect.
[0009] In a fourth aspect, the embodiments of the present disclosure provide a computer readable medium, which stores a computer program, when the computer program is executed by a processor, the steps of the image information processing method according to the first aspect or the second aspect are implemented.
[0010] The image information processing method, apparatus and electronic device provided by the embodiments of the present disclosure, by acquiring initial correction image data of a to-be-processed image and an initial correction table corresponding to the initial correction image data, the initial correction image being obtained by performing a first correction operation on to-be-processed image data of the to-be-processed image, and the initial correction table being configured to perform the first correction on the to-be-processed image data, determining a first correction value corresponding to a first region in the to-be-processed image that satisfies a first preset condition based on a fitting function corresponding to the initial correction table and first color gradient information of the to-be-processed image, updating the initial correction table based on the first correction value to obtain a first correction table, and processing the initial correction image data based on the first correction table to obtain first correction image data of the to-be-processed image, the first image data of the to-be-processed image is determined, thereby realizing the rapid determination of the first correction value based on the fitting function of the initial correction table and the first color gradient information, and then the initial correction image is corrected by using the first correction value, and the first correction image is obtained, and the speed of eliminating the color shadow of the image is improved. BRIEF DESCRIPTION OF DRAWINGS
[0011] The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings. The same or similar components have the same or similar reference labels. It should be understood that the drawings are not necessarily to scale, with emphasis instead being placed upon illustrating the principles of the embodiments of the present disclosure.
[0012] Figure 1 is a flowchart of some embodiments of the image information processing method according to the present disclosure;
[0013] Figure 2 is a flowchart of some embodiments of the image information processing method according to the present disclosure;
[0014] Figure 3 shows a schematic diagram of determining the correction value of a pixel within a target sub-region according to a vertex of the target sub-region;
[0015] Figure 4A shows some principle schematic diagrams of the image information processing method provided by the present disclosure;
[0016] Figure 4B shows the step of obtaining the original correction table of ambient color temperature;
[0017] Figure 4C shows a schematic diagram of determining the correction value of a vertex of a sub-region;
[0018] Figure 5 is a structural schematic diagram of one embodiment of the image information processing device according to the present disclosure;
[0019] Figure 6 is an exemplary system architecture to which the image information processing method of one embodiment of the present disclosure can be applied;
[0020] Figure 7 is a schematic diagram of the basic structure of an electronic device provided according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0021] Embodiments of the present disclosure will be described more fully hereinafter with reference to the accompanying drawings. While several embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be construed as being limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and fully convey the scope of the present disclosure to those skilled in the art.
[0022] It should be understood that the various steps in the method embodiments of the present disclosure can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0023] The term "include" and variations thereof, as used in this document, mean "to include, without limitation." The term "based on" means "based at least in part on." The term "one embodiment" means "at least one embodiment." The term "another embodiment" means "at least one additional embodiment." The term "some embodiments" means "at least some embodiments." Related terms shall be construed accordingly.
[0024] It should be noted that the terms "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not intended to limit the order or interdependence of the functions performed by these devices, modules or units.
[0025] It should be noted that the modification of "one" or "multiple" mentioned in the present disclosure is illustrative rather than limiting, and those skilled in the art should understand that "one or more" should be understood unless otherwise explicitly indicated in the context.
[0026] The names of the messages or information exchanged between the devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of the messages or information.
[0027] Reference is made to Figure 1 , which shows a flow of one embodiment of an image information processing method according to the present disclosure. As Figure 1 shown, the image information processing method includes the following steps:
[0028] Step 101, obtaining initial correction image data of a to-be-processed image and an initial correction table corresponding to the initial correction image data, the initial correction image being obtained by performing a first correction operation on to-be-processed image data of the to-be-processed image; the initial correction table being used for first correction of the to-be-processed image data.
[0029] The first correction operation here can be a correction operation on brightness, contrast, etc. Correspondingly, the first correction can be a brightness, contrast, etc. correction on the to-be-processed image data. The initial correction table can be a table for brightness shadow, contrast, etc. correction of the to-be-processed image data.
[0030] In this embodiment, the first correction operation is taken as a brightness shadow correction operation, the first correction is taken as a brightness shadow correction, and the initial correction table is taken as an initial correction table for brightness shadow correction of the to-be-processed image data.
[0031] The to-be-processed image can be collected by an image collection device or pre-stored.
[0032] The image collected by the image collection device can be subjected to image signal processing (ISP) first, such as dark current correction, PD pixel point correction, and bad point correction, to obtain raw image data of the image to be processed.
[0033] Due to the image collection device and / or the environment during image collection, the image collected by the image collection device has shadows. The shadows may, for example, include brightness shadows and color shadows.
[0034] After obtaining the raw image data of the image to be processed, the raw image data can be subjected to brightness shadow correction first, to obtain initial correction image data.
[0035] When the raw image data is subjected to brightness shadow correction, the raw image data can be subjected to first correction using a pre-set initial correction table.
[0036] After step 101, the brightness in the image to be processed can be corrected. Therefore, the brightness in the initial correction image data described above is relatively uniform. In addition, the initial correction image data obtained after step 101 can also have color shadows.
[0037] In step 102, based on the fitting function corresponding to the initial correction table and the first color gradient information of the image to be processed, a first correction value corresponding to a first region in the image to be processed that satisfies a first preset condition is determined; and the initial correction table is updated according to the first correction value to obtain a first correction table.
[0038] The initial correction table described above may, for example, be a correction table when the raw image data is subjected to brightness correction.
[0039] When the color shadow correction is performed, the initial correction values in the initial correction table described above can be fitted to obtain a fitting function.
[0040] The fitting function described above can be a linear fitting function or a nonlinear fitting function.
[0041] Preferably, the fitting function described above can be a nonlinear fitting function.
[0042] The first color gradient information of the image to be processed is determined by a pre-set method. The first correction value corresponding to the first region in the image to be processed that satisfies the first preset condition is determined according to the first color gradient information.
[0043] That is, the first region of the image to be processed can be determined according to various methods. Then, the correction value in the initial correction table corresponding to the first region is adjusted according to the first color gradient information. The adjustment direction may, for example, be to make the value of the first preset gradient function indicated by the first color gradient information smaller.
[0044] After the correction value of the first region is corrected at least once according to the first color gradient information, the first color gradient information can meet a convergence condition, so that the first correction value of the first region is obtained. The first correction value of the first region is used to replace the initial correction value corresponding to the first region in the initial correction table, so that the first correction table is obtained.
[0045] In step 103, the initial correction image data is processed based on the first correction table to obtain first correction image data, and the first image data of the to-be-processed image is determined.
[0046] The initial correction image data is processed using the first correction table, and the first correction image data is obtained.
[0047] In some application scenarios, the first correction table can include first correction values corresponding to respective pixels. For each pixel, the first correction value of the pixel can be used to correct the pixel value of the pixel in the initial correction image. In this way, the first correction image data can be obtained.
[0048] The first image data of the to-be-processed image can be determined based on the first correction image data.
[0049] In some application scenarios, the initial correction image data can include initial image data corresponding to different color channels. The initial correction table can include initial correction tables corresponding to different color channels. For each color channel, a fitting function of the color channel can be created according to the initial correction table corresponding to the color channel. Gradient information corresponding to each color channel is then determined. The first color gradient information is determined according to the gradient information corresponding to each color channel. The parameters of the fitting function are determined according to the first color gradient information, and the reference correction value of the first region is determined using the fitting function with the adjusted parameters. The initial image data is adjusted using the reference correction value, and the first color gradient information is determined again according to the adjusted image data. The adjustment direction of the parameters is to make the gradient function value indicated by the first color gradient information smaller. Finally, the first correction value of each color channel is determined.
[0050] Each color channel initial correction image data is processed according to the first correction value of each color channel, and first correction image data corresponding to each color channel is obtained. The first correction image data of each color is integrated to obtain the first image data of the to-be-processed image.
[0051] The image information processing method provided in the embodiment comprises the following steps: obtaining initial correction image data of a to-be-processed image and an initial correction table corresponding to the initial correction image data, wherein the initial correction image is obtained by performing a first correction operation on to-be-processed image data of the to-be-processed image; the initial correction table is used to perform the first correction on the to-be-processed image data; determining a first correction value corresponding to a first region in the to-be-processed image that satisfies a first preset condition based on a fitting function corresponding to the initial correction table and first color gradient information of the to-be-processed image; updating the initial correction table according to the first correction value to obtain a first correction table; and processing the initial correction image data based on the first correction table to obtain first correction image data and determining first image data of the to-be-processed image, so that the first correction value is quickly determined according to the fitting function of the initial correction table and the first color gradient information, the initial correction image is corrected by using the first correction value, and then the first correction image is obtained. The speed of eliminating image color shadows is improved.
[0052] In some optional implementations, the step 102 comprises the following sub-steps:
[0053] In the sub-step 1021, the initial correction image is divided into a plurality of sub-regions with equal size.
[0054] The number of the sub-regions can be set according to application scenarios, which is not limited here. As an illustrative example, the plurality of sub-regions with equal size can be 15*15.
[0055] In the sub-step 1022, for each sub-region, if the sub-region satisfies the first preset condition, it is determined that the sub-region belongs to the first region.
[0056] Each sub-region can be judged to determine whether the sub-region satisfies the first preset condition. If yes, the sub-region belongs to the first region. Otherwise, it does not belong to the first region.
[0057] Specifically, the first preset condition comprises that a quotient of a pixel value of a first color and a pixel value of a second color of a pixel in the sub-region is less than a first preset threshold, or
[0058] a quotient of a pixel value of a third color and a pixel value of a fourth color of the pixel in the sub-region is less than a second preset threshold.
[0059] The quotient of the pixel value of the first color and the pixel value of the second color of the pixel in the sub-region is less than the first preset threshold. The quotient of the pixel value of the first color and the pixel value of the second pixel of each pixel in the sub-region can be calculated, and then the average of the quotient of the pixel value of the first color and the pixel value of the second pixel corresponding to each pixel is calculated. The average of the quotient of the pixel value of the first color and the pixel value of the second pixel corresponding to each pixel in the sub-region is taken as the quotient of the pixel value of the first color and the pixel value of the second color of the sub-region. Similarly, the quotient of the pixel value of the third color and the pixel value of the fourth color in a sub-region can be determined.
[0060] The first preset threshold and the second preset threshold can be set according to specific application scenarios, which are not limited here.
[0061] The first color here can be red (R), and the second color can be green (Gr). The third color can be blue (B), and the fourth color can be green (Gb). Specifically, whether the sub-region belongs to the first region can be determined by the following formula:
[0062]
[0063] Wherein Mark(l,m) represents whether the sub-region (l,m) belongs to the first region. Taking an example that the image to be processed is divided into N×N sub-regions, l and m are positive integers greater than or equal to zero and less than or equal to N-1. thd r is the first preset threshold, and thd b is the second preset threshold. The values of the first preset threshold and the second preset threshold can be set according to specific application scenarios, which are not limited here.
[0064] In some optional implementations, the step 102 includes the following sub-steps:
[0065] In the sub-step 1021, a fitting function of the initial correction table is constructed according to the color shadow distribution characteristics of the image, and an initial parameter value of the fitting function is determined.
[0066] Generally, the color shadow distribution of the image is similar to a parabola, and the color shadow of the center region of the image is small, and the color shadow gradually increases from the center to the edge.
[0067] Therefore, the fitting function adopts a parabolic function, and the fitting function is specifically shown in the following formula (1):
[0068] z(r)=ar 2 +br+c (1); wherein,
[0069] r is the normalized distance, width and height are the width and height of the image. Similarly, the upper left corner of the image is the coordinate origin, and z(x, y) represents the correction value of each coordinate position fitted by the parabolic model. Here, x is a positive integer greater than or equal to zero and less than or equal to width. y is a positive integer greater than or equal to zero and less than or equal to height.
[0070] In the fitting function of the above formula (1), a, b, and c are parameters of the fitting function.
[0071] In practice, in order to determine the initial parameter value of the parameter of the fitting function, the following steps can be performed:
[0072] First, according to the first fitting function, a first loss function is determined, the first loss function including the parameters of the fitting function.
[0073] Second, according to the partial derivative of each unknown parameter with respect to the first loss function, the initial parameter value is determined.
[0074] The first loss function constructed can be characterized by the following formula (2):
[0075]
[0076] The partial derivatives of the three unknowns in the above formula can be calculated using the least squares method and set to zero, resulting in three non-homogeneous linear equations. The three unknowns a, b, and c in the equation set are calculated to minimize the loss function. The values of a, b, and c obtained can be used as the initial parameter values of the parameters a, b, and c.
[0077] Sub-step 1022: Perform the following first correction value determination operation: using the reference correction value of the first region obtained by the fitting function, determine the first color gradient information of the first region; if the first color gradient information of the first region meets a second preset condition, the reference correction value is taken as the first correction value; otherwise, adjust the parameter value of the fitting function, and repeat the first correction value determination operation using the fitting function with the adjusted parameter value.
[0078] The above sub-step 1022 can be a loop operation. The first correction value and the parameter value of the fitting function corresponding to the first correction value are determined through multiple loop operations.
[0079] In some application scenarios, the first color gradient information of the first region includes a gradient of the first color, a gradient of the second color, a gradient of the third color, and a gradient of the fourth color; and the first color gradient information of the first region in the substep 1022 satisfies the second preset condition, including that an absolute value of a difference between the gradient of the first color and the gradient of the second color is less than a first preset gradient threshold; or an absolute value of a difference between the gradient of the third color and the gradient of the fourth color is less than a second preset gradient threshold.
[0080] The color gradient corresponding to one pixel can be determined by the following formula (3):
[0081]
[0082] For each target subregion belonging to the first region, the color gradient corresponding to each pixel in the target subregion can be calculated. The sum of the color gradients corresponding to each pixel is determined as the color gradient of the target subregion.
[0083] In practice, for each target subregion, the color gradients of different colors in the subregion can be calculated. The color gradients of different colors can include a first color (red (R)) gradient a second color (green (Gr)) gradient a third color (blue (B)) gradient and a fourth color (green (Gb)) gradient
[0084] The above second preset condition can be represented by the following formula (4):
[0085]
[0086] The first preset gradient threshold thrd_rg and the second preset gradient threshold thrd_bg can be set according to specific application scenarios, which are not limited here.
[0087] Because the colors in a real scene are rich and varied, the color gradients of the same region either change greatly or are flat regions without changes. If there are color shadows, the color shadows have small gradients and small gradient changes as the position changes.
[0088] After adjusting the parameter values of the parameters of the fitting function for multiple times, after setting the parameter values of the parameters each time, the first color gradient information of the target subregion belonging to the first region can be calculated, and whether the first color gradient information satisfies the second preset condition can be determined according to the formula (4). The parameter values of the parameters when the above formula (4) is satisfied can be used as the first parameter values of the fitting function. And the reference correction value of the target subregion belonging to the first region is used as the first correction value of the subregion.
[0089] In order to simplify the calculation and reduce the storage space, the initial correction values of the vertices of each sub-region can be stored in the initial correction table. The above-mentioned sub-step 1022 determines the first correction values of the vertices of the target sub-region belonging to the first region. For each target sub-region, the initial correction values of the target sub-region are replaced by the first correction values of the vertices of the target sub-region, to obtain the first correction table.
[0090] The first correction values of the vertices of each target sub-region can be stored in the first correction table (for the sub-regions not belonging to the first region, the correction values of the vertices can remain as the initial correction values). The first correction values corresponding to each pixel of the target sub-region can be obtained by interpolation using the first correction values of the vertices of the target sub-region.
[0091] In some optional implementations, the otherwise of the above-mentioned sub-step 1022 adjusts the initial parameters of the fitting function, so that the fitting function after the adjustment of the initial parameters repeats the first correction value determination operation, including: adjusting the parameter value of the parameter of the first fitting function corresponding to the first color, or adjusting the parameter value of the parameter of the first fitting function corresponding to the third color, so that the first color gradient information satisfies the second preset condition.
[0092] Specifically, if The parameter value of the parameter of the first fitting function corresponding to the first color can be adjusted so that
[0093] If The parameter value of the parameter of the first fitting function corresponding to the third color can be adjusted so that
[0094] In practice, the process of adjusting the parameter value of the parameter of the first fitting function can include multiple loops. The parameter value of the parameter can be adjusted according to a preset step size. The purpose of quickly determining the first parameter value can be achieved by controlling the step size.
[0095] Please refer to Figure 4A After obtaining the correction image of the to-be-processed image, the correction image can be segmented to obtain N×N sub-regions of equal size. Here, N can be 15. If the correction image is an initial correction image, it is determined whether each sub-region belongs to the first region. Thus, the position of the first region is determined. For the first region, the gradient sums of each color (the first color, i.e., red (R); the second color, i.e., green (Gr); the third color, i.e., blue (B); and the fourth color, i.e., green (Gb)) are calculated. The first color gradient information is determined by the gradient sums of each color. Whether the first color gradient information satisfies the convergence condition (such as the convergence condition corresponding to formula (4)). If The parameter value of the parameter of the first fitting function corresponding to the first color can be adjusted. That is, the correction value corresponding to the first color is adjusted so that If The parameter value of the parameter of the first fitting function corresponding to the third color can be adjusted. That is, the correction value corresponding to the third color is adjusted so that
[0096] In some optional implementations, the initial correction table includes a first color initial correction table corresponding to the first color, a second color initial correction table corresponding to the second color, a third color initial correction table corresponding to the third color, and a fourth color initial correction table corresponding to the fourth color; and the above sub-step 1021 includes: constructing the first fitting function of the first color according to the color shadow distribution characteristics of the first color; constructing the first fitting function of the second color according to the color shadow distribution characteristics of the second color; constructing the first fitting function of the third color according to the color shadow distribution characteristics of the third color; and constructing the first fitting function of the fourth color according to the color shadow distribution characteristics of the fourth color.
[0097] The initial parameter values of the parameters of the first fitting function of the first color, the first fitting function of the second color, the first fitting function of the third color, and the first fitting function of the fourth color are respectively determined.
[0098] The first fitting function of each color can be a function of the same type as the above-mentioned fitting function. The initial parameter values of the parameters of the first fitting functions are respectively determined according to the above-mentioned determination method. The initial parameter values of the above-mentioned first fitting functions can be different.
[0099] In some optional implementations, the initial correction table includes initial correction tables corresponding to the first color, the second color, the third color, and the fourth color, and the initial correction image includes a plurality of target sub-regions belonging to the first region; the fitting function includes first fitting functions corresponding to different colors; and
[0100] The above step 102 includes the following sub-steps:
[0101] In sub-step 1023, for each color, the reference correction value of the vertex of the target sub-region is determined based on the first fitting function of the color.
[0102] The initial parameter value of the parameter of the first fitting function of the color can be determined by various methods. The reference correction value of the vertex of the target sub-region is determined by using the first fitting function.
[0103] In sub-step 1024, the reference correction value of the color of a plurality of pixels in the target sub-region is determined by interpolation according to the reference correction value of the vertex of the target sub-region.
[0104] Please refer toFigure 3 Figure 4 shows a diagram illustrating interpolation of correction values according to correction values of target sub-region vertices to obtain correction values of pixels within the target sub-region.
[0105]
[0106] (x1,y1), (x2,y1), (x1,y2) and (x2,y2) can be coordinates of vertices of a sub-region. (x,y) can be coordinates of any pixel within the sub-region. g(x1,y1), g(x2,y1), g(x1,y2) and g(x2,y2) can be correction values corresponding to the vertices respectively. The correction value g(x,y) of the pixel (x,y) within the sub-region can be determined according to the above formula (5).
[0107] Sub-step 1025, adjusting pixel values of pixels in the initial correction image data according to the reference correction table including reference correction values of pixels of the plurality of target sub-regions to obtain a reference first correction image corresponding to the color.
[0108] Sub-step 1026, determining a gradient of the color according to pixel information of the plurality of target sub-regions in the reference first correction image.
[0109] For each target sub-region, the gradient of each pixel corresponding to the color in the target sub-region can be determined using the above formula (3).
[0110] Then the sum of the gradients of the pixels is taken as the gradient of the color of the target sub-region.
[0111] Sub-step 1027, determining first color gradient information of the first region according to information of the first color gradient, the second color gradient, the third color gradient and the fourth color gradient of the plurality of target sub-regions.
[0112] For each color, the gradients of the target regions are accumulated to obtain the gradient of the color of the first region.
[0113] In some optional implementations, the initial correction table includes a first color initial correction table corresponding to the first color, a second color initial correction table corresponding to the second color, a third color initial correction table corresponding to the third color and a fourth color initial correction table corresponding to the fourth color.
[0114] The initial correction image data is obtained based on the following steps:
[0115] The image data to be processed is split into first color image data to be processed, second color image data to be processed, third color image data to be processed and fourth color image data to be processed according to colors.
[0116] The first color initial correction table is used to correct the first color to-be-processed image data to obtain first color initial correction image data; the second color initial correction table is used to correct the second color to-be-processed image data to obtain second color initial correction image data; the third color initial correction table is used to correct the third color to-be-processed image data to obtain third color initial correction image data; and the fourth color initial correction table is used to correct the fourth color to-be-processed image data to obtain fourth color initial correction image data.
[0117] In these optional implementations, the to-be-processed image is split into different color channels respectively corresponding to to-be-processed image data according to color, and initial correction image data is determined for the to-be-processed image data of each color by using an initial correction table of the color. Each sub-region belonging to the first region is determined according to the initial correction image data. Then, a first fitting function of the initial correction table of the color is determined. The gradient of each color is determined by using the first fitting function and the initial correction image, and then it is determined whether the first color gradient information meets a second preset condition. If the second preset condition is met, the first parameter value of the first fitting function is determined. Then, the first correction value of the vertex of each target sub-region of the color can be determined.
[0118] Since the to-be-processed image data is split into different color channels respectively corresponding to to-be-processed image data according to color, and the first correction value of the target sub-region of each color is determined according to the above method, the complexity of calculating the first correction value can be reduced, and the speed of obtaining the first image data can be improved.
[0119] In some optional implementations, the initial correction table here can be determined by two original correction tables. Each original correction table can correspond to a color temperature.
[0120] The plurality of original correction tables here can be generated from images obtained by illuminating a closed environment under standard light sources of different color temperatures.
[0121] Please refer to Figure 4B The original correction table corresponding to the environment color temperature can be obtained by the following steps:
[0122] First, in a closed environment, a standard light source corresponding to the environment color temperature is used to illuminate the closed environment. The standard light source can be a first light source, and the corresponding color temperature can be a first color temperature (the first color temperature can be a low color temperature). The standard light source can be a second light source, and the color temperature corresponding to the second light source can be a second color temperature (the second color temperature can be a medium color temperature). The standard light source can be a third light source, and the color temperature corresponding to the third light source can be a third color temperature (the third color temperature can be a high color temperature).
[0123] Secondly, a first reference image is obtained by using the preset image acquisition device to capture a flat surface of a standard object arranged in the closed environment. The flat surface can fill the camera field of view of the image acquisition device. The standard object can be a gray card.
[0124] Thirdly, different first reference images corresponding to different standard light sources can be obtained by using different standard light sources. The first reference images can be preprocessed to obtain second reference image data (raw image) corresponding to different color temperatures of the standard light sources. The image data format of the second reference image can be bayer format.
[0125] For example, the raw image under the first light source environment, the raw image under the second light source environment, and the raw image under the third light source environment.
[0126] Subsequently, for each second reference image data, the image data of the second reference image is divided into four channels of image data according to R, Gr, B, and Gb. After obtaining the four channels of image data of the second reference image, each channel can be processed separately.
[0127] For each channel, the image data of the channel can be divided into N×N sub-regions of the same size. The average value of the pixels in each sub-region is calculated to obtain a first correction value of each sub-region. Here, N can be a positive integer greater than 1. As an exemplary illustration, N can be 15. The coordinates of each sub-region can be determined with the top-left corner of the image as the origin. The formula (1) for calculating the correction value of each sub-region is as follows:
[0128] gain(l,m)=mean(center_l,center_m) / mean(l,m) (6); wherein gain(l,m) is the correction value corresponding to the sub-region with coordinates (l,m), mean(l,m) represents the average value of the pixels in the region (l,m), and mean(center_l,center_m) represents the average value of the pixels in the sub-region where the center of the image is located. The values of l and m are positive integers greater than or equal to 1 and less than or equal to 15. The correction value obtained from formula (6) can be regarded as the first original correction value.
[0129] A coordinate system can be established with the pixel at the top-left corner of the image as the coordinate origin, the horizontal direction of the image as the x-axis, and the vertical direction of the image as the y-axis. The coordinates of each sub-region can be determined. The coordinates of the first sub-region are (0, 0); the coordinates of the sub-region adjacent to the first sub-region in the x-axis are (1, 0); the coordinates of the sub-region adjacent to the first sub-region in the y-axis are (0, 1); and so on, the coordinates of each sub-region can be determined
[0130] Then, after obtaining the first original correction values of the 15x15 sub-regions, it is determined whether to use a bilinear interpolation algorithm or a linear interpolation algorithm to calculate the correction values at the four corners of each rectangular sub-region according to the pixel position to be interpolated. The correction value of each sub-region determined by formula (6) can be regarded as the first original correction value of the center point of the sub-region.
[0131] Reference is made to Figure 4C When the interpolation position is located in the middle of the four first original correction values, the second original correction value of the interpolation position can be calculated using the following bilinear interpolation formula:
[0132]
[0133]
[0134] When the interpolation position is located at the edge, the second initial correction value of the edge position can be calculated using the following bilinear interpolation formula:
[0135] f1(l,m)=2×f2(l,m)-f3(l,m) (9);
[0136] Through the above interpolation, 16x16 correction values can be obtained, which form the original correction table under the standard light source of the color temperature.
[0137] Each of the 16x16 arrays corresponds to four channels under each standard light source, so a total of 12 original correction tables need to be stored.
[0138] In summary, the original correction table of the first color temperature, the original correction table of the second color temperature, and the original correction table of the third color temperature can be obtained.
[0139] Finally, the environment color temperature of the image to be corrected is obtained, the original correction tables corresponding to the standard light sources of two color temperatures are determined according to the environment color temperature, and the initial correction table of the image to be corrected is determined according to the original correction tables corresponding to the standard light sources of the two color temperatures.
[0140] After obtaining the target image to be corrected, the corresponding environment color temperature of the target image when being photographed can be obtained. According to the above environment color temperature, the original correction tables corresponding to the standard light sources of two color temperatures can be determined from a plurality of original correction tables corresponding to standard light sources. For example, the original correction tables corresponding to the standard light sources of two color temperatures close to the environment color temperature are used as the original correction tables to be used.
[0141] The initial correction table under the environment color temperature is generated using the above two original correction tables to be used.
[0142] For example, the standard light sources include high color temperature 7000K, medium color temperature 4000K, and low color temperature 2000K. The original correction table can include four channels of original correction tables corresponding to the three color temperatures. If the environment color temperature corresponding to the current image to be processed is 5000K, the original correction tables corresponding to 7000K and 4000K can be selected to determine the target initial correction table. Specifically, for any one channel, the correction value d ij for any position (i, j) in the channel can be determined by the following formula: ij
[0143] (d ij -d 1ij ) / (d 2ij -d 1ij )=(5000-4000) / (7000-4000) (10);
[0144] where i is a positive integer greater than or equal to 1 and less than or equal to 16, and j is a positive integer greater than or equal to 1 and less than or equal to 16. d 1ij is the first original correction value at the position (i, j) in the original correction table corresponding to the standard light source with a color temperature of 4000K. d 2ij is the first original correction value at the position (i, j) in the original correction table corresponding to the standard light source with a color temperature of 7000K.
[0145] The initial correction table corresponding to the current image can be obtained according to formula (10) and the original correction table.
[0146] Please continue to refer to Figure 2 , Figure 2 A flowchart of another embodiment of the image information processing method provided by the present application is shown. As shown in Figure 2 , the image information processing method includes the following steps:
[0147] Step 201, obtaining initial correction image data of an image to be processed and an initial correction table corresponding to the initial correction image data, the initial correction image being obtained by performing a first correction operation on image data of the image to be processed; the initial correction table being used for performing a first correction on the image data of the image to be processed;
[0148] Step 202, determining a first correction value corresponding to a first region in the image to be processed that satisfies a first preset condition based on a fitting function corresponding to the initial correction table and first color gradient information of the image to be processed; and updating the initial correction table according to the first correction value to obtain a first correction table;
[0149] In step 203, the initial correction image data is processed based on the first correction table to obtain first correction image data, and the first image data of the to-be-processed image is determined.
[0150] The implementation of steps 201-203 can be the same as or similar to the implementation of steps 101-103 of the embodiment shown in FIG. 1, and thus will not be described here. Figure 1 The implementation of steps 101-103 of the embodiment shown in FIG. 1 can be the same as or similar to the implementation of steps 101-103 of the embodiment shown in FIG. 1, and thus will not be described here.
[0151] In step 204, the second correction value corresponding to the first region is determined based on the second color gradient information of the first region of the first image data, and the first correction table is updated using the second correction value to obtain a second correction table.
[0152] After the first image data is obtained in step 203, color shadows still exist in the image corresponding to the first image data. The first image data can be further adjusted to obtain image data after the shadows are eliminated.
[0153] Specifically, the second color gradient information can be calculated according to various preset methods. Then, the parameters of the fitting function are adjusted according to the second color gradient information. After the parameters of the final fitting function are determined, the second correction value of the first region can be determined using the fitting function. Further, the first correction table is updated using the second correction value.
[0154] The second color gradient information here can be determined by a preset second color gradient function. Specifically, the intermediate second color gradient information can be calculated from the first correction image data, and the parameters of the fitting function are adjusted. After the parameters of the fitting function are adjusted, the intermediate second correction value of the first region is calculated using the fitting function, and the intermediate second correction table is generated according to the intermediate second correction value. The first correction image is adjusted using the second correction table to obtain intermediate second correction image data. The second color gradient information of the first region corresponding to the intermediate second correction image data is calculated. The direction of the above-mentioned parameter adjustment is that the value indicated by the second color gradient information is reduced. The above-mentioned process is repeated until the second color gradient information is relatively stable, and the parameters of the fitting function are no longer adjusted. The final second correction value of the first region is determined using the fitting function whose parameters are no longer adjusted.
[0155] In some optional implementations, the first region includes a plurality of target sub-regions of equal size. The step 204 includes the following sub-steps:
[0156] In sub-step 2041, the color gradient of each pixel in the target sub-region is determined.
[0157] In sub-step 2042, the color gradient mean of the plurality of target sub-regions is determined according to the gradients of the pixels in the plurality of target sub-regions.
[0158] In sub-step 2043, the second color gradient information is determined by using the color gradient of each pixel in the target sub-region, the average of the color gradients, and a preset second gradient function.
[0159] In sub-step 2044, the parameters of the fitting function are adjusted according to the second color gradient information.
[0160] In sub-step 2045, the second correction value of the vertex of the target sub-region is determined according to the fitting function with the adjusted parameters.
[0161] The second gradient function can be represented by the following formula (11):
[0162]
[0163] where N is the total number of pixels in the current sub-region, is the average of the gradients of the N sub-regions, is the gradient at position (x, y).
[0164] The fitting function corresponding to the first correction value of the first correction table can be represented by formula (1). The parameters a, b, and c in formula (1) can have first parameter values according to steps 201-203.
[0165] The parameter values of the parameters a, b, and c of formula (1) can be continuously adjusted according to formula (11) so that the value of formula (11) decreases until the value of formula (11) stabilizes.
[0166] In the process of adjusting the parameter values of the above parameters, the Levenberg-Marquardt (LM) algorithm can be used to calculate the change direction of the independent variables a, b, and c. The change amount solved is in the direction of descending gradient of formula (11), so that the minimum value of formula (11) is found by iteration. In the above process, the step length of parameter value change can be controlled to prevent local optimal solution from being calculated.
[0167] When formula (11) reaches the minimum value, the values of the parameters a, b, and c of the fitting function are determined as the final parameter values of the fitting function. The second correction values of each sub-region are calculated using the final parameter values of the parameters a, b, and c, and the second correction table is obtained.
[0168] In step 205, the first corrected image data is processed based on the second correction table to obtain second corrected image data.
[0169] The first corrected image data is adjusted by using the second correction table. For example, the second correction value of each pixel is determined according to the second correction value of each sub-region. For each pixel, the pixel value of the pixel in the first corrected image is adjusted by using the second correction value of the pixel, to obtain the second corrected image data of the pixel. Further, the second corrected image data of the to-be-processed image is obtained.
[0170] Optionally, the step 205 comprises: for a target sub-region, determining the second correction value corresponding to each pixel of the target sub-region by using the second correction value of each vertex of the target sub-region; and processing each pixel of the first corrected image by using the second correction value corresponding to the pixel, to obtain the second corrected image data.
[0171] In some optional implementations, the step 203 obtains the first correction table and the first corrected image data corresponding to the first color, the second color, the third color and the fourth color respectively. The second correction value of the vertex of the target sub-region corresponding to each color can be calculated by the step 204, to obtain the second correction table corresponding to each color. In the step 205, for each color, the first corrected image data of the color is adjusted by using the second correction table of the color, to obtain the second corrected image data corresponding to the color.
[0172] Compared with the embodiment shown in Figure 1 , the embodiment provided by the present disclosure further comprises the steps of: determining the second correction value of the first region by using the second color gradient information of the first image data, obtaining the second correction table, and processing the first corrected image by using the second correction table to obtain the second corrected image data, so that the first corrected image is further eliminated from color shading by using the second color gradient information. The color shading of the to-be-processed image is further improved.
[0173] Further referring to Figure 5 , as an implementation of the method shown in the above figures, the present disclosure provides an embodiment of an image information processing device, which corresponds to the method embodiment shown in Figure 1 . The device can be applied in various electronic devices.
[0174] As shown in Figure 5As shown, the image information processing apparatus in this embodiment includes an acquisition unit 501, a first determination unit 502, and a second determination unit 503. The acquisition unit 501 is configured to acquire initial correction image data of a to-be-processed image and an initial correction table corresponding to the initial correction image data, the initial correction image being obtained by performing a first correction operation on to-be-processed image data of the to-be-processed image, and the initial correction table being configured to perform the first correction on the to-be-processed image data. The first determination unit 502 is configured to determine a first correction value corresponding to a first region in the to-be-processed image that satisfies a first preset condition based on a fitting function corresponding to the initial correction table and first color gradient information of the to-be-processed image, and update the initial correction table based on the first correction value to obtain a first correction table. The second determination unit 503 is configured to process the initial correction image data based on the first correction table to obtain first correction image data, and determine first image data of the to-be-processed image.
[0175] In this embodiment, the specific processing of the acquisition unit 501, the first determination unit 502, and the second determination unit 503 of the image information processing apparatus and the technical effects brought by the specific processing can be respectively referred to the specific processing of the acquisition unit 501, the first determination unit 502, and the second determination unit 503 of the image information processing apparatus and the technical effects brought by the specific processing. Figure 1 The related description of steps 101-103 in the corresponding embodiment will not be repeated here.
[0176] In some optional implementations, the image information processing apparatus further includes a third determination unit and a fourth determination unit (not shown in the figure). The third determination unit is configured to determine a second correction value corresponding to the first region based on second color gradient information of the first region of the first image data, update the first correction table based on the second correction value to obtain a second correction table, and the fourth determination unit is configured to process the first correction image data based on the second correction table to obtain second correction image data.
[0177] In some optional implementations, the first determination unit 502 is further configured to construct a first fitting function of the initial correction table according to image color shadow distribution characteristics, determine an initial parameter value of the fitting function, and perform the following first correction value determination operation: determine the first color gradient information of the first region by using a reference correction value of the first region obtained by the fitting function, if the first color gradient information of the first region satisfies a second preset condition, take the reference correction value as the first correction value, and otherwise adjust the parameter value of the fitting function, and repeat the first correction value determination operation by using the fitting function with the adjusted parameter value.
[0178] In some optional implementation, the first color gradient information of the first region includes a gradient of the first color, a gradient of the second color, a gradient of the third color, and a gradient of the fourth color; and the first color gradient information of the first region satisfies a second preset condition, including that an absolute value of a difference between the gradient of the first color and the gradient of the second color is less than a first preset gradient threshold, or an absolute value of a difference between the gradient of the third color and the gradient of the fourth color is less than a second preset gradient threshold.
[0179] In some optional implementation, the initial correction table includes a first color initial correction table corresponding to the first color, a second color initial correction table corresponding to the second color, a third color initial correction table corresponding to the third color, and a fourth color initial correction table corresponding to the fourth color.
[0180] The obtaining unit 501 further obtains the initial correction image data based on the following steps: splitting the to-be-processed image data into first color to-be-processed image data, second color to-be-processed image data, third color to-be-processed image data, and fourth color to-be-processed image data according to colors; correcting the first color to-be-processed image data using the first color initial correction table to obtain first color initial correction image data; correcting the second color to-be-processed image data using the second color initial correction table to obtain second color initial correction image data; correcting the third color to-be-processed image data using the third color initial correction table to obtain third color initial correction image data; correcting the fourth color to-be-processed image data using the fourth color initial correction table to obtain fourth color initial correction image data; and combining the first color initial correction image data, the second color initial correction image data, the third color initial correction image data, and the fourth color initial correction image data into the initial correction image data.
[0181] In some optional implementation, the first determining unit 502 is further configured to: construct a first fitting function of the first color according to the color shadow distribution feature of the first color; construct a first fitting function of the second color according to the color shadow distribution feature of the second color; construct a first fitting function of the third color according to the color shadow distribution feature of the third color; construct a first fitting function of the fourth color according to the color shadow distribution feature of the fourth color; and determine initial parameter values of the first fitting function of the first color, the first fitting function of the second color, the first fitting function of the third color, and the first fitting function of the fourth color, respectively.
[0182] In some optional implementation, the first determining unit 502 is further configured to: determine a first loss function according to the first fitting function, the first loss function including unknown parameters; and determine the initial parameter values according to partial derivatives of the first loss function with respect to each unknown parameter.
[0183] In some optional implementation, the first determining unit 502 is further configured to: divide the initial correction image into a plurality of sub-regions of equal size; and for each sub-region, if the sub-region satisfies a first preset condition, determine that the sub-region belongs to the first region.
[0184] In some optional implementation, the first preset condition comprises: a quotient of a pixel value of a first color and a pixel value of a second color of a pixel in the sub-region is less than a first preset threshold, or a quotient of a pixel value of a third color and a pixel value of a fourth color of the pixel in the sub-region is less than a second preset threshold.
[0185] In some optional implementation, the initial correction table comprises an initial correction table corresponding to each of the first color, the second color, the third color and the fourth color; the initial correction image comprises a plurality of target sub-regions belonging to the first region; the fitting function comprises a first fitting function corresponding to each color; and the first determining unit 502 is further configured to: for each color, determine a reference correction value of a vertex of a target sub-region based on the first fitting function of the color; determine a reference correction value of the color of a plurality of pixels in the target sub-region by interpolation according to the reference correction value of the vertex of the target sub-region; adjust a pixel value of each pixel in the initial correction image data according to a reference correction table comprising reference correction values of pixels of the plurality of target sub-regions, to obtain a reference and first correction image corresponding to the color; determine a gradient of the color according to pixel information of the plurality of target sub-regions in the reference first correction image; and determine first color gradient information of the first region according to the first color gradient, the second color gradient, the third color gradient and the fourth color gradient information of the plurality of target sub-regions respectively.
[0186] In some optional implementation, the first color gradient information of the first region comprises a gradient of the first color, a gradient of the second color, a gradient of the third color and a gradient of the fourth color, the fitting function comprises a first fitting function corresponding to each of the first color, the second color, the third color and the fourth color, and the first determining unit 502 is further configured to: adjust a parameter value of the first fitting function corresponding to the first color, or adjust a parameter value of the first fitting function corresponding to the third color, so that the first color gradient information satisfies a second preset condition.
[0187] In some optional implementation, the first region includes a plurality of target sub-regions with equal size; and the third determining unit is further configured to: determine the color gradient of each pixel in a target sub-region; determine the average color gradient of the plurality of target sub-regions according to the gradient of each pixel in the plurality of target sub-regions; determine the second color gradient information by using the color gradient of each pixel in the target sub-region, the average color gradient, and a preset second gradient function; adjust the parameters of the fitting function according to the second color gradient information; and determine the second correction value of the vertex of the target sub-region according to the fitting function with adjusted parameters.
[0188] In some optional implementation, the fourth determining unit is further configured to: for a target sub-region, determine the second correction value corresponding to each pixel in the target sub-region by using the second correction value of each vertex of the target sub-region for interpolation; and process each pixel of the first correction image by using the second correction value corresponding to each pixel respectively, to obtain the second correction image data.
[0189] Please refer to Figure 6 , Figure 6 An exemplary system architecture in which the information processing method of one embodiment of the present disclosure can be applied is shown.
[0190] As shown in Figure 6 , the system architecture can include terminals 601, 602, 603, a network 604, and a server 605. The network 604 is a medium for providing communication links between the terminals 601, 602, 603 and the server 605. The network 604 can include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0191] The terminals 601, 602, 603 can interact with the server 605 through the network 604 to receive or send messages, etc. Various client applications can be installed on the terminals 601, 602, 603, such as web browser applications, search applications, image processing applications, etc. The client applications in the terminals 601, 602, 603 can receive instructions from the user and complete corresponding functions according to the instructions of the user, such as processing image information according to the instructions of the user.
[0192] Terminals 601, 602, and 603 can be either hardware or software. When terminals 601, 602, and 603 are hardware, they can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), laptops, and desktop computers, etc. When terminals 601, 602, and 603 are software, they can be installed in the aforementioned electronic devices. They can be implemented as multiple software programs or software modules (e.g., software programs or software modules used to provide distributed services) or as a single software program or software module. No specific limitations are imposed here.
[0193] Server 605 can provide various services, such as receiving image processing requests sent by terminals 601, 602, and 603, analyzing and processing the image processing requests, and sending the analysis and processing results (such as image processing results) to terminals 601, 602, and 603.
[0194] It should be noted that the image information processing method provided in this embodiment can be executed by a terminal, and correspondingly, the image information processing device can be installed in terminals 601, 602, and 603. The image information processing method can also be executed by a server, and correspondingly, the image information processing device can be installed in server 605.
[0195] It should be understood that Figure 6 The number of terminals, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminals, networks, and servers can be included.
[0196] The following is for reference. Figure 7 This illustrates a schematic diagram of an electronic device suitable for implementing embodiments of the present disclosure. Here, "electronic device" generally refers to a hardware terminal or server (e.g., ...). Figure 6 The terminal device in this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (e.g., vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0197] like Figure 7 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the electronic device 700. The processing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0198] Typically, the following devices can be connected to I / O interface 705: input devices 706 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 707 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 708 including, for example, magnetic tapes, hard disks, etc.; and communication devices 709. Communication device 709 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 7 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0199] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 709, or installed from storage device 708, or installed from ROM 702. When the computer program is executed by processing device 701, it performs the functions defined in the methods of embodiments of this disclosure.
[0200] It should be noted that the computer-readable medium described above can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any suitable combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program used by or in connection with an instruction execution system, apparatus or device. In the present disclosure, the computer-readable signal medium can include a data signal propagated in baseband or propagated as a carrier wave in a propagated data signal, in which the computer-readable program code is contained. Such a propagated data signal can take many forms, including but not limited to, an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium that can send, propagate or transfer the program for use by or in connection with the instruction execution system, apparatus or device. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to, wire, cable, RF (radio frequency), etc., or any suitable combination of the above.
[0201] In some embodiments, the client, server, or both can communicate using any current known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet, and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any current known or future developed networks.
[0202] The computer-readable medium described above can be included in the electronic device described above; or can exist separately from the electronic device, and is not assembled into the electronic device.
[0203] The computer readable medium described above carries one or more programs, when the one or more programs are executed by the electronic device, cause the electronic device to: acquire initial correction image data of a to-be-processed image and an initial correction table corresponding to the initial correction image data, the initial correction image being obtained by performing a first correction operation on to-be-processed image data of the to-be-processed image; the initial correction table being used for performing the first correction on the to-be-processed image data; determine a first correction value corresponding to a first region in the to-be-processed image that satisfies a first preset condition based on a fitting function corresponding to the initial correction table and first color gradient information of the to-be-processed image; update the initial correction table according to the first correction value to obtain a first correction table; and perform processing on the initial correction image data based on the first correction table to obtain first image data of the to-be-processed image.
[0204] Computer program code for carrying out operations of the present disclosure can be written in any of one or more programming languages or combinations of languages including object or visual programming languages such as Java, Smalltalk, C++ or conventional procedural programming languages such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0205] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of systems, methods, and computer program products according to various embodiments of present disclosure. In this regard, each block in the flow diagrams and the block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may
[0206] The units described in the embodiments of the present disclosure can be implemented by means of software, or by hardware. In some cases, the name of the unit does not constitute a limitation on the unit itself.
[0207] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, non-limiting examples of exemplary types of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system on a chip (SOCs), complex programmable logic devices (CPLDs), etc.
[0208] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium will include one or more lines of a program of a processor, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0209] The above description is merely exemplary of the application of the present disclosure and the principles thereof. It is understood that modifications will be obvious to those skilled in the art, and the scope of the present disclosure is not limited to the specific implementations described herein. In particular, it is understood that the scope of the present disclosure encompasses all alternatives resulting from the combination of the features described above, or from the combination of these features with other features not explicitly described herein. For example, the features described above can be interchanged or combined in any way, with other features disclosed herein (but not limited to) that serve the same, equivalent or similar purpose.
[0210] Furthermore, while operations are depicted in a particular, sequential order, this should not be understood as requiring or implying that the operations are performed in the order depicted or in sequential order, and that other operations were not intervening, including partially or fully in parallel with other operations. In certain circumstances, multitasking and parallel processing can be advantageous. Likewise, the specific sequential order described above should not be understood as a requirement or implication, that operations be performed in that order, nor that other operations were not intervening, including partially or fully in parallel with other operations. The descriptions above should not be interpreted in the aspects of a requirement that the various features described above are composed in the single embodiment. Conversely, various features described in the context of a single embodiment can also be implemented individually or in any suitable sub-combination.
[0211] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
Claims
1. An image information processing method, comprising: obtaining initial correction image data of a to-be-processed image and an initial correction table corresponding to the initial correction image data, the initial correction image data being obtained by performing a first correction operation on to-be-processed image data of the to-be-processed image, and the initial correction table being used to perform the first correction on the to-be-processed image data; determining a first correction value corresponding to a first region in the to-be-processed image that meets a first preset condition based on a fitting function corresponding to the initial correction table and first color gradient information of the to-be-processed image, and updating the initial correction table based on the first correction value to obtain a first correction table; processing the initial correction image data based on the first correction table to obtain first correction image data, and determining first image data of the to-be-processed image.
2. The method of claim 1, wherein, The method further comprises: determining a second correction value corresponding to the first region based on second color gradient information of the first region of the first image data, and updating the first correction table based on the second correction value to obtain a second correction table; processing the first correction image data based on the second correction table to obtain second correction image data.
3. The method of claim 1, wherein, The determination of the first correction value corresponding to the first region in the initial correction image that meets the first preset condition based on the fitting function corresponding to the initial correction table and the first color gradient information comprises: constructing a first fitting function of the initial correction table according to image color shadow distribution characteristics, and determining an initial parameter value of a parameter of the fitting function; performing the following first correction value determination operation: determining the first color gradient information of the first region by using a reference correction value of the first region obtained by the fitting function; if the first color gradient information of the first region meets a second preset condition, taking the reference correction value as the first correction value; otherwise adjusting the parameter value of the fitting function, and repeatedly performing the first correction value determination operation by using the fitting function with the adjusted parameter value.
4. The method of claim 3, wherein, The first color gradient information of the first region comprises a gradient of a first color, a gradient of a second color, a gradient of a third color, and a gradient of a fourth color; and the first color gradient information of the first region meets the second preset condition, comprising: an absolute value of a difference between the gradient of the first color and the gradient of the second color is less than a first preset gradient threshold; or an absolute value of a difference between the gradient of the third color and the gradient of the fourth color is less than a second preset gradient threshold.
5. The method of claim 3, wherein, The initial correction table comprises a first color initial correction table corresponding to a first color, a second color initial correction table corresponding to a second color, a third color initial correction table corresponding to a third color, and a fourth color initial correction table corresponding to a fourth color; The initial correction image data is obtained based on the following steps: splitting the to-be-processed image data into first color to-be-processed image data, second color to-be-processed image data, third color to-be-processed image data, and fourth color to-be-processed image data according to colors; correcting the first color to-be-processed image data using the first color initial correction table to obtain first color initial correction image data; correcting the second color to-be-processed image data using the second color initial correction table to obtain second color initial correction image data; correcting the third color to-be-processed image data using the third color initial correction table to obtain third color initial correction image data; and correcting the fourth color to-be-processed image data using the fourth color initial correction table to obtain fourth color initial correction image data. combining the first color initial correction image data, the second color initial correction image data, the third color initial correction image data and the fourth color initial correction image data into the initial correction image data.
6. The method of claim 3, wherein, The initial correction table includes a first color initial correction table corresponding to the first color, a second color initial correction table corresponding to the second color, a third color initial correction table corresponding to the third color, and a fourth color initial correction table corresponding to the fourth color. The method further includes: constructing a first fitting function according to a color shadow distribution characteristic of the image, and determining an initial parameter value of the fitting function, including: constructing a first fitting function of the first color according to a color shadow distribution characteristic of the first color, constructing a first fitting function of the second color according to a color shadow distribution characteristic of the second color, constructing a first fitting function of the third color according to a color shadow distribution characteristic of the third color, and constructing a first fitting function of the fourth color according to a color shadow distribution characteristic of the fourth color; determining an initial parameter value of the first fitting function of the first color, the first fitting function of the second color, the first fitting function of the third color and the first fitting function of the fourth color, respectively.
7. The method of claim 3 or 6, wherein, The method further includes: determining a first loss function according to the first fitting function, the first loss function including unknown parameters; determining the initial parameter value according to a partial derivative function of each unknown parameter of the first loss function.
8. The method of claim 1, wherein, The method further includes: segmenting the initial correction image into a plurality of sub-regions of equal size; for each sub-region, if the sub-region satisfies a first preset condition, determining that the sub-region belongs to the first region.
9. The method of claim 8, wherein, The first preset condition includes: a quotient of a pixel value of the first color and a pixel value of the second color of a pixel in the sub-region is less than a first preset threshold, or a quotient of a pixel value of the third color and a pixel value of the fourth color of a pixel in the sub-region is less than a second preset threshold.
10. The method of claim 3, wherein, The initial correction table includes initial correction tables corresponding to the first color, the second color, the third color and the fourth color; the initial correction image includes a plurality of target sub-regions belonging to the first region; the fitting function includes first fitting functions corresponding to different colors; and The first correction value corresponding to the first region in the initial correction image is determined based on the fitting function corresponding to the initial correction table and the first color gradient information, and the first correction value determination operation includes: For each color, a reference correction value of a target sub-region vertex is determined based on the first fitting function of the color; An interpolation is performed according to the reference correction value of the target sub-region vertex to determine a reference correction value of the color of each pixel in the target sub-region; A reference correction table including the reference correction values of the pixels of the target sub-regions is used to adjust the pixel values of the pixels in the initial correction image data to obtain a reference and first correction image corresponding to the color; A gradient of the color is determined according to the pixel information of the target sub-regions in the reference first correction image; The first color gradient information of the first region is determined according to the first color gradient, the second color gradient, the third color gradient and the fourth color gradient information of the target sub-regions.
11. The method of claim 3, wherein the first color gradient information of the first region includes a gradient of a first color, a gradient of a second color, a gradient of a third color and a gradient of a fourth color, the fitting function includes a first fitting function corresponding to the first color, the second color, the third color and the fourth color respectively, and The initial parameters of the fitting function are adjusted to repeat the first correction value determination operation with the fitting function after the initial parameters are adjusted, and the operation includes: The parameter value of the first fitting function corresponding to the first color is adjusted, or the parameter value of the first fitting function corresponding to the third color is adjusted, so that the first color gradient information meets a second preset condition.
12. The method of claim 2, wherein, The first region includes a plurality of target sub-regions with equal sizes, and the second correction value corresponding to the first region is determined based on the second color gradient information of the first region in the first correction image data, and the operation includes: A color gradient of each pixel in a target sub-region is determined; A mean value of the color gradients of the target sub-regions is determined according to the gradients of the pixels of the target sub-regions; The second color gradient information is determined using the color gradients of the pixels in the target sub-region and the mean value of the color gradients and a preset second gradient function; The parameters of the fitting function are adjusted according to the second color gradient information; The second correction value of the vertex of the target sub-region is determined according to the fitting function after the parameters are adjusted.
13. The method of claim 12, wherein, The first correction image data is processed based on the second correction table to obtain second correction image data, and the operation includes: For a target sub-region, an interpolation is performed using the second correction values of the vertices of the target sub-region to determine the second correction values corresponding to the pixels of the target sub-region respectively; Each pixel of the first correction image is processed respectively using the second correction values corresponding to the pixels respectively to obtain the second correction image data.
14. An image information processing device, comprising: An acquisition unit is configured to acquire initial correction image data of a to-be-processed image and an initial correction table corresponding to the initial correction image data, the initial correction image being obtained by performing a first correction operation on to-be-processed image data of the to-be-processed image, and the initial correction table being configured to perform the first correction on the to-be-processed image data; A first determination unit is configured to determine a first correction value corresponding to a first region in the to-be-processed image based on a fitting function corresponding to the initial correction table and first color gradient information of the to-be-processed image, the first region satisfying a first preset condition; The initial correction table is updated based on the first correction value to obtain a first correction table; A second determination unit is configured to determine first image data of the to-be-processed image based on processing the initial correction image data by using the first correction table to obtain first correction image data.
15. An electronic device, comprising: comprising: one or more processors; a memory device storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-13.
16. A computer readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method according to any one of claims 1-13.
Citation Information
Patent Citations
A color correction method for structurally consistent stereoscopic images based on gradient preservation
CN109461128A
Image processing apparatus and image processing method
US20100259541A1