Image adjustment method and device
By adjusting the pixel values of the first and second pixels in the central area of the image, the crosstalk problem caused by setting the PD sub-pixel is solved, and the image display effect is improved.
Patent Information
- Application Number
- CN202110221195.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-26
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2041-02-26
AI Technical Summary
In the prior art, the crosstalk problem caused by setting PD sub-pixels affects the image display effect and causes inaccurate image adjustment.
By determining a first pixel and at least one second pixel in the central area of the original image, the pixel value of the first type sub-pixel in the second pixel is adjusted according to the pixel value of the first type sub-pixel in the first pixel set, and the pixel value of the PD sub-pixel is adjusted in combination with the pixel values in the original image and the PD image.
The crosstalk problem caused by setting PD sub-pixels is solved, and the image display effect is improved.
Smart Images

Figure CN114979412B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer communication technology, and in particular to an image adjustment method and device. Background Art
[0002] Phase Detection Auto Focus (PDAF) means phase detection auto focus. To achieve phase focus, some PD (Phase Detection) sub-pixels are added, among which some PD sub-pixels only allow light from the left to pass through, and other PD sub-pixels only allow light from the right to pass through.
[0003] In the related art, PD sub-pixels are extracted from the original image, and a PD image is formed by the PD sub-pixels. According to the original image and the pixel values in the PD image, the pixel values of the PD sub-pixels in the original image are adjusted to improve the image display effect.
[0004] Since setting PD pixels will cause crosstalk problems and affect the pixel values of pixels around the PD pixels, the above method is used to adjust the pixel values of the PD sub-pixels. The obtained adjustment result is inaccurate and the image display effect is poor. Summary of the Invention
[0005] To overcome the problems existing in the related art, the present disclosure provides an image adjustment method and device.
[0006] According to a first aspect of an embodiment of the present disclosure, there is provided an image adjustment method, the method comprising:
[0007] Determine a first pixel and at least one second pixel in a central area of the original image, wherein the first pixel includes a PD sub-pixel and the first pixel is adjacent to each second pixel;
[0008] For each second pixel, determining a set of first pixels located around the second pixel in the original image;
[0009] adjusting pixel values of first-type sub-pixels in the second pixel set according to pixel values of first-type sub-pixels in the first pixel set, wherein the first-type sub-pixels and the PD sub-pixels have the same target sub-pixel type;
[0010] When obtaining the PD image corresponding to the original image, the pixel value of the PD sub-pixel in the original image is adjusted according to the pixel value of the target sub-pixel in the central area of the adjusted original image and the pixel value of the PD sub-pixel in the PD image, and the target sub-pixel has the target sub-pixel type.
[0011] Optionally, the first pixel set located around the second pixel includes: a plurality of first adjacent pixels adjacent to the second pixel, and a plurality of second adjacent pixels adjacent to each of the first adjacent pixels; the pixel value of the first type sub-pixel in the second pixel is equal to the weighted sum of the pixel values of the first type sub-pixels in the plurality of first adjacent pixels;
[0012] The adjusting the pixel values of the first-type sub-pixels in the second pixel set according to the pixel values of the first-type sub-pixels in the first pixel set includes:
[0013] Calculating a weight value used by each first adjacent pixel according to the pixel value of the first type sub-pixel in each first adjacent pixel and each second adjacent pixel;
[0014] Calculating a multiplication result of a pixel value of a first-type sub-pixel in each first-adjacent pixel and a corresponding weight value;
[0015] The pixel value of the first type sub-pixel in the second pixel is adjusted to the sum of all multiplication results.
[0016] Optionally, calculating the weight value used by each first adjacent pixel according to the pixel value of the first type sub-pixel in each first adjacent pixel and each second adjacent pixel includes:
[0017] Iteratively updating the weight values used for each of the first-neighboring pixels according to the pixel values of the first-type sub-pixels in each of the first-neighboring pixels and the pixel values of the first-type sub-pixels in each of the second-neighboring pixels;
[0018] After iterating to a first preset number of times, obtaining the weight value currently used by each of the first adjacent pixels; or,
[0019] After iterating until the first pixel value difference is less than a first preset value, the weight value currently used by each of the first adjacent pixels is obtained, where the first pixel value difference is determined based on the weight value used by each of the first adjacent pixels.
[0020] Optionally, calculating the weight value used by each first adjacent pixel according to the pixel value of the first type sub-pixel in each first adjacent pixel and each second adjacent pixel includes:
[0021] For each first neighboring pixel, calculating a mean square difference between a first pixel value set and pixel values of first-type sub-pixels in the first neighboring pixel, the first pixel value set including: pixel values of first-type sub-pixels in a plurality of second neighboring pixels adjacent to the first neighboring pixel;
[0022] Determine a weight value used by each of the first adjacent pixels when all mean square errors meet a first preset condition.
[0023] Optionally, adjusting the pixel value of the PD sub-pixel in the original image according to the adjusted pixel value of the target sub-pixel in the central area of the original image and the pixel value of the PD sub-pixel in the PD image includes:
[0024] determining a second pixel set located around the first pixel in a central area of the adjusted original image, the second pixel set including the second pixel whose pixel value is adjusted;
[0025] Adjusting the pixel value of the PD sub-pixel in the first pixel according to the pixel value of the first type sub-pixel in the second pixel set;
[0026] The pixel value of the PD sub-pixel in the original image is adjusted according to the pixel value of the target sub-pixel in the central area of the original image after secondary adjustment and the pixel value of the PD sub-pixel in the PD image.
[0027] Optionally, the second pixel set includes: a plurality of second pixels adjacent to the first pixel, and a plurality of first adjacent pixels adjacent to each second pixel; a pixel value of a PD sub-pixel in the first pixel is equal to a weighted sum of pixel values of first-type sub-pixels in the plurality of second pixels;
[0028] The adjusting the pixel value of the PD sub-pixel in the first pixel according to the pixel value of the first type sub-pixel in the second pixel set includes:
[0029] Calculating a weight value used by each second pixel according to the pixel value of each second pixel and the first type sub-pixel in each first adjacent pixel;
[0030] Calculating a multiplication result of a pixel value of a first-type sub-pixel in each second pixel and a corresponding weight value;
[0031] The pixel value of the PD sub-pixel in the first pixel is adjusted to the sum of all multiplication results.
[0032] Optionally, calculating the weight value used by each second pixel according to the pixel value of each second pixel and the pixel value of the first type sub-pixel in each first adjacent pixel includes:
[0033] Iteratively updating a weight value used for each of the second pixels according to a pixel value of a first-type sub-pixel in each of the second pixels and a pixel value of a first-type sub-pixel in each of the first adjacent pixels;
[0034] After iterating to a second preset number of times, obtaining the weight value currently used by each second pixel; or,
[0035] After iterating until the second pixel value difference is less than a second preset value, the weight value currently used by each second pixel is obtained, where the second pixel value difference is determined according to the weight value used by each second pixel.
[0036] Optionally, calculating the weight value used by each second pixel according to the pixel value of each second pixel and the pixel value of the first type sub-pixel in each first adjacent pixel includes:
[0037] For each second pixel, calculating a mean square difference between a second pixel value set and pixel values of first-type sub-pixels in the second pixel, where the second pixel value set includes: pixel values of first-type sub-pixels in a plurality of first adjacent pixels adjacent to the second pixel;
[0038] Determine a weight value used by each second pixel when all mean square errors meet a second preset condition.
[0039] According to a second aspect of an embodiment of the present disclosure, there is provided an image adjustment device, the device comprising:
[0040] A pixel determination module is configured to determine a first pixel and at least one second pixel in a central area of an original image, wherein the first pixel includes a PD sub-pixel and is adjacent to each second pixel;
[0041] a set determining module configured to determine, for each second pixel, a set of first pixels located around the second pixel in the original image;
[0042] a first pixel value adjustment module configured to adjust pixel values of first-type sub-pixels in the second pixel set according to pixel values of first-type sub-pixels in the first pixel set, wherein the first-type sub-pixels and the PD sub-pixels have the same target sub-pixel type;
[0043] The second pixel value adjustment module is configured to adjust the pixel value of the PD sub-pixel in the original image according to the pixel value of the target sub-pixel in the central area of the adjusted original image and the pixel value of the PD sub-pixel in the PD image when obtaining the PD image corresponding to the original image, and the target sub-pixel has the target sub-pixel type.
[0044] Optionally, the first pixel set located around the second pixel includes: a plurality of first adjacent pixels adjacent to the second pixel, and a plurality of second adjacent pixels adjacent to each of the first adjacent pixels; the pixel value of the first type sub-pixel in the second pixel is equal to the weighted sum of the pixel values of the first type sub-pixels in the plurality of first adjacent pixels;
[0045] The first pixel value adjustment module includes:
[0046] a weight value calculation submodule configured to calculate a weight value used by each first adjacent pixel according to the pixel value of the first type sub-pixel in each first adjacent pixel and each second adjacent pixel;
[0047] a data calculation submodule configured to calculate a multiplication result of a pixel value of a first type sub-pixel in each first adjacent pixel and a corresponding weight value;
[0048] The first pixel value adjustment submodule is configured to adjust the pixel value of the first type sub-pixel in the second pixel to the sum of all multiplication results.
[0049] Optionally, the weight value calculation submodule includes:
[0050] a weight value iteration unit configured to iteratively update the weight value used by each of the first adjacent pixels according to the pixel value of the first type sub-pixel in each of the first adjacent pixels and the pixel value of the first type sub-pixel in each of the second adjacent pixels;
[0051] The first weight value acquisition unit is configured to acquire the weight value currently used by each of the first adjacent pixels after iterating to a first preset number of times; or
[0052] The second weight value acquisition unit is configured to iterate until the first pixel value difference is less than a first preset value, and then obtain the weight value currently used by each of the first adjacent pixels, wherein the first pixel value difference is determined based on the weight value used by each of the first adjacent pixels.
[0053] Optionally, the weight value calculation submodule includes:
[0054] a mean square error calculation unit configured to calculate, for each first neighboring pixel, a mean square error between a first pixel value set and pixel values of first-type sub-pixels in the first neighboring pixel, the first pixel value set comprising: pixel values of first-type sub-pixels in a plurality of second neighboring pixels adjacent to the first neighboring pixel;
[0055] The weight value determining unit is configured to determine the weight value used by each of the first adjacent pixels when all mean square errors meet a first preset condition.
[0056] Optionally, the second pixel value adjustment module includes:
[0057] a set determining submodule configured to determine a second pixel set located around the first pixel in a central area of the adjusted original image, wherein the second pixel set includes the second pixel whose pixel value is adjusted;
[0058] a second pixel value adjustment submodule, configured to adjust the pixel value of the PD sub-pixel in the first pixel according to the pixel value of the first type sub-pixel in the second pixel set;
[0059] The third pixel value adjustment submodule is configured to adjust the pixel value of the PD subpixel in the original image according to the pixel value of the target subpixel in the central area of the original image after secondary adjustment and the pixel value of the PD subpixel in the PD image.
[0060] Optionally, the second pixel set includes: a plurality of second pixels adjacent to the first pixel, and a plurality of first adjacent pixels adjacent to each second pixel; a pixel value of a PD sub-pixel in the first pixel is equal to a weighted sum of pixel values of first-type sub-pixels in the plurality of second pixels;
[0061] The second pixel value adjustment submodule includes:
[0062] a weight value calculation unit configured to calculate a weight value used by each second pixel according to the pixel value of each second pixel and the pixel value of the first type sub-pixel in each first adjacent pixel;
[0063] a data calculation unit configured to calculate a multiplication result of a pixel value of a first-type sub-pixel in each second pixel and a corresponding weight value;
[0064] The pixel value adjustment unit is configured to adjust the pixel value of the PD sub-pixel in the first pixel to the sum of all multiplication results.
[0065] Optionally, the weight value calculation unit includes:
[0066] a weight value iteration subunit, configured to iteratively update the weight value used by each second pixel according to the pixel value of the first type sub-pixel in each second pixel and the pixel value of the first type sub-pixel in each first adjacent pixel;
[0067] The first weight value acquisition subunit is configured to acquire the weight value currently used by each second pixel after iterating to a second preset number of times; or
[0068] The second weight value acquisition subunit is configured to iterate until the second pixel value difference is less than a second preset value, and then obtain the weight value currently used by each second pixel, wherein the second pixel value difference is determined based on the weight value used by each second pixel.
[0069] Optionally, the weight value calculation unit includes:
[0070] a mean square error calculation subunit, configured to calculate, for each second pixel, a mean square error between a second pixel value set and pixel values of first-type sub-pixels in the second pixel, the second pixel value set including: pixel values of first-type sub-pixels in a plurality of first adjacent pixels adjacent to the second pixel;
[0071] The weight value determining subunit is configured to determine the weight value used by each second pixel when all mean square errors meet a second preset condition.
[0072] According to a third aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method according to any one of the above-mentioned first aspects is implemented.
[0073] According to a fourth aspect of the embodiments of the present disclosure, there is provided an electronic device, including:
[0074] processor;
[0075] a memory for storing processor-executable instructions;
[0076] Wherein, the processor is configured to:
[0077] Determine a first pixel and at least one second pixel in a central area of the original image, wherein the first pixel includes a PD sub-pixel and the first pixel is adjacent to each second pixel;
[0078] For each second pixel, determining a set of first pixels located around the second pixel in the original image;
[0079] adjusting pixel values of first-type sub-pixels in the second pixel set according to pixel values of first-type sub-pixels in the first pixel set, wherein the first-type sub-pixels and the PD sub-pixels have the same target sub-pixel type;
[0080] When obtaining the PD image corresponding to the original image, the pixel value of the PD sub-pixel in the original image is adjusted according to the pixel value of the target sub-pixel in the central area of the adjusted original image and the pixel value of the PD sub-pixel in the PD image, and the target sub-pixel has the target sub-pixel type.
[0081] The technical solutions provided by the embodiments of the present disclosure may have the following beneficial effects:
[0082] In the embodiment of the present disclosure, a first pixel and at least one second pixel in the central area of the original image are determined, the first pixel includes a PD sub-pixel, and the first pixel is adjacent to each second pixel. A first pixel set located around the second pixel in the original image is determined, and the pixel value of the first type sub-pixel in the second pixel is adjusted according to the pixel value of the first type sub-pixel in the first pixel set. The first type sub-pixel and the PD sub-pixel have the same target sub-pixel type, thereby solving the crosstalk problem caused by setting the PD sub-pixel in the related art and improving the image display effect.
[0083] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0084] Figure 1 is a flow chart of an image adjustment method according to an exemplary embodiment;
[0085] Figure 2 is a partial schematic diagram of a pixel panel according to an exemplary embodiment;
[0086] Figure 3 is a flow chart of another image adjustment method according to an exemplary embodiment;
[0087] Figure 4 is a flow chart of another image adjustment method according to an exemplary embodiment;
[0088] Figure 5 is a flow chart of another image adjustment method according to an exemplary embodiment;
[0089] Figure 6 is a block diagram of an image adjustment device according to an exemplary embodiment;
[0090] Figure 7 The figure is a schematic structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0091] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0092] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0093] It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information without departing from the scope of this disclosure. Depending on the context, the term "if" as used herein may be interpreted as "when," "when," or "in response to determining."
[0094] Figure 1 is a flow chart of an image adjustment method according to an exemplary embodiment. Figure 1 The methods shown include:
[0095] In step 101 , a first pixel and at least one second pixel in a central area of an original image are determined, where the first pixel includes a PD sub-pixel and is adjacent to each second pixel.
[0096] The original image may be an original RAW image captured by a camera, or may be an image obtained by cropping the original RAW image.
[0097] The position and size of the center area of the original image can be fixed, or can be determined according to the current original image. For example, the center point of the center area of the original image is the center point of the entire original image, and the height of the center area of the original image is the height of the entire original image. The width of the center area of the original image is equal to the width of the entire original image.
[0098] Typically, a pixel may include an R sub-pixel, a G sub-pixel, and a B sub-pixel. The sub-pixel type may include R type, G type, or B type. The sub-pixel type of a PD sub-pixel may be R type, G type, or B type. For example, the sub-pixel type of a PD sub-pixel is G type, and the PD sub-pixel is essentially a G sub-pixel.
[0099] When this step is performed, all second pixels adjacent to the first pixel in the central area of the original image may be determined.
[0100] In step 102 , for each second pixel, a set of first pixels located around the second pixel in the original image is determined.
[0101] The pixels in the first pixel set may be located in the central area of the original image, or may not be located in the central area of the original image.
[0102] For a pixel, the pixel values of adjacent pixels have a greater impact on the pixel value of the pixel itself. Based on this, the first pixel set located around the second pixel may include pixels adjacent to the second pixel.
[0103] In step 103 , the pixel values of the first type sub-pixels in the second pixel set are adjusted according to the pixel values of the first type sub-pixels in the first pixel set, where the first type sub-pixels and the PD sub-pixels have the same target sub-pixel type.
[0104] The sub-pixel type of the first type sub-pixel is the same as the sub-pixel type of the PD sub-pixel. For example, when the sub-pixel type of the PD sub-pixel is G, the sub-pixel type of the first type sub-pixel is also G, and the first type sub-pixel is a G sub-pixel.
[0105] A first-type sub-pixel may be a PD sub-pixel or a non-PD sub-pixel, and the PD sub-pixel and the non-PD sub-pixel have the same sub-pixel type.
[0106] Among the possible pixel arrangement structures, there are the following situations: the first situation: the first type of sub-pixels in the first pixel set include PD sub-pixels and non-PD sub-pixels; the second situation: the first type of sub-pixels in the first pixel set only include PD sub-pixels; the third situation: the first type of sub-pixels in the first pixel set only include non-PD sub-pixels.
[0107] In step 104, when the PD image corresponding to the original image is obtained, the pixel value of the PD sub-pixel in the original image is adjusted according to the pixel value of the target sub-pixel in the central area of the adjusted original image and the pixel value of the PD sub-pixel in the PD image, and the target sub-pixel has a target sub-pixel type.
[0108] The target sub-pixels may include: all sub-pixels having the target sub-pixel type in the central area of the original image, or the target sub-pixels may include: some sub-pixels having the target sub-pixel type in the central area of the original image.
[0109] PD sub-pixels are extracted from the original image, and a PD image is formed based on the extracted PD sub-pixels. For example, PD sub-pixels that allow light to escape from the left side are extracted from the original image, and a left PD image is formed from the extracted PD sub-pixels that allow light to escape from the left side. PD sub-pixels that allow light to escape from the right side are extracted from the original image, and a right PD image is formed from the extracted PD sub-pixels that allow light to escape from the right side.
[0110] For example, the pixel value of the PD sub-pixel in the original image that allows light to escape from the left side can be adjusted based on the pixel value of the target sub-pixel in the adjusted central area of the original image and the pixel value of the PD sub-pixel in the left PD image. The specific process is as follows: the left PD image is divided into multiple areas, and there are multiple target sub-pixels in the adjusted central area of the original image. The average pixel value N of the multiple target sub-pixels is determined. For each image area of the PD image, the average pixel value M of the multiple PD sub-pixels in the image area is determined, and the average pixel value M of the multiple PD sub-pixels in the image area is calculated. Will The pixel value compensation coefficient used for this image area.
[0111] Case 1: The pixel value compensation coefficient used by the PD sub-pixel in the image area is Can be multiplied The multiplication result is obtained by multiplying the pixel value of the PD sub-pixel in the image area, and the pixel value of the PD sub-pixel in the original image is adjusted to the multiplication result.
[0112] The second case: according to the pixel value compensation coefficients used by the two adjacent image areas, the pixel value compensation coefficients used by the PD sub-pixels in the two adjacent image areas are determined.
[0113] For example, there are adjacent image areas 1 and 2. The pixel value compensation coefficient used in image area 1 is Specifically, the PD sub-pixel located at the center of image area 1 uses The pixel value compensation coefficient used in image area 2 is Specifically, the pixel at the center of image region 2 is used The distance between the center points of image area 1 and image area 2 is d, and the calculation Obtain the pixel value compensation coefficient Q corresponding to the unit distance.
[0114] The distance between the PD sub-pixel q1 in image area 1 and the center point is d1, and the pixel value compensation coefficient used by q1 is Can be multiplied The pixel value of q1 is obtained by adding the pixel value of q1 to the target pixel value. The pixel value of q1 in the original image is adjusted to the target pixel value.
[0115] The distance between the PD sub-pixel q2 in image area 2 and the center point is d2, and the pixel value compensation coefficient used by q2 is Can be multiplied The pixel value of q2 is obtained by adding the pixel value of q2 and adjusting the pixel value of q2 in the original image to the target pixel value.
[0116] Similarly, the pixel value of the PD sub-pixel in the original image that allows light to escape from the right side can be adjusted based on the pixel value of the target sub-pixel in the adjusted central area of the original image and the pixel value of the PD sub-pixel in the right PD image.
[0117] In the embodiment of the present disclosure, a first pixel and at least one second pixel in the central area of the original image are determined, the first pixel includes a PD sub-pixel, and the first pixel is adjacent to each second pixel. A first pixel set located around the second pixel in the original image is determined, and the pixel value of the first type sub-pixel in the second pixel is adjusted according to the pixel value of the first type sub-pixel in the first pixel set. The first type sub-pixel and the PD sub-pixel have the same target sub-pixel type, thereby solving the crosstalk problem caused by setting the PD sub-pixel in the related art and improving the image display effect.
[0118] In one embodiment, the first pixel set located around the second pixel may include: a plurality of first adjacent pixels adjacent to the second pixel, and a plurality of second adjacent pixels adjacent to each of the first adjacent pixels.
[0119] For example, Figure 2 is a partial schematic diagram of a pixel panel according to an exemplary embodiment. Figure 2 , the first pixel a is close to the center of the original image, specifically located at the center of the original image, the second pixel b adjacent to the first pixel a is close to the center of the original image, the number of first-neighboring pixels c adjacent to the second pixel b is 8, and the number of second-neighboring pixels d adjacent to each first-neighboring pixel c is 8. The plurality of first-neighboring pixels c adjacent to the second pixel b includes the first pixel a, and the plurality of second-neighboring pixels d adjacent to the first-neighboring pixel c includes the second pixel b.
[0120] For another example, the first pixel is close to the edge of the original image, the second pixel adjacent to the first pixel is close to the edge of the original image, the number of first adjacent pixels adjacent to the second pixel may be less than 8, and the number of second adjacent pixels adjacent to each first adjacent pixel may be less than 8.
[0121] The pixel value of the first type sub-pixel in the second pixel is equal to the weighted sum of the pixel values of the first type sub-pixels in the plurality of first adjacent pixels.
[0122] Based on this, Figure 3is a flowchart of another image adjustment method according to an exemplary embodiment. Figure 3 , step 103 can be implemented in the following way:
[0123] In step 201 , a weight value used by each first adjacent pixel is calculated based on the pixel values of the first type sub-pixels in each first adjacent pixel and each second adjacent pixel.
[0124] In step 202 , a multiplication result of the pixel value of the first type sub-pixel in each first adjacent pixel and the corresponding weight value is calculated.
[0125] In step 203 , the pixel value of the first type sub-pixel in the second pixel is adjusted to the sum of all multiplication results.
[0126] For step 201, the first implementation method is: first, based on the pixel value of the first type sub-pixel in each first adjacent pixel and the pixel value of the first type sub-pixel in each second adjacent pixel, the weight value used by each first adjacent pixel is iteratively updated; second, after iterating to a first preset number of times, the weight value currently used by each first adjacent pixel is obtained.
[0127] For example, there are 8 first-adjacent pixels adjacent to the second pixel, and the pixel values of the first type sub-pixels in the 8 first-adjacent pixels are a0, b0, c0, d0, e0, f0, g0, and h0, respectively, and X is defined as (a0, b0, c0, d0, e0, f0, g0, and h0).
[0128] Each first adjacent pixel is adjacent to 8 second adjacent pixels. The 8 groups of second adjacent pixels adjacent to the 8 first adjacent pixels are: (a1, b1, c1, d1, e1, f1, g1, h1) to (a8, b8, c8, d8, e8, f8, g8, h8). Define X n =(a n 、b n 、c n d n 、e n 、f n 、g n 、h n ).
[0129] When performing the first iteration, n=1.
[0130] Input data u(1) = (X1, X2, X3, X4, X5, X6, X7, X8). w(0) H =(w1,w2,w3,w4,w5,w6,w7,w8) H =(0,0,0,0,0,0,0,0) H, initially set to 0. d(1)=(X、X、X、X、X、X、X、X).
[0131] According to the negative gradient descent algorithm, update the weight coefficient:
[0132] e(1)=d(1)-w(0) H u(1);
[0133] w(1)=w(0)+μ(1)e * (1)u(1).
[0134] For a fixed step size, μ(n) is generally a constant.
[0135] When performing the second iteration, n=2.
[0136] Input data u(2) = (X1, X2, X3, X4, X5, X6, X7, X8). w(1) is the weight value obtained in the first iteration. d(2) = (X, X, X, X, X, X, X, X).
[0137] According to the negative gradient descent algorithm, update the weight coefficient:
[0138] e(2)=d(1)-w(1) H u(2);
[0139] w(2)=w(1)+μ(2)e * (2)u(2).
[0140] After iterating a preset number of times using the above method, the iteration is stopped to obtain the currently used weight value.
[0141] For step 201, the second implementation method is: first, based on the pixel value of the first type sub-pixel in each first adjacent pixel and the pixel value of the first type sub-pixel in each second adjacent pixel, the weight value used by each first adjacent pixel is iteratively updated; second, after iterating until the first pixel value difference is less than the first preset value, the weight value currently used by each first adjacent pixel is obtained, and the first pixel value difference is determined based on the weight value used by each first adjacent pixel.
[0142] The weight values used for each first-neighboring pixel can be iteratively updated by referring to the method in the above example. e(n) is the first pixel value difference. When e(n) is less than a first preset value, w(n-1), used when calculating e(n), is used as the current weight value for each first-neighboring pixel.
[0143] For step 201, a third implementation method: a first step, for each first adjacent pixel, calculating the mean square error of a first pixel value set and the pixel values of first type sub-pixels in the first adjacent pixel, the first pixel value set including: pixel values of first type sub-pixels in multiple second adjacent pixels adjacent to the first adjacent pixel; a second step, determining the weight value used for each first adjacent pixel when all mean square errors meet a first preset condition.
[0144] In this implementation, the plurality of second adjacent pixels adjacent to the first adjacent pixel include the second pixel.
[0145] Assume that the pixel value of the first type sub-pixel in the second pixel is y0, and the pixel values of the first type sub-pixels in the eight first adjacent pixels adjacent to the second pixel are a0, b0, c0, d0, e0, f0, g0, and h0, respectively. y0=w′1a0+w′2b0+w′3c0+w′4d0+w′5e0+w′6f0+w′7g0+w′8h0. n is the weight value.
[0146] For each first-neighboring pixel adjacent to a second pixel, there are eight adjacent second-neighboring pixels. The difference between the pixel value of each second-neighboring pixel and the pixel value of the first-type sub-pixel in the first-neighboring pixel is calculated. The mean square difference between the average of the eight differences and the pixel value of the first-type sub-pixel in the first-neighboring pixel is calculated, where the mean square difference is a function of w′1 to w′8. The eight mean square differences are combined to determine the weight value used for each first-neighboring pixel when all mean square differences meet a first preset condition.
[0147] There are various first preset conditions. For example, when all mean square errors are lower than a preset value, the weight value currently used by each first adjacent pixel is obtained.
[0148] In one embodiment, Figure 4 is a flowchart of another image adjustment method according to an exemplary embodiment. Figure 4 , step 104 can be implemented in the following way:
[0149] In step 301 , a second pixel set located around a first pixel in a central area of an adjusted original image is determined, where the second pixel set includes a second pixel whose pixel value is adjusted.
[0150] After adjusting the pixel values of the PD sub-pixels in the original image using the above-mentioned image adjustment method, an adjusted original image is obtained. The second pixel set in the central area of the adjusted original image includes the second pixel with the adjusted pixel value.
[0151] For a pixel, the pixel values of adjacent pixels have a greater impact on the pixel value of the pixel itself. Based on this, the second pixel set may include pixels adjacent to the first pixel.
[0152] In step 302 , the pixel value of the PD sub-pixel in the first pixel is adjusted according to the pixel value of the first type sub-pixel in the second pixel set.
[0153] In step 303 , the pixel value of the PD sub-pixel in the original image is adjusted according to the pixel value of the target sub-pixel in the central area of the original image after secondary adjustment and the pixel value of the PD sub-pixel in the PD image.
[0154] In this embodiment, after completing the adjustment of the pixel value of the first type sub-pixel in the second pixel, the pixel value of the PD sub-pixel in the first pixel is further adjusted to compensate for the pixel value of the PD sub-pixel, thereby improving the image display effect.
[0155] In one embodiment, the second pixel set includes: a plurality of second pixels adjacent to the first pixel, and a plurality of first adjacent pixels adjacent to each second pixel.
[0156] The pixel value of the PD sub-pixel in the first pixel is equal to the weighted sum of the pixel values of the first type sub-pixels in the plurality of second pixels.
[0157] Based on this, Figure 5 is a flowchart of another image adjustment method according to an exemplary embodiment. Figure 5 , step 302 can be implemented in the following manner:
[0158] In step 401 , a weight value used by each second pixel is calculated based on the pixel value of each second pixel and the pixel value of the first type sub-pixel in each first adjacent pixel.
[0159] In step 402 , a multiplication result of the pixel value of each first-type sub-pixel in each second pixel and the corresponding weight value is calculated.
[0160] In step 403 , the pixel value of the PD sub-pixel in the first pixel is adjusted to the sum of all multiplication results.
[0161] For step 401, the first implementation method is: first, based on the pixel value of the first type sub-pixel in each second pixel and the pixel value of the first type sub-pixel in each first adjacent pixel, the weight value used by each second pixel is iteratively updated; secondly, after iterating to a second preset number of times, the weight value currently used by each second pixel is obtained.
[0162] For example, there are 8 second pixels adjacent to the first pixel, and the pixel values of the first type sub-pixels in the 8 second pixels are A0, B0, C0, D0, E0, F0, G0, and H0, respectively, and P is defined as (A0, B0, C0, D0, E0, F0, G0, and H0).
[0163] Each second pixel is adjacent to 8 first adjacent pixels. The 8 groups of first adjacent pixels adjacent to the 8 second pixels are: (A1, B1, C1, D1, E1, F1, G1, H1) to (A8, B8, C8, D8, E8, F8, G8, H8). Define P n =(A n 、B n 、C n 、D n 、E n 、F n , G n 、H n ).
[0164] When performing the first iteration, n=1.
[0165] Input data U(1) = (P1, P2, P3, P4, P5, P6, P7, P8). W(0) H =(W1, W2, W3, W4, W5, W6, W7, W8) H =(0,0,0,0,0,0,0,0) H , initially set to 0. D(1) = (P, P, P, P, P, P, P, P).
[0166] According to the negative gradient descent algorithm, update the weight coefficient:
[0167] E(1)=D(1)-W(0) H U(1);
[0168] W(1)=W(0)+μ(1)E * (1)U(1).
[0169] For a fixed step size, μ(n) is generally a constant.
[0170] When performing the second iteration, n=2.
[0171] Input data U(2) = (P1, P2, P3, P4, P5, P6, P7, P8). W(1) is the weight value obtained in the first iteration. D(2) = (P, P, P, P, P, P, P, P).
[0172] According to the negative gradient descent algorithm, update the weight coefficient:
[0173] E(2)=D(1)-W(1) H U(2);
[0174] W(2)=W(1)+μ(2)E * (2)U(2).
[0175] After iterating a preset number of times using the above method, the iteration is stopped to obtain the currently used weight value.
[0176] The second preset number of times is the same as the first preset number of times, or the second preset number of times is different from the first preset number of times.
[0177] For step 401, the second implementation method is: first, based on the pixel value of the first type sub-pixel in each second pixel and the pixel value of the first type sub-pixel in each first adjacent pixel, the weight value used by each second pixel is iteratively updated; secondly, after iterating until the difference in the second pixel value is less than the second preset value, the weight value currently used by each second pixel is obtained, and the second pixel value difference is determined based on the weight value used by each second pixel.
[0178] The weight values used for each second pixel can be iteratively updated by referring to the method in the above example. E(n) is the second pixel value difference. When E(n) is less than a second preset value, W(n-1) used in calculating E(n) is used as the current weight value for each second pixel.
[0179] For step 401, the third implementation method is: the first step, for each second pixel, calculate the mean square error of the second pixel value set and the pixel values of the first type of sub-pixels in the second pixel, the second pixel value set including: the pixel values of the first type of sub-pixels in multiple first adjacent pixels adjacent to the second pixel; the second step, determine the weight value used for each second pixel when all mean square errors meet the second preset condition.
[0180] In this implementation, the plurality of first adjacent pixels adjacent to the second pixel include the first pixel.
[0181] Assume that the pixel value of the PD sub-pixel in the first pixel is Y0, and the pixel values of the first type sub-pixels in the eight second pixels adjacent to the first pixel are A0, B0, C0, D0, E0, F0, G0, and H0 respectively. Y0 = W'1A0 + W'2B0 + W'3C0 + W'4D0 + W'5E0 + W'6F0 + W'7G0 + W'8H0. n is the weight value.
[0182] For each second pixel adjacent to a first pixel, there are eight adjacent first-neighboring pixels. The difference between each first-neighboring pixel and the pixel value of the first-type sub-pixel in the second pixel is calculated. The mean square difference between the average of the eight differences and the pixel value of the first-type sub-pixel in the second pixel is calculated. The mean square difference is a function of W′1 to W′8. The eight mean square differences are combined to determine the weight value used for each second pixel when all mean square differences meet a second preset condition.
[0183] There are various second preset conditions. For example, when all mean square errors are lower than a preset threshold, the weight value currently used by each second pixel is obtained.
[0184] For the sake of simplicity, the aforementioned method embodiments are all expressed as a series of action combinations. However, those skilled in the art should know that the present disclosure is not limited to the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously.
[0185] Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0186] Corresponding to the aforementioned application function implementation method embodiment, the present disclosure also provides an application function implementation device and a corresponding electronic device embodiment.
[0187] Figure 6 1 is a block diagram of an image adjustment device according to an exemplary embodiment, the device comprising:
[0188] A pixel determination module 51 is configured to determine a first pixel and at least one second pixel in a central area of an original image, wherein the first pixel includes a PD sub-pixel and is adjacent to each second pixel;
[0189] a set determining module 52 configured to determine, for each second pixel, a set of first pixels located around the second pixel in the original image;
[0190] a first pixel value adjustment module 53 configured to adjust the pixel values of the first type sub-pixels in the second pixel set according to the pixel values of the first type sub-pixels in the first pixel set, wherein the first type sub-pixels and the PD sub-pixels have the same target sub-pixel type;
[0191] The second pixel value adjustment module 54 is configured to adjust the pixel value of the PD sub-pixel in the original image according to the pixel value of the target sub-pixel in the central area of the original image after adjustment and the pixel value of the PD sub-pixel in the PD image when obtaining the PD image corresponding to the original image, and the target sub-pixel has the target sub-pixel type.
[0192] In an optional embodiment, Figure 5 Based on the image adjustment device shown, a first pixel set located around the second pixel includes: a plurality of first adjacent pixels adjacent to the second pixel, and a plurality of second adjacent pixels adjacent to each of the first adjacent pixels; a pixel value of a first-type sub-pixel in the second pixel is equal to a weighted sum of pixel values of the first-type sub-pixels in the plurality of first adjacent pixels;
[0193] The first pixel value adjustment module 53 may include:
[0194] a weight value calculation submodule configured to calculate a weight value used by each first adjacent pixel according to the pixel value of the first type sub-pixel in each first adjacent pixel and each second adjacent pixel;
[0195] a data calculation submodule configured to calculate a multiplication result of a pixel value of a first type sub-pixel in each first adjacent pixel and a corresponding weight value;
[0196] The first pixel value adjustment submodule is configured to adjust the pixel value of the first type sub-pixel in the second pixel to the sum of all multiplication results.
[0197] In an optional embodiment, the weight value calculation submodule may include:
[0198] a weight value iteration unit configured to iteratively update the weight value used by each of the first adjacent pixels according to the pixel value of the first type sub-pixel in each of the first adjacent pixels and the pixel value of the first type sub-pixel in each of the second adjacent pixels;
[0199] The first weight value acquisition unit is configured to acquire the weight value currently used by each of the first adjacent pixels after iterating to a first preset number of times; or
[0200] The second weight value acquisition unit is configured to iterate until the first pixel value difference is less than a first preset value, and then obtain the weight value currently used by each of the first adjacent pixels, wherein the first pixel value difference is determined based on the weight value used by each of the first adjacent pixels.
[0201] In an optional embodiment, the weight value calculation submodule may include:
[0202] a mean square error calculation unit configured to calculate, for each first neighboring pixel, a mean square error between a first pixel value set and pixel values of first-type sub-pixels in the first neighboring pixel, the first pixel value set comprising: pixel values of first-type sub-pixels in a plurality of second neighboring pixels adjacent to the first neighboring pixel;
[0203] The weight value determining unit is configured to determine the weight value used by each of the first adjacent pixels when all mean square errors meet a first preset condition.
[0204] In an optional embodiment, Figure 5 Based on the image adjustment device shown, the second pixel value adjustment module 54 may include:
[0205] a set determining submodule configured to determine a second pixel set located around the first pixel in a central area of the adjusted original image, wherein the second pixel set includes the second pixel whose pixel value is adjusted;
[0206] a second pixel value adjustment submodule, configured to adjust the pixel value of the PD sub-pixel in the first pixel according to the pixel value of the first type sub-pixel in the second pixel set;
[0207] The third pixel value adjustment submodule is configured to adjust the pixel value of the PD subpixel in the original image according to the pixel value of the target subpixel in the central area of the original image after secondary adjustment and the pixel value of the PD subpixel in the PD image.
[0208] In an optional embodiment, the second pixel set may include: a plurality of second pixels adjacent to the first pixel, and a plurality of first adjacent pixels adjacent to each second pixel; a pixel value of a PD sub-pixel in the first pixel is equal to a weighted sum of pixel values of first-type sub-pixels in the plurality of second pixels;
[0209] The second pixel value adjustment submodule may include:
[0210] a weight value calculation unit configured to calculate a weight value used by each second pixel according to the pixel value of each second pixel and the pixel value of the first type sub-pixel in each first adjacent pixel;
[0211] a data calculation unit configured to calculate a multiplication result of a pixel value of a first-type sub-pixel in each second pixel and a corresponding weight value;
[0212] The pixel value adjustment unit is configured to adjust the pixel value of the PD sub-pixel in the first pixel to the sum of all multiplication results.
[0213] In an optional embodiment, the weight value calculation unit may include:
[0214] a weight value iteration subunit, configured to iteratively update the weight value used by each second pixel according to the pixel value of the first type sub-pixel in each second pixel and the pixel value of the first type sub-pixel in each first adjacent pixel;
[0215] The first weight value acquisition subunit is configured to acquire the weight value currently used by each second pixel after iterating to a second preset number of times; or
[0216] The second weight value acquisition subunit is configured to iterate until the second pixel value difference is less than a second preset value, and then obtain the weight value currently used by each second pixel, wherein the second pixel value difference is determined based on the weight value used by each second pixel.
[0217] In an optional embodiment, the weight value calculation unit may include:
[0218] a mean square error calculation subunit, configured to calculate, for each second pixel, a mean square error between a second pixel value set and pixel values of first-type sub-pixels in the second pixel, the second pixel value set including: pixel values of first-type sub-pixels in a plurality of first adjacent pixels adjacent to the second pixel;
[0219] The weight value determining subunit is configured to determine the weight value used by each second pixel when all mean square errors meet a second preset condition.
[0220] Figure 7 1 is a schematic diagram illustrating the structure of an electronic device 1600 according to an exemplary embodiment. For example, device 1600 may be a user device, specifically a mobile phone, a computer, a digital broadcast electronic device, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or a wearable device such as a smart watch, smart glasses, a smart bracelet, or a smart running shoe.
[0221] Reference Figure 6 , device 1600 may include one or more of the following components: a processing component 1602 , a memory 1604 , a power component 1606 , a multimedia component 1608 , an audio component 1610 , an input / output (I / O) interface 1612 , a sensor component 1614 , and a communication component 1616 .
[0222] Processing component 1602 generally controls the overall operation of device 1600, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. Processing component 1602 may include one or more processors 1620 to execute instructions to perform all or part of the steps of the above-described method. In addition, processing component 1602 may include one or more modules to facilitate interaction between processing component 1602 and other components. For example, processing component 1602 may include a multimedia module to facilitate interaction between multimedia component 1608 and processing component 1602.
[0223] The memory 1604 is configured to store various types of data to support the operations on the device 1600. Examples of such data include instructions for any application or method operating on the device 1600, contact data, phone book data, messages, pictures, videos, etc. The memory 1604 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0224] The power supply component 1606 provides power to the various components of the device 1600. The power supply component 1606 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device 1600.
[0225] The multimedia component 1608 includes a screen that provides an output interface between the device 1600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensors may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action. In some embodiments, the multimedia component 1608 includes a front camera and / or a rear camera. When the device 1600 is in an operating mode, such as adjustment mode or video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0226] The audio component 1610 is configured to output and / or input audio signals. For example, the audio component 1610 includes a microphone (MIC) that is configured to receive external audio signals when the device 1600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 1604 or transmitted via the communication component 1616. In some embodiments, the audio component 1610 also includes a speaker for outputting audio signals.
[0227] I / O interface 1612 provides an interface between processing component 1602 and peripheral interface modules, such as a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to, a home button, volume buttons, a start button, and a lock button.
[0228] Sensor assembly 1614 includes one or more sensors for providing various aspects of the status assessment of device 1600. For example, sensor assembly 1614 can detect the open / closed state of device 1600, the relative positioning of components, such as the display and keypad of device 1600. Sensor assembly 1614 can also detect changes in the position of device 1600 or a component of device 1600, the presence or absence of user contact with device 1600, the orientation or acceleration / deceleration of device 1600, and changes in the temperature of device 1600. Sensor assembly 1614 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 1614 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 1614 can also include an accelerometer, a gyroscope, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0229] The communication component 1616 is configured to facilitate wired or wireless communication between the device 1600 and other devices. The device 1600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 1616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1616 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0230] In an exemplary embodiment, the device 1600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0231] In an exemplary embodiment, a non-transitory computer-readable storage medium is also provided, such as a memory 1604 including instructions, which, when executed by a processor 1620 of the device 1600 , enable the device 1600 to perform an image adjustment method, the method comprising: determining a first pixel and at least one second pixel in a central area of an original image, the first pixel including a PD sub-pixel, the first pixel being adjacent to each second pixel;
[0232] For each second pixel, determining a set of first pixels located around the second pixel in the original image;
[0233] adjusting pixel values of first-type sub-pixels in the second pixel set according to pixel values of first-type sub-pixels in the first pixel set, wherein the first-type sub-pixels and the PD sub-pixels have the same target sub-pixel type;
[0234] When obtaining the PD image corresponding to the original image, the pixel value of the PD sub-pixel in the original image is adjusted according to the pixel value of the target sub-pixel in the central area of the adjusted original image and the pixel value of the PD sub-pixel in the PD image, and the target sub-pixel has the target sub-pixel type.
[0235] The non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0236] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0237] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An image adjustment method, characterized in that: The method comprises: Determine a first pixel and at least one second pixel in a central area of the original image, wherein the first pixel includes a PD sub-pixel and the first pixel is adjacent to each second pixel; For each second pixel, determining a set of first pixels located around the second pixel in the original image; adjusting pixel values of first-type sub-pixels in the second pixel set according to pixel values of first-type sub-pixels in the first pixel set, wherein the first-type sub-pixels and the PD sub-pixels have the same target sub-pixel type; When obtaining the PD image corresponding to the original image, the pixel value of the PD sub-pixel in the original image is adjusted according to the pixel value of the target sub-pixel in the central area of the adjusted original image and the pixel value of the PD sub-pixel in the PD image, and the target sub-pixel has the target sub-pixel type.
2. The method according to claim 1, characterized in that a first pixel set located around the second pixel including: a plurality of first adjacent pixels adjacent to the second pixel, and a plurality of second adjacent pixels adjacent to each of the first adjacent pixels; a pixel value of a first-type sub-pixel in the second pixel is equal to a weighted sum of pixel values of the first-type sub-pixels in the plurality of first adjacent pixels; The adjusting the pixel values of the first-type sub-pixels in the second pixel set according to the pixel values of the first-type sub-pixels in the first pixel set includes: Calculating a weight value used by each first adjacent pixel according to the pixel value of the first type sub-pixel in each first adjacent pixel and each second adjacent pixel; Calculating a multiplication result of a pixel value of a first-type sub-pixel in each first-adjacent pixel and a corresponding weight value; The pixel value of the first type sub-pixel in the second pixel is adjusted to the sum of all multiplication results.
3. The method according to claim 2, characterized in that The step of calculating the weight value used by each first adjacent pixel according to the pixel value of the first type sub-pixel in each first adjacent pixel and each second adjacent pixel includes: Iteratively updating the weight values used for each of the first-neighboring pixels according to the pixel values of the first-type sub-pixels in each of the first-neighboring pixels and the pixel values of the first-type sub-pixels in each of the second-neighboring pixels; After iterating to a first preset number of times, obtaining the weight value currently used by each of the first adjacent pixels; or, After iterating until the first pixel value difference is less than a first preset value, the weight value currently used by each of the first adjacent pixels is obtained, where the first pixel value difference is determined based on the weight value used by each of the first adjacent pixels.
4. The method according to claim 2, characterized in that The step of calculating the weight value used by each first adjacent pixel according to the pixel value of the first type sub-pixel in each first adjacent pixel and each second adjacent pixel includes: For each first neighboring pixel, calculating a mean square difference between a first pixel value set and pixel values of first-type sub-pixels in the first neighboring pixel, the first pixel value set including: pixel values of first-type sub-pixels in a plurality of second neighboring pixels adjacent to the first neighboring pixel; Determine a weight value used by each of the first adjacent pixels when all mean square errors meet a first preset condition.
5. The method according to claim 1, wherein The adjusting the pixel value of the PD sub-pixel in the original image according to the adjusted pixel value of the target sub-pixel in the central area of the original image and the pixel value of the PD sub-pixel in the PD image includes: determining a second pixel set located around the first pixel in a central area of the adjusted original image, the second pixel set including the second pixel whose pixel value is adjusted; Adjusting the pixel value of the PD sub-pixel in the first pixel according to the pixel value of the first type sub-pixel in the second pixel set; The pixel value of the PD sub-pixel in the original image is adjusted according to the pixel value of the target sub-pixel in the central area of the original image after secondary adjustment and the pixel value of the PD sub-pixel in the PD image.
6. The method according to claim 5, characterized in that The second pixel set includes: a plurality of second pixels adjacent to the first pixel, and a plurality of first adjacent pixels adjacent to each second pixel; a pixel value of a PD sub-pixel in the first pixel is equal to a weighted sum of pixel values of first-type sub-pixels in the plurality of second pixels; The adjusting the pixel value of the PD sub-pixel in the first pixel according to the pixel value of the first type sub-pixel in the second pixel set includes: Calculating a weight value used by each second pixel according to the pixel value of each second pixel and the first type sub-pixel in each first adjacent pixel; Calculating a multiplication result of a pixel value of a first-type sub-pixel in each second pixel and a corresponding weight value; The pixel value of the PD sub-pixel in the first pixel is adjusted to the sum of all multiplication results.
7. The method according to claim 6, characterized in that The step of calculating the weight value used by each second pixel according to the pixel value of each second pixel and the first type sub-pixel in each first adjacent pixel includes: Iteratively updating a weight value used for each of the second pixels according to a pixel value of a first-type sub-pixel in each of the second pixels and a pixel value of a first-type sub-pixel in each of the first adjacent pixels; After iterating to a second preset number of times, obtaining the weight value currently used by each second pixel; or, After iterating until the second pixel value difference is less than a second preset value, the weight value currently used by each second pixel is obtained, where the second pixel value difference is determined according to the weight value used by each second pixel.
8. The method according to claim 6, characterized in that The step of calculating the weight value used by each second pixel according to the pixel value of each second pixel and the first type sub-pixel in each first adjacent pixel includes: For each second pixel, calculating a mean square difference between a second pixel value set and pixel values of first-type sub-pixels in the second pixel, where the second pixel value set includes: pixel values of first-type sub-pixels in a plurality of first adjacent pixels adjacent to the second pixel; Determine a weight value used by each second pixel when all mean square errors meet a second preset condition.
9. An image adjustment device, characterized in that: The device comprises: A pixel determination module is configured to determine a first pixel and at least one second pixel in a central area of an original image, wherein the first pixel includes a PD sub-pixel and is adjacent to each second pixel; a set determining module configured to determine, for each second pixel, a set of first pixels located around the second pixel in the original image; a first pixel value adjustment module configured to adjust pixel values of first-type sub-pixels in the second pixel set according to pixel values of first-type sub-pixels in the first pixel set, wherein the first-type sub-pixels and the PD sub-pixels have the same target sub-pixel type; The second pixel value adjustment module is configured to adjust the pixel value of the PD sub-pixel in the original image according to the pixel value of the target sub-pixel in the central area of the adjusted original image and the pixel value of the PD sub-pixel in the PD image when obtaining the PD image corresponding to the original image, and the target sub-pixel has the target sub-pixel type.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
11. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: Determine a first pixel and at least one second pixel in a central area of the original image, wherein the first pixel includes a PD sub-pixel and the first pixel is adjacent to each second pixel; For each second pixel, determining a set of first pixels located around the second pixel in the original image; adjusting pixel values of first-type sub-pixels in the second pixel set according to pixel values of first-type sub-pixels in the first pixel set, wherein the first-type sub-pixels and the PD sub-pixels have the same target sub-pixel type; When obtaining the PD image corresponding to the original image, the pixel value of the PD sub-pixel in the original image is adjusted according to the pixel value of the target sub-pixel in the central area of the adjusted original image and the pixel value of the PD sub-pixel in the PD image, and the target sub-pixel has the target sub-pixel type.
Citation Information
Patent Citations
Imaging device and control method for imaging device
CN103108193A
Image capturing element and image capturing device
CN109196857A