CN114979412A - Image adjusting method and device - Google Patents

Image adjusting method and device Download PDF

Info

Publication number
CN114979412A
CN114979412A CN202110221195.2A CN202110221195A CN114979412A CN 114979412 A CN114979412 A CN 114979412A CN 202110221195 A CN202110221195 A CN 202110221195A CN 114979412 A CN114979412 A CN 114979412A
Authority
CN
China
Prior art keywords
pixel
sub
value
pixels
type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110221195.2A
Other languages
Chinese (zh)
Inventor
赵海浪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202110221195.2A priority Critical patent/CN114979412A/en
Publication of CN114979412A publication Critical patent/CN114979412A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/81Camera processing pipelines; Components thereof for suppressing or minimising disturbance in the image signal generation

Abstract

The disclosure provides an image adjusting method and device. The method comprises the following steps: the method comprises the steps of determining a first pixel and at least one second pixel in a central area of an original image, wherein the first pixel comprises PD sub-pixels, the first pixel is adjacent to each second pixel, determining a first pixel set around the second pixels in the original image, and adjusting the pixel value of the first type sub-pixels in the second pixels according to the pixel value 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, so that the problem of crosstalk caused by setting the PD sub-pixels in the related art is solved, and the image display effect is improved.

Description

Image adjusting method and device
Technical Field
The present disclosure relates to the field of computer communication technologies, and in particular, to an image adjusting method and apparatus.
Background
Phase Detection Autofocus (PDAF) means Phase detection autofocus. In order to realize phase focusing, some PD (phase detection) sub-pixels are added, wherein one part of PD sub-pixels only allow light on the left side to pass through, and the other part of PD sub-pixels only allow light on the right side to pass through.
In the related art, PD subpixels are extracted from an original image, a PD image is formed by the PD subpixels, and pixel values of the PD subpixels in the original image are adjusted according to pixel values in the original image and the PD image, so as to improve an image display effect.
Because the crosstalk problem is generated by setting the PD pixel and the pixel values of the pixels around the PD pixel are affected, the adjustment result obtained by adjusting the pixel values of the PD sub-pixels by using the above method is inaccurate, and the image display effect is not good.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides an image adjustment method and apparatus.
According to a first aspect of an embodiment of the present disclosure, there is provided an image adjustment method, including:
determining a first pixel and at least one second pixel in a central area of an original image, wherein the first pixel comprises PD sub-pixels, and the first pixel is adjacent to each second pixel;
for each second pixel, determining a first set of pixels in the original image that are located around the second pixel;
adjusting the pixel value of a first type sub-pixel in the second pixel according to the pixel value of the first type sub-pixel in the first pixel set, wherein the first type sub-pixel and the PD sub-pixel have the same target sub-pixel type;
under the condition that a PD image corresponding to the original image is obtained, adjusting the pixel value of a PD sub-pixel in the original image according to the adjusted pixel value of a target sub-pixel in the central area of the original image and the adjusted pixel value of the PD sub-pixel in the PD image, wherein the target sub-pixel is of the target sub-pixel type.
Optionally, the first set of pixels located around the second pixel comprises: a plurality of first neighboring pixels adjacent to the second pixel, and a plurality of second neighboring pixels adjacent to each of the first neighboring 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;
the adjusting the pixel value of the first type sub-pixel in the second pixel according to the pixel value of the first type sub-pixel 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 the pixel value of the first type sub-pixel in each first adjacent pixel and the corresponding weight value;
and adjusting the pixel value of the first type sub-pixel in the second pixel into the sum of all multiplication results.
Optionally, the 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 includes:
iteratively updating 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 the pixel value of the first-type sub-pixel in each second adjacent pixel;
after iteration is carried out for a first preset number of times, the weight value currently used by each first adjacent pixel is obtained; alternatively, the first and second electrodes may be,
and after iterating until the difference of the first pixel values is smaller than a first preset value, obtaining the currently used weight value of each first adjacent pixel, wherein the difference of the first pixel values is determined according to the used weight value of each first adjacent pixel.
Optionally, the 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 error of a first set of pixel values with pixel values of a first type of sub-pixel in the first neighboring pixel, the first set of pixel values comprising: a pixel value of a first type sub-pixel in a plurality of second neighboring pixels neighboring the first neighboring pixel;
and determining the weight value used by each first adjacent pixel when all the mean square deviations meet a first preset condition.
Optionally, the adjusting, according to the adjusted pixel value of the target subpixel in the central area of the original image and the pixel value of the PD subpixel in the PD image, the pixel value of the PD subpixel in the original image includes:
determining a second pixel set which is positioned around the first pixel in the center area of the adjusted original image, wherein the second pixel set comprises a second pixel with an adjusted pixel value;
adjusting the pixel value of a PD sub-pixel in the first pixel according to the pixel value of a first type sub-pixel in the second pixel set;
and adjusting 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 the secondary adjustment and the pixel value of the PD sub-pixel in the PD image.
Optionally, the second set of pixels comprises: a plurality of second pixels adjacent to the first pixels, and a plurality of first adjacent pixels adjacent to each of the second pixels; 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;
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 the first type sub-pixel in each second pixel and each first adjacent pixel;
calculating a multiplication result of the pixel value of the first type sub-pixel in each second pixel and the corresponding weight value;
and adjusting the pixel value of the PD sub-pixel in the first pixel into the sum of all multiplication results.
Optionally, the calculating a weight value used by each second pixel according to the pixel values of the first type sub-pixels in each second pixel and each first adjacent pixel includes:
iteratively updating 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;
after iteration is carried out for a second preset number of times, the weight value currently used by each second pixel is obtained; alternatively, the first and second electrodes may be,
and after iterating until the difference of the second pixel values is smaller than a second preset value, obtaining the currently used weight value of each second pixel, wherein the difference of the second pixel values is determined according to the used weight value of each second pixel.
Optionally, the calculating a weight value used by each second pixel according to the pixel values of the first type sub-pixels in each second pixel and each first adjacent pixel includes:
for each second pixel, calculating a mean square error of a set of second pixel values and pixel values of a first type of sub-pixel in the second pixel, the set of second pixel values comprising: a pixel value of a first type sub-pixel in a plurality of first neighboring pixels neighboring the second pixel;
and determining the weight value used by each second pixel when all the mean square deviations meet a second preset condition.
According to a second aspect of an embodiment of the present disclosure, there is provided an image adjusting apparatus including:
a pixel determination module configured to determine a first pixel and at least one second pixel in a central region of an original image, the first pixel including PD sub-pixels, the first pixel being adjacent to each of the second pixels;
a set determination module configured to determine, for each second pixel, a first set of pixels in the original image that are located around the second pixel;
a first pixel value adjusting module configured to adjust a pixel value of a first type sub-pixel in the second pixel according to a pixel value of the first type sub-pixel in the first pixel set, the first type sub-pixel and the PD sub-pixel having a same target sub-pixel type;
and a second pixel value adjusting module configured to, in a case that a PD image corresponding to the original image is obtained, adjust a pixel value of a PD sub-pixel in the original image according to an adjusted pixel value of a target sub-pixel in a central area of the original image and a pixel value of a PD sub-pixel in the PD image, where the target sub-pixel has the target sub-pixel type.
Optionally, the first set of pixels located around the second pixel comprises: a plurality of first neighboring pixels adjacent to the second pixel, and a plurality of second neighboring pixels adjacent to each of the first neighboring 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;
the first pixel value adjusting module comprises:
a weight value calculation sub-module configured to calculate a weight value used by each of the first adjacent pixels, based on the pixel value of the first type sub-pixel in each of the first adjacent pixels and each of the second adjacent pixels;
a data calculation sub-module 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;
a first pixel value adjusting sub-module configured to adjust the pixel value of the first type sub-pixel in the second pixel to a sum of all multiplication results.
Optionally, the weight value calculating sub-module includes:
a weight value iteration unit configured to iteratively update 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 the pixel value of the first-type sub-pixel in each second adjacent pixel;
the first weight value obtaining unit is configured to obtain the weight value currently used by each first adjacent pixel after iterating to a first preset number of times; alternatively, the first and second electrodes may be,
and the second weight value obtaining unit is configured to iterate until the difference of the first pixel values is smaller than a first preset value, and then obtain the currently used weight value of each first adjacent pixel, wherein the difference of the first pixel values is determined according to the used weight value of each first adjacent pixel.
Optionally, the weight value calculating sub-module includes:
a mean square error calculation unit configured to calculate, for each first neighboring pixel, a mean square error of a first set of pixel values with pixel values of a first type of sub-pixel in the first neighboring pixel, the first set of pixel values comprising: a pixel value of a first type sub-pixel in a plurality of second neighboring pixels neighboring the first neighboring pixel;
a weight value determination unit configured to determine a weight value used by each of the first neighboring pixels when all the mean square deviations satisfy a first preset condition.
Optionally, the second pixel value adjusting module includes:
a set determination submodule configured to determine a second set of pixels located around the first pixel in a central region of the adjusted original image, the second set of pixels including a pixel value-adjusted second pixel;
a second pixel value adjusting sub-module configured to adjust the pixel value of the PD sub-pixel of the first pixel according to the pixel value of the first type sub-pixel of the second pixel set;
and the third pixel value adjusting sub-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 original image after the secondary adjustment and the pixel value of the PD sub-pixel in the PD image.
Optionally, the second set of pixels comprises: a plurality of second pixels adjacent to the first pixels, and a plurality of first adjacent pixels adjacent to each of the second pixels; 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;
the second pixel value adjustment submodule includes:
a weight value calculation unit configured to calculate a weight value used by each second pixel according to the pixel value of the first type sub-pixel in each second pixel and each first adjacent pixel;
a data calculation unit configured to calculate a multiplication result of pixel values of the first-type sub-pixels in the respective second pixels and the corresponding weight values;
a pixel value adjusting unit configured to adjust a pixel value of a PD sub-pixel in the first pixel to a sum of all multiplication results.
Optionally, the weight value calculating unit includes:
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;
the first weight value obtaining subunit is configured to obtain a currently used weight value of each second pixel after iterating to a second preset number of times; alternatively, the first and second electrodes may be,
and the second weight value obtaining subunit is configured to iterate until the difference between the second pixel values is smaller than a second preset value, and then obtain the currently used weight value of each second pixel, where the difference between the second pixel values is determined according to the used weight value of each second pixel.
Optionally, the weight value calculating unit includes:
a mean square error calculation sub-unit configured to calculate, for each second pixel, a mean square error of a set of second pixel values with pixel values of a first type of sub-pixel of the second pixel, the set of second pixel values comprising: a pixel value of a first type sub-pixel in a plurality of first neighboring pixels neighboring the second pixel;
a weight value determining subunit configured to determine a weight value used by each of the second pixels when all the mean square deviations satisfy a second preset condition.
According to a third aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any one of the above first aspects.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
determining a first pixel and at least one second pixel in a central area of an original image, wherein the first pixel comprises PD sub-pixels, and the first pixel is adjacent to each second pixel;
for each second pixel, determining a first set of pixels in the original image that are located around the second pixel;
adjusting the pixel value of a first type sub-pixel in the second pixel according to the pixel value of the first type sub-pixel in the first pixel set, wherein the first type sub-pixel and the PD sub-pixel have the same target sub-pixel type;
under the condition that a PD image corresponding to the original image is obtained, adjusting the pixel value of a PD sub-pixel in the original image according to the adjusted pixel value of a target sub-pixel in the central area of the original image and the adjusted pixel value of the PD sub-pixel in the PD image, wherein the target sub-pixel is of the target sub-pixel type.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
in the embodiment of the disclosure, a first pixel and at least one second pixel in a central area of an original image are determined, the first pixel includes PD sub-pixels, the first pixel is adjacent to each second pixel, a first pixel set around the second pixels in the original image is determined, and a pixel value of a first type sub-pixel in the second pixels is adjusted according to a pixel value of the first type sub-pixel in the first pixel set, where the first type sub-pixel and the PD sub-pixel have the same target sub-pixel type, so that a crosstalk problem caused by setting the PD sub-pixels in the related art is solved, and an image display effect is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
FIG. 1 is a flow diagram illustrating an image adjustment method according to an exemplary embodiment;
FIG. 2 is a partial schematic view of a pixel panel shown in accordance with an exemplary embodiment;
FIG. 3 is a flow diagram illustrating another method of image adjustment according to an exemplary embodiment;
FIG. 4 is a flow diagram illustrating another method of image adjustment according to an exemplary embodiment;
FIG. 5 is a flow diagram illustrating another method of image adjustment according to an exemplary embodiment;
FIG. 6 is a block diagram illustrating an image adjustment apparatus according to an exemplary embodiment;
fig. 7 is a schematic structural diagram of an electronic device according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the disclosure, as detailed in the appended claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a", "an", 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.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from 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 the present disclosure. The word "if," as used herein, may be interpreted as "when or" responsive to a determination, "depending on the context.
Fig. 1 is a flowchart illustrating an image adjustment method according to an exemplary embodiment, the method illustrated in fig. 1 including:
in step 101, a first pixel and at least one second pixel in a central region of the original image are determined, the first pixel comprising PD sub-pixels, the first pixel being adjacent to each of the second pixels.
The original image may be an original RAW image acquired by a camera, or may be an image obtained by cropping the original RAW image.
The position and size of the central region of the original image may be fixed or may be determined from the current original image. For example, the center point of the center region of the original image is the center point of the whole original image, and the height of the center region of the original image is the height of the whole original image
Figure BDA0002954982860000101
The width of the central region of the original image is the width of the whole original image
Figure BDA0002954982860000102
Generally, one pixel may include an R sub-pixel, a G sub-pixel, and a B sub-pixel, the sub-pixel type may include an R type, a G type, or a B type, and the sub-pixel type of the PD sub-pixel may be an R type, a G type, or a B type. For example, the sub-pixel type of the PD sub-pixel is G type, and the PD sub-pixel is essentially G sub-pixel.
In performing this step, all second pixels adjacent to the first pixel in a central region of the original image may be determined.
In step 102, for each second pixel, a first set of pixels in the original image that are located around the second pixel is determined.
The pixels in the first set of pixels may or may not be located in a central region of the original image.
For one pixel, the influence of the pixel value of the neighboring pixel on the pixel value of the own pixel is large. Based on this, the first set of pixels located around the second pixel may include pixels adjacent to the second pixel.
In step 103, 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 first-type sub-pixel and the PD sub-pixel have the same target sub-pixel type.
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 type, the sub-pixel type of the first type sub-pixel is also G type, and the first type sub-pixel is G sub-pixel.
A first type of sub-pixel may be a PD sub-pixel or a non-PD sub-pixel, the PD sub-pixel and the non-PD sub-pixel having the same sub-pixel type.
Among the possible pixel arrangements, there are several cases: in the first case: the first type sub-pixels in the first pixel set comprise PD sub-pixels and non-PD sub-pixels; in the second case: the first type sub-pixels in the first pixel set only comprise PD sub-pixels; in a third case: the first type of sub-pixels in the first set of pixels comprise only non-PD sub-pixels.
In step 104, in the case of obtaining a PD image corresponding to the original image, the pixel value of the PD sub-pixel in the original image is adjusted 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, and the target sub-pixel has the target sub-pixel type.
The target subpixel may include: all the sub-pixels in the central area of the original image having the target sub-pixel type, or the target sub-pixels may include: the central area of the original image is partially provided with sub-pixels of the target sub-pixel type.
PD sub-pixels are extracted from the original image, and a PD image is formed according to the extracted PD sub-pixels. Illustratively, PD sub-pixels allowing left-side light emission are extracted from the original image, and a left PD image is formed by the extracted PD sub-pixels allowing left-side light emission. And extracting the PD sub-pixels allowing light to be emitted from the right side from the original image, and forming a right PD image by the extracted PD sub-pixels allowing light to be emitted from the right side.
For example, the pixel value of the PD subpixel that allows left-side light emission in the original image may be adjusted according to the adjusted pixel value of the target subpixel in the central area of the original image and the pixel value of the PD subpixel in the left PD image. The specific process is as follows: dividing a left PD image into a plurality of areas, wherein a plurality of target sub-pixels exist in the center area of an adjusted original image, determining the average pixel value N of the plurality of target sub-pixels, determining the average pixel value M of the plurality of PD sub-pixels in each image area of the PD image, and calculating
Figure BDA0002954982860000121
Will be provided with
Figure BDA0002954982860000122
As a pixel value compensation coefficient for use in the image area.
In the first case: the PD sub-pixels in the image area use pixel value compensation coefficients of
Figure BDA0002954982860000123
Can be multiplied by
Figure BDA0002954982860000124
And obtaining a multiplication result with the pixel value of the PD sub-pixel in the image area, and adjusting the pixel value of the PD sub-pixel in the original image to the multiplication result.
In the second case: and determining pixel value compensation coefficients used by the PD sub-pixels in the two adjacent image areas according to the pixel value compensation coefficients used by the two adjacent image areas.
Examples are: there are adjacent image area 1 and image area 2, and the image area 1 uses a pixel value compensation coefficient of
Figure BDA0002954982860000131
In particular, the PD sub-pixel located at the center point of the image area 1 uses
Figure BDA0002954982860000132
The pixel value compensation coefficient used for the image area 2 is
Figure BDA0002954982860000133
In particular, the pixel located at the center point of the image area 2 uses
Figure BDA0002954982860000134
The distance between the center points in the image area 1 and the image area 2 is d, and the distance is calculated
Figure BDA0002954982860000135
And obtaining a pixel value compensation coefficient Q corresponding to the unit distance.
PD sub-pixel q in image area 1 1 At a distance d from the center point 1 ,q 1 The pixel value compensation coefficient used is
Figure BDA0002954982860000136
Can be multiplied by
Figure BDA0002954982860000137
And q is 1 To obtain a pixel value of q 1 The target pixel value of (1). Q in the original image 1 Is adjusted to the target pixel value.
PD sub-pixel q in image area 2 2 At a distance d from the center point 2 ,q 2 The pixel value compensation coefficient used is
Figure BDA0002954982860000138
Can be multiplied by
Figure BDA0002954982860000139
And q is 2 To obtain a pixel value of q 2 The target pixel value of (1). Q in the original image 2 Is adjusted to the target pixel value.
Similarly, the pixel value of the PD sub-pixel allowing right-side light emission in the original image may be adjusted 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 right PD image.
In the embodiment of the disclosure, a first pixel and at least one second pixel in a central area of an original image are determined, the first pixel includes PD sub-pixels, the first pixel is adjacent to each second pixel, a first pixel set around the second pixels in the original image is determined, and a pixel value of a first type sub-pixel in the second pixels is adjusted according to a pixel value of the first type sub-pixel in the first pixel set, where the first type sub-pixel and the PD sub-pixel have the same target sub-pixel type, so as to solve a crosstalk problem caused by setting the PD sub-pixels in the related art, and improve an image display effect.
In one embodiment, the first set of pixels located around the second pixel may include: a plurality of first neighboring pixels adjacent to the second pixel, and a plurality of second neighboring pixels adjacent to each of the first neighboring pixels.
For example, fig. 2 is a partial schematic view of a pixel panel according to an exemplary embodiment, in fig. 2, a first pixel a is close to the center of an original image, specifically, the center of the original image, a second pixel b adjacent to the first pixel a is close to the center of the original image, the number of first adjacent pixels c adjacent to the second pixel b is 8, and the number of second adjacent pixels d adjacent to each first adjacent pixel c is 8. The plurality of first adjacent pixels c adjacent to the second pixel b include a first pixel a, and the plurality of second adjacent pixels d adjacent to the first adjacent pixels c include a second pixel b.
As another example, a first pixel is close to an edge of the original image, a 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 of the first adjacent pixels may be less than 8.
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 neighboring pixels.
Based on this, fig. 3 is a flowchart illustrating another image adjustment method according to an exemplary embodiment, and referring to fig. 3, step 103 can be implemented by:
in step 201, a weight value used by each first neighboring pixel is calculated according to the pixel value of the first type sub-pixel in each first neighboring pixel and each second neighboring pixel.
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.
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.
For step 201, the first implementation manner: firstly, iteratively updating 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 the pixel value of the first type sub-pixel in each second adjacent pixel; and secondly, after iterating to a first preset number of times, obtaining the currently used weight value of each first adjacent pixel.
For example, there are 8 first neighboring pixels adjacent to the second pixel, and the pixel values of the first type sub-pixels among the 8 first neighboring pixels are a respectively 0 、b 0 、c 0 、d 0 、e 0 、f 0 、g 0 、h 0 In the definition of (a) 0 、b 0 、c 0 、d 0 、e 0 、f 0 、g 0 、h 0 )。
Each first adjacent pixel is adjacent to 8 second adjacent pixels,the 8 groups of second neighboring pixels neighboring the 8 first neighboring pixels are: (a) 1 、b 1 、c 1 、d 1 、e 1 、f 1 、g 1 、h 1 )~(a 8 、b 8 、c 8 、d 8 、e 8 、f 8 、g 8 、h 8 ) Definition of X n =(a n 、b n 、c n 、d n 、e n 、f n 、g n 、h n )。
At the first iteration, n is 1.
Input data u (1) ═ X 1 、X 2 、X 3 、X 4 、X 5 、X 6 、X 7 、X 8 )。w(0) H =(w 1 、w 2 、w 3 、w 4 、w 5 、w 6 、w 7 、w 8 ) H =(0、0、0、0、0、0、0、0) H Initially set to 0. d (1) ═ X, X, X, X, X, X, X, X.
According to the negative gradient descent algorithm, updating the weight coefficient:
e(1)=d(1)-w(0) H u(1);
w(1)=w(0)+μ(1)e * (1)u(1)。
for a fixed step size, μ (n) is typically constant.
At the second iteration, n is 2.
Input data u (2) ═ X 1 、X 2 、X 3 、X 4 、X 5 、X 6 、X 7 、X 8 ). w (1) is the weight value obtained at the first iteration. d (2) ═ X, X, X, X, X, X, X, X.
According to the negative gradient descent algorithm, updating the weight coefficient:
e(2)=d(1)-w(1) H u(2);
w(2)=w(1)+μ(2)e * (2)u(2)。
after the method is used for iteration for the preset times, the iteration is stopped, and the currently used weight value is obtained.
For step 201, the second implementation: firstly, iteratively updating 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 the pixel value of the first type sub-pixel in each second adjacent pixel; and secondly, after iterating until the difference of the first pixel values is smaller than a first preset value, obtaining the currently used weight value of each first adjacent pixel, wherein the difference of the first pixel values is determined according to the used weight value of each first adjacent pixel.
The weight values used by the respective first neighboring pixels may be iteratively updated with reference to the method in the above example. And e (n) is the first pixel value difference, and when e (n) is smaller than the first preset value, w (n-1) used in the calculation of e (n) is used as the weight value currently used by each first adjacent pixel.
With respect to step 201, the third implementation: a first step of calculating, for each first neighboring pixel, a mean square error of a first set of pixel values with pixel values of a first type of sub-pixel in the first neighboring pixel, the first set of pixel values comprising: a pixel value of a first type sub-pixel in a plurality of second adjacent pixels adjacent to the first adjacent pixel; and a second step of determining a weight value used by each first adjacent pixel when all the mean square deviations meet a first preset condition.
In this implementation, the plurality of second adjacent pixels adjacent to the first adjacent pixel include the second pixel.
Assume that the first-type sub-pixel in the second pixel has a pixel value of y 0 The pixel values of the first type sub-pixels in 8 first adjacent pixels adjacent to the second pixel are a 0 、b 0 、c 0 、d 0 、e 0 、f 0 、g 0 、h 0 ,y 0 =w′ 1 a 0 +w′ 2 b 0 +w′ 3 c 0 +w′ 4 d 0 +w′ 5 e 0 +w′ 6 f 0 +w′ 7 g 0 +w′ 8 h 0 。w′ n Is a weight value.
For each first adjacent pixel adjacent to the second pixel, 8 adjacent second adjacent pixels exist, the difference value of each second adjacent pixel and the pixel value of the first type sub-pixel in the first adjacent pixel is calculated, the mean square difference of the average value of the 8 difference values and the pixel value of the first type sub-pixel in the first adjacent pixel is calculated, and the mean square difference is w' 1 ~w′ 8 As a function of (c). And combining 8 mean square deviations, and solving a weight value used by each first adjacent pixel when all the mean square deviations meet a first preset condition.
The first preset conditions are various, for example, when all the mean square deviations are lower than a preset value, the weight value currently used by each first adjacent pixel is obtained.
In one embodiment, fig. 4 is a flowchart illustrating another image adjustment method according to an exemplary embodiment, and referring to fig. 4, step 104 may be implemented by:
in step 301, a second set of pixels located around the first pixel in the center area of the adjusted original image is determined, and the second set of pixels includes the second pixel with the adjusted pixel value.
After the pixel values of the PD sub-pixels in the original image are adjusted by the image adjusting method, the adjusted original image is obtained. The second pixel set in the center region of the adjusted original image includes the second pixel whose pixel value is adjusted.
For one pixel, the influence of the pixel value of the neighboring pixel on the pixel value of the own pixel is large. Based on this, the second set of pixels may include pixels adjacent to the first pixel.
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.
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 the secondary adjustment and the pixel value of the PD sub-pixel in the PD image.
In this embodiment, after the adjustment of the pixel value of the first type sub-pixel in the second pixel is completed, the pixel value of the PD sub-pixel in the first pixel is further adjusted, so that the compensation of the pixel value of the PD sub-pixel is realized, and the image display effect is improved.
In one embodiment, the second set of pixels comprises: a plurality of second pixels adjacent to the first pixels, and a plurality of first adjacent pixels adjacent to each of the second pixels.
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.
Based on this, fig. 5 is a flowchart illustrating another image adjustment method according to an exemplary embodiment, and referring to fig. 5, step 302 may be implemented by:
in step 401, a weight value used by each second pixel is calculated according to the pixel values of the first type sub-pixels in each second pixel and each first adjacent pixel.
In step 402, the result of multiplying the pixel value of the first-type sub-pixel in each second pixel by the corresponding weight value is calculated.
In step 403, the pixel value of the PD sub-pixel in the first pixel is adjusted to the sum of all multiplication results.
For step 401, the first implementation: first, 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, iteratively updating the weight value used by each second pixel; and secondly, after iterating to a second preset number of times, obtaining the weight value currently used by each second pixel.
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 a respectively 0 、B 0 、C 0 、D 0 、E 0 、F 0 、G 0 、H 0 Definition of P ═ A 0 、B 0 、C 0 、D 0 、E 0 、F 0 、G 0 、H 0 )。
Each second pixel is adjacent to 8 first neighboring pixels, and 8 groups of first neighboring pixels adjacent to 8 second pixels are: (A) 1 、B 1 、C 1 、D 1 、E 1 、F 1 、G 1 、H 1 )~(A 8 、B 8 、C 8 、D 8 、E 8 、F 8 、G 8 、H 8 ) Definition of P n =(A n 、B n 、C n 、D n 、E n 、F n 、G n 、H n )。
When the first iteration is performed, n is 1.
Input data U (1) ═ P 1 、P 2 、P 3 、P 4 、P 5 、P 6 、P 7 、P 8 )。W(0) H =(W 1 、W 2 、W 3 、W 4 、W 5 、W 6 、W 7 、W 8 ) H =(0、0、0、0、0、0、0、0) H Initially set to 0. D (1) ═ (P, P, P, P, P, P, P, P).
According to the negative gradient descent algorithm, updating the weight coefficient:
E(1)=D(1)-W(0) H U(1);
W(1)=W(0)+μ(1)E * (1)U(1)。
for a fixed step size, μ (n) is typically constant.
At the second iteration, n is 2.
Input data U (2) ═ P 1 、P 2 、P 3 、P 4 、P 5 、P 6 、P 7 、P 8 ). W (1) is the weight value obtained at the first iteration. D (2) ═ P, P, P, P, P, P, P, P.
According to the negative gradient descent algorithm, updating the weight coefficient:
E(2)=D(1)-W(1) H U(2);
W(2)=W(1)+μ(2)E * (2)U(2)。
after the method is used for iteration for the preset times, the iteration is stopped, and the currently used weight value is obtained.
The second preset times are the same as the first preset times, or the second preset times are different from the first preset times.
For step 401, the second implementation: first, 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, iteratively updating the weight value used by each second pixel; and secondly, after iterating until the difference of the second pixel values is smaller than a second preset value, obtaining the currently used weight value of each second pixel, wherein the difference of the second pixel values is determined according to the used weight value of each second pixel.
The weight values used by the respective second pixels may be iteratively updated with reference to the method in the above example. And E (n) is a second pixel value difference, and when E (n) is smaller than a second preset value, W (n-1) used in the calculation of E (n) is used as a weight value currently used by each second pixel.
With respect to step 401, a third implementation: a first step of calculating, for each second pixel, a mean square error of a set of second pixel values and pixel values of a first type of sub-pixel in the second pixel, the set of second pixel values comprising: a pixel value of a first type sub-pixel in a plurality of first neighboring pixels neighboring the second pixel; and a second step of determining a weight value used by each second pixel when all the mean square deviations meet a second preset condition.
In this implementation, the plurality of first adjacent pixels adjacent to the second pixel includes the first pixel.
Suppose that the pixel value of the PD sub-pixel in the first pixel is Y 0 The first type sub-pixels in 8 second pixels adjacent to the first pixel have pixel values A 0 、B 0 、C 0 、D 0 、E 0 、F 0 、G 0 、H 0 ,Y 0 =W′ 1 A 0 +W′ 2 B 0 +W′ 3 C 0 +W′ 4 D 0 +W′ 5 E 0 +W′ 6 F 0 +W′ 7 G 0 +W′ 8 H 0 。W′ n Is a weight value.
For each second pixel adjacent to the first pixel, 8 adjacent first adjacent pixels exist, difference values of pixel values of the first type sub-pixels in each first adjacent pixel and the second pixel are calculated, mean square deviation of the average value of the 8 difference values and the pixel value of the first type sub-pixel in the second pixel is calculated, and the mean square deviation is W' 1 ~W′ 8 As a function of (c). And combining 8 mean square deviations, and solving the weight value used by each second pixel when all the mean square deviations meet a second preset condition.
The second preset condition is various, for example, when all the mean square deviations are lower than a preset threshold, the weight value currently used by each second pixel is obtained.
While, for purposes of simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present disclosure is not limited by the order of acts, as some steps may, in accordance with the present disclosure, occur in other orders and concurrently.
Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary embodiments and that acts and modules referred to are not necessarily required by the disclosure.
Corresponding to the embodiment of the application function implementation method, the disclosure also provides an embodiment of an application function implementation device and corresponding electronic equipment.
Fig. 6 is a block diagram illustrating an image adjusting apparatus according to an exemplary embodiment, the apparatus including:
a pixel determination module 51 configured to determine a first pixel and at least one second pixel in a central region of the original image, the first pixel including PD sub-pixels, the first pixel being adjacent to each of the second pixels;
a set determination module 52 configured to determine, for each second pixel, a first set of pixels located around the second pixel in the original image;
a first pixel value adjusting module 53 configured to adjust a pixel value of a first type sub-pixel in the second pixel according to a pixel value of a first type sub-pixel in the first pixel set, wherein the first type sub-pixel and the PD sub-pixel have a same target sub-pixel type;
the second pixel value adjusting module 54 is configured to, in a case that a PD image corresponding to the original image is obtained, adjust a pixel value of a PD sub-pixel in the original image according to an adjusted pixel value of a target sub-pixel in a central area of the original image and a pixel value of a PD sub-pixel in the PD image, where the target sub-pixel has the target sub-pixel type.
In an alternative embodiment, based on the image adjusting apparatus shown in fig. 5, the first set of pixels located around the second pixel includes: a plurality of first neighboring pixels adjacent to the second pixel, and a plurality of second neighboring pixels adjacent to each of the first neighboring 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;
the first pixel value adjusting module 53 may include:
a weight value calculation sub-module 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;
a data calculation sub-module 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;
a first pixel value adjusting sub-module configured to adjust the pixel value of the first type sub-pixel in the second pixel to a sum of all multiplication results.
In an optional embodiment, the weight value calculating sub-module may include:
a weight value iteration unit configured to iteratively update 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 the pixel value of the first-type sub-pixel in each second adjacent pixel;
the first weight value obtaining unit is configured to obtain the weight value currently used by each first adjacent pixel after iterating to a first preset number of times; alternatively, the first and second electrodes may be,
the second weight value obtaining unit is configured to iterate until the difference between the first pixel values is smaller than a first preset value, and then obtain the currently used weight value of each first adjacent pixel, wherein the difference between the first pixel values is determined according to the used weight value of each first adjacent pixel.
In an optional embodiment, the weight value calculating sub-module may include:
a mean square error calculation unit configured to calculate, for each first neighboring pixel, a mean square error of a first set of pixel values with pixel values of a first type of sub-pixel in the first neighboring pixel, the first set of pixel values comprising: a pixel value of a first type sub-pixel in a plurality of second neighboring pixels neighboring the first neighboring pixel;
a weight value determining unit configured to determine a weight value used by each of the first neighboring pixels when all the mean square deviations satisfy a first preset condition.
In an alternative embodiment, on the basis of the image adjusting apparatus shown in fig. 5, the second pixel value adjusting module 54 may include:
a set determination submodule configured to determine a second set of pixels located around the first pixel in a central region of the adjusted original image, the second set of pixels including a pixel value-adjusted second pixel;
a second pixel value adjusting sub-module 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;
and the third pixel value adjusting sub-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 original image after the secondary adjustment and the pixel value of the PD sub-pixel in the PD image.
In an alternative embodiment, the second set of pixels may include: a plurality of second pixels adjacent to the first pixels, and a plurality of first adjacent pixels adjacent to each of the second pixels; 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;
the second pixel value adjusting sub-module may include:
a weight value calculation unit configured to calculate a weight value used by each second pixel according to the pixel value of the first type sub-pixel in each second pixel and each first adjacent pixel;
a data calculation unit configured to calculate a multiplication result of a pixel value of the first-type sub-pixel in the respective second pixels and the corresponding weight value;
a pixel value adjusting unit configured to adjust a pixel value of a PD sub-pixel in the first pixel to a sum of all multiplication results.
In an optional embodiment, the weight value calculating unit may include:
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;
the first weight value obtaining subunit is configured to obtain a weight value currently used by each second pixel after iterating to a second preset number of times; alternatively, the first and second electrodes may be,
and the second weight value obtaining subunit is configured to iterate until the difference between the second pixel values is smaller than a second preset value, and then obtain the currently used weight value of each second pixel, where the difference between the second pixel values is determined according to the used weight value of each second pixel.
In an optional embodiment, the weight value calculating unit may include:
a mean square error calculation sub-unit configured to calculate, for each second pixel, a mean square error of a set of second pixel values with pixel values of a first type of sub-pixel of the second pixel, the set of second pixel values comprising: a pixel value of a first type sub-pixel in a plurality of first neighboring pixels neighboring the second pixel;
a weight value determining subunit configured to determine a weight value used by each of the second pixels when all the mean square deviations satisfy a second preset condition.
Fig. 7 is a schematic diagram illustrating a structure of an electronic device 1600 according to an example embodiment. For example, device 1600 may be a user device, which may be embodied as a mobile phone, a computer, a digital broadcast electronic device, a messaging device, a gaming console, a tablet device, a medical device, a fitness device, a personal digital assistant, a wearable device such as a smart watch, smart glasses, smart bracelet, smart running shoe, and the like.
Referring to fig. 6, device 1600 may include one or more of the following components: processing component 1602, memory 1604, power component 1606, multimedia component 1608, audio component 1610, input/output (I/O) interface 1612, sensor component 1614, and communications component 1616.
The processing component 1602 generally controls overall operation of the device 1600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 1602 may include one or more processors 1620 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 1602 can include one or more modules that facilitate interaction between the processing component 1602 and other components. For example, the processing component 1602 can include a multimedia module to facilitate interaction between the multimedia component 1608 and the processing component 1602.
The memory 1604 is configured to store various types of data to support operation at the device 1600. Examples of such data include instructions for any application or method operating on device 1600, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 1604 may be implemented by any type of volatile or non-volatile memory device or 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 or optical disk.
A power supply component 1606 provides power to the various components of the device 1600. The power components 1606 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 1600.
The multimedia component 1608 includes a screen that provides an output interface between the device 1600 and a user as described above. 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 an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of the touch or slide action but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1608 comprises a front-facing camera and/or a rear-facing camera. The front-facing camera and/or the back-facing camera may receive external multimedia data when device 1600 is in an operational mode, such as an adjustment mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 1610 is configured to output and/or input an audio signal. For example, audio component 1610 includes a Microphone (MIC) configured to receive external audio signals when device 1600 is in an operational mode, such as a call mode, recording mode, and voice recognition mode. The received audio signal may further be stored in the memory 1604 or transmitted via the communications component 1616. In some embodiments, audio component 1610 further includes a speaker for outputting audio signals.
The I/O interface 1612 provides an interface between the processing component 1602 and peripheral interface modules, such as keyboards, click wheels, buttons, and the like. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
Sensor assembly 1614 includes one or more sensors for providing status assessment of various aspects of device 1600. For example, sensor assembly 1614 can detect an open/closed state of device 1600, the relative positioning of components, such as a display and keypad of device 1600, a change in position of device 1600 or a component of device 1600, the presence or absence of user contact with device 1600, orientation or acceleration/deceleration of device 1600, and a change in temperature of device 1600. The sensor assembly 1614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 1614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
Communications component 1616 is configured to facilitate communications between device 1600 and other devices in a wired or wireless manner. The device 1600 may 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 broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the aforementioned communication component 1616 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
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, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, there is also provided a non-transitory computer readable storage medium, such as the memory 1604 including instructions that, when executed by the 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, wherein the first pixel comprises PD sub-pixels, and the first pixel is adjacent to each second pixel;
for each second pixel, determining a first set of pixels in the original image that are located around the second pixel;
adjusting the pixel value of a first type sub-pixel in the second pixel according to the pixel value of the first type sub-pixel in the first pixel set, wherein the first type sub-pixel and the PD sub-pixel have the same target sub-pixel type;
under the condition that a PD image corresponding to the original image is obtained, adjusting the pixel value of a PD sub-pixel in the original image according to the adjusted pixel value of a target sub-pixel in the central area of the original image and the adjusted pixel value of the PD sub-pixel in the PD image, wherein the target sub-pixel is of the target sub-pixel type.
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.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (11)

