CN117764895A - Image processing method, device and storage medium - Google Patents

Image processing method, device and storage medium Download PDF

Info

Publication number
CN117764895A
CN117764895A CN202211124774.6A CN202211124774A CN117764895A CN 117764895 A CN117764895 A CN 117764895A CN 202211124774 A CN202211124774 A CN 202211124774A CN 117764895 A CN117764895 A CN 117764895A
Authority
CN
China
Prior art keywords
pixel
value
adjustment
initial
brightness
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
CN202211124774.6A
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 CN202211124774.6A priority Critical patent/CN117764895A/en
Publication of CN117764895A publication Critical patent/CN117764895A/en
Pending legal-status Critical Current

Links

Landscapes

  • Studio Devices (AREA)
  • Transforming Electric Information Into Light Information (AREA)

Abstract

The present disclosure relates to an image processing method. The method comprises the following steps: acquiring an initial image and an adjustment image generated when the initial image is photographed; wherein the pixel array in the adjusted image is the same as the pixel array in the initial image; determining adjustment values corresponding to all pixels in the initial image from the adjustment image; adjusting initial pixel parameters of the pixels in the initial image based on the adjustment values corresponding to the pixels to obtain target pixel parameters of the pixels; and obtaining a target image based on the target pixel parameters of each pixel. Therefore, each pixel in the initial image can be adjusted, the adjustment of each pixel is accurate, the function of locally enhancing the display effect of the initial image shot by the terminal equipment can be realized, and the reality and the contrast of the local display effect of the initial image are improved, so that the purposes of restoring the shot scene and improving the user experience are achieved.

Description

