Image data processing method and device, computer equipment, readable storage medium and program product
By acquiring and correcting the pixel block brightness data in the AMOLED screen, calculating the difference value and determining the correction level, the problem of inaccurate brightness compensation in the prior art is solved, and the display effect is improved.
Patent Information
- Application Number
- CN202411268780.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-24
AI Technical Summary
In the prior art, when using Demura IP for brightness compensation, AMOLED screen fails to perform data correction, resulting in poor display effect, matte feeling, and inaccurate calculation results.
By obtaining the brightness data of the target pending pixel block and its adjacent pixel blocks, calculating the brightness difference value, determining the correction level and correcting the pixel blocks to generate accurate image data.
It improves the accuracy and display effect of image data processing, ensures the accuracy of image data after compensation, and improves the display effect of the screen.
Smart Images

Figure CN119182865A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image data processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] AMOLED (Active-matrix organic light-emitting diode) screen has the characteristics of wide color gamut, wide viewing angle, and independent light emission. The Demura IP (compensation module) is integrated in the Driver IC (driver chip) to eliminate the uneven display brightness of the AMOLED screen caused by the manufacturing process.
[0003] In the related art, the use of Demura IP to compensate for uneven brightness of AMOLED screens mainly consists of two steps: collecting data and calculating the collected data using a compensation algorithm. However, if the collected data is not corrected, the calculation result obtained when the compensation algorithm is used to calculate the collected data is not accurate. Therefore, the screen using the compensation solution in the related art may still have a frosted feeling when displaying, and the display effect is not good. Summary of the invention
[0004] Based on this, it is necessary to provide an image data processing method, device, computer equipment, computer-readable storage medium and computer program product that can improve display effects in response to the above technical problems.
[0005] In a first aspect, the present application provides an image data processing method, comprising:
[0006] Obtaining a target pixel block to be processed and adjacent pixel blocks of the target pixel block to be processed;
[0007] Acquire first brightness data of a target pixel block to be processed, and second brightness data of an adjacent pixel block;
[0008] Determining a correction level corresponding to a target pixel block to be processed according to the first brightness data and the second brightness data;
[0009] Correct the target pixel block to be processed according to the correction level;
[0010] Generate target image data according to the corrected target pixel block to be processed.
[0011] In one embodiment, before obtaining the target pixel block to be processed, the image data processing method also includes: obtaining the image data to be processed, and dividing the image data to be processed into multiple pixel blocks to be processed; determining a standard pixel block from the multiple pixel blocks to be processed, wherein the standard pixel block is located in the central area of the image data to be processed; selecting any pixel block to be processed except the standard pixel block from the multiple pixel blocks to be processed; obtaining the third brightness data of each first sub-pixel block in any pixel block to be processed, and the fourth brightness data of the standard pixel block; calculating each first brightness difference between each third brightness data and the fourth brightness data; when the first brightness difference is greater than the first preset brightness difference for more than a preset number of times, determining any pixel block to be processed as the target pixel block to be processed.
[0012] In an optional embodiment, before determining the correction level corresponding to the target pixel block to be processed based on the first brightness data and the second brightness data, the image data processing method also includes: acquiring fifth brightness data of the second sub-pixel block in the target pixel block to be processed, and sixth brightness data of the third sub-pixel block in the adjacent pixel block, the second sub-pixel block and the third sub-pixel block have the same boundary line and are symmetrical along the boundary line, or the second sub-pixel block and the third sub-pixel block are diagonally symmetrical; determining a second brightness difference between the second sub-pixel block and the third sub-pixel block based on the fifth brightness data and the sixth brightness data; when the second brightness difference is greater than the second preset brightness difference, determining the correction level corresponding to the target pixel block to be processed based on the first brightness data and the second brightness data.
[0013] In one embodiment, the fifth brightness data includes a first brightness error value of a first pixel and a second brightness error value of a second pixel, the sixth brightness data includes a third brightness error value of a third pixel and a fourth brightness error value of a fourth pixel, the first pixel and the fourth pixel are symmetrical along a boundary line, or the first pixel and the fourth pixel are diagonally symmetrical; the second pixel and the third pixel are located between the first pixel and the fourth pixel; according to the fifth brightness data and the sixth brightness data, the second brightness difference between the second sub-pixel block and the third sub-pixel block is determined, including: generating a first brightness error gradient value according to the first brightness error value, the second brightness error value and the third brightness error value; generating a second brightness error gradient value according to the second brightness error value, the third brightness error value and the fourth brightness error value; and determining the second brightness difference based on the first brightness error gradient value and the second brightness error gradient value.
[0014] In one embodiment, the first brightness error value of the first pixel includes the brightness error value of the first sub-pixel and the brightness error value of the second sub-pixel, the second brightness error value of the second pixel includes the brightness error value of the third sub-pixel and the brightness error value of the fourth sub-pixel, the third brightness error value of the third pixel includes the brightness error value of the fifth sub-pixel and the brightness error value of the sixth sub-pixel, and the fourth brightness error value of the fourth pixel includes the brightness error value of the seventh sub-pixel and the brightness error value of the eighth sub-pixel; generating a first brightness error gradient value according to the first brightness error value, the second brightness error value and the third brightness error value includes: generating a first sub-brightness error gradient value according to the brightness error value of the first sub-pixel, the brightness error value of the third sub-pixel and the brightness error value of the fifth sub-pixel; generating a first sub-brightness error gradient value according to the brightness error value of the third sub-pixel and the brightness error value of the fifth sub-pixel; generating a first sub-brightness error gradient value according to the brightness error value of the third sub-pixel The method comprises: generating a second sub-brightness error gradient value according to the brightness error value of the second sub-pixel, the brightness error value of the fourth sub-pixel and the brightness error value of the sixth sub-pixel; generating a fourth sub-brightness error gradient value according to the brightness error value of the fourth sub-pixel, the brightness error value of the sixth sub-pixel and the brightness error value of the eighth sub-pixel; and determining the second brightness error gradient value according to the third sub-brightness error gradient value and the fourth sub-brightness error gradient value.
[0015] In one embodiment, determining a correction level corresponding to a target pixel block to be processed according to first brightness data and second brightness data includes: determining a third brightness difference value between a first brightness error value and a second brightness error value, and a fourth brightness difference value between the third brightness error value and a fourth brightness error value; determining the correction level according to the first brightness error gradient value, the second brightness error gradient value, the third brightness difference value, and the fourth brightness difference value.
[0016] In one of the embodiments, correcting the target pixel block to be processed according to the correction level includes: when the correction level is a first correction level, obtaining a first preset number of first pixel points to be corrected; determining a first correction strategy according to the first correction level, and correcting the first pixel points to be corrected using the first correction strategy.
[0017] In one of the embodiments, the target pixel block to be processed is corrected according to the correction level, including: when the correction level is a second correction level, obtaining a second preset number of second pixel points to be corrected; the second preset number is less than the first preset number; determining a second correction strategy according to the second correction level, and correcting the second pixel points to be corrected using the second correction strategy; wherein the pixel correction strength corresponding to the second correction strategy is less than the pixel correction strength corresponding to the first correction strategy.
[0018] In one embodiment, obtaining a second preset number of second pixel points to be corrected includes: when the first sub-brightness error gradient value is greater than the preset correction level coefficient, setting the fifth sub-pixel point as the second pixel point to be corrected; when the second sub-brightness error gradient value is greater than the preset correction level coefficient, setting the third sub-pixel point as the second pixel point to be corrected; when the third sub-brightness error gradient value is greater than the preset correction level coefficient, setting the sixth sub-pixel point as the second pixel point to be corrected; when the fourth sub-brightness error gradient value is greater than the preset correction level coefficient, setting the fourth sub-pixel point as the second pixel point to be corrected.
[0019] In a second aspect, the present application further provides an image data processing device, comprising:
[0020] A pixel block acquisition module is used to acquire a target pixel block to be processed and adjacent pixel blocks of the target pixel block to be processed;
[0021] A brightness data extraction module, used to extract first brightness data of a target pixel block to be processed and second brightness data of an adjacent pixel block;
[0022] A correction level determination module, used to determine a correction level corresponding to a target pixel block to be processed according to the first brightness data and the second brightness data;
[0023] A correction module, used for correcting the target pixel block to be processed according to the correction level;
[0024] The target image generation module is used to generate target image data according to the corrected target pixel block to be processed.
[0025] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned method embodiments when executing the computer program.
[0026] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-mentioned method embodiments when the computer program is executed by a processor.
[0027] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned method embodiments when executed by a processor.
[0028] The above-mentioned image data processing method, device, computer equipment, computer-readable storage medium and computer program product correct the acquired image data to be processed, thereby improving the accuracy of the data when the image data to be processed is compensated using a compensation algorithm, ensuring the accuracy of the compensated image data, and improving the display effect of the image data. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0030] Figure 1 is a schematic flow chart of an image data processing method in one embodiment;
[0031] Figure 2 is a schematic diagram of the structure of a target pixel block to be processed and adjacent pixel blocks in one embodiment;
[0032] Figure 3 is a schematic diagram of the structure of a target pixel block to be processed and adjacent pixel blocks in another embodiment;
[0033] Figure 4 A schematic diagram of a structure between pixels in a vertical direction in one embodiment;
[0034] Figure 5 A schematic diagram of the structure between pixels in the vertical direction in another embodiment;
[0035] Figure 6 A schematic diagram of a structure between diagonal pixel points in one embodiment;
[0036] Figure 7 is a flowchart of an image data processing method in another embodiment;
[0037] Figure 8 A schematic diagram of a flow chart of an image data processing method in yet another embodiment;
[0038] Fig. 9 is a flowchart of an image data processing method in yet another embodiment;
[0039] Fig.10A schematic diagram of a flow chart of an image data processing method in yet another embodiment;
[0040] Fig.11 is a structural block diagram of an image data processing device in one embodiment;
[0041] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] In an exemplary embodiment, Figure 1 As shown, an image data processing method is provided, and the method is applied to a terminal as an example for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps 202 to 210. Among them:
[0044] Step 202: Acquire a target pixel block to be processed and adjacent pixel blocks of the target pixel block to be processed.
[0045] The target pixel block to be processed is used to represent the pixel block that needs to be corrected.
[0046] The adjacent pixel block is a pixel block adjacent to the target pixel block to be processed.
[0047] In one embodiment, the terminal includes a display screen, the display screen displays the image data to be processed, and the image data to be processed includes a target pixel block to be processed and an adjacent pixel block. Optionally, the display screen may be an AMOLED screen. Optionally, the image data to be processed may be 1080x2400 image data.
[0048] Alternatively, if Figure 2 As shown, the adjacent pixel blocks may have the same boundary as the target pixel block to be processed and may be symmetrically arranged along the boundary, for example Figure 2 The vertically symmetric P and Q in Figure a, or Figure 2 In the b figure, P and Q are horizontally symmetric. When the target pixel block to be processed is P, the adjacent pixel block is Q.
[0049] Optionally, the adjacent pixel block may also be a pixel block that is diagonally symmetrical to the target pixel block to be processed, for example Figure 2 In Figure c, P and Q are diagonally symmetric. When the target pixel block to be processed is P, the adjacent pixel block is Q.
[0050] In one embodiment, the image data to be processed may be obtained, and the original brightness data of each pixel in the image data to be processed may be obtained, and whether to perform correction and compensation processing on the corresponding pixel may be determined according to the original brightness data of each pixel.
[0051] In one embodiment, the original brightness data of the pixel point may be obtained by obtaining brightness data at a preset grayscale. For example, the grayscale collected is [16, 32, 96, 160, 192, 224], a total of 6 grayscales and 18 single-channel original brightness data.
[0052] In an optional embodiment, it can be determined whether to perform correction and compensation processing on the corresponding pixel block based on the pixel block included in the image data to be processed. If so, the pixel block is determined as the target pixel block to be processed.
[0053] Optionally, image data to be processed can be obtained and divided into multiple pixel blocks to be processed; a standard pixel block can be determined from the multiple pixel blocks to be processed; any pixel block to be processed other than the standard pixel block can be selected from the multiple pixel blocks to be processed; third brightness data of each first sub-pixel block in any pixel block to be processed and fourth brightness data of the standard pixel block can be obtained; each first brightness difference between each third brightness data and the fourth brightness data can be calculated; and when the first brightness difference is greater than the first preset brightness difference for more than a preset number of times, any pixel block to be processed is determined to be a target pixel block to be processed.
[0054] The standard pixel block is used as a basic pixel block for comparison. Optionally, the standard pixel block may be a pixel block located in the central area of the image data to be processed. Optionally, the standard pixel block may be a 20×20 pixel block, or a 40×40 pixel block, etc., which is not limited.
[0055] In one embodiment, when the image data to be processed is obtained, the position information of each pixel included in the image data to be processed can be obtained, and the pixel at the middle position in the image data to be processed is determined based on the position information. Then, based on the determined pixel at the middle position, a preset number of pixel points are obtained to generate a standard pixel block, for example, a 40×40 pixel block.
[0056] Optionally, after the standard pixel block is obtained, original brightness data of each pixel in the standard pixel block may be obtained, and an average value of the original brightness data of each pixel may be calculated to obtain fourth brightness data.
[0057] In one embodiment, a pixel block division standard may be pre-set, and the image data to be processed may be divided according to the pixel block division standard to obtain a plurality of pixel blocks to be processed. For example, the pixel block division standard may be to divide the image data to be processed into 4×4 pixel blocks, and then a plurality of 4×4 pixel blocks may be obtained after the image data to be processed is divided.
[0058] In one embodiment, any pixel block to be processed can be obtained from other pixel blocks to be processed except the standard pixel block, and whether any pixel block to be processed is the target pixel block to be processed can be determined based on the brightness data of the pixel block to be processed and the brightness data of the standard pixel block.
[0059] Optionally, any pixel block to be processed can be divided into multiple sub-pixel blocks, for example, a 4×4 pixel block can be divided into 2×2 pixel blocks; based on the third brightness data of each sub-pixel block and the fourth brightness data of the standard pixel block, it is determined whether any pixel block to be processed is the target pixel block to be processed.
[0060] In one embodiment, the first brightness difference between each sub-pixel block and the standard pixel block can be determined, and the number of times the first brightness difference is greater than a preset brightness difference can be determined. If the number is greater than the preset number, any pixel block to be processed is considered to be the target pixel block to be processed.
[0061] In one of the embodiments, the third brightness data may be determined according to original brightness data of pixels included in the sub-pixel block.
[0062] Exemplarily, a 4×4 pixel block to be processed is obtained, such as Figure 3 The 4×4 pixel block on the left will be Figure 3 The 4×4 pixel block on the left is divided into 2×2 sub-pixel blocks, and sub-pixel blocks [L10, L11, L21, L20], [L12, L13, L23, L22], [L30, L31, L41, L40] and [L32, L33, L43, L42] can be obtained. The original brightness data of the pixels included in each sub-pixel block is obtained, and the third brightness data corresponding to each sub-pixel block is generated according to the obtained original brightness data of the pixels of each sub-pixel block. For example, the third brightness data can be the average value of the original brightness data of each pixel.
[0063] In one embodiment, after the third brightness data of each sub-pixel block is determined, the third brightness data and the fourth brightness data of each sub-pixel point are calculated to determine each first brightness difference between each third brightness data and the fourth brightness data.
[0064] For example, taking the sub-pixel block [L10, L11, L21, L20] as an example, the calculation formula for the first brightness difference between the third brightness data and the fourth brightness data of the pixel block may be:
[0065]
[0066] ΔB1 is used to represent the first brightness difference between the third brightness data and the fourth brightness data, lumi target Used to characterize the fourth brightness data, L 10 , L 11 , L 20 and L 21 are the original brightness data of each pixel.
[0067] For other sub-pixel blocks [L12, L13, L23, L22], [L30, L31, L41, L40] and [L32, L33, L43, L42], the calculation formula for the difference between the third brightness data and the fourth brightness data of each sub-pixel block can be:
[0068]
[0069] Among them, L 12 , L 13 , L 22 , L 23 , L 30 , L 31 , L 32 , L 33 , L 40 , L 41 , L 42 , L 43 are the original brightness data of each pixel.
[0070] Optionally, after determining each first brightness difference between each third brightness data and the fourth brightness data, a preset difference can be obtained, and the determined first brightness difference between each third brightness data and the fourth brightness data can be compared with the preset difference. If the first brightness difference is larger than the preset difference, it is considered that the brightness difference between the corresponding sub-pixel block and the standard pixel block is large, and the sub-pixel block needs to be corrected.
[0071] In an optional embodiment, the number of times may be counted, and each time the first brightness difference between the third brightness data and the fourth brightness data of the sub-pixel block is greater than the preset difference, the number of times is recorded as 1. In an optional embodiment, the total number of times the first brightness difference between the third brightness data and the fourth brightness data of each sub-pixel block in any pixel block to be processed is greater than the preset difference may be counted, and whether any pixel block to be processed is the target pixel block to be processed is determined based on the total number of times.
[0072] Optionally, a preset number of times is obtained, and when the total number of times is greater than the preset number of times, any pixel block to be processed is determined to be a target pixel block to be processed. Exemplarily, the preset number of times is an integer greater than or equal to 1, which can be set as needed and is not limited to this. For example, when the preset number of times is 1 and the total number of times is greater than 1, any pixel block to be processed is considered to be a target pixel block to be processed.
[0073] In one embodiment, after identifying whether any pixel block to be processed is a target pixel block to be processed, it can be determined whether there are other pixel blocks to be processed. If so, any pixel block to be processed is further obtained from the other pixel blocks to be processed, and it can be determined whether it is the target pixel block to be processed based on the brightness data of any pixel block to be processed, until all the pixel blocks to be processed in the image data to be processed are identified, so as to determine the target pixel block to be processed included in the image data to be processed that needs to be corrected.
[0074] In one embodiment, after all target pixel blocks to be processed included in the image data to be processed are determined, a further processing step of cyclically acquiring a target pixel block to be processed from all target pixel blocks to be processed and correcting the acquired target pixel block to be processed may be further performed. Alternatively, after one target pixel block to be processed is determined, the determined target pixel block to be processed is corrected first, and then other pixel blocks to be processed are further acquired from the image data to be processed, and whether the acquired other pixel blocks to be processed are the target pixel blocks to be processed is determined according to the other pixel blocks to be processed, and the target pixel blocks to be processed are corrected, until all pixel blocks to be processed included in the image data to be processed are processed.
[0075] Step 204: Acquire first brightness data of the target pixel block to be processed and second brightness data of adjacent pixel blocks.
[0076] Step 206: Determine a correction level corresponding to the target pixel block to be processed according to the first brightness data and the second brightness data.
[0077] The correction level is used to characterize the level of pixel correction performed on the pixel block. In one embodiment, the correction level includes a first correction level and a second correction level, and optionally, the correction strength of the first correction level is greater than that of the second correction level.
[0078] In one embodiment, different correction levels have different correction strategies, and the pixel blocks to be corrected are corrected according to the different correction strategies.
[0079] Optionally, the first correction level corresponds to a first correction strategy, and the second correction level corresponds to a second correction strategy, wherein the pixel correction strength corresponding to the first correction strategy is greater than the pixel correction strength corresponding to the second correction strategy.
[0080] In one embodiment, before determining the correction level corresponding to the target pixel block to be processed based on the first brightness data and the second brightness data, it can be determined whether to correct the target pixel block to be processed based on the brightness data of the target pixel block to be processed and the adjacent pixel blocks. When it is determined that correction is required, the step of determining the correction level based on the brightness data is further performed. Optionally, the fifth brightness data of the second sub-pixel block in the target pixel block to be processed and the sixth brightness data of the third sub-pixel block in the adjacent pixel block can be obtained; the second brightness difference between the second sub-pixel block and the third sub-pixel block is determined based on the fifth brightness data and the sixth brightness data; when the second brightness error coefficient is greater than the second preset brightness difference, the correction level corresponding to the target pixel block to be processed is determined based on the first brightness data and the second brightness data.
[0081] The second sub-pixel block and the third sub-pixel block have the same boundary line and are symmetrical along the boundary line, or the second sub-pixel block and the third sub-pixel block are diagonally symmetrical.
[0082] In one embodiment, in order to improve the accuracy of image data processing, thereby improving the display effect based on the processed image data, the original brightness data of each pixel in the image data can be processed when processing the image data to obtain the brightness error data corresponding to each pixel, and the processing is performed based on the obtained brightness error data of each pixel. Optionally, any pixel block to be processed can be obtained, and the comparison pixel block included in the any pixel block to be processed can be obtained, the original brightness data of each pixel in the comparison pixel block can be obtained, and the average value of the original brightness data of each pixel in the comparison pixel block can be calculated, and the brightness error data of each pixel can be determined according to the original brightness data of each pixel in any pixel block to be processed and the average value of each pixel in the comparison pixel block.
[0083] For ease of understanding, the calculation method of the brightness error data corresponding to the pixel point is illustrated as follows:
[0084] Take a 4×4 pixel block, such as Figure 3 For the 4×4 pixel block in the example on the left, the original brightness data of each pixel in the 4×4 pixel block is obtained, and the brightness error data of each brightness data is determined according to the original brightness data. Optionally, for the extracted 4×4 pixel block, each pixel included in the pixel block can be marked with a position, for example, the pixel in the second row and the second column can be marked with 21, or other marking methods can be used, such as marking the pixel at the corresponding position with a letter + a position number, such as L21, and there is no limitation on this, as long as the different pixels can be distinguished.
[0085] Optionally, a 2×2 pixel block in the middle area of the 4×4 pixel block may be used as a comparison pixel block. For example, the comparison pixel block may be [L21, L22, L32, L31], and the average value of the comparison pixel block may be calculated as: Then subtract the average value from the original brightness value of each pixel to get the brightness error data corresponding to each pixel, for example:
[0086]
[0087] Among them, N1 is used to represent the brightness error data corresponding to the pixel point L21, N2 is used to represent the brightness error data at the pixel point L22, n3 is used to represent the brightness error data at the pixel point L31, and n4 is used to represent the brightness error data at the pixel point L32. 21 It is used to represent the original brightness data corresponding to the pixel point L21. 22 It is used to represent the original brightness data corresponding to the pixel point L22. 31 The original brightness data used to represent the pixel L31, L 32 Used to represent the original brightness data of pixel L32.
[0088] Optionally, for other pixel points of the 4×4 pixel block, the corresponding brightness error data is also calculated. For example, for the L10 pixel point, the corresponding brightness error data can be Among them, Q 10 is the brightness error data corresponding to pixel L10, L 10 is the original brightness data.
[0089] In one embodiment, each pixel in the 4×4 pixel block may be calculated to determine the brightness error data corresponding to each pixel, and a 4×4 brightness error pixel block corresponding to the 4×4 pixel block may be generated according to the brightness error data corresponding to each pixel. Figure 3 This is shown in the right pixel block in .
[0090] In one embodiment, the brightness error data of each pixel point included in the image data to be processed may be determined, so that the brightness error data of the required pixel point can be obtained when needed.
[0091] It is understandable that when the brightness difference between pixels is greater than a preset value, the pixels need to be corrected to ensure the display effect. Figure 4Taking [N2, Q23, P20, M1] in the example, the difference between the brightness error values of the pixels in [N2, Q23, P20, M1] can be calculated to determine the maximum difference, and whether to make corrections is determined according to the maximum difference. Optionally, when the maximum difference is greater than the preset difference, it is considered that corrections are required.
[0092] Alternatively, if Figure 5 As shown, the distribution of each pixel in [N2, Q23, P20, M1] can be Figure 5 The eight cases shown in Figure 5 Taking the distribution of a in as an example, the calculation of the difference in brightness error values between pixels can be:
[0093] ΔL1=P 20 -Q 23 (9)
[0094] ΔL2=P 20 -N2 (10)
[0095] ΔL3=M2-N2 (11)
[0096] ΔL4=P 20 -N2 (12)
[0097] Optionally, after ΔL1, ΔL2, ΔL3 and ΔL4 are determined, the sizes of ΔL1, ΔL2, ΔL3 and ΔL4 may be compared to obtain the largest one being ΔL1.
[0098] In one embodiment, ΔL1 is compared with a preset difference. When ΔL1 is greater than the preset difference, correction is considered necessary. At this time, a step of determining a correction level according to brightness data of the target pixel block to be processed and brightness data of adjacent pixel blocks can be further performed.
[0099] In one embodiment, the fifth brightness data includes a first brightness error value of a first pixel and a second brightness error value of a second pixel, the sixth brightness data includes a third brightness error value of a third pixel and a fourth brightness error value of a fourth pixel, the first pixel and the fourth pixel are symmetrical along a boundary line, or the first pixel and the fourth pixel are diagonally symmetrical; the second pixel and the third pixel are located between the first pixel and the fourth pixel; according to the brightness data of the second sub-pixel block and the brightness data of the third sub-pixel block, the second brightness difference between the second sub-pixel block and the third sub-pixel block is determined, including: generating a first brightness error gradient value according to the first brightness error value, the second brightness error value and the third brightness error value; generating a second brightness error gradient value according to the second brightness error value, the third brightness error value and the fourth brightness error value; and determining the second brightness difference based on the first brightness error gradient value and the second brightness error gradient value.
[0100] Optionally, the first pixel may include a first sub-pixel and a second sub-pixel, the second pixel may include a third sub-pixel and a fourth sub-pixel, the third pixel may include a fifth sub-pixel and a sixth sub-pixel, and the fourth pixel may include a seventh sub-pixel and an eighth sub-pixel, wherein the first sub-pixel, the third sub-pixel, the fifth sub-pixel and the seventh sub-pixel are located in the same row, the second sub-pixel, the fourth sub-pixel, the sixth sub-pixel and the eighth sub-pixel are located in the same row, the first brightness error gradient value includes a first sub-brightness error gradient value and a second sub-brightness error gradient value, and the second brightness error gradient value includes a first sub-brightness error gradient value and a second sub-brightness error gradient value. The value includes a third sub-brightness error gradient value and a fourth sub-brightness error gradient value, the first sub-brightness error gradient is determined according to the first sub-pixel point, the third sub-pixel point, and the fifth sub-pixel point, the second sub-brightness error gradient is determined according to the third sub-pixel point, the fifth sub-pixel point, and the seventh sub-pixel point, the third sub-brightness error gradient is determined according to the second sub-pixel point, the fourth sub-pixel point, and the sixth sub-pixel point, the fourth sub-brightness error gradient is determined according to the fourth sub-pixel point, the sixth sub-pixel point, and the eighth sub-pixel point, and the second brightness difference value is determined according to the first sub-brightness error gradient, the second sub-brightness error gradient, the third sub-brightness error gradient, and the fourth sub-brightness error gradient.
[0101] In one embodiment, the second sub-pixel block and the third sub-pixel block may be symmetrical along the same boundary, and the calculation of the second brightness error value between the second sub-pixel block and the third sub-pixel block may be a brightness difference value in the vertical direction and / or a brightness difference value in the horizontal direction.
[0102] For example, Figure 4 As shown, taking the second sub-pixel block as [N2, Q23, Q33, N4] and the third sub-pixel block as [P20, M1, M3, P30] as an example, the calculation of the brightness error value in the vertical direction between the target pixel block to be processed and the adjacent pixel block is illustrated as follows:
[0103] When the second sub-pixel block is [N2, Q23, Q33, N4] and the third sub-pixel block is [P20, M1, M3, P30], the calculation of the brightness difference in the vertical direction can be to calculate the brightness error gradient value of [N2, Q23, P20, M1] and the brightness error gradient value of [N4, Q33, P30, M3], and then determine the brightness difference in the vertical direction based on the brightness error gradient value of [N2, Q23, P20, M1] and the brightness error gradient value of [N4, Q33, P30, M3].
[0104] Exemplarily, taking [N2, Q23, P20, M1] as an example, the calculation of the brightness error gradient value is illustrated as follows:
[0105] The first sub-pixel point may be N2, the third sub-pixel point may be Q23, the fifth sub-pixel point may be P20, and the seventh sub-pixel point may be M1. Then, the calculation formulas for the first sub-brightness error gradient value and the second sub-brightness error gradient value may be:
[0106] dq1=|n2-2*q 23 +p 20 | (13)
[0107] dp1=|m1-2*p 20 +q 23 | (14)
[0108] Among them, dq1 is the first sub-brightness error gradient value, dp1 is the second sub-brightness error gradient value, n2 is the brightness error value of pixel point N2, q 23 is the brightness error value of pixel Q23, p 20 is the brightness error value of the pixel point P20, and m1 is the brightness error value of the pixel point M1.
[0109] Optionally, after determining the first sub-brightness error gradient value and the second sub-brightness error gradient value, the first brightness error gradient value can be determined according to the first sub-brightness error gradient value and the second sub-brightness error gradient value, for example, the first sub-brightness error gradient value and the second sub-brightness error gradient value are added to obtain the first brightness error gradient value.
[0110] For example, for [N4, Q33, P30, M3], the second sub-pixel point may be N4, the fourth sub-pixel point may be Q33, the sixth sub-pixel point may be P30, and the eighth sub-pixel point may be M3. Then, the third sub-brightness error gradient value and the fourth sub-brightness error gradient value may be calculated as follows:
[0111] dq2=|n4-2*q 33 +p 30 | (15)
[0112] dp2=|m3-2*p 30 +q 33 | (16)
[0113] Among them, dq2 is the third sub-brightness error gradient value, dq2 is the fourth sub-brightness error gradient value, n4 is the brightness error value of pixel point N4, q 33 is the brightness error value of pixel Q33, p 30 is the brightness error value of pixel point P30, and m3 is the brightness error value of pixel point M3.
[0114] Optionally, after determining the third sub-brightness error gradient value and the fourth sub-brightness error gradient value, the second brightness error gradient value can be determined according to the third sub-brightness error gradient value and the fourth sub-brightness error gradient value, for example, the third sub-brightness error gradient value and the fourth sub-brightness error gradient value are added to obtain the second brightness error gradient value.
[0115] In one embodiment, after the first brightness error gradient value and the second brightness error gradient value are determined, the second brightness difference value C in the vertical direction may be determined according to the brightness error gradient value. B1 , the calculation formula for calculating the second brightness difference in the vertical direction can be:
[0116] C B1 =dq1+dp1+dq2+dq2 (17)
[0117] In an optional embodiment, the second preset brightness difference value may include a first preset brightness error value. Optionally, when determining the second brightness difference value in the vertical direction, the first preset brightness error value R1 is obtained, the second brightness difference value in the vertical direction and the first preset brightness error value are compared, and whether to determine the correction level is determined according to the comparison result. Exemplarily, when C B1 >R1, it is considered that the pixels at the vertical boundary need to be corrected, and the correction level can be further determined based on the first brightness data of the target pixel block to be processed and the second brightness data of the adjacent pixel block.
[0118] Optionally, the calculation of the brightness error coefficient in the horizontal direction is similar to the calculation of the brightness error coefficient in the vertical direction, and will not be described in detail here.
[0119] In an optional embodiment, the second sub-pixel block and the third sub-pixel block may also be diagonally symmetrical.
[0120] In one embodiment, the pixels in the second sub-pixel block may be discontinuous, and the pixels in the third sub-pixel block may also be discontinuous.
[0121] For example, Figure 6 As shown, the second sub-pixel block may be [N4, Q43] and [H2, A13], the third sub-pixel block may be [P10, M1] and [S40, K3], [N4, Q43] in the second sub-pixel block is diagonally symmetrical with [P10, M1] in the third sub-pixel block, and [H2, A13] in the second sub-pixel block is diagonally symmetrical with [S40, K3] in the third sub-pixel block. Optionally, when performing calculations, pixel blocks for diagonal calculations may be generated based on the diagonally symmetrical pixel blocks, for example, pixel blocks for diagonal calculations [N4, Q43, P10, M1] and [K3, S40, A13, H2] may be generated.
[0122] In one embodiment, Figure 6 As shown, when the second sub-pixel block is diagonally symmetrical with the third sub-pixel block, the calculation of the brightness error coefficient in the diagonal direction between the target pixel block to be processed and the adjacent pixel block can be performed by calculating the brightness error gradient value of [N4, Q43, P10, M1] and the brightness error gradient value of [K3, S40, A13, H2], and then determining the brightness error coefficient in the diagonal direction based on the brightness error gradient value of [N4, Q43, P10, M1] and the brightness error gradient value of [K3, S40, A13, H2].
[0123] Optionally, taking [N4, Q43, P10, M1] as an example, the calculation of the brightness error gradient value can be:
[0124] The first sub-pixel point may be N4, the third sub-pixel point may be Q43, the fifth sub-pixel point may be P10, and the seventh sub-pixel point may be M1. Then, the calculation formula for the first sub-brightness error gradient value and the second sub-brightness error gradient value may be:
[0125] dq3=|n4-2*q 43 +p 10 | (18)
[0126] dp3=|m1-2*p 10 +q 43 | (19)
[0127] Among them, dq3 is the first sub-brightness error gradient value, dp3 is the second sub-brightness error gradient value, n4 is the brightness error value of pixel point N4, q 43 is the brightness error value of pixel Q43, p 10 is the brightness error value of the pixel point P10, and m1 is the brightness error value of the pixel point M1.
[0128] Optionally, after determining the first sub-brightness error gradient value and the second sub-brightness error gradient value, the first brightness error gradient value can be determined according to the first sub-brightness error gradient value and the second sub-brightness error gradient value, for example, the first sub-brightness error gradient value and the second sub-brightness error gradient value are added to obtain the first brightness error gradient value.
[0129] For example, for [K3, S40, A13, H2], the second sub-pixel point may be K3, the fourth sub-pixel point may be S40, the sixth sub-pixel point may be A13, and the eighth sub-pixel point may be H2. Then, the calculation formula for the third sub-brightness error gradient value and the fourth sub-brightness error gradient value may be:
[0130] dq4=|k3-2*s 40 +a 13 | (20)
[0131] dp4=|h2-2*a 13 +s 40 | (21)
[0132] Among them, dq4 is the third sub-brightness error gradient value, dp4 is the fourth sub-brightness error gradient value, k3 is the brightness error value of pixel K3, s 40 is the brightness error value of pixel S40, A 13 is the brightness error value of pixel A13, and H2 is the brightness error value of pixel H2.
[0133] Optionally, after determining the third sub-brightness error gradient value and the fourth sub-brightness error gradient value, the second brightness error gradient value can be determined according to the third sub-brightness error gradient value and the fourth sub-brightness error gradient value, for example, the third sub-brightness error gradient value and the fourth sub-brightness error gradient value are added to obtain the second brightness error gradient value.
[0134] In one embodiment, after determining the brightness error gradient value corresponding to [N4, Q43, P10, M1] and the brightness error gradient value corresponding to [K3, S40, A13, H2], the second brightness difference value C in the diagonal direction is calculated. B2 The calculation formula can be:
[0135] C B2 =dq3+dp3+dq4+dp4 (22)
[0136] In an optional embodiment, the second preset brightness difference value may include a second preset brightness error value. Optionally, when determining the second brightness error value in the diagonal direction, the second preset brightness error value R2 is obtained, the second brightness error value in the diagonal direction is compared with the second preset brightness error value, and whether to determine the correction level is determined according to the comparison result. Exemplarily, when C B2 >R2, it is considered that the diagonally symmetrical pixels need to be corrected, and the correction level can be further determined based on the first brightness data of the target pixel block to be processed and the second brightness data of the adjacent pixel block.
[0137] In one embodiment, determining a correction level corresponding to a target pixel block to be processed according to first brightness data and second brightness data includes: determining a third brightness difference value between a first brightness error value and a second brightness error value, and a fourth brightness difference value between the third brightness error value and a fourth brightness error value; determining the correction level according to the first brightness error gradient value, the second brightness error gradient value, the third brightness difference value, and the fourth brightness difference value.
[0138] In one embodiment, the third brightness difference value may be an absolute value of a difference between the first brightness error value and the second brightness error value. Optionally, the fourth brightness difference value may be an absolute value of a difference between the third brightness error value and the fourth brightness error value.
[0139] Optionally, the first brightness error value may include brightness error values corresponding to the first sub-pixel and the second sub-pixel, respectively. Optionally, the second brightness error value may include brightness error values corresponding to the third sub-pixel and the fourth sub-pixel, respectively. Optionally, the third brightness error value may include brightness error values corresponding to the fifth sub-pixel and the sixth sub-pixel, respectively. Optionally, the fourth brightness error value may include brightness error values corresponding to the seventh sub-pixel and the eighth sub-pixel, respectively.
[0140] In one embodiment, calculating the third brightness difference between the first brightness error value and the second brightness error value can be performed by calculating the difference between the brightness error value of the first sub-pixel point and the brightness error value of the third sub-pixel point, and the difference between the brightness error values of the second sub-pixel point and the fourth sub-pixel point.
[0141] In one embodiment, calculating the fourth brightness difference between the third brightness error value and the fourth brightness error value can be calculating the difference between the brightness error value of the fifth sub-pixel and the brightness error value of the seventh sub-pixel, and the difference between the brightness error value of the sixth sub-pixel and the brightness error value of the eighth sub-pixel.
[0142] Exemplarily, for the second sub-pixel block [N2, Q23, N4, Q33] and the third sub-pixel block [P20, M1, P30, M3], the first sub-pixel point may be N2, the second sub-pixel point may be N4, the third sub-pixel point may be Q23, the fourth sub-pixel point may be Q33, the fifth sub-pixel point may be P20, the sixth sub-pixel point may be P30, the seventh sub-pixel point may be M1, and the eighth sub-pixel point may be M3.
[0143] Optionally, the first brightness error value may include a brightness error value corresponding to the first sub-pixel N2 and a brightness error value corresponding to the second sub-pixel N4. The second brightness error value may include a brightness error value corresponding to the third sub-pixel Q23 and a brightness error value corresponding to the fourth sub-pixel Q33. The third brightness error value may include a brightness error value corresponding to the fifth sub-pixel P20 and a brightness error value corresponding to the sixth sub-pixel P30. The fourth brightness error value may include a brightness error value corresponding to the seventh sub-pixel M1 and a brightness error value corresponding to the eighth sub-pixel M3.
[0144] Optionally, the third brightness difference between the first brightness error value and the second brightness error value may be calculated as |N2-Q 23 | and | N4-Q33 |.
[0145] Optionally, the fourth brightness difference between the third brightness error value and the fourth brightness error value may be calculated as |M1-P 20 | and |M3-P 30 |.
[0146] In one embodiment, when determining the correction level, the formula used for determining the correction level can be generated based on the pixels in the same row. For example, the pixels in the same row can be [N2, Q23, P20, M1], and the formula for determining the correction level can be |N2-Q 23 |+|M1-P 20 In an optional embodiment, a correction level coefficient β is preset, and the correction level is determined according to the preset correction level coefficient. For example, the first brightness error gradient value, the second brightness error gradient value, and the formula for determining the correction level generated above can be compared with the preset correction level coefficient, and the correction level can be determined according to the comparison result.
[0147] For example, for the second sub-pixel block [N2, Q23, N4, Q33] and the third sub-pixel block [P20, M1, P30, M3], the formula for determining the correction level according to the preset correction level coefficient may be:
[0148] (dq1+dq1)>β (23)
[0149] (dp2+dq2)>β (24)
[0150] |N2-Q 23 |+|M1-P 20 |<β>>1 (25)
[0151] |N4-Q 33 |+|M3-P 30 |<β>>1 (26)
[0152] Among them, the above formulas (23) and (24) are used to determine the strength of the change in pixel error brightness on both sides of the boundary, and the above formulas (25) and (26) are used to determine whether the pixel error brightness on both sides of the boundary is evenly distributed.
[0153] Optionally, when formula (23), formula (24), formula (25) and formula (26) are all true, it can be considered that the pixel error brightness changes strongly on both sides of the boundary, and the pixel error brightness on both sides of the boundary is not flat, then it is considered that strong correction is required, and the correction level can be confirmed to be the first correction level, and correction is implemented according to the first correction level.
[0154] Optionally, when formula (23), formula (24), formula (25) and formula (26) are not all true, it can be considered that strong correction is not necessary, weak correction can be used, and the correction level can be considered to be the second correction level, and correction is implemented according to the second correction level.
[0155] In one embodiment, the preset correction level coefficient β is affected by the grayscale brightness and R / G / B channel images during shooting. It can be seen from the brightness data of shooting from low grayscale to high grayscale that the larger the grayscale, the greater the error brightness of adjacent pixels. Optionally, β can be obtained by querying a preset correction level coefficient query table. The preset correction level coefficients are shown in Table 1 below:
[0156] Table 1 Preset Correction Level Coefficient Lookup Table
[0157] Grayscale 16 32 96 160 192 224 <![CDATA[β r ]]> 0.008 0.034 0.226 0.390 0.465 0.474 <![CDATA[β g ]]> 0.027 0.091 0.508 1.041 1.199 1.345 <![CDATA[β b ]]> 0.003 0.011 0.056 0.099 0.154 0.187
[0158] Step 208: correct the target pixel block to be processed according to the correction level.
[0159] In one embodiment, different correction levels correspond to different correction strategies. Optionally, the first correction level corresponds to the first correction strategy; the second correction level corresponds to the second correction strategy. Optionally, the correction strength of the first correction strategy is greater than the correction strength of the second correction strategy.
[0160] In one embodiment, after the correction level is determined, a corresponding correction strategy can be determined according to the correspondence between the correction level and the correction strategy, and the target pixel block to be processed can be corrected according to the obtained correction strategy.
[0161] In an optional embodiment, when the correction level is the first correction level, a first preset number of first pixels to be corrected are obtained; a first correction strategy is determined according to the first correction level, and the first pixels to be corrected are corrected using the first correction strategy.
[0162] Optionally, the first preset number may be all the pixel points included in the second sub-pixel block and the third sub-pixel block that are symmetrical on both sides of the boundary line or diagonally. For example, the second sub-pixel block is [N2, Q23, Q33, N4], the third sub-pixel block is [P20, M1, M3, P30], and the first preset number may be 8, that is, the first pixel point to be corrected should be [N2, Q23, Q33, N4, P20, M1, M3, P30].
[0163] Optionally, the first preset number may also be other numbers, such as 4, and the pixel points to be corrected may be determined according to the difference in brightness error data between the pixel points.
[0164] In one embodiment, when the correction level is the first correction level, multiple pixel points to be corrected are determined, any pixel point to be corrected is selected, and the first adjacent pixel point and the second adjacent pixel point of any pixel point to be corrected are determined; based on the brightness error data of any pixel point to be corrected, the brightness error data of the first adjacent pixel point and the brightness error data of the second adjacent pixel point, the corrected brightness data corresponding to any pixel point to be corrected is determined.
[0165] The first adjacent pixel point and any pixel point to be corrected belong to the same sub-pixel block. For example, when the pixel point to be corrected is N2, the first adjacent pixel point may be Q23.
[0166] The second adjacent pixel point belongs to a different sub-pixel block from the pixel point to be corrected. Optionally, there may be multiple second adjacent pixel points. For example, when the pixel point to be corrected is N2, the second adjacent pixel points may be P20 and M1.
[0167] Exemplarily, when the multiple correction pixel points are [N2, Q23, P20, M1], the correction strategy for each pixel point can adopt the following formula:
[0168] Q 23 ′=(N2+2*Q 23 +P 20 )>>3 (27)
[0169] P 20 ′=(M1+2*P 20 +Q 23 )>>3 (28)
[0170] N2′=(2*N2+Q 23 +P 20 )>>2 (29)
[0171] M1′=(2*M1+Q 23 +P 20 )>>2 (30)
[0172] In an optional embodiment, when the correction level is the second correction level, a second preset number of second pixels to be corrected are obtained; a second correction strategy is determined according to the second correction level, and the second pixels to be corrected are corrected using the second correction strategy.
[0173] Optionally, the second preset number is smaller than the first preset number.
[0174] It can be understood that when the correction level is the second correction level, and the second correction level is less than the first correction level, it indicates that the brightness change between the target pixel block to be processed and the adjacent pixel block is relatively gentle, and the number of pixels to be corrected is relatively small, so the second preset number can be less than the first preset number. Optionally, the second preset number can be a positive integer less than or equal to 2.
[0175] In one embodiment, obtaining a second preset number of second pixel points to be corrected may include: when the first sub-brightness error gradient value is greater than the preset correction level coefficient, setting the fifth sub-pixel point as the third pixel point to be corrected; when the second sub-brightness error gradient value is greater than the preset correction level coefficient, setting the third sub-pixel point as the second pixel point to be corrected.
[0176] Optionally, when the third sub-brightness error gradient is greater than the preset correction level coefficient, the sixth sub-pixel point is set as the third pixel point to be corrected; when the fourth sub-brightness error gradient is greater than the preset correction level coefficient, the fourth sub-pixel point is set as the second pixel point to be corrected.
[0177] For example, the pixel blocks are [N2, Q23, Q33, N4] and [P20, M1, M3, P30]:
[0178] The first sub-pixel point is N2, the second sub-pixel point is N4, the third sub-pixel point is Q23, the fourth sub-pixel point is Q33, the fifth sub-pixel point is P20, the sixth sub-pixel point is P30, the seventh sub-pixel point is M1, and the eighth sub-pixel point is M3.
[0179] The first sub-brightness error gradient value dq1 can be determined according to the first sub-pixel point, the third sub-pixel point and the fifth sub-pixel point. The specific calculation formula can refer to formula (13). The brightness error gradient value dq1 is compared with the preset correction level coefficient β. If dq1>β, it can be considered that the pixel point to be corrected is the fifth sub-pixel point P20. The correction strategy can adopt the following formula:
[0180] P 20 ′=(P 20 +(M1+Q 23 )>>1-P 20 )>>1 (31)
[0181] Among them, P 20 ′ is the corrected brightness data of pixel P20, P 20 is the brightness error data of pixel point P20, M1 is the brightness error data of pixel point M1, Q 23 is the brightness error data of pixel Q23.
[0182] Optionally, the second sub-brightness error gradient value dp1 can be determined according to the third sub-pixel point, the fifth sub-pixel point and the seventh sub-pixel point. The specific calculation formula is shown in formula (14). The brightness error gradient value dp1 is compared with the preset correction level coefficient β. If dq1>β, it can be considered that the third sub-pixel point to be corrected is Q23, and the correction strategy can adopt the following formula:
[0183] Q 23 ′=(Q 23 +(N2+P 20 )>>1-Q 23 )>>1 (32)
[0184] Among them, Q 23 ′ is the corrected brightness data of pixel Q23, Q 23 is the brightness error data of pixel Q23, N2 is the brightness error data of pixel N2, P 20 is the brightness error data of pixel P20.
[0185] Optionally, the third sub-brightness error gradient dq2 is determined according to the second sub-pixel point, the fourth sub-pixel point and the sixth sub-pixel point. The specific calculation formula is shown in formula (15). The brightness error gradient value dq2 is compared with the preset correction level coefficient β. If dq2>β, it can be considered that the pixel point to be corrected is the sixth sub-pixel point P30, and the correction strategy can adopt the following formula:
[0186] P 30 ′=(P 30 +(M3+Q 33 )>>1-P 30 )>>1 (33)
[0187] Among them, P 30 ′ is the corrected brightness data of pixel P30, P 30 is the brightness error data of pixel point P30, M3 is the brightness error data of pixel point M3, Q 33 is the brightness error data of pixel Q33.
[0188] Optionally, the fourth sub-brightness error gradient dp2 can be determined according to the fourth sub-pixel point, the sixth sub-pixel point and the eighth sub-pixel point. The specific calculation formula is shown in formula (16). The brightness error gradient value dp2 is compared with the preset correction level coefficient β. If dp2>β, it can be considered that the third sub-pixel point to be corrected is Q33, and the correction strategy can adopt the following formula:
[0189] Q 33 ′=(Q 33 +(N4+P 30 ) >>1-Q 33) >>1 (34)
[0190] Step 210, generating target image data according to the corrected target pixel block to be processed.
[0191] In one embodiment, after brightness correction is performed on the pixel points, corrected brightness data is obtained, and the corrected brightness data is superimposed on the original brightness data to obtain the corrected brightness data corresponding to the target pixel point to be processed, and a corrected target pixel block is generated based on the corrected brightness data target pixel block to be processed.
[0192] Optionally, when the correction of multiple target pixel blocks to be processed in the image data to be processed is completed, the target image data can be generated.
[0193] In an optional embodiment, after the corrected target pixel block is determined, a pixel compensation algorithm may be further executed based on the corrected target pixel block.
[0194] In one embodiment, the pixel compensation algorithm may include collecting grayscale-brightness data pairs, and solving grayscale-brightness curves of R, G, and B channels according to the collected grayscale-brightness data pairs.
[0195] Optionally, at different grayscales, a pixel block in the central area of the target image data is obtained, and brightness data of the pixel block in the central area is obtained, and the brightness data of the pixel block in the central area is used as the standard brightness lum_mid[i]. Optionally, the size of the central area can be 40x40 pixels.
[0196] Optionally, the grayscale-brightness relationship of each sub-pixel is calculated according to lum1[i] and lum_mid[i], and the brightness lum_mid[i] of the center area of the screen at the current grayscale is substituted into formula (35) to obtain the grayscale compensation value of each area. The grayscale-brightness relationship can be solved by setting the equation group:
[0197]
[0198] Given the gray1 grayscale of each sub-pixel and the corresponding brightness lum1[i], i∈[32, 64, 128, 192, 224], we can solve for the parameters gamma1 and b1. The brightness lum_mid[i] corresponding to the center area of the screen has a grayscale of gray[i], i∈[16, 32, 96, 160, 192, 224], and we can solve for the parameters gamma[i] and b.
[0199] After solving for gamma[i] and b, according to the grayscale-brightness relationship of R, G, B sub-pixels, lg(lum1[i])=gamma1*lg(gray[i])+b1, substitute the corrected brightness lum_mi[i] of the center of the screen into the equation, and the grayscale difference can be solved as:
[0200]
[0201] According to formula (36), the compensation value can be obtained as the compensation value corresponding to the current grayscale as well as
[0202] Optionally, the compensation value obtained by solving as well as Compensation of target image data is achieved, and compensated target image data is obtained and output.
[0203] In the above-mentioned image data processing method, the acquired image data to be processed is corrected, so that the accuracy of the data when the image data to be processed is compensated by using the compensation algorithm can be improved, the accuracy of the compensated image data can be guaranteed, and the display effect of the image data can be improved. Moreover, in the above-mentioned image data processing method, when correcting the acquired image data to be processed, different correction levels are set, and correction is achieved using different correction levels, which can ensure the correction effect, improve the processing of the corrected data, and ensure the image display effect.
[0204] In an exemplary embodiment, Figure 7 As shown, an image data processing method is provided, and the method is applied to a terminal as an example for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps 302 to 328:
[0205] Step 302: Acquire image data to be processed, and divide the image data to be processed into a plurality of pixel blocks to be processed.
[0206] Step 304: determine a standard pixel block from the plurality of pixel blocks to be processed.
[0207] Optionally, the standard pixel block is located in a central area of the image data to be processed.
[0208] Step 306: Select any pixel block to be processed except the standard pixel block from the plurality of pixel blocks to be processed.
[0209] Step 308 , obtaining the third brightness data of each first sub-pixel block of any pixel block to be processed and the fourth brightness data of the standard pixel block.
[0210] Step 310: Calculate each first brightness difference between each third brightness data and the fourth brightness data, and count the number of times the first brightness difference is greater than a first preset brightness difference.
[0211] Step 312, determine whether the number is greater than a preset number, if so, execute step 314, if not, execute step 326.
[0212] Step 314: determine any pixel block to be processed as a target pixel block to be processed.
[0213] Step 316: Obtain the adjacent pixel blocks of the target pixel block to be processed.
[0214] Step 318: Acquire the first brightness data of the target pixel block to be processed and the second brightness data of the adjacent pixel blocks.
[0215] Step 320: Determine a correction level corresponding to the target pixel block to be processed according to the first brightness data and the second brightness data.
[0216] Step 322: Correct the target pixel block to be processed according to the correction level.
[0217] Step 324, generating target image data according to the corrected target pixel block to be processed.
[0218] Step 326 , determining whether there are other pixel blocks to be processed, if so, executing step 306 , if not, executing step 328 .
[0219] Step 328: output the target image data.
[0220] In this embodiment, the acquired image data to be processed is corrected, so that the accuracy of the data can be improved when the image data to be processed is compensated by using a compensation algorithm, the accuracy of the compensated image data is guaranteed, and the display effect of the image data is improved. Moreover, in the above-mentioned image data processing method, when correcting the acquired image data to be processed, different correction levels are set, and correction is performed using different correction levels, which can ensure the correction effect, improve the processing of the corrected data, and ensure the image display effect.
[0221] In an exemplary embodiment, Figure 8 As shown, a method for processing image data is provided, and the method is applied to Figure 1 The terminal in the example is used for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps 402 to 424:
[0222] Step 402: Acquire a target pixel block to be processed and adjacent pixel blocks of the target pixel block to be processed.
[0223] Step 404 , obtaining fifth brightness data of the second sub-pixel block in the target pixel block to be processed and sixth brightness data of the third sub-pixel block in the adjacent pixel block.
[0224] Optionally, the second sub-pixel block and the third sub-pixel block have the same boundary line and are symmetrical along the boundary line, or the second sub-pixel block and the third sub-pixel block are diagonally symmetrical.
[0225] Optionally, the fifth brightness data includes a first brightness error value of the first pixel and a second brightness error value of the second pixel, the sixth brightness data includes a third brightness error value of the third pixel and a fourth brightness error value of the fourth pixel, the first pixel and the fourth pixel are symmetrical along the boundary line, or the first pixel and the fourth pixel are diagonally symmetrical; the second pixel and the third pixel are located between the first pixel and the fourth pixel.
[0226] Step 406 , generating a first brightness error gradient value according to the first brightness error value, the second brightness error value, and the third brightness error value.
[0227] Step 408 , generating a second brightness error gradient value according to the second brightness error value, the third brightness error value, and the fourth brightness error value.
[0228] Step 410: Determine a second brightness difference value based on the first brightness error gradient value and the second brightness error gradient value.
[0229] Step 412, determining whether the second brightness difference is greater than the second preset brightness difference, if so, executing step 414, if not, executing step 422.
[0230] Step 414: determine a third brightness difference between the first brightness error value and the second brightness error value, and a fourth brightness difference between the third brightness error value and the fourth brightness error value.
[0231] Step 416, determining a correction level according to the first brightness error gradient value, the second brightness error gradient value, the third brightness difference value, and the fourth brightness difference value.
[0232] Step 418: correct the target pixel block to be processed according to the correction level.
[0233] Step 420: Generate target image data according to the corrected target pixel block to be processed.
[0234] Step 422 , determine whether there are other target pixel blocks to be processed, if so, execute 402 , if not, execute step 424 .
[0235] Step 424, output the target image data.
[0236] In this embodiment, the acquired image data to be processed is corrected, so that the accuracy of the data can be improved when the image data to be processed is compensated by using a compensation algorithm, the accuracy of the compensated image data is guaranteed, and the display effect of the image data is improved. Moreover, in the above-mentioned image data processing method, when correcting the acquired image data to be processed, different correction levels are set, and correction is performed using different correction levels, which can ensure the correction effect, improve the processing of the corrected data, and ensure the image display effect.
[0237] In an exemplary embodiment, Fig. 9 As shown, an image data processing method is provided, and the method is applied to a terminal as an example for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps 502 to 520:
[0238] Step 502: Acquire a target pixel block to be processed and adjacent pixel blocks of the target pixel block to be processed.
[0239] Step 504: Acquire first brightness data of the target pixel block to be processed and second brightness data of adjacent pixel blocks.
[0240] Step 506: Determine a correction level corresponding to the target pixel block to be processed according to the first brightness data and the second brightness data.
[0241] Step 508 , determining whether the correction level is the first correction level, if so, executing step 510 , if not, executing step 514 .
[0242] Step 510: Obtain a first preset number of first pixels to be corrected.
[0243] Step 512: determine a first correction strategy according to the first correction level, and use the first correction strategy to correct the first pixel to be corrected.
[0244] Step 514: Obtain a second preset number of second pixels to be corrected.
[0245] Optionally, the second preset number is smaller than the first preset number.
[0246] Step 516, determining a second correction strategy according to the second correction level, and correcting the second pixel to be corrected using the second correction strategy.
[0247] The pixel correction strength corresponding to the second correction strategy is smaller than the pixel correction strength corresponding to the first correction strategy.
[0248] Step 518: Generate a corrected target pixel block to be processed according to the corrected first pixel point to be corrected and / or the corrected second pixel point to be corrected.
[0249] Step 520: Generate target image data according to the corrected target pixel block to be processed.
[0250] In this embodiment, the acquired image data to be processed is corrected, so that the accuracy of the data can be improved when the image data to be processed is compensated by using a compensation algorithm, the accuracy of the compensated image data is guaranteed, and the display effect of the image data is improved. Moreover, in the above-mentioned image data processing method, when correcting the acquired image data to be processed, different correction levels are set, and correction is performed using different correction levels, which can ensure the correction effect, improve the processing of the corrected data, and ensure the image display effect.
[0251] In an exemplary embodiment, Fig.10 As shown, an image data processing method is provided, and the method is applied to a terminal as an example for explanation. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps 602 to 646:
[0252] Step 602: Acquire a target pixel block to be processed and adjacent pixel blocks of the target pixel block to be processed.
[0253] Step 604 , obtaining fifth brightness data of the second sub-pixel block in the target pixel block to be processed and sixth brightness data of the third sub-pixel block in the adjacent pixel block.
[0254] Optionally, the second sub-pixel block and the third sub-pixel block have the same boundary line and are symmetrical along the boundary line, or the second sub-pixel block and the third sub-pixel block are diagonally symmetrical.
[0255] Optionally, the fifth brightness data includes a first brightness error value of the first pixel and a second brightness error value of the second pixel, the sixth brightness data includes a third brightness error value of the third pixel and a fourth brightness error value of the fourth pixel, the first pixel and the fourth pixel are symmetrical along the boundary line, or the first pixel and the fourth pixel are diagonally symmetrical; the second pixel and the third pixel are located between the first pixel and the fourth pixel.
[0256] Optionally, the first brightness error value of the first pixel includes the brightness error value of the first sub-pixel and the brightness error value of the second sub-pixel, the second brightness error value of the second pixel includes the brightness error value of the third sub-pixel and the brightness error value of the fourth sub-pixel, the third brightness error value of the third pixel includes the brightness error value of the fifth sub-pixel and the brightness error value of the sixth sub-pixel, and the fourth brightness error value of the fourth pixel includes the brightness error value of the seventh sub-pixel and the brightness error value of the eighth sub-pixel.
[0257] Step 606 , generating a first sub-brightness error gradient value according to the brightness error value of the first sub-pixel point, the brightness error value of the third sub-pixel point, and the brightness error value of the fifth sub-pixel point.
[0258] Step 608 , generating a second sub-brightness error gradient value according to the brightness error value of the third sub-pixel point, the brightness error value of the fifth sub-pixel point, and the brightness error value of the seventh sub-pixel point.
[0259] Step 610: Generate a third sub-brightness error gradient value according to the brightness error value of the second sub-pixel, the brightness error value of the fourth sub-pixel, and the brightness error value of the sixth sub-pixel.
[0260] Step 612: Generate a fourth sub-brightness error gradient value according to the brightness error value of the fourth sub-pixel, the brightness error value of the sixth sub-pixel, and the brightness error value of the eighth sub-pixel.
[0261] Step 614: Generate a first brightness error gradient value according to the first sub-brightness error gradient value and the second sub-brightness error gradient value, and generate a second brightness error gradient value according to the third sub-brightness error gradient value and the fourth sub-brightness error gradient value.
[0262] Step 616: Determine a second brightness difference value based on the first brightness error gradient value and the second brightness error gradient value.
[0263] Step 618 , determining whether the second brightness difference is greater than the second preset brightness difference, if so, executing step 620 , if not, executing step 644 .
[0264] Step 620, obtaining first brightness data of the target pixel block to be processed and second brightness data of adjacent pixel blocks, and determining a correction level corresponding to the target pixel block to be processed according to the first brightness data and the second brightness data.
[0265] Step 622, determine whether the correction level is the first correction level, if so, execute step 624, if not, execute step 626.
[0266] Step 624 , obtaining a first preset number of first pixels to be corrected, and correcting the first pixels to be corrected using a first correction strategy corresponding to a first correction level.
[0267] Step 626 , determining whether the first sub-brightness error gradient value is greater than a preset correction level coefficient, if so, executing step 628 , if not, executing step 630 .
[0268] Step 628 , extract the fifth sub-pixel point as the second pixel point to be corrected, and execute step 630 .
[0269] Step 630 , determining whether the second sub-brightness error gradient value is greater than a preset correction level coefficient, if so, executing step 632 , if not, executing step 634 .
[0270] Step 632 , extract the third sub-pixel point, update the second pixel point to be corrected, and execute step 634 .
[0271] Step 634 , determining whether the third sub-brightness error gradient value is greater than a preset correction level coefficient, if so, executing step 636 , if not, executing step 638 .
[0272] Step 636 , extract the sixth sub-pixel point, update the second pixel point to be corrected, and execute step 638 .
[0273] Step 638, determining whether the fourth sub-brightness error gradient value is greater than the preset correction level coefficient, if so, executing step 640, if not, executing step 642.
[0274] Step 640 , extract the fourth sub-pixel point, update the second pixel point to be corrected, and execute step 642 .
[0275] Step 642: Correct the updated second pixel to be corrected using the second correction strategy corresponding to the second correction level.
[0276] Step 644 , determining whether there are other target pixel blocks to be processed, if so, executing step 602 , if not, executing step 646 .
[0277] Step 646, generating target image data according to the corrected first pixel point to be corrected and the corrected second pixel point to be corrected.
[0278] In this embodiment, the acquired image data to be processed is corrected, so that the accuracy of the data can be improved when the image data to be processed is compensated by using a compensation algorithm, the accuracy of the compensated image data is guaranteed, and the display effect of the image data is improved. Moreover, in the above-mentioned image data processing method, when correcting the acquired image data to be processed, different correction levels are set, and correction is performed using different correction levels, which can ensure the correction effect, improve the processing of the corrected data, and ensure the image display effect.
[0279] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0280] Based on the same inventive concept, the embodiment of the present application also provides an image data processing device for implementing the image data processing method involved above. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above method, so the specific limitations in one or more image data processing device embodiments provided below can refer to the limitations of the image data processing method above, and will not be repeated here.
[0281] In an exemplary embodiment, Fig.11 As shown, an image data processing device 1100 is provided, comprising: a pixel block acquisition module 1102, a brightness data extraction module 1104, a correction level determination module 1106, a correction module 1108 and a target image generation module 1110, wherein:
[0282] The pixel block acquisition module 1102 is used to acquire a target pixel block to be processed and pixel blocks adjacent to the target pixel block to be processed.
[0283] The brightness data extraction module 1104 is used to obtain first brightness data of the target pixel block to be processed and second brightness data of the adjacent pixel blocks.
[0284] The correction level determination module 1106 is used to determine the correction level corresponding to the target pixel block to be processed according to the first brightness data and the second brightness data.
[0285] The correction module 1108 is used to correct the target pixel block to be processed according to the correction level.
[0286] The target image generation module 1110 is used to generate target image data according to the modified target pixel block to be processed.
[0287] In one embodiment, the image data processing device also includes a pixel block determination module, which is used to obtain image data to be processed and divide the image data to be processed into multiple pixel blocks to be processed; determine a standard pixel block from the multiple pixel blocks to be processed, and the standard pixel block is located in the central area of the image data to be processed; select any pixel block to be processed except the standard pixel block from the multiple pixel blocks to be processed; obtain the third brightness data of each first sub-pixel block in any pixel block to be processed, and the fourth brightness data of the standard pixel block; calculate each first brightness difference between each third brightness data and the fourth brightness data; when the first brightness difference is greater than the first preset brightness difference value for more than a preset number of times, determine any pixel block to be processed as a target pixel block to be processed.
[0288] In one embodiment, the image data processing device also includes a judgment module, which is used to obtain fifth brightness data of a second sub-pixel block in a target pixel block to be processed, and sixth brightness data of a third sub-pixel block in an adjacent pixel block, the second sub-pixel block and the third sub-pixel block have the same boundary line and are symmetrical along the boundary line, or the second sub-pixel block and the third sub-pixel block are diagonally symmetrical; according to the fifth brightness data and the sixth brightness data, a second brightness difference between the second sub-pixel block and the third sub-pixel block is determined; when the second brightness difference is greater than a second preset brightness difference, a correction level corresponding to the target pixel block to be processed is determined according to the first brightness data and the second brightness data.
[0289] In one embodiment, the fifth brightness data includes a first brightness error value of a first pixel and a second brightness error value of a second pixel, the sixth brightness data includes a third brightness error value of a third pixel and a fourth brightness error value of a fourth pixel, the first pixel and the fourth pixel are symmetrical along a boundary line, or the first pixel and the fourth pixel are diagonally symmetrical; the second pixel and the third pixel are located between the first pixel and the fourth pixel; the judgment module is further used to generate a first brightness error gradient value based on the first brightness error value, the second brightness error value and the third brightness error value; generate a second brightness error gradient value based on the second brightness error value, the third brightness error value and the fourth brightness error value; and determine a second brightness difference value based on the first brightness error gradient value and the second brightness error gradient value.
[0290] In an optional embodiment, the first brightness error value of the first pixel includes the brightness error value of the first sub-pixel and the brightness error value of the second sub-pixel, the second brightness error value of the second pixel includes the brightness error value of the third sub-pixel and the brightness error value of the fourth sub-pixel, the third brightness error value of the third pixel includes the brightness error value of the fifth sub-pixel and the brightness error value of the sixth sub-pixel, and the fourth brightness error value of the fourth pixel includes the brightness error value of the seventh sub-pixel and the brightness error value of the eighth sub-pixel. The judgment module is further used to generate a first sub-brightness error gradient value according to the brightness error value of the first sub-pixel, the brightness error value of the third sub-pixel, and the brightness error value of the fifth sub-pixel, and the judgment module generates a first sub-brightness error gradient value according to the brightness error value of the third sub-pixel and the brightness error value of the fifth sub-pixel. The first brightness error gradient value is determined according to the first brightness error gradient value and the second brightness error gradient value; the third brightness error gradient value is generated according to the brightness error value of the second sub-pixel, the brightness error value of the fourth sub-pixel and the brightness error value of the sixth sub-pixel; the fourth brightness error gradient value is generated according to the brightness error value of the fourth sub-pixel, the brightness error value of the sixth sub-pixel and the brightness error value of the eighth sub-pixel; the second brightness error gradient value is determined according to the third brightness error gradient value and the fourth brightness error gradient value.
[0291] In an optional embodiment, the correction level determination module is further used to determine a third brightness difference between the first brightness error value and the second brightness error value, and a fourth brightness difference between the third brightness error value and the fourth brightness error value; and determine the correction level according to the first brightness error gradient value, the second brightness error gradient value, the third brightness difference value and the fourth brightness difference value.
[0292] In one embodiment, the correction module is further used to obtain a first preset number of first pixels to be corrected when the correction level is a first correction level; determine a first correction strategy according to the first correction level, and correct the first pixels to be corrected using the first correction strategy.
[0293] In one embodiment, the correction module is also used to obtain a second preset number of pixels to be corrected when the correction level is a second correction level; the second preset number is less than the first preset number; determine a second correction strategy according to the second correction level, and use the second correction strategy to correct the second pixels to be corrected; wherein the pixel correction intensity corresponding to the second correction strategy is less than the pixel correction intensity corresponding to the first correction strategy.
[0294] In one embodiment, the correction module is also used to set the fifth pixel point as the pixel point to be corrected when the first brightness error gradient value is greater than the preset correction level coefficient; set the fourth pixel point as the pixel point to be corrected when the second brightness error gradient value is greater than the preset correction level coefficient; set the sixth sub-pixel point as the second pixel point to be corrected when the third sub-brightness error gradient value is greater than the preset correction level coefficient; and set the fourth sub-pixel point as the second pixel point to be corrected when the fourth sub-brightness error gradient value is greater than the preset correction level coefficient.
[0295] Each module in the above-mentioned image data processing device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0296] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.12 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (Near Field Communication, NFC) or other technologies. When the computer program is executed by the processor, an image data processing method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0297] Those skilled in the art will understand that Fig.12The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0298] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned method embodiments when executing the computer program.
[0299] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method embodiments are implemented.
[0300] In one embodiment, a computer program product is provided, including a computer program, which implements the steps of the above-mentioned method embodiments when executed by a processor.
[0301] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0302] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0303] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0304] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for processing image data, characterized in that: The method comprises: Acquire a target pixel block to be processed and adjacent pixel blocks of the target pixel block to be processed; Acquire first brightness data of the target pixel block to be processed and second brightness data of the adjacent pixel block; Determining a correction level corresponding to the target pixel block to be processed according to the first brightness data and the second brightness data; Correcting the target pixel block to be processed according to the correction level; Generate target image data according to the corrected target pixel block to be processed.
2. The method according to claim 1, characterized in that Before obtaining the target pixel block to be processed, the method further includes: Acquire image data to be processed, and divide the image data to be processed into a plurality of pixel blocks to be processed; Determine a standard pixel block from the plurality of pixel blocks to be processed, wherein the standard pixel block is located in a data center area of the image to be processed; Selecting any pixel block to be processed except the standard pixel block from the plurality of pixel blocks to be processed; Acquire the third brightness data of each first sub-pixel block in any pixel block to be processed, and the fourth brightness data of the standard pixel block; Calculating each first brightness difference between each of the third brightness data and the fourth brightness data; When the number of times that the first brightness difference value is greater than the first preset brightness difference value is greater than a preset number, the any pixel block to be processed is determined as the target pixel block to be processed.
3. The method according to claim 1, characterized in that Before determining the correction level corresponding to the target pixel block to be processed according to the first brightness data and the second brightness data, the method further includes: Acquire fifth brightness data of a second sub-pixel block in the target pixel block to be processed, and sixth brightness data of a third sub-pixel block in the adjacent pixel block, wherein the second sub-pixel block and the third sub-pixel block have the same boundary line and are symmetrical along the boundary line, or the second sub-pixel block and the third sub-pixel block are diagonally symmetrical; Determine a second brightness difference between the second sub-pixel block and the third sub-pixel block according to the fifth brightness data and the sixth brightness data; When the second brightness difference value is greater than a second preset brightness difference value, the step of determining a correction level corresponding to the target pixel block to be processed according to the first brightness data and the second brightness data is performed.
4. The method according to claim 3, characterized in that The fifth brightness data includes a first brightness error value of a first pixel and a second brightness error value of a second pixel, the sixth brightness data includes a third brightness error value of a third pixel and a fourth brightness error value of a fourth pixel, the first pixel and the fourth pixel are symmetrical along the boundary line, or the first pixel and the fourth pixel are diagonally symmetrical; the second pixel and the third pixel are located between the first pixel and the fourth pixel; The determining, according to the fifth brightness data and the sixth brightness data, a second brightness difference between the second sub-pixel block and the third sub-pixel block comprises: generating a first brightness error gradient value according to the first brightness error value, the second brightness error value, and the third brightness error value; generating a second brightness error gradient value according to the second brightness error value, the third brightness error value and the fourth brightness error value; The second brightness difference value is determined based on the first brightness error gradient value and the second brightness error gradient value.
5. The method according to claim 4, characterized in that The first brightness error value of the first pixel includes the brightness error value of the first sub-pixel and the brightness error value of the second sub-pixel, the second brightness error value of the second pixel includes the brightness error value of the third sub-pixel and the brightness error value of the fourth sub-pixel, the third brightness error value of the third pixel includes the brightness error value of the fifth sub-pixel and the brightness error value of the sixth sub-pixel, and the fourth brightness error value of the fourth pixel includes the brightness error value of the seventh sub-pixel and the brightness error value of the eighth sub-pixel; The generating a first brightness error gradient value according to the first brightness error value, the second brightness error value and the third brightness error value comprises: generating a first sub-brightness error gradient value according to the brightness error value of the first sub-pixel point, the brightness error value of the third sub-pixel point, and the brightness error value of the fifth sub-pixel point; generating a second sub-brightness error gradient value according to the brightness error value of the third sub-pixel point, the brightness error value of the fifth sub-pixel point, and the brightness error value of the seventh sub-pixel point; Determining the first brightness error gradient value according to the first sub-brightness error gradient value and the second sub-brightness error gradient value; The step of generating a second brightness error gradient value according to the second brightness error value, the third brightness error value, and the fourth brightness error value comprises: generating a third sub-brightness error gradient value according to the brightness error value of the second sub-pixel point, the brightness error value of the fourth sub-pixel point, and the brightness error value of the sixth sub-pixel point; generating a fourth sub-brightness error gradient value according to the brightness error value of the fourth sub-pixel point, the brightness error value of the sixth sub-pixel point, and the brightness error value of the eighth sub-pixel point; The second brightness error gradient value is determined according to the third sub-brightness error gradient value and the fourth sub-brightness error gradient value.
6. The method according to claim 4, characterized in that The step of determining the correction level corresponding to the target pixel block to be processed according to the first brightness data and the second brightness data includes: determining a third brightness difference value between the first brightness error value and the second brightness error value, and a fourth brightness difference value between the third brightness error value and a fourth brightness error value; The correction level is determined according to the first brightness error gradient value, the second brightness error gradient value, the third brightness difference value, and the fourth brightness difference value.
7. The method according to claim 5 or 6, characterized in that: The step of correcting the target pixel block to be processed according to the correction level includes: When the correction level is the first correction level, obtaining a first preset number of first pixels to be corrected; Determining a first correction strategy according to the first correction level, and correcting the first pixel to be corrected by using the first correction strategy; When the correction level is the second correction level, obtaining a second preset number of second pixels to be corrected; the second preset number is less than the first preset number; A second correction strategy is determined according to the second correction level, and the second pixel to be corrected is corrected using the second correction strategy; wherein the pixel correction strength corresponding to the second correction strategy is less than the pixel correction strength corresponding to the first correction strategy.
8. The method according to claim 7, characterized in that The step of obtaining a second preset number of second pixels to be corrected includes: When the first sub-brightness error gradient value is greater than a preset correction level coefficient, setting the fifth sub-pixel point as the second pixel point to be corrected; When the second sub-brightness error gradient value is greater than the preset correction level coefficient, setting the third sub-pixel point as the second pixel point to be corrected; When the third sub-brightness error gradient value is greater than a preset correction level coefficient, setting the sixth sub-pixel point as the second pixel point to be corrected; When the fourth sub-brightness error gradient value is greater than the preset correction level coefficient, the fourth sub-pixel point is set as the second pixel point to be corrected.
9. An image data processing device, characterized in that: The device comprises: A pixel block acquisition module, used to acquire a target pixel block to be processed and adjacent pixel blocks of the target pixel block to be processed; A brightness data extraction module, used to obtain first brightness data of the target pixel block to be processed and second brightness data of the adjacent pixel block; A correction level determination module, configured to determine a correction level corresponding to the target pixel block to be processed according to the first brightness data and the second brightness data; A correction module, used for correcting the target pixel block to be processed according to the correction level; The target image generation module is used to generate target image data according to the corrected target pixel block to be processed.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