1. An image adjustment method, characterized in that the method comprises:
determining a first pixel and at least one second pixel in a central area of an original image, wherein the first pixel comprises PD sub-pixels, and the first pixel is adjacent to each second pixel;
for each second pixel, determining a first set of pixels in the original image that are located around the second pixel;
adjusting the pixel value of a first type sub-pixel in the second pixel according to the pixel value of the first type sub-pixel in the first pixel set, wherein the first type sub-pixel and the PD sub-pixel have the same target sub-pixel type;
under the condition that a PD image corresponding to the original image is obtained, adjusting the pixel value of a PD sub-pixel in the original image according to the adjusted pixel value of a target sub-pixel in the central area of the original image and the adjusted pixel value of the PD sub-pixel in the PD image, wherein the target sub-pixel is of the target sub-pixel type.
2. The method of claim 1, wherein the first set of pixels located around the second pixel comprises: a plurality of first neighboring pixels adjacent to the second pixel, and a plurality of second neighboring pixels adjacent to each of the first neighboring 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;
the adjusting the pixel value of the first type sub-pixel in the second pixel according to the pixel value of the first type sub-pixel 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 the pixel value of the first type sub-pixel in each first adjacent pixel and the corresponding weight value;
and adjusting the pixel value of the first type sub-pixel in the second pixel into the sum of all multiplication results.
3. The method of claim 2, wherein calculating the weight value used by each first neighboring pixel according to the pixel values of the first type sub-pixels in each first neighboring pixel and each second neighboring pixel comprises:
iteratively updating 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 the pixel value of the first-type sub-pixel in each second adjacent pixel;
after iteration is carried out for a first preset number of times, the weight value currently used by each first adjacent pixel is obtained; alternatively, the first and second electrodes may be,
and after iterating until the difference of the first pixel values is smaller than a first preset value, obtaining the currently used weight value of each first adjacent pixel, wherein the difference of the first pixel values is determined according to the used weight value of each first adjacent pixel.
4. The method of claim 2, wherein calculating the weight value used by each first neighboring pixel according to the pixel values of the first type sub-pixels in each first neighboring pixel and each second neighboring pixel comprises:
for each first neighboring pixel, calculating a mean square error of a first set of pixel values with pixel values of a first type of sub-pixel in the first neighboring pixel, the first set of pixel values comprising: a pixel value of a first type sub-pixel in a plurality of second neighboring pixels neighboring the first neighboring pixel;
and determining the weight value used by each first adjacent pixel when all the mean square deviations 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 adjusted pixel value of the PD sub-pixel in the PD image comprises:
determining a second pixel set located around the first pixel in the adjusted central area of the original image, wherein the second pixel set comprises a second pixel with an adjusted pixel value;
adjusting the pixel value of a PD sub-pixel in the first pixel according to the pixel value of a first type sub-pixel in the second pixel set;
and adjusting 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 the secondary adjustment and the pixel value of the PD sub-pixel in the PD image.
6. The method of claim 5, wherein the second set of pixels comprises: a plurality of second pixels adjacent to the first pixels, and a plurality of first adjacent pixels adjacent to each of the second pixels; 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;
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 the first type sub-pixel in each second pixel and each first adjacent pixel;
calculating a multiplication result of the pixel value of the first type sub-pixel in each second pixel and the corresponding weight value;
and adjusting the pixel value of the PD sub-pixel in the first pixel into the sum of all multiplication results.
7. The method of claim 6, wherein calculating the weight value for each second pixel based on the pixel values of the first type sub-pixels in each second pixel and each first neighboring pixel comprises:
iteratively updating 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;
after iteration is carried out for a second preset number of times, the weight value currently used by each second pixel is obtained; alternatively, the first and second electrodes may be,
and after iterating until the difference of the second pixel values is smaller than a second preset value, obtaining the currently used weight value of each second pixel, wherein the difference of the second pixel values is determined according to the used weight value of each second pixel.
8. The method of claim 6, wherein calculating the weight value used by each second pixel according to the pixel values of the first type sub-pixels in each second pixel and each first neighboring pixel comprises:
for each second pixel, calculating a mean square error of a set of second pixel values and pixel values of a first type of sub-pixel in the second pixel, the set of second pixel values comprising: a pixel value of a first type sub-pixel in a plurality of first neighboring pixels neighboring the second pixel;
and determining the weight value used by each second pixel when all the mean square deviations meet a second preset condition.
9. An image adjusting apparatus, characterized in that the apparatus comprises:
a pixel determination module configured to determine a first pixel and at least one second pixel in a central region of an original image, the first pixel including PD sub-pixels, the first pixel being adjacent to each of the second pixels;
a set determination module configured to determine, for each second pixel, a first set of pixels in the original image that are located around the second pixel;
a first pixel value adjusting module configured to adjust a pixel value of a first type sub-pixel in the second pixel according to a pixel value of the first type sub-pixel in the first pixel set, the first type sub-pixel and the PD sub-pixel having a same target sub-pixel type;
and the second pixel value adjusting module is configured to, under the condition that the PD image corresponding to the original image is obtained, adjust 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, wherein the target sub-pixel has the target sub-pixel type.
10. A non-transitory computer readable storage medium having stored thereon a computer program, characterized in that the program, when executed by a processor, implements the method of any one of claims 1-8.
11. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
determining a first pixel and at least one second pixel in a central area of an original image, wherein the first pixel comprises PD sub-pixels, and the first pixel is adjacent to each second pixel;
for each second pixel, determining a first set of pixels in the original image that are located around the second pixel;
adjusting the pixel value of a first type sub-pixel in the second pixel according to the pixel value of the first type sub-pixel in the first pixel set, wherein the first type sub-pixel and the PD sub-pixel have the same target sub-pixel type;
under the condition that a PD image corresponding to the original image is obtained, adjusting the pixel value of a PD sub-pixel in the original image according to the adjusted pixel value of a target sub-pixel in the central area of the original image and the adjusted pixel value of the PD sub-pixel in the PD image, wherein the target sub-pixel is of the target sub-pixel type.
CN202110221195.2A 2021-02-26 2021-02-26 Image adjusting method and device Pending CN114979412A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110221195.2A CN114979412A (en) 2021-02-26 2021-02-26 Image adjusting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110221195.2A CN114979412A (en) 2021-02-26 2021-02-26 Image adjusting method and device