Image processing method, device and storage medium
Technical Field
The present disclosure relates to the field of image processing, and in particular, to an image processing method, apparatus, and storage medium.
Background
In the related art, the requirements of users on the display effect of the images shot by the terminal equipment are higher and higher, but when a shooting function is realized by many terminal equipment, the image effect finally displayed and checked on the terminal equipment is inconsistent with the image effect displayed in the preview frame of the terminal equipment in actual shooting, namely, the shot image effect is inconsistent with the scene effect in shooting, and especially, the reality and the contrast ratio in local detail are deficient.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides an image processing method, an image processing device, and a storage medium, which can adjust each pixel in an initial image, and accurately adjust each pixel, so as to achieve the function of locally enhancing a display effect of the initial image shot by a terminal device, and improve the reality and contrast of the local display effect of the initial image, thereby achieving the purpose of restoring a shooting scene, keeping the display effect of an adjusted target image as consistent as possible with the shooting scene, and improving user experience.
According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method including:
Acquiring an initial image and an adjustment image generated when the initial image is photographed; wherein the pixel array in the adjusted image is the same as the pixel array in the initial image;
determining adjustment values corresponding to all pixels in the initial image from the adjustment image;
adjusting initial pixel parameters of the pixels in the initial image based on the adjustment values corresponding to the pixels to obtain target pixel parameters of the pixels;
and obtaining a target image based on the target pixel parameters of each pixel.
In some embodiments, the pixel parameters include: pixel brightness and pixel value; the adjusting the initial pixel parameter of the pixel in the initial image based on the adjustment value corresponding to the pixel to obtain the target pixel parameter of the pixel includes:
determining a target adjustment strategy corresponding to the adjustment value of the pixel; wherein, different adjustment values correspond to different adjustment strategies;
adjusting the initial pixel brightness and/or the initial pixel value of the pixel according to the target adjustment strategy to obtain target pixel brightness and target pixel value of the pixel;
the obtaining a target image based on the target pixel parameters of the pixels comprises the following steps:
And obtaining the target image based on the target pixel brightness and the target pixel value of each pixel.
In some embodiments, the adjusting the initial pixel brightness and/or the initial pixel value of the pixel according to the target adjustment policy to obtain the target pixel brightness and the target pixel value of the pixel includes:
determining a target pixel brightness of the pixel according to the initial pixel brightness of the pixel;
and under the condition that the brightness of the target pixel is determined, adjusting the initial pixel value of the pixel to obtain the target pixel value of the pixel.
In some embodiments, the determining the target pixel luminance of the pixel from the initial pixel luminance of the pixel comprises:
determining an initial pixel brightness of the pixel as a target pixel brightness of the pixel under the condition that the adjustment value of the pixel is a first preset adjustment value;
when the adjustment value of the pixel is a second preset adjustment value or a third preset adjustment value, the initial pixel brightness of the pixel is adjusted to obtain the target pixel brightness of the pixel;
the first preset adjustment value is smaller than the second preset adjustment value, and the third preset adjustment value is larger than the second preset adjustment value.
In some embodiments, the adjusting the initial pixel brightness of the pixel to obtain the target pixel brightness of the pixel when the adjustment value of the pixel is the second preset adjustment value includes:
determining a first difference value according to the current brightness value of the terminal equipment and the limit brightness value of the terminal equipment under the condition that the adjustment value of the pixel is the second preset adjustment value;
determining a second difference value according to the first preset adjustment value and the third preset adjustment value;
determining a first adjustment coefficient according to the first difference value and the second difference value;
determining a change value according to the first adjustment coefficient and the second preset adjustment value;
and determining the target pixel brightness of the pixel according to the change value and the current brightness value of the terminal equipment.
In some embodiments, the adjusting the initial pixel brightness of the pixel to obtain the target pixel brightness of the pixel when the adjustment value of the pixel is a third preset adjustment value includes:
and determining the limit brightness value of the terminal equipment as the target pixel brightness of the pixel under the condition that the adjustment value of the pixel is the third preset adjustment value.
In some embodiments, the adjusting the initial pixel value of the pixel to obtain the target pixel value of the pixel when the target pixel brightness is determined includes:
under the condition that the brightness of the target pixel is determined, if the adjustment value of the pixel is a first preset adjustment value or a second preset adjustment value, determining a second adjustment coefficient based on the brightness of the target pixel of the pixel and the limit brightness value of the terminal equipment;
determining a target pixel value of the pixel based on the second adjustment coefficient, the initial pixel value of the pixel and a preset conversion relation;
wherein, the preset conversion relation represents: and a mapping relation between the pixel brightness and the pixel value.
In some embodiments, the adjusting the initial pixel value of the pixel to obtain the target pixel value of the pixel when the target pixel brightness is determined includes:
and under the condition that the brightness of the target pixel is determined, if the adjustment value of the pixel is a third preset adjustment value, determining the initial pixel value of the pixel as the target pixel value of the pixel.
In some embodiments, the method further comprises:
And under the condition that an adjustment instruction for adjusting the initial image is received, adjusting initial pixel parameters of all pixels in the initial image based on adjustment values corresponding to all pixels to obtain the target image.
According to a second aspect of the embodiments of the present disclosure, there is provided an image processing apparatus including:
a generation module configured to acquire an initial image and an adjustment image generated when the initial image is photographed; wherein the pixel array in the adjusted image is the same as the pixel array in the initial image;
the determining module is configured to determine the adjustment value corresponding to each pixel in the initial image from the adjustment image;
the first adjusting module is configured to adjust initial pixel parameters of the pixels in the initial image based on the adjustment values corresponding to the pixels to obtain target pixel parameters of the pixels;
and the processing module is configured to obtain a target image based on the target pixel parameters of each pixel.
In some embodiments, the pixel parameters include: pixel brightness and pixel value; the first adjustment module is configured to:
determining a target adjustment strategy corresponding to the adjustment value of the pixel; wherein, different adjustment values correspond to different adjustment strategies;
Adjusting the initial pixel brightness and/or the initial pixel value of the pixel according to the target adjustment strategy to obtain target pixel brightness and target pixel value of the pixel;
the obtaining a target image based on the target pixel parameters of the pixels comprises the following steps:
and obtaining the target image based on the target pixel brightness and the target pixel value of each pixel.
In some embodiments, the first adjustment module is configured to:
determining a target pixel brightness of the pixel according to the initial pixel brightness of the pixel;
and under the condition that the brightness of the target pixel is determined, adjusting the initial pixel value of the pixel to obtain the target pixel value of the pixel.
In some embodiments, the first adjustment module is configured to:
determining an initial pixel brightness of the pixel as a target pixel brightness of the pixel under the condition that the adjustment value of the pixel is a first preset adjustment value;
when the adjustment value of the pixel is a second preset adjustment value or a third preset adjustment value, the initial pixel brightness of the pixel is adjusted to obtain the target pixel brightness of the pixel;
The first preset adjustment value is smaller than the second preset adjustment value, and the third preset adjustment value is larger than the second preset adjustment value.
In some embodiments, the first adjustment module is configured to:
determining a first difference value according to the current brightness value of the terminal equipment and the limit brightness value of the terminal equipment under the condition that the adjustment value of the pixel is the second preset adjustment value;
determining a second difference value according to the first preset adjustment value and the third preset adjustment value;
determining a first adjustment coefficient according to the first difference value and the second difference value;
determining a change value according to the first adjustment coefficient and the second preset adjustment value;
and determining the target pixel brightness of the pixel according to the change value and the current brightness value of the terminal equipment.
In some embodiments, the first adjustment module is configured to:
and determining the limit brightness value of the terminal equipment as the target pixel brightness of the pixel under the condition that the adjustment value of the pixel is the third preset adjustment value.
In some embodiments, the first adjustment module is configured to:
under the condition that the brightness of the target pixel is determined, if the adjustment value of the pixel is a first preset adjustment value or a second preset adjustment value, determining a second adjustment coefficient based on the brightness of the target pixel of the pixel and the limit brightness value of the terminal equipment;
Determining a target pixel value of the pixel based on the second adjustment coefficient, the initial pixel value of the pixel and a preset conversion relation;
wherein, the preset conversion relation represents: and a mapping relation between the pixel brightness and the pixel value.
In some embodiments, the first adjustment module is configured to:
and under the condition that the brightness of the target pixel is determined, if the adjustment value of the pixel is a third preset adjustment value, determining the initial pixel value of the pixel as the target pixel value of the pixel.
In some embodiments, the apparatus further comprises:
and the second adjusting module is configured to adjust initial pixel parameters of each pixel in the initial image based on the adjustment value corresponding to each pixel under the condition that an adjustment instruction for adjusting the initial image is received, so as to obtain the target image.
According to a third aspect of the embodiments of the present disclosure, there is provided an image processing apparatus including:
a processor;
a memory configured to store processor-executable instructions;
wherein the processor is configured to: the steps of any one of the image processing methods of the first aspect described above are implemented when executed.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium, which when executed by a processor of an image processing apparatus, causes the apparatus to perform the steps of any one of the image processing methods of the first aspect described above.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects:
in the embodiment of the disclosure, an initial image and an adjustment image generated when the initial image is photographed may be acquired; wherein the pixel array in the adjusted image is the same as the pixel array in the initial image. From the adjustment image, the adjustment value corresponding to each pixel in the initial image can be determined, the initial pixel parameters of the pixels in the initial image are adjusted based on the adjustment values corresponding to the pixels, the target pixel parameters of the pixels are obtained, and then the target image is obtained based on the target pixel parameters of each pixel.
According to the method and the device for adjusting the initial image, on the basis of obtaining the initial image and generating the adjustment image corresponding to the initial image, the adjustment can be performed on each pixel in the initial image according to the adjustment value corresponding to each pixel in the adjustment image, the adjustment of each pixel is accurate, the function of locally enhancing the display effect of the initial image shot by the terminal equipment can be achieved, the reality and the contrast of the local display effect of the initial image are improved, the shooting scene is restored, the display effect of the target image obtained after adjustment is kept consistent with the shooting scene as much as possible, and the purpose of improving user experience is achieved.
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
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow diagram of an image processing method, shown in accordance with an exemplary embodiment;
FIG. 2 is a flow chart diagram II of an image processing method according to an exemplary embodiment;
FIG. 3 is a block diagram of an image processing apparatus according to an exemplary embodiment;
fig. 4 is a block diagram of an image processing apparatus 800 shown according to an exemplary embodiment;
fig. 5 is a block diagram of a hardware configuration of an image processing apparatus according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
An image processing method is provided in an embodiment of the present disclosure, and fig. 1 is a schematic flow diagram of the image processing method according to an exemplary embodiment, as shown in fig. 1. The method mainly comprises the following steps:
in step 101, an initial image is acquired, and an adjustment image generated when the initial image is photographed; wherein the pixel array in the adjusted image is the same as the pixel array in the initial image;
in step 102, determining adjustment values corresponding to each pixel in the initial image from the adjustment image;
in step 103, adjusting an initial pixel parameter of the pixel in the initial image based on the adjustment value corresponding to the pixel to obtain a target pixel parameter of the pixel;
in step 104, a target image is obtained based on the target pixel parameters for each of the pixels.
It should be noted that the image processing method provided in the present disclosure may be applied to a terminal device or a server. Here, the terminal device may include: mobile terminals and fixed terminals. Wherein, the mobile terminal may include: a mobile phone, a tablet computer, a notebook computer and other devices. The fixed terminal may include: desktop computers, smart televisions, etc.
The image processing method in the embodiment of the present disclosure may be configured in an image processing apparatus, which may be provided in a server, or may also be provided in a terminal device, to which the embodiment of the present disclosure is not limited.
The execution body of the embodiment of the present disclosure may be, for example, a central processing unit (Central Processing Unit, CPU) in a server or a terminal device in hardware, and may be, for example, a relevant background service in a server or a terminal device in software, which is not limited.
In the embodiment of the disclosure, when a shooting instruction is detected, a terminal device or a server executes a shooting function to complete shooting of a shooting scene, an initial image can be obtained, and an adjustment image corresponding to the initial image is generated, wherein a pixel array in the adjustment image is the same as a pixel array in the initial image, that is, each pixel in the adjustment image corresponds to each pixel in the initial image.
Here, the initial image may be an image that may be displayed and viewed on the terminal device when the terminal device is photographed, an image that may be viewed and displayed in an album of the terminal device after the terminal device is photographed, or an image that may be acquired from another terminal device by the terminal device after the terminal device is photographed; the adjustment image may be image information generated corresponding to the initial image according to a scene at the time of photographing, and includes adjustment values corresponding to respective pixels in the initial image. Thus, when the initial image is adjusted, the target image obtained after adjustment can be ensured to be consistent with the scene at the time of shooting.
In some embodiments, the terminal device shoots and generates an initial image and an adjustment image, and adjusts the initial image according to the adjustment image; in other embodiments, the other terminal device captures an initial image and an adjustment image, the terminal device obtains the initial image and the adjustment image from the other terminal device, and adjusts the initial image according to the adjustment image.
In some embodiments, the terminal device is provided with software or a control for executing the shooting function, and when the terminal device receives a shooting instruction, that is, when the software or the control for executing the shooting function works, the terminal device can control the camera to complete shooting of a scene based on the shooting instruction, so that an initial image can be obtained, and the shot initial image is displayed on a screen of the terminal device. In the process that the terminal equipment obtains the initial image, an adjustment image corresponding to the initial image can be generated, wherein the adjustment image can be image information corresponding to the initial image according to a scene during shooting, and the value corresponding to each pixel in the image information is the adjustment value corresponding to each pixel in the initial image.
The adjustment image may be understood as an information set containing additional information corresponding to the initial image, i.e., the adjustment image may be an information set generated corresponding to the initial image according to a scene at the time of photographing, and the information set may be represented in the form of an information array. The position information of each unit in the information array corresponds to the position information of each pixel in the initial image, and each unit contains an adjustment value corresponding to each pixel in the initial image.
The additional information may be the above image information, at least including adjustment values corresponding to each pixel in the initial image, and of course, may also include other additional information corresponding to each pixel, for example: position information corresponding to each pixel, and the like.
From the adjustment image, an adjustment value corresponding to each pixel in the initial image may be determined, where the pixel array in the adjustment image is the same as the pixel array in the initial image, a certain pixel in the initial image may be determined first, and then position information of the pixel in the initial image may be determined, where the position information may include coordinate information of the pixel in the initial image, distance and direction information relative to a reference pixel, and so on. And then, determining an adjustment pixel corresponding to the pixel in the adjustment image according to the position information of the pixel, wherein the value corresponding to the adjustment pixel in the adjustment image is the adjustment value corresponding to the pixel in the initial image.
In some embodiments, the method further comprises:
and under the condition that an adjustment instruction for adjusting the initial image is received, adjusting initial pixel parameters of all pixels in the initial image based on adjustment values corresponding to all pixels to obtain the target image.
In the embodiment of the disclosure, on the basis of obtaining the initial image and generating the adjustment image corresponding to the initial image, the adjustment image may be stored in the terminal device or the server in correspondence with the initial image, and the image that may be viewed and displayed in the terminal device or the server is the initial image. When an adjustment instruction for adjusting the initial image is received, initial pixel parameters of each pixel in the initial image can be adjusted based on adjustment values corresponding to each pixel, so that a target image is obtained, and thus the target image obtained after adjustment can be viewed and displayed in a terminal device or a server.
In some embodiments, a trigger interface for adjusting the initial images is configured in the terminal device or the server, and when the initial images need to be adjusted so that the generated target images are consistent with the scene in shooting, the adjustment function can be started through the trigger interface, the terminal device or the server executes the adjustment function for the initial images, and each initial image can have one trigger interface for adjusting, so that the corresponding initial image can be adjusted.
In the embodiment of the disclosure, under the condition that the adjustment instruction for adjusting the initial image is not received, the initial image can not be adjusted, so that the memory of a central processing unit occupied when the initial image is adjusted can be saved; when receiving an adjustment instruction for adjusting the initial image, the initial image can be adjusted so as to obtain a target image, so that the initial image can be adjusted if needed, and the image displayed in the terminal device or the server is more in line with the actual need.
In some embodiments, the display effect of the initial image obtained after the shooting is completed is inconsistent with the scene effect during shooting, that is, the display effect of the initial image is inconsistent with the image effect displayed in the preview frame during shooting of the terminal device, and the initial pixel parameters of the pixels in the initial image can be adjusted according to the adjustment value in the adjustment image, so as to obtain the target pixel parameters of the pixels. Here, the adjustment value of each pixel in the adjustment image represents the degree of adjustment to each pixel in the initial image, and the adjustment value of each pixel in the adjustment image corresponds to the initial pixel parameter of each pixel in the initial image.
In some embodiments, different modes may be selected according to actual application conditions to adjust initial pixel parameters of pixels in the initial image according to adjustment values in the adjustment image, so as to obtain target pixel parameters of the pixels. For example, a target pixel parameter for a pixel may be determined from the sum of the adjustment value and the initial pixel parameter; for another example, the weight of the adjustment value and the weight of the initial pixel parameter may be determined first, and then the target pixel parameter of the pixel may be determined together according to the weight of the adjustment value and the weight of the initial pixel parameter.
Based on the target pixel parameters of the pixels according to the adjustment values of the pixels, a target image can be obtained, wherein each pixel in the target image corresponds to each pixel in the adjustment image and each pixel in the initial image, that is, when the target pixel parameters corresponding to each pixel in the initial image are determined, the target image corresponding to each pixel in the initial image can be generated based on each target pixel parameter. Here, the target pixel parameter may characterize the display effect of each pixel in the target image.
In some embodiments, the pixel parameters may include: pixel brightness, may also include: pixel values, which can be used to characterize the average luminance information of a pixel. The pixel brightness can be 0-255, the pixel value can be 0-255, the pixel adjustment value can be 0-255, and in practical application, each value range can be adaptively adjusted according to the practical use requirement or the configuration of the terminal equipment.
According to the method and the device for adjusting the initial image, on the basis of obtaining the initial image and generating the adjustment image corresponding to the initial image, the adjustment can be performed on each pixel in the initial image according to the adjustment value corresponding to each pixel in the adjustment image, the adjustment of each pixel is accurate, the function of locally enhancing the display effect of the initial image shot by the terminal equipment can be achieved, the reality and the contrast of the local display effect of the initial image are improved, the shooting scene is restored, the display effect of the target image obtained after adjustment is kept consistent with the shooting scene as much as possible, and the purpose of improving user experience is achieved.
In some embodiments, the pixel parameters include: pixel brightness and pixel value; fig. 2 is a second flow chart of an image processing method according to an exemplary embodiment, and as shown in fig. 2, the method mainly includes the following steps:
in step 101, an initial image is acquired, and an adjustment image generated when the initial image is photographed; wherein the pixel array in the adjusted image is the same as the pixel array in the initial image;
in step 102, determining adjustment values corresponding to each pixel in the initial image from the adjustment image;
in step 201, a target adjustment policy corresponding to the adjustment value of the pixel is determined; wherein, different adjustment values correspond to different adjustment strategies;
in step 202, the initial pixel brightness and/or the initial pixel value of the pixel are adjusted according to the target adjustment strategy, so as to obtain the target pixel brightness and the target pixel value of the pixel;
in step 203, the target image is obtained based on the target pixel luminance and the target pixel value of each of the pixels.
In the embodiment of the present disclosure, the pixel parameters may include pixel brightness and pixel value, and the corresponding adjustment values may also include: the brightness adjustment value is used for adjusting the initial pixel brightness of the pixel to obtain target pixel brightness, and the pixel adjustment value is used for adjusting the initial pixel value of the pixel to obtain target pixel value.
In some embodiments, where the adjustment values of the pixels are different, different adjustment strategies corresponding to the adjustment values of the pixels are determined. For example, a mapping relationship between the adjustment values and the respective adjustment policies may be preset, and after the adjustment values are determined, the adjustment policies corresponding to the respective adjustment values may be determined based on the mapping relationship between the adjustment values and the adjustment policies.
Here, the adjustment policy may be an adjustment manner for adjusting the initial pixel parameter. For example, the adjustment method may be an adjustment method for adjusting the initial pixel brightness according to an adjustment policy. For another example, the initial pixel value may be adjusted according to an adjustment policy.
Under the condition that the corresponding target adjustment strategy is determined according to the adjustment value of the pixel, the initial pixel brightness of the pixel can be adjusted according to the target adjustment strategy, the initial pixel value of the pixel can be adjusted according to the target adjustment strategy, and the initial pixel brightness of the pixel and the initial pixel value of the pixel can be adjusted according to the target adjustment strategy, so that the target pixel brightness and the target pixel value of the pixel are obtained. The target image can be obtained on the basis of the target pixel luminance and the target pixel value of each pixel.
In the embodiment of the disclosure, different adjustment strategies corresponding to different pixels are determined according to the adjustment values of the different pixels, so that each pixel is adjusted according to the different adjustment strategies, the pixels can be adjusted in a targeted manner, the flexibility of image processing can be improved, and the local display effect of the image is better.
In some embodiments, the adjusting the initial pixel brightness and/or the initial pixel value of the pixel according to the target adjustment policy to obtain the target pixel brightness and the target pixel value of the pixel includes:
determining a target pixel brightness of the pixel according to the initial pixel brightness of the pixel;
and under the condition that the brightness of the target pixel is determined, adjusting the initial pixel value of the pixel to obtain the target pixel value of the pixel.
In the embodiment of the disclosure, under the condition that a target adjustment strategy corresponding to an adjustment value of a pixel is determined, the initial pixel brightness of the pixel is adjusted according to the target adjustment strategy, so that the target pixel brightness of the pixel is determined, and under the condition that the target pixel brightness is determined, the initial pixel value of the pixel is adjusted according to the target adjustment strategy, so that the target pixel value of the pixel is obtained.
In some embodiments, according to the target adjustment policy, the initial pixel brightness and the initial pixel value of the pixel may be adjusted at the same time, or the initial pixel value of the pixel may be adjusted first, and then the initial pixel brightness of the pixel may be adjusted to obtain the target pixel brightness and the target pixel value.
In the embodiment of the disclosure, under the condition that the target pixel brightness is determined, the initial pixel value of the pixel is adjusted to obtain the target pixel value of the pixel, so that the target pixel brightness can be determined more simply, and under the condition that the target pixel value is finally determined, the target image can be determined according to the target pixel values of all the pixels.
In some embodiments, the determining the target pixel luminance of the pixel from the initial pixel luminance of the pixel comprises:
determining an initial pixel brightness of the pixel as a target pixel brightness of the pixel under the condition that the adjustment value of the pixel is a first preset adjustment value;
when the adjustment value of the pixel is a second preset adjustment value or a third preset adjustment value, the initial pixel brightness of the pixel is adjusted to obtain the target pixel brightness of the pixel;
The first preset adjustment value is smaller than the second preset adjustment value, and the third preset adjustment value is larger than the second preset adjustment value.
In the embodiment of the disclosure, under the condition that the adjustment values of the pixels are different, an adjustment strategy for the initial pixel brightness of the pixel corresponding to the adjustment value of the pixel is determined, so that the initial pixel brightness is adjusted according to the adjustment strategy, and the target pixel brightness is obtained.
In some embodiments, in the case where the adjustment value of the pixel is the first preset adjustment value, the initial pixel luminance of the pixel may be determined as the target pixel luminance of the pixel.
In other embodiments, when the adjustment value of the pixel is the second preset adjustment value or the third preset adjustment value, the initial pixel brightness of the pixel may be adjusted, so as to obtain the target pixel brightness of the pixel.
In the embodiment of the disclosure, the first preset adjustment value is smaller than the second preset adjustment value, and the third preset adjustment value is larger than the second preset adjustment value, where specific values of the first preset adjustment value, the second preset adjustment value, and the third preset adjustment value may be different according to different value ranges of the adjustment values of the pixels.
In some embodiments, the first preset adjustment value may be a minimum value in the value range, the third preset adjustment value may be a maximum value in the value range, and the second preset adjustment value may be any other adjustment value that eliminates the extremum in the value range.
In another embodiment, the value range of the pixel may be divided into several different sections, where the three sections may be a section composed of smaller values, a section composed of middle values, and a section composed of larger values, respectively, the first preset adjustment value may be any adjustment value in the section composed of smaller values, the second preset adjustment value may be any adjustment value in the section composed of middle values, and the third preset adjustment value may be any adjustment value in the section composed of larger values.
Taking the value range of the adjustment value of the pixel as 0-255, the first preset adjustment value is exemplified by the minimum value 0 in the value range. The adjustment value of the pixel may represent the brightness of the corresponding pixel in the initial image, and in the case that the adjustment value of the pixel is a minimum value in the value range, the adjustment may be represented without adjusting the initial pixel brightness of the pixel, that is, the initial pixel brightness of the pixel may be directly determined as the target pixel brightness of the pixel, and the initial pixel brightness of the pixel may be the current brightness value of the terminal device.
Taking the value range of the adjustment value of the pixel as 0-255, the second preset adjustment value as any one of adjustment values of 1-254, and the third preset adjustment value as 255 as an example, when the adjustment value of the pixel is any one of adjustment values of 1-255, the initial pixel brightness of the pixel needs to be adjusted, so as to obtain the target pixel brightness of the pixel.
In the embodiment of the disclosure, different adjustment strategies for the initial pixel brightness are determined according to different adjustment values of the pixels, so that the initial pixel brightness is adjusted under the condition that the adjustment values of the pixels are different, the pixels can be adjusted in a targeted manner, and the display effect of the image is better.
In some embodiments, the adjusting the initial pixel brightness of the pixel to obtain the target pixel brightness of the pixel when the adjustment value of the pixel is the second preset adjustment value includes:
determining a first difference value according to the current brightness value of the terminal equipment and the limit brightness value of the terminal equipment under the condition that the adjustment value of the pixel is the second preset adjustment value;
determining a second difference value according to the first preset adjustment value and the third preset adjustment value;
Determining a first adjustment coefficient according to the first difference value and the second difference value;
determining a change value according to the first adjustment coefficient and the second preset adjustment value;
and determining the target pixel brightness of the pixel according to the change value and the current brightness value of the terminal equipment.
In the embodiment of the disclosure, when the adjustment value of the pixel is the second preset adjustment value, the initial pixel brightness of the pixel may be adjusted, so as to obtain the target pixel brightness of the pixel. Here, the adjustment value of the pixel may have a value range of 0 to 255, and the second preset adjustment value may be any adjustment value of 1 to 254.
In some embodiments, in the case that the adjustment value of the pixel is the second preset adjustment value, the first difference value may be determined according to the current brightness value of the terminal device and the limit brightness value of the terminal device; determining a second difference value according to the first preset adjustment value and the third preset adjustment value; determining a first adjustment coefficient according to the first difference value and the second difference value; determining a change value according to the first adjustment coefficient and a second preset adjustment value; and determining the target pixel brightness of the pixel according to the change value and the current brightness value of the terminal equipment. The calculation formula of the target pixel brightness is as follows:
In the formula (1), lv tar Lv is the target pixel luminance of a pixel cur Lv is the current luminance value of the terminal equipment max E is the limit brightness value of the terminal equipment 1 E is a first preset adjustment value 2 E is a second preset adjustment value 3 For the third preset adjustment value, lv max -Lv cur E is the first difference value e 3 -e 1 Is the second difference.
The calculation formula of the first adjustment coefficient is as follows:
in the formula (2), k 1 For the first adjustment coefficient, lv cur Lv is the current luminance value of the terminal equipment max E is the limit brightness value of the terminal equipment 1 E is a first preset adjustment value 3 And a third preset adjustment value.
The calculation formula of the change value is as follows:
in the formula (3), a is a variation value, lv cur Lv is the current luminance value of the terminal equipment max E is the limit brightness value of the terminal equipment 1 E is a first preset adjustment value 2 E is a second preset adjustment value 3 And a third preset adjustment value.
It should be noted that, the current brightness value of the terminal device may be: the terminal equipment displays the brightness value of the initial image in the current state, namely the initial pixel brightness of the pixel; the limit luminance value of the terminal device may be: the highest brightness that the terminal device can support.
In the embodiment of the disclosure, the second preset adjustment value is determined, and the target pixel brightness of the pixel is determined more clearly and simply by combining the first preset adjustment value, the second preset adjustment value and the third preset adjustment value according to the current brightness value of the terminal device and the limit brightness value of the terminal device.
In some embodiments, the adjusting the initial pixel brightness of the pixel to obtain the target pixel brightness of the pixel when the adjustment value of the pixel is a third preset adjustment value includes:
and determining the limit brightness value of the terminal equipment as the target pixel brightness of the pixel under the condition that the adjustment value of the pixel is the third preset adjustment value.
In the embodiment of the disclosure, in the case where the adjustment value of the pixel is the third preset adjustment value, the limit luminance value of the terminal device may be determined as the target pixel luminance of the pixel. Here, the value range of the adjustment value of the pixel may be 0 to 255, and the third preset adjustment value may be a maximum value 255 in the value range. The adjustment value of the pixel may represent the brightness enhancement degree of the corresponding pixel in the initial image, and in the case that the adjustment value of the pixel is the maximum value in the value range, the brightness enhancement degree of the pixel in the initial image reaches the maximum, that is, the brightness of the corresponding pixel in the initial image needs to be enhanced to the limit brightness value of the terminal device, that is, the maximum brightness that can be supported by the terminal device is enhanced.
In the embodiment of the disclosure, when the adjustment value of the pixel is the third preset adjustment value, the limit brightness value of the terminal device is determined to be the target pixel brightness of the pixel, so that the highest brightness which can be supported by the terminal device can be utilized as much as possible, and the reality and the contrast of the image display effect are improved.
In some embodiments, the adjusting the initial pixel value of the pixel to obtain the target pixel value of the pixel when the target pixel brightness is determined includes:
under the condition that the brightness of the target pixel is determined, if the adjustment value of the pixel is a first preset adjustment value or a second preset adjustment value, determining a second adjustment coefficient based on the brightness of the target pixel of the pixel and the limit brightness value of the terminal equipment;
determining a target pixel value of the pixel based on the second adjustment coefficient, the initial pixel value of the pixel and a preset conversion relation;
wherein, the preset conversion relation represents: and a mapping relation between the pixel brightness and the pixel value.
In the embodiment of the disclosure, if the adjustment value of the pixel is the first preset adjustment value or the second preset adjustment value under the condition that the brightness of the target pixel is determined, the initial pixel value of the pixel can be adjusted, so that the target pixel value of the pixel is obtained. Here, the value range of the adjustment value of the pixel may be 0-255, the first preset adjustment value may be a minimum value 0 in the value range, and the second preset adjustment value may be any adjustment value of 1-254.
In some embodiments, in the case that the adjustment value of the pixel is the first preset adjustment value or the second preset adjustment value, the second adjustment coefficient may be determined based on the target pixel brightness of the pixel and the limit brightness value of the terminal device; determining a target pixel value of the pixel based on the second adjustment coefficient, the initial pixel value of the pixel, and a preset conversion relationship, wherein the preset conversion relationship characterizes: mapping relation between pixel brightness and pixel value. The calculation formula of the target pixel value of the pixel is as follows:
in the formula (4), lv tar Lv is the target pixel luminance of a pixel max For the limit brightness value of the terminal equipment, P old For an initial pixel value of a pixel, P new Is the target pixel value for the pixel.
The calculation formula of the second adjustment coefficient is as follows:
in the formula (5), k 2 For the second adjustment coefficient, lv tar Lv is the target pixel luminance of a pixel max Is the limit luminance value of the terminal device.
It should be noted that, when the adjustment value of the pixel is the first preset adjustment value, the target pixel brightness of the pixel is the current brightness value of the terminal device; in the case that the adjustment value of the pixel is a second preset adjustment value, the target pixel brightness of the pixel can be obtained according to formula (1); the limit luminance value of the terminal device may be: the highest brightness that the terminal device can support. The preset conversion relation is that the value representing the pixel value in the formula (4) is divided by 255 and taken to the power of 2.2, and can be converted into the value representing the pixel brightness, wherein 255 can be expressed as the difference between the maximum value and the minimum value in the value interval of the pixel brightness.
In the embodiment of the disclosure, when the target pixel brightness is determined, the target pixel value in the case that the adjustment value of the pixel is the first preset adjustment value or the second preset adjustment value is determined based on the target pixel brightness of the pixel, the limit brightness value of the terminal device, the initial pixel value of the pixel and the preset conversion relation, so that the target pixel value of the pixel can be determined more clearly and simply.
In some embodiments, the adjusting the initial pixel value of the pixel to obtain the target pixel value of the pixel when the target pixel brightness is determined includes:
and under the condition that the brightness of the target pixel is determined, if the adjustment value of the pixel is a third preset adjustment value, determining the initial pixel value of the pixel as the target pixel value of the pixel.
In the embodiment of the disclosure, if the adjustment value of the pixel is the third preset adjustment value, the initial pixel value of the pixel may be determined as the target pixel value of the pixel under the condition that the target pixel brightness is determined. Here, the value range of the adjustment value of the pixel may be 0 to 255, and the third preset adjustment value may be a maximum value 255 in the value range.
When the adjustment value of the pixel is the third preset adjustment value, the target pixel brightness of the pixel is the limit brightness value of the terminal device, that is, the display effect of the pixel corresponding to the third preset adjustment value is satisfied, at this time, the pixel value of the pixel corresponding to the third preset adjustment value is not required to be adjusted, and the initial pixel value of the pixel is directly determined as the target pixel value of the pixel.
In the embodiment of the disclosure, when the adjustment value of the pixel is the third preset adjustment value, and the highest brightness that can be supported by the terminal device is utilized as much as possible to improve the target pixel brightness of the pixel, the pixel value of the pixel corresponding to the third preset adjustment value is not required to be adjusted, so that image distortion caused by excessive modification of the pixel value can be avoided on the basis of improving the authenticity and contrast of the image display effect, and meanwhile, the memory resources occupied when the pixel value is modified can be saved.
In some embodiments, in the case where the adjustment value of the pixel is the first preset adjustment value, the initial pixel brightness of the pixel (i.e., the current brightness value of the terminal device) may be determined as the target pixel brightness of the pixel; in the case where the adjustment value of the pixel is the third preset adjustment value, the limit luminance value of the terminal device may be determined as the target pixel luminance of the pixel. Here, the value range of the adjustment value of the pixel may be 0-255, the first preset adjustment value may be a minimum value 0 in the value range, and the third preset adjustment value may be a maximum value 255 in the value range.
In this way, the correspondence between the adjustment value of the pixel and the target pixel luminance of the pixel may be determined according to the first preset adjustment value, the target pixel luminance of the pixel corresponding to the first preset adjustment value (i.e., the current luminance value of the terminal device), the third preset adjustment value, and the target pixel luminance of the pixel corresponding to the third preset adjustment value (i.e., the limit luminance value of the terminal device). For example, the adjustment value of the pixel and the target pixel luminance of the pixel are in a linear relationship, and in the case of determining the adjustment value of the pixel, the target pixel luminance of the pixel may be determined from the linear relationship.
In some embodiments, the current brightness value of the terminal device may be adjusted to a limit brightness value of the terminal device, and the brightness of the pixel corresponding to the third preset adjustment value reaches the highest brightness supported by the terminal device, so that the display effect meets the requirement. However, in the value range of the adjustment value of the pixel, the pixel corresponding to the adjustment value other than the third preset adjustment value is removed, and the corresponding display effect needs to be achieved by changing the pixel value. The corresponding formula for changing the pixel value is as follows:
in the formula (6), lv max Lv is the limit luminance value of the terminal equipment cur E is the current brightness value of the terminal equipment 1 E is a first preset adjustment value 3 E is an adjustment value, P old For an initial pixel value of a pixel, P new Is the target pixel value for the pixel.
In other embodiments, in the case that the adjustment value of the pixel determined in the adjustment image does not include the third preset adjustment value, the current maximum adjustment value of the adjustment values of the pixels may be determined in the current adjustment image, and the target pixel brightness corresponding to the current maximum adjustment value may be determined according to the correspondence between the predetermined adjustment value of the pixel and the target pixel brightness of the pixel, and the target pixel brightness may be determined as the target brightness of the terminal device. And (3) removing pixels corresponding to other adjustment values of the current maximum adjustment value from the adjustment image, and changing the pixel value through a formula (6) to realize a corresponding display effect.
Fig. 3 is a block diagram of an image processing apparatus according to an exemplary embodiment, and as shown in fig. 3, the image processing apparatus 300 is applied to a terminal device, and the image processing apparatus 300 mainly includes:
a generation module 301 configured to acquire an initial image, and an adjustment image generated when the initial image is captured; wherein the pixel array in the adjusted image is the same as the pixel array in the initial image;
A determining module 302, configured to determine, from the adjustment image, adjustment values corresponding to respective pixels in the initial image;
a first adjustment module 303, configured to adjust an initial pixel parameter of the pixel in the initial image based on an adjustment value corresponding to the pixel, so as to obtain a target pixel parameter of the pixel;
a processing module 304 is configured to obtain a target image based on the target pixel parameters of each of the pixels.
In some embodiments, the pixel parameters include: pixel brightness and pixel value; the first adjusting module 303 is configured to:
determining a target adjustment strategy corresponding to the adjustment value of the pixel; wherein, different adjustment values correspond to different adjustment strategies;
adjusting the initial pixel brightness and/or the initial pixel value of the pixel according to the target adjustment strategy to obtain target pixel brightness and target pixel value of the pixel;
the obtaining a target image based on the target pixel parameters of the pixels comprises the following steps:
and obtaining the target image based on the target pixel brightness and the target pixel value of each pixel.
In some embodiments, the first adjustment module 303 is configured to:
Determining a target pixel brightness of the pixel according to the initial pixel brightness of the pixel;
and under the condition that the brightness of the target pixel is determined, adjusting the initial pixel value of the pixel to obtain the target pixel value of the pixel.
In some embodiments, the first adjustment module 303 is configured to:
determining an initial pixel brightness of the pixel as a target pixel brightness of the pixel under the condition that the adjustment value of the pixel is a first preset adjustment value;
when the adjustment value of the pixel is a second preset adjustment value or a third preset adjustment value, the initial pixel brightness of the pixel is adjusted to obtain the target pixel brightness of the pixel;
the first preset adjustment value is smaller than the second preset adjustment value, and the third preset adjustment value is larger than the second preset adjustment value.
In some embodiments, the first adjustment module 303 is configured to:
determining a first difference value according to the current brightness value of the terminal equipment and the limit brightness value of the terminal equipment under the condition that the adjustment value of the pixel is the second preset adjustment value;
determining a second difference value according to the first preset adjustment value and the third preset adjustment value;
Determining a first adjustment coefficient according to the first difference value and the second difference value;
determining a change value according to the first adjustment coefficient and the second preset adjustment value;
and determining the target pixel brightness of the pixel according to the change value and the current brightness value of the terminal equipment.
In some embodiments, the first adjustment module 303 is configured to:
and determining the limit brightness value of the terminal equipment as the target pixel brightness of the pixel under the condition that the adjustment value of the pixel is the third preset adjustment value.
In some embodiments, the first adjustment module 303 is configured to:
under the condition that the brightness of the target pixel is determined, if the adjustment value of the pixel is a first preset adjustment value or a second preset adjustment value, determining a second adjustment coefficient based on the brightness of the target pixel of the pixel and the limit brightness value of the terminal equipment;
determining a target pixel value of the pixel based on the second adjustment coefficient, the initial pixel value of the pixel and a preset conversion relation;
wherein, the preset conversion relation represents: and a mapping relation between the pixel brightness and the pixel value.
In some embodiments, the first adjustment module 303 is configured to:
and under the condition that the brightness of the target pixel is determined, if the adjustment value of the pixel is a third preset adjustment value, determining the initial pixel value of the pixel as the target pixel value of the pixel.
In some embodiments, the apparatus further comprises:
and the second adjusting module is configured to adjust initial pixel parameters of each pixel in the initial image based on the adjustment value corresponding to each pixel under the condition that an adjustment instruction for adjusting the initial image is received, so as to obtain the target image.
According to a third aspect of the embodiments of the present disclosure, there is provided an image processing apparatus including:
a processor;
a memory configured to store processor-executable instructions;
wherein the processor is configured to: the steps of any one of the image processing methods of the first aspect described above are implemented when executed.
According to a fourth aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium, which when executed by a processor of an image processing apparatus, causes the apparatus to perform the steps of any one of the image processing methods of the first aspect described above.
Fig. 4 is a block diagram of an image processing apparatus 800 according to an exemplary embodiment. For example, the device 800 may be a mobile phone, mobile computer, or the like.
Referring to fig. 4, apparatus 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the apparatus 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to perform all or part of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interactions between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the apparatus 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phonebook data, messages, pictures, videos, and the like. The memory 804 may be implemented by any type or combination of volatile or nonvolatile memory devices 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.
The power supply component 806 provides power to the various components of the device 800. The power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 800.
The multimedia component 808 includes a screen between the device 800 and the user that provides an output interface. 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 a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or sliding action, but also the duration and pressure associated with the touch or sliding operation. In some embodiments, the multimedia component 808 includes a front camera and/or a rear camera. The front camera and/or the rear camera may receive external multimedia data when the apparatus 800 is in an operational mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 further includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of the apparatus 800. For example, the sensor assembly 814 may detect an on/off state of the device 800, a relative positioning of the assemblies, such as a display and keypad of the device 800, the sensor assembly 814 may also detect a change in position of the device 800 or one of the assemblies of the device 800, the presence or absence of user contact with the device 800, an orientation or acceleration/deceleration of the device 800, and a change in temperature of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 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 814 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communication between the apparatus 800 and other devices, either in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as Wi-Fi,4G, or 5G, or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 816 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 apparatus 800 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 elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 804 including instructions executable by processor 820 of apparatus 800 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
A non-transitory computer readable storage medium, which when executed by a processor of an image processing apparatus, causes the image processing apparatus to perform an image processing method, the method comprising:
acquiring an initial image and an adjustment image generated when the initial image is photographed; wherein the pixel array in the adjusted image is the same as the pixel array in the initial image;
determining adjustment values corresponding to all pixels in the initial image from the adjustment image;
adjusting initial pixel parameters of the pixels in the initial image based on the adjustment values corresponding to the pixels to obtain target pixel parameters of the pixels;
and obtaining a target image based on the target pixel parameters of each pixel.
Fig. 5 is a block diagram showing a hardware configuration of an image processing apparatus according to an exemplary embodiment. For example, electronic device 1900 may be provided as a server. Referring to FIG. 5, electronic device 1900 includes a processing component 1922 that further includes one or more processors and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by processing component 1922. The application programs stored in memory 1932 may include one or more modules each corresponding to a set of instructions. Further, processing component 1922 is configured to execute instructions to perform an image processing method comprising:
Acquiring an initial image and an adjustment image generated when the initial image is photographed; wherein the pixel array in the adjusted image is the same as the pixel array in the initial image;
determining adjustment values corresponding to all pixels in the initial image from the adjustment image;
adjusting initial pixel parameters of the pixels in the initial image based on the adjustment values corresponding to the pixels to obtain target pixel parameters of the pixels;
and obtaining a target image based on the target pixel parameters of each pixel.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present disclosure. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present disclosure, the sequence numbers of the foregoing processes do not mean the order of execution, and the order of execution of the processes should be determined by their functions and internal logic, and should not constitute any limitation on the implementation of the embodiments of the present disclosure. The foregoing embodiment numbers of the present disclosure are merely for description and do not represent advantages or disadvantages of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in the present disclosure, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above described device embodiments are only illustrative, e.g. the division of the units is only one logical function division, and there may be other divisions in practice, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units; can be located in one place or distributed to a plurality of network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present disclosure may be integrated in one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
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 adaptations, uses, or adaptations of the disclosure following the general 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 is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (12)

1. An image processing method, applied to a terminal device, comprising:
acquiring an initial image and an adjustment image generated when the initial image is photographed; wherein the pixel array in the adjusted image is the same as the pixel array in the initial image;
determining adjustment values corresponding to all pixels in the initial image from the adjustment image;
adjusting initial pixel parameters of the pixels in the initial image based on the adjustment values corresponding to the pixels to obtain target pixel parameters of the pixels;
and obtaining a target image based on the target pixel parameters of each pixel.
2. The method of claim 1, wherein the pixel parameters comprise: pixel brightness and pixel value; the adjusting the initial pixel parameter of the pixel in the initial image based on the adjustment value corresponding to the pixel to obtain the target pixel parameter of the pixel includes:
Determining a target adjustment strategy corresponding to the adjustment value of the pixel; wherein, different adjustment values correspond to different adjustment strategies;
adjusting the initial pixel brightness and/or the initial pixel value of the pixel according to the target adjustment strategy to obtain target pixel brightness and target pixel value of the pixel;
the obtaining a target image based on the target pixel parameters of the pixels comprises the following steps:
and obtaining the target image based on the target pixel brightness and the target pixel value of each pixel.
3. The method according to claim 2, wherein adjusting the initial pixel brightness and/or the initial pixel value of the pixel according to the target adjustment policy results in a target pixel brightness and a target pixel value of the pixel, comprising:
determining a target pixel brightness of the pixel according to the initial pixel brightness of the pixel;
and under the condition that the brightness of the target pixel is determined, adjusting the initial pixel value of the pixel to obtain the target pixel value of the pixel.
4. A method according to claim 3, wherein said determining a target pixel luminance of said pixel from an initial pixel luminance of said pixel comprises:
Determining an initial pixel brightness of the pixel as a target pixel brightness of the pixel under the condition that the adjustment value of the pixel is a first preset adjustment value;
when the adjustment value of the pixel is a second preset adjustment value or a third preset adjustment value, the initial pixel brightness of the pixel is adjusted to obtain the target pixel brightness of the pixel;
the first preset adjustment value is smaller than the second preset adjustment value, and the third preset adjustment value is larger than the second preset adjustment value.
5. The method according to claim 4, wherein adjusting the initial pixel brightness of the pixel to obtain the target pixel brightness of the pixel when the adjustment value of the pixel is a second preset adjustment value comprises:
determining a first difference value according to the current brightness value of the terminal equipment and the limit brightness value of the terminal equipment under the condition that the adjustment value of the pixel is the second preset adjustment value;
determining a second difference value according to the first preset adjustment value and the third preset adjustment value;
determining a first adjustment coefficient according to the first difference value and the second difference value;
Determining a change value according to the first adjustment coefficient and the second preset adjustment value;
and determining the target pixel brightness of the pixel according to the change value and the current brightness value of the terminal equipment.
6. The method according to claim 4, wherein adjusting the initial pixel brightness of the pixel to obtain the target pixel brightness of the pixel when the adjustment value of the pixel is a third preset adjustment value comprises:
and determining the limit brightness value of the terminal equipment as the target pixel brightness of the pixel under the condition that the adjustment value of the pixel is the third preset adjustment value.
7. A method according to claim 3, wherein said adjusting the initial pixel value of the pixel to obtain the target pixel value of the pixel in the case that the target pixel brightness is determined comprises:
under the condition that the brightness of the target pixel is determined, if the adjustment value of the pixel is a first preset adjustment value or a second preset adjustment value, determining a second adjustment coefficient based on the brightness of the target pixel of the pixel and the limit brightness value of the terminal equipment;
Determining a target pixel value of the pixel based on the second adjustment coefficient, the initial pixel value of the pixel and a preset conversion relation;
wherein, the preset conversion relation represents: and a mapping relation between the pixel brightness and the pixel value.
8. A method according to claim 3, wherein said adjusting the initial pixel value of the pixel to obtain the target pixel value of the pixel in the case that the target pixel brightness is determined comprises:
and under the condition that the brightness of the target pixel is determined, if the adjustment value of the pixel is a third preset adjustment value, determining the initial pixel value of the pixel as the target pixel value of the pixel.
9. The method according to any one of claims 1 to 8, further comprising:
and under the condition that an adjustment instruction for adjusting the initial image is received, adjusting initial pixel parameters of all pixels in the initial image based on adjustment values corresponding to all pixels to obtain the target image.
10. An image processing apparatus, characterized by being applied to a terminal device, comprising:
A generation module configured to acquire an initial image and an adjustment image generated when the initial image is photographed; wherein the pixel array in the adjusted image is the same as the pixel array in the initial image;
the determining module is configured to determine the adjustment value corresponding to each pixel in the initial image from the adjustment image;
the first adjusting module is configured to adjust initial pixel parameters of the pixels in the initial image based on the adjustment values corresponding to the pixels to obtain target pixel parameters of the pixels;
and the processing module is configured to obtain a target image based on the target pixel parameters of each pixel.
11. An image processing apparatus, comprising:
a processor;
a memory configured to store processor-executable instructions;
wherein the processor is configured to: the steps of the image processing method of any of the preceding claims 1 to 9 are carried out.
12. A non-transitory computer readable storage medium, characterized in that instructions in the storage medium, when executed by a processor of an image processing apparatus, enable the apparatus to perform the steps in the image processing method of any one of the preceding claims 1 to 9.
CN202211124774.6A 2022-09-15 2022-09-15 Image processing method, device and storage medium Pending CN117764895A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211124774.6A CN117764895A (en) 2022-09-15 2022-09-15 Image processing method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211124774.6A CN117764895A (en) 2022-09-15 2022-09-15 Image processing method, device and storage medium

Publications (1)

Publication Number Publication Date
CN117764895A true CN117764895A (en) 2024-03-26

Family

ID=90316662

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211124774.6A Pending CN117764895A (en) 2022-09-15 2022-09-15 Image processing method, device and storage medium

Country Status (1)

Country Link
CN (1) CN117764895A (en)

Similar Documents

Publication Publication Date Title
CN109345485B (en) Image enhancement method and device, electronic equipment and storage medium
CN106131441B (en) Photographing method and device and electronic equipment
CN111261081B (en) Screen display method and device
CN110876014B (en) Image processing method and device, electronic device and storage medium
CN112669231B (en) Image processing method, training method, device and medium of image processing model
CN112331158B (en) Terminal display adjusting method, device, equipment and storage medium
CN112702514B (en) Image acquisition method, device, equipment and storage medium
CN111277754B (en) Mobile terminal shooting method and device
CN110874829B (en) Image processing method and device, electronic device and storage medium
CN108108668B (en) Age prediction method and device based on image
CN117764895A (en) Image processing method, device and storage medium
CN114418865A (en) Image processing method, device, equipment and storage medium
CN107682623B (en) Photographing method and device
CN114268745B (en) Brightness adjustment method, device, equipment and storage medium
CN114339017B (en) Distant view focusing method, device and storage medium
CN110876015B (en) Method and device for determining image resolution, electronic equipment and storage medium
CN109862252B (en) Image shooting method and device
CN114268745A (en) Brightness adjusting method, device, equipment and storage medium
CN107317977B (en) Shooting method and device
CN117354413A (en) Display control method, display control device, electronic equipment and readable storage medium
CN116567411A (en) Power consumption control method, device, equipment and medium
CN117876275A (en) Image processing method, device, terminal and storage medium
CN117369615A (en) Electronic equipment control method and device, storage medium and electronic equipment
CN118175420A (en) Image acquisition method, device, equipment and storage medium
CN117252769A (en) Image processing method, device, electronic equipment and storage 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