Publications (1)

Publication Number Publication Date
CN114979412A true CN114979412A (en) 2022-08-30

Family

ID=82973586

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110221195.2A Pending CN114979412A (en) 2021-02-26 2021-02-26 Image adjusting method and device

Country Status (1)

Country Link
CN (1) CN114979412A (en)

Similar Documents

Publication Publication Date Title
CN107798669B (en) Image defogging method and device and computer readable storage medium
EP3057304B1 (en) Method and apparatus for generating image filter
EP3125158B1 (en) Method and device for displaying images
US11061202B2 (en) Methods and devices for adjusting lens position
CN106331504B (en) Shooting method and device
KR20160021737A (en) Method, apparatus and device for image segmentation
US10248855B2 (en) Method and apparatus for identifying gesture
CN107944367B (en) Face key point detection method and device
CN106651777B (en) Image processing method and device and electronic equipment
CN107967459B (en) Convolution processing method, convolution processing device and storage medium
CN107341509B (en) Convolutional neural network training method and device and readable storage medium
CN107403144B (en) Mouth positioning method and device
EP3040912A1 (en) Method and device for classifying pictures
EP3770859B1 (en) Image processing method, image processing apparatus, and storage medium
US20170147896A1 (en) Method, device, and storage medium for feature extraction
WO2021031311A1 (en) Supernet construction method and device, supernet usage method and device, and medium
CN107730443B (en) Image processing method and device and user equipment
CN113160038B (en) Image style migration method and device, electronic equipment and storage medium
US9665925B2 (en) Method and terminal device for retargeting images
CN107609513B (en) Video type determination method and device
CN107920015B (en) Method and device for publishing picture
CN105635573A (en) Pick-up head visual angle adjusting method and apparatus
CN114979412A (en) Image adjusting method and device
CN116934823A (en) Image processing method, device, electronic equipment and readable storage medium
CN110910304B (en) Image processing method, device, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination