WO2023125160A1 - 图像处理方法、装置、电子设备及可读存储介质 - Google Patents

图像处理方法、装置、电子设备及可读存储介质 Download PDF

Info

Publication number
WO2023125160A1
WO2023125160A1 PCT/CN2022/140408 CN2022140408W WO2023125160A1 WO 2023125160 A1 WO2023125160 A1 WO 2023125160A1 CN 2022140408 W CN2022140408 W CN 2022140408W WO 2023125160 A1 WO2023125160 A1 WO 2023125160A1
Authority
WO
WIPO (PCT)
Prior art keywords
color
image
channel
target
input
Prior art date
Application number
PCT/CN2022/140408
Other languages
English (en)
French (fr)
Inventor
邱昌鑫
Original Assignee
维沃移动通信有限公司
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 维沃移动通信有限公司 filed Critical 维沃移动通信有限公司
Publication of WO2023125160A1 publication Critical patent/WO2023125160A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance

Definitions

  • the present application belongs to the technical field of image processing, and in particular relates to an image processing method, device, electronic equipment and readable storage medium.
  • users can input multiple parameter controls in the image editing interface through the image editing function in the electronic device or professional image editing software to trigger the electronic device to adjust multiple parameters of the image, thereby realizing image processing. In this way, an image satisfactory to the user can be obtained.
  • the purpose of the embodiments of the present application is to provide an image processing method, device, electronic device, and readable storage medium, which can solve the problem that the image processing process is relatively cumbersome.
  • an embodiment of the present application provides an image processing method, the method comprising: displaying a first image and a target control; receiving a user's first input on the target control; in response to the first input, adjusting the first image to A target effect corresponding to the first input; wherein, the target control is used to adjust color or light and shadow.
  • the embodiment of the present application provides an image processing device, which includes a display module, a receiving module, and an adjustment module; a display module, used to display the first image and a target control; The first input of the control; the adjustment control is used to adjust the first image to the target effect corresponding to the first input in response to the first input received by the receiving module; wherein, the target control is used to adjust the color or light and shadow.
  • the embodiment of the present application provides an electronic device, the electronic device includes a processor and a memory, the memory stores programs or instructions that can run on the processor, and the programs or instructions are processed by the The steps of the method described in the first aspect are realized when the controller is executed.
  • an embodiment of the present application provides a readable storage medium, on which a program or an instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented .
  • the embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions, so as to implement the first aspect the method described.
  • an embodiment of the present application provides a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the method described in the first aspect.
  • the first image and the target control may be displayed; and the user's first input on the target control is received; and in response to the first input, the first image is adjusted to the target effect corresponding to the first input; wherein , the target control is used to adjust the color or light and shadow.
  • Fig. 1 is a flow chart of the image processing method provided by the embodiment of the present application.
  • Fig. 2 is a schematic interface diagram of the application of the image processing method provided by the embodiment of the present application.
  • FIG. 3 is a schematic diagram of a method for an electronic device to determine a secondary color of a first image in an image processing method provided in an embodiment of the present application;
  • Fig. 4 is a schematic diagram of a method for determining at least one adjustment ratio by an electronic device in the image processing method provided by the embodiment of the present application;
  • Fig. 5 is a schematic diagram of an image processing device provided by an embodiment of the present application.
  • Fig. 6 is a schematic diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 7 is a schematic diagram of hardware of an electronic device provided by an embodiment of the present application.
  • the embodiment of the present application provides an image processing method, which can provide users with image processing functions such as accurate recognition of primary and secondary colors, controllable adjustment effects, and beautiful images based on underlying functions such as color recognition and channel search, reducing the It lowers the threshold for users to process images and simplifies the process of image processing.
  • the image processing method provided in the embodiment of the present application may be applied in the scene of image processing.
  • the electronic device displays image 1 (such as the first image in the embodiment of this application) and a control a for adjusting color or light and shadow (such as the target control in the embodiment of this application), if the electronic device receives the user Input to control a (such as the first input in the embodiment of the present application), the electronic device can adjust the image 1 to the effect corresponding to the input (such as the target effect in the embodiment of the present application);
  • image 1 is processed, only one input from the user is required to adjust the color or light and shadow effect of the image 1, thus simplifying the image processing process.
  • FIG. 1 shows a flowchart of the image processing method provided in the embodiment of the present application.
  • the image processing method provided in the embodiment of the present application may include the following steps 101 to 103 .
  • Step 101 the electronic device displays a first image and a target control.
  • the electronic device may display the first image and the target control on any possible interface such as a shooting preview interface, a shooting interface, or an image browsing interface.
  • the shooting preview interface may be an interface for displaying a shooting preview image in a camera application
  • the electronic device may display the shooting preview interface after the user triggers and selects the camera application.
  • the shooting interface may be an interface for displaying captured images in the camera application, and the electronic device may display the shooting interface after the user triggers the camera application to take pictures.
  • the image browsing interface may be an interface for displaying images in the photo album application
  • the electronic device may display the image browsing interface after the user triggers to select an image in the photo album application.
  • the first image may be any image stored in the electronic device, or may be an image acquired in real time by the electronic device in the shooting preview interface.
  • the target control can be set in any area of the above interface, and can be a control of any possible shape, which can be determined according to actual usage requirements, and is not limited in this embodiment of the application.
  • Step 102 the electronic device receives a first input from a user on a target control.
  • the first input may be input in any possible form such as hovering input or touch input, which may be determined according to actual usage requirements, and is not limited in this embodiment of the present application.
  • the first input can be any possible touch input such as the user's click input, long press input, or heavy press input on the target control.
  • Step 103 the electronic device adjusts the first image to a target effect corresponding to the first input in response to the first input.
  • the target control may be used to adjust color or light and shadow.
  • each position of the target control may correspond to a different color parameter or light and shadow parameter
  • the electronic device may adjust the color parameter or light and shadow parameter of the first image according to the end position of the first input, so that The first image is adjusted to a target effect corresponding to the first input.
  • the color parameters may include saturation, or saturation and lightness, and any of the following: contrast and vignetting, contrast and vibrancy, and contrast, vibrancy and color temperature.
  • the light and shadow parameters may include exposure parameters, highlight parameters, and shadow parameters.
  • the electronic device displays an image 21 (ie, the first image) and a color adjustment control 22 (ie, the target control) in the image browsing interface 20; Click the input (i.e. the first input), then the electronic device can adjust the color parameters of the image 21 according to the end position 23 of the input on the color adjustment control 22, so that the image 21 can be adjusted to the color effect corresponding to the input (i.e. target effect).
  • a color adjustment control 22 ie, the target control
  • the user can trigger the electronic device to adjust the first image to the target effect corresponding to the first input in the shooting preview interface, and then trigger the electronic device to continue to adjust the first image in the shooting interface or image browsing interface.
  • the adjusted first image is adjusted; that is, the electronic device can adjust the color or light and shadow of the first image both in the early stage of shooting and in the later stage of shooting, and the parameters adjusted in the early stage of shooting can continue to be adjusted in the later stage of shooting.
  • the electronic device can adjust the displayed image to the effect corresponding to the input through the user's input to the controls for adjusting the color or light and shadow; that is, the electronic device is processing the image.
  • the electronic device is processing the image.
  • only one input from the user is required to adjust the color or light and shadow effects of the image, thus simplifying the process of image processing.
  • the above-mentioned target control is used to adjust the color, then before the electronic device adjusts the first image to the target effect corresponding to the first input, the image processing method provided in the embodiment of the present application may further include Step 104 described below.
  • Step 104 the electronic device acquires the type of the first image.
  • the first image may be an image including a face image (that is, the first type described below), or may be an image that does not include a face image (that is, the second type described below) .
  • the electronic device may obtain the type of the first image by comparing the first image with a trained face model in the electronic device.
  • the electronic device may adjust the first image to correspond to the first input through one of the following possible implementations or another possible implementation according to the type of the first image target effect.
  • step 103 may specifically be implemented through the following step 103a.
  • Step 103a In response to the first input, if the first image is of the first type, the electronic device adjusts the first image to a first effect corresponding to the first input in a first manner.
  • the first effect is the aforementioned target effect.
  • step 103a may be specifically implemented through the following steps 103a1 to 103a3.
  • Step 103a1 In response to the first input, the electronic device determines a preset channel of the first image when the first image is of the first type.
  • the preset channel may be a color channel corresponding to the face image in the first image.
  • step 103a2 the electronic device adjusts the first color of the preset channel to the first target color value corresponding to the first input.
  • the first color may be saturation, or saturation and lightness in the above color parameters.
  • the first target color value may be the saturation corresponding to the end position of the first input in the target control, or the saturation corresponding to the preset channel in the saturation and lightness, or the saturation and lightness.
  • the preset channels may include the first channel, the second channel and the third channel, then the above-mentioned step 103a2 may specifically be performed through at least one of the following steps A, B and C accomplish.
  • Step A The electronic device adjusts the first color of the first channel to the first sub-color value corresponding to the first channel in the first target color value.
  • the first channel may be a red channel
  • the electronic device may adjust the saturation, or saturation and lightness, of the red channel to the saturation corresponding to the red channel in the first target color value, or Saturation and lightness.
  • Step B the electronic device adjusts the first color of the second channel to the second sub-color value corresponding to the second channel in the first target color value.
  • the second channel may be an orange channel
  • the electronic device may adjust the saturation, or saturation and lightness, of the orange channel to the saturation corresponding to the orange channel in the first target color value, or Saturation and lightness.
  • Step C the electronic device adjusts the first color of the third channel to the third sub-color value corresponding to the third channel in the first target color value.
  • the third channel may be a yellow channel
  • the electronic device may adjust the saturation, or saturation and lightness, of the yellow channel to the saturation corresponding to the yellow channel in the first target color value, or Saturation and lightness.
  • the target control may include connected first sub-controls and second sub-controls.
  • the target control is a bar control in the X-axis direction
  • the target control includes a position range of [- 100, 100]
  • the first child control can be a child control with a position range of [-100, 0) in the target control
  • the second child control can be a child control with a position range of [0, 100] in the target control.
  • the above-mentioned step 103a2 can be specifically implemented through the above-mentioned step A, and the first color is saturation, and the electronic device can also set The saturation and lightness of other channels except the first channel, the second channel and the third channel are adjusted to the saturation and lightness corresponding to the first input; if the end position of the first input is on the second sub-control, the above Step 103a2 can be specifically implemented through the above steps A, B and C, and the first color is saturation and lightness.
  • the color of the electronic device adjustment channel is actually the color of the color corresponding to the electronic device adjustment channel.
  • the electronic device can adjust the first color of at least one of the preset channels to a corresponding color value according to the first input, the flexibility of image processing can be improved.
  • step 103a3 the electronic device adjusts the second color of the first image to a second target color value corresponding to the first input.
  • the first effect may be indicated by a first target color value and a second target color value.
  • the second color may be contrast and vignetting, or contrast and natural saturation.
  • the second target color value may be the contrast and vignetting corresponding to the end position of the first input in the target control, or the contrast and natural saturation.
  • the electronic device adjusts the first color of the first image to the first target color value and adjusts the second color of the first image to the second target color value
  • the first image after adjusting the color parameters can be
  • the first effect display, ie the first target color value and the second target color value may indicate the first effect.
  • the electronic device can directly determine the preset channel of the first image, and compare the first color and the second color of the preset channel The second color of an image is respectively adjusted to the color value corresponding to the first input, so that the processing effect of the face image in the first image can be ensured, and the atmosphere of the first image can be improved.
  • step 103 may specifically be implemented through the following step 103b.
  • Step 103b In response to the first input, if the first image is of the second type, the electronic device adjusts the first image to a second effect corresponding to the first input in a second manner.
  • the second effect is the aforementioned target effect.
  • the electronic device may adjust the first image to a second effect corresponding to the first input in a second manner through the following method 1 and/or method 2.
  • step 103b may be specifically implemented through the following steps 103b1 to 103b4.
  • Step 103b1 In response to the first input, if the first image is of the second type, the electronic device determines the main color channel, auxiliary color channel and noise channel of the first image.
  • step 103b1 may specifically be implemented through the following steps D, E, F and G.
  • Step D the electronic device responds to the first input, and if the first image is of the second type, determines the main color and the auxiliary color of the first image.
  • step D may be specifically implemented through the following steps D1 to D3.
  • Step D1 In response to the first input, the electronic device determines the color with the largest sum of saturation and lightness among the colors of the first image as the main color when the first image is of the second type.
  • the electronic device can read the saturation and lightness of the colors in the first image, and convert the black, white and gray colors (that is, the saturation is less than 20 and the lightness is greater than 20) in the first image
  • the sum of saturation and lightness of the colors is sorted, so that the color with the largest sum of saturation and lightness is determined as the main color of the first image.
  • Step D2 the electronic device determines at least one color region in the first image according to the main color and the color wheel.
  • the color wheel can be a strip-shaped color sequence seen in the color spectrum, connecting the end to the end, so that red is connected to the purple at the other end, and the color wheel can include 12-24 different colors .
  • the electronic device can divide the color circle into multiple unit color channels on average, and the number of unit color channels divided by the electronic device can be the system default, or can be set according to the user's actual use requirements. of.
  • each color area may correspond to a color
  • the angle between the position of the color corresponding to each color area in the color wheel and the first position is greater than or equal to a preset angle
  • the first position is the position of the above-mentioned main color in the color wheel.
  • the electronic device may determine at least one angle range in the color circle according to at least one preset angle, set the priority of the at least one angle range, and determine the first image according to the priority. At least one color region of .
  • Step D3 the electronic device determines the color corresponding to the color region with the largest area among the at least one color region as the auxiliary color.
  • the color region with the largest area may be the color region including the largest number of pixels.
  • the electronic device may determine that the second An image does not have secondary colors.
  • the electronic device determines that the angle between position 0 and position 0 is equal to 180 degrees (that is, the preset angle) and there is an angle range A with a margin of 15 degrees.
  • the electronic device can determine color 1' as the auxiliary color of the first image; if there is no color corresponding to the color area in the first image in the angle range A, and the color 2' corresponding to color area 2 in the first image
  • the position of the color 3' corresponding to the color area 3 in the color wheel is in the angular range B, and the area of the color area 2 is larger than the area of the color area 3, then the electronic device can determine the color 2' as the auxiliary color of the first image; If there is no color corresponding to the color area in the first
  • the electronic device can determine the color with the largest sum of saturation and lightness in the first image as the main color of the first image, and can determine the main color of the first image according to the main color and the color circle. auxiliary color, so the electronic device can accurately obtain the main color and auxiliary color of the first image, so as to improve the accuracy of image processing.
  • Step E the electronic device determines all unit color channels in the color wheel corresponding to the first preset angle range as the main color channel.
  • the center of the first preset angle range coincides with the first position of the main color in the color wheel.
  • the first preset angle range may be a system default, or may be set by a user according to actual usage requirements.
  • all unit color channels corresponding to the first preset angle range may be all unit color channels in the color circle that have coincident angles with the first preset angle range.
  • Step F the electronic device determines all unit color channels in the color wheel corresponding to the second preset angle range as auxiliary color channels.
  • the center of the second preset angle range coincides with the second position of the secondary color in the color wheel.
  • the second preset angle range may be a system default, or may be set by a user according to actual usage requirements.
  • the second preset angle may be the same as or different from the first preset angle.
  • all the unit color channels corresponding to the second preset angle range may be all unit color channels in the color wheel that have overlapping angles with the second preset angle range.
  • step G the electronic device determines other unit color channels in the color wheel except the main color channel and the auxiliary color channel as noise channels.
  • the noise channel is a unit color channel in the color wheel except the main color channel.
  • the electronic device can determine the main color and auxiliary color of the first image when the first image is of the second type, and then can determine the main color channel, auxiliary color channel and noise channel, it can Further improve the accuracy of image processing.
  • the image processing method provided in the embodiment of this application can also be applied to other scenarios.
  • the electronic device can determine the main color and auxiliary color of the desktop wallpaper through the image processing method provided in the embodiment of the application. After coloring, color the icons of the application programs on the desktop in a targeted manner to make the display effect more coordinated.
  • Step 103b2 the electronic device adjusts the third color of the target channel to the third target color value corresponding to the first input.
  • the target channel may be a main color channel or a noise channel.
  • the third color may be saturation and lightness in the above color parameters.
  • the third target color value may be the saturation and lightness corresponding to the target channel among the saturation and lightness corresponding to the end position of the first input in the target control, that is, different target channels may be Corresponding to different saturation and lightness.
  • Step 103b3 the electronic device adjusts the third color of the auxiliary color channel to the fourth target color value corresponding to the first input.
  • the fourth target color value may be the saturation and lightness corresponding to the secondary color channel among the saturation and lightness corresponding to the end position of the first input in the target control.
  • the above-mentioned main color channel or auxiliary color channel may include at least two unit color channels in the color circle, and the electronic device may determine the coincidence angle between the at least two unit color channels and the target angle range, At least two overlapping angles corresponding to the at least two unit color channels are obtained; wherein, for the main color channel, the above-mentioned target angle range is the first preset angle range; for the auxiliary color channel, the above-mentioned target angle range is the second Preset angle range.
  • the electronic device when it adjusts the third color of the main color channel or the auxiliary color channel, it can adjust the third color of at least two unit color channels included in it according to at least one adjustment ratio; wherein each adjustment ratio can be a coincidence The ratio of the angle to the largest angle of the at least two coincident angles.
  • the at least two unit color channels may be Among them, the third color of the unit color channel corresponding to the largest coincidence angle is adjusted to the target color value corresponding to the first input, and each of the other unit color channels in the at least two unit color channels is adjusted according to the corresponding adjustment ratio, The tertiary color of each unit color channel is adjusted. It can be understood that if the main color channel or the auxiliary color channel includes two unit color channels, and the two coincident angles corresponding to the two unit color channels are equal, the electronic device can adjust the third color of the two unit color channels. The target color value corresponding to the first input.
  • the electronic device may adjust the third color of the same unit color channel to: the above-mentioned third target color value and The maximum value of the fourth target color value.
  • the electronic device can determine the coincidence angle b between the unit color channel 41 and a , the coincidence angle c between the unit color channel 42 and a, and b ⁇ c.
  • the electronic device can adjust the third color of the unit color channel 42 to the third target color value, and adjust the third color of the unit color channel 41 according to the adjustment ratio b/c; for example, the electronic device can adjust the saturation of the unit color channel 42 Adjust the saturation to A (ie the third target color value), and adjust the saturation of the unit color channel 41 to A ⁇ (b/c) according to the adjustment ratio b/c.
  • the electronic device can adjust the third color of the two unit color channels included in the main color channel in proportion, so as to improve the accuracy of image processing, thereby ensuring a better display effect of the processed image.
  • step 103b4 the electronic device adjusts the fourth color of the first image to the fifth target color value corresponding to the first input.
  • the second effect may be indicated by a third target color value, a fourth target color value, and a fifth target color value.
  • the fourth color may be contrast and vignetting, or contrast and natural saturation.
  • the fifth target color value may be the contrast and vignetting corresponding to the end position of the first input in the target control, or the contrast and natural saturation.
  • the electronic device adjusts the third color of the first image to the fourth target color value, and adjusts the fourth color of the first image to the fifth target color value
  • the first image after adjusting the color parameters can be
  • the second effect display, ie the fourth target color value and the fifth target color value may indicate the second effect.
  • the electronic device can determine the main color channel, auxiliary color channel and noise channel of the first image, and set each The third color of the channel and the fourth color of the first image are respectively adjusted to the color values corresponding to the first input, so the accuracy of image processing can be further improved to ensure the display effect of the processed image.
  • step 103b may be specifically implemented through the following steps 103b5 and 103b6.
  • Step 103b5 the electronic device determines the target color temperature adjustment amount corresponding to the target hue range among the two color temperature adjustment amounts corresponding to the first input.
  • the target hue range is the hue range where the hue of the main color of the first image is located.
  • the target hue range may be a warm hue range or a cool hue range
  • the warm hue range may be [0, 80] and [330, 360]
  • the cool hue range may be (80, 330) .
  • the first input may correspond to the first color temperature adjustment amount and the second color temperature adjustment amount, and the first color temperature adjustment amount corresponds to the warm color hue range, and the second color temperature adjustment amount corresponds to the cool color hue range, so that the electronic The device may determine the target color temperature adjustment amount according to the hue range in which the hue of the main color of the first image is located.
  • Step 103b6 the electronic device adjusts the color temperature of the first image based on the target color temperature adjustment amount.
  • the second effect may be indicated by the adjusted color temperature of the first image.
  • the electronic device may determine that the target color temperature adjustment amount is the first color temperature adjustment amount, and adjust the target color temperature based on the first color temperature adjustment amount. Adjust the color temperature of the first image, for example, the original color temperature of the first image is 50, the first color temperature adjustment amount is +20, then the adjusted color temperature of the first image is 70; if the hue of the main color of the first image is in the If the hue range is a cool hue range, the electronic device can determine that the target color temperature adjustment amount is the second color temperature adjustment amount, and adjust the color temperature of the first image based on the second color temperature adjustment amount. For example, the original color temperature of the first image is 50, and the second color temperature If the adjustment amount is -20, then the adjusted color temperature of the first image is 30.
  • the electronic device can adjust the color temperature of the first image based on the target color temperature adjustment amount, the adjusted color temperature of the first image can be displayed with the second effect, that is, the adjusted color temperature of the first image can indicate the second effect.
  • the electronic device can adjust the color temperature of the first image based on the target color temperature adjustment amount corresponding to the target hue range among the two color temperature adjustment amounts corresponding to the first input, the color temperature of the processed image can be ensured. accuracy.
  • the electronic device can adjust the first image to an effect corresponding to the first input in different ways according to the type of the acquired first image, the flexibility of image processing can be improved.
  • the image processing method provided in the embodiment of the present application may be executed by an image processing device.
  • the method for performing image processing by the image processing device is taken as an example to describe the image processing device provided in the embodiment of the present application.
  • an embodiment of the present application provides an image processing device 50 , which may include a display module 51 , a receiving module 52 and an adjustment module 53 .
  • the display module 51 can be used to display the first image and the target control.
  • the receiving module 52 may be configured to receive a user's first input to the target control.
  • the adjustment control 53 may be used to adjust the first image to a target effect corresponding to the first input in response to the first input received by the receiving module 52 .
  • the target control can be used to adjust the color or light and shadow.
  • the above-mentioned target control may be used to adjust the color
  • the above-mentioned image processing apparatus 50 may further include an acquisition module.
  • the acquisition module may be configured to acquire the type of the first image before the adjustment module 53 adjusts the first image to a target effect corresponding to the first input.
  • the adjustment module 53 may specifically be configured to adjust the first image to a first effect corresponding to the first input in a first manner when the first image is of the first type.
  • the adjustment module 53 may specifically be configured to adjust the first image to a second effect corresponding to the first input in a second manner when the first image is of the second type.
  • the image processing apparatus 50 may further include a determining module.
  • the determination module can be used to determine the preset channel of the first image.
  • the adjusting module 53 can be specifically configured to adjust the first color of the preset channel to the first target color value corresponding to the first input.
  • the adjustment module 53 may specifically be configured to adjust the second color of the first image to a second target color value corresponding to the first input. Wherein, the first effect may be indicated by the first target color value and the second target color value.
  • the preset channels may include a first channel, a second channel, and a third channel.
  • the adjustment module 53 can specifically be used to adjust at least one of the following: adjust the first color of the first channel to the first sub-color value corresponding to the first channel in the first target color value; adjust the first color of the second channel adjusting to the second sub-color value corresponding to the second channel in the first target color value; adjusting the first color of the third channel to the third sub-color value corresponding to the third channel in the first target color value.
  • the determining module may be specifically configured to determine the main color channel, secondary color channel, and noise channel of the first image.
  • the adjusting module 53 can be specifically configured to adjust the third color of the target channel to the third target color value corresponding to the first input, where the target channel is a main color channel or a noise channel.
  • the adjusting module 53 can be specifically configured to adjust the third color of the auxiliary color channel to the fourth target color value corresponding to the first input.
  • the adjustment module 53 may specifically be configured to adjust the fourth color of the first image to the fifth target color value corresponding to the first input.
  • the second effect may be indicated by the third target color value, the fourth target color value and the fifth target color value.
  • the determination module may be specifically configured to determine a target color temperature adjustment amount corresponding to a target hue range among the two color temperature adjustment amounts corresponding to the first input, and the target hue range is the main color of the first image.
  • the adjustment module 53 may specifically be configured to adjust the color temperature of the first image based on the target color temperature adjustment amount. Wherein, the second effect may be indicated by the adjusted color temperature of the first image.
  • the determining module may specifically be configured to determine the main color and the auxiliary color of the first image.
  • the determination module can specifically be used to determine all the unit color channels corresponding to the first preset angle range in the color circle as the main color channel, and the center of the first preset angle range and the first position of the main color in the color circle coincide.
  • the determination module can specifically be used to determine all the unit color channels corresponding to the second preset angle range in the color circle as auxiliary color channels, and the center of the second preset angle range and the second position of the auxiliary color in the color circle coincide.
  • the determination module can specifically be used to determine other unit color channels in the color wheel except the main color channel and the auxiliary color channel as noise channels.
  • the determining module may specifically be configured to determine the color having the largest sum of saturation and lightness among the colors of the first image as the main color.
  • the determination module can specifically be used to determine at least one color area in the first image according to the main color and the color circle, each color area corresponds to a color, and the position of the color corresponding to each color area in the color circle is the same as the first The included angle of the position is greater than or equal to the preset angle.
  • the determining module may specifically be configured to determine the color corresponding to the color area with the largest area in the at least one color area as the auxiliary color.
  • the image processing device can adjust the displayed image to the effect corresponding to the input through the user's input to the controls for adjusting the color or light and shadow; that is, the image processing device When processing an image, only one input from the user is required to adjust the color or light and shadow effect of the image, thus simplifying the process of image processing.
  • the image processing apparatus in the embodiment of the present application may be an electronic device, or may be a component in the electronic device, such as an integrated circuit or a chip.
  • the electronic device may be a terminal, or other devices other than the terminal.
  • the electronic device can be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR)/virtual reality (virtual reality, VR) ) equipment, robots, wearable devices, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc.
  • the image processing device in the embodiment of the present application may be a device with an operating system.
  • the operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.
  • the image processing apparatus provided in the embodiment of the present application can implement various processes implemented by the method embodiments in FIGS. 1 to 4 , and details are not repeated here to avoid repetition.
  • the embodiment of the present application also provides an electronic device 600, including a processor 601 and a memory 602, and the memory 602 stores programs or instructions that can run on the processor 601.
  • the programs or instructions are executed by the processor 601, the various steps of the above-mentioned image processing method embodiments can be realized, and the same technical effect can be achieved. To avoid repetition, details are not repeated here.
  • the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
  • FIG. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
  • the electronic device 1000 includes, but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010, etc. part.
  • the electronic device 1000 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 1010 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions.
  • a power supply such as a battery
  • the structure of the electronic device shown in FIG. 7 does not constitute a limitation to the electronic device.
  • the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange different components, and details will not be repeated here. .
  • the display unit 1006 can be used to display the first image and the target control.
  • the user input unit 1007 may be configured to receive a first input from the user on the target control.
  • the processor 1010 may be configured to, in response to the first input received by the user input unit 1007, adjust the first image to a target effect corresponding to the first input.
  • the target control can be used to adjust the color or light and shadow.
  • the above-mentioned target control can be used to adjust the color.
  • the processor 1010 may also be configured to acquire the type of the first image before adjusting the first image to a target effect corresponding to the first input.
  • the processor 1010 may specifically be configured to adjust the first image to a first effect corresponding to the first input in a first manner when the first image is of the first type.
  • the processor 1010 may specifically be configured to adjust the first image to a second effect corresponding to the first input in a second manner when the first image is of the second type.
  • the processor 1010 may also be configured to determine a preset channel of the first image.
  • the processor 1010 may specifically be configured to adjust the first color of the preset channel to a first target color value corresponding to the first input.
  • the processor 1010 may specifically be configured to adjust the second color of the first image to a second target color value corresponding to the first input.
  • the first effect may be indicated by the first target color value and the second target color value.
  • the preset channels may include a first channel, a second channel, and a third channel.
  • the processor 1010 can be specifically configured to adjust at least one of the following: adjusting the first color of the first channel to the first sub-color value corresponding to the first channel in the first target color value; adjusting the first color of the second channel adjusting to the second sub-color value corresponding to the second channel in the first target color value; adjusting the first color of the third channel to the third sub-color value corresponding to the third channel in the first target color value.
  • the processor 1010 may specifically be configured to determine a main color channel, a secondary color channel, and a noise channel of the first image.
  • the processor 1010 may specifically be configured to adjust the third color of the target channel to the third target color value corresponding to the first input, where the target channel is a main color channel or a noise channel.
  • the processor 1010 may specifically be configured to adjust the third color of the auxiliary color channel to a fourth target color value corresponding to the first input.
  • the processor 1010 may specifically be configured to adjust the fourth color of the first image to a fifth target color value corresponding to the first input.
  • the second effect may be indicated by the third target color value, the fourth target color value and the fifth target color value.
  • the processor 1010 may specifically be configured to determine a target color temperature adjustment amount corresponding to a target hue range among the two color temperature adjustment amounts corresponding to the first input, where the target hue range is the main color of the first image The hue range in which the hue is located.
  • the processor 1010 may specifically be configured to adjust the color temperature of the first image based on the target color temperature adjustment amount. Wherein, the second effect may be indicated by the adjusted color temperature of the first image.
  • the processor 1010 may specifically be configured to determine the main color and the auxiliary color of the first image.
  • the processor 1010 can be specifically configured to determine all unit color channels in the color circle corresponding to the first preset angle range as the main color channel, and the center of the first preset angle range is the first color channel of the main color in the color circle. The location coincides.
  • the processor 1010 can specifically be configured to determine all unit color channels corresponding to the second preset angle range in the color wheel as auxiliary color channels, and the center of the second preset angle range is the second color channel of the auxiliary color in the color wheel. The location coincides.
  • the processor 1010 may specifically be configured to determine other unit color channels in the color wheel except the main color channel and the auxiliary color channel as noise channels.
  • the processor 1010 may specifically be configured to determine the color with the largest sum of saturation and lightness among the colors of the first image as the main color.
  • the processor 1010 can be specifically configured to determine at least one color area in the first image according to the main color and the color circle, each color area corresponds to a color, and the position of the color corresponding to each color area in the color circle is the same as the first An included angle of a position is greater than or equal to a preset angle.
  • the processor 1010 may specifically be configured to determine a color corresponding to a color region with a largest area in at least one color region as an auxiliary color.
  • the electronic device since the electronic device can adjust the displayed image to the effect corresponding to the input through the user's input to the control for adjusting the color or light and shadow; that is, the electronic device is processing the image At the same time, only one input from the user is required to adjust the color or light and shadow effects of the image, thus simplifying the process of image processing.
  • the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 is used for the image capture device (such as the image data of the still picture or video obtained by the camera) for processing.
  • the display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072 .
  • the touch panel 10071 is also called a touch screen.
  • the touch panel 10071 may include two parts, a touch detection device and a touch controller.
  • Other input devices 10072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, and joysticks, which will not be repeated here.
  • the memory 1009 can be used to store software programs as well as various data.
  • the memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required by at least one function (such as a sound playing function, image playback function, etc.), etc.
  • memory 1009 may include volatile memory or nonvolatile memory, or, memory 1009 may include both volatile and nonvolatile memory.
  • the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electronically programmable Erase Programmable Read-Only Memory (Electrically EPROM, EEPROM) or Flash.
  • ROM Read-Only Memory
  • PROM programmable read-only memory
  • Erasable PROM Erasable PROM
  • EPROM erasable programmable read-only memory
  • Electrical EPROM Electrical EPROM
  • EEPROM electronically programmable Erase Programmable Read-Only Memory
  • Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (Synch link DRAM , SLDRAM) and Direct Memory Bus Random Access Memory (Direct Rambus RAM, DRRAM).
  • RAM Random Access Memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM Double Data Rate SDRAM
  • DDRSDRAM double data rate synchronous dynamic random access memory
  • Enhanced SDRAM, ESDRAM enhanced synchronous dynamic random access memory
  • Synch link DRAM , SLDRAM
  • Direct Memory Bus Random Access Memory Direct Rambus
  • the processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., Modem processors mainly process wireless communication signals, such as baseband processors. It can be understood that the foregoing modem processor may not be integrated into the processor 1010 .
  • the embodiment of the present application also provides a readable storage medium, the readable storage medium stores a program or an instruction, and when the program or instruction is executed by the processor, the various processes in the above image processing method embodiment are realized, and can achieve The same technical effects are not repeated here to avoid repetition.
  • the processor is the processor in the electronic device described in the above embodiments.
  • the readable storage medium includes a computer-readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk, and the like.
  • the embodiment of the present application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the above-mentioned image processing method embodiment Each process, and can achieve the same technical effect, in order to avoid repetition, will not repeat them here.
  • chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.
  • the embodiment of the present application provides a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the various processes in the above image processing method embodiment, and can achieve the same technical effect , to avoid repetition, it will not be repeated here.
  • the term “comprising”, “comprising” or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase “comprising a " does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element.
  • the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Image Processing (AREA)

Abstract

本申请公开了一种图像处理方法、装置、电子设备及可读存储介质,属于图像处理技术领域。该方法包括:显示第一图像和目标控件;接收用户对目标控件的第一输入;响应于第一输入,将第一图像调节至与第一输入对应的目标效果;其中,目标控件用于调节色彩或光影。

Description

图像处理方法、装置、电子设备及可读存储介质
相关申请的交叉引用
本申请主张在2021年12月29日在中国提交的中国专利申请号202111639868.2的优先权,其全部内容通过引用包含于此。
技术领域
本申请属于图像处理技术领域,具体涉及一种图像处理方法、装置、电子设备及可读存储介质。
背景技术
随着电子设备的拍摄功能的不断丰富,越来越多的人选择通过电子设备拍摄图像,但由于拍摄场景、拍摄技术等原因,导致拍摄的一些图像的效果较差,因此当用户需求使用这些图像时,还需对图像进行处理,以得到层次分明、主体突出的图像。
目前,用户可以通过电子设备中的图像编辑功能或专业修图软件,分别对图像编辑界面中的多个参数控件的输入,以触发电子设备调节图像的多个参数,从而实现对图像的处理,如此可以得到用户满意的图像。
然而,按照上述方法,由于用户并不完全了解图像参数,且用户需要多个输入才能触发电子设备对图像的多个参数的调节,因此可能导致图像处理的过程较为繁琐。
发明内容
本申请实施例的目的是提供一种图像处理方法、装置、电子设备及可读存储介质,能够解决图像处理的过程较为繁琐的问题。
第一方面,本申请实施例提供了一种图像处理方法,该方法包括:显示第一图像和目标控件;接收用户对目标控件的第一输入;响应于第一输入,将第一图像调节至与第一输入对应的目标效果;其中,目标控件用于调节色彩或光影。
第二方面,本申请实施例提供了一种图像处理装置,该装置包括显示模块、接收模块和调节模块;显示模块,用于显示第一图像和目标控件;接收模块,用于接收用户对目标控件的第一输入;调节控件,用于响应于接收模块接收的第一输入,将第一图像调节至与第一输入对应的目标效果;其中,目标控件用于调节色彩或光影。
第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤。
第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤。
第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所 述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法。
第六方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面所述的方法。
在本申请实施例中,可以显示第一图像和目标控件;且接收用户对目标控件的第一输入;并响应于第一输入,将第一图像调节至与第一输入对应的目标效果;其中,目标控件用于调节色彩或光影。通过该方案,由于电子设备可以通过用户对用于调节色彩或光影的控件的输入,将显示的图像调节至与该输入对应的效果;即电子设备在对图像进行处理时,仅需通过用户的一个输入,便可以调节图像的色彩或光影效果,因此可以简化图像处理的过程。
附图说明
图1是本申请实施例提供的图像处理方法的流程图;
图2是本申请实施例提供的图像处理方法应用的界面示意图;
图3是本申请实施例提供的图像处理方法中电子设备确定第一图像的辅颜色的方法的示意图;
图4是本申请实施例提供的图像处理方法中电子设备确定至少一个调节比例的方法的示意图;
图5是本申请实施例提供的图像处理装置的示意图;
图6是本申请实施例提供的电子设备的示意图;
图7是本申请实施例提供的电子设备的硬件示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的图像处理方法进行详细地说明。
电子设备的普及让拍摄行为大众化,人人都可以对身边的事物进行拍摄记录,社交媒体的流行让大家更乐意通过图像、视频等来展现自己的生活。然而,由于拍摄场 景等原因,导致用户的电子设备中的一些图像较为普通、不美观,因此需要对这些图像进行处理。但大多数用户对修图知识并不了解,理解复杂的图像参数较为困难,且专业修图的复杂性极高,仍有很高的门槛,用户可能需要反复调节多个图像参数,才能得到一张足够有震撼力、层次分明、主体突出的图像。虽然用户知道好的图像应该是什么样,但面对复杂的处理过程,用户常常选择放弃对图像的处理。
为了解决上述问题,本申请实施例提供一种图像处理方法,可以基于颜色识别、通道查找等底层功能,为用户提供主辅色识别准确、调节效果可控、成片精彩的图像处理功能,降低了用户对图像进行处理的门槛,简化了图像处理的过程。
本申请实施例提供的图像处理方法可以应用于图像处理的场景中。
示例性地,假设电子设备显示图像1(例如本申请实施例中的第一图像)和用于调节色彩或光影的控件a(例如本申请实施例中的目标控件),若电子设备接收到用户对控件a的输入(例如本申请实施例中的第一输入),则电子设备可以将图像1调节至与该输入对应的效果(例如本申请实施例中的目标效果);即电子设备在对图像1进行处理时,仅需通过用户的一个输入,便可以调节图像1的色彩或光影效果,因此可以简化图像处理的过程。
本申请实施例提供一种图像处理方法,图1示出了本申请实施例提供的图像处理方法的流程图。如图1所示,本申请实施例提供的图像处理方法可以包括下述的步骤101至步骤103。
步骤101、电子设备显示第一图像和目标控件。
可选地,本申请实施例中,电子设备可以在拍摄预览界面、拍摄界面或图像浏览界面等任意可能的界面显示第一图像和目标控件。
可选地,本申请实施例中,拍摄预览界面可以为相机应用程序中显示拍摄预览图像的界面,电子设备可以在用户触发选中相机应用程序之后,显示拍摄预览界面。
可选地,本申请实施例中,拍摄界面可以为相机应用程序中显示拍摄图像的界面,电子设备可以在用户触发相机应用程序进行拍摄之后,显示拍摄界面。
可选地,本申请实施例中,图像浏览界面可以为相册应用程序中显示图像的界面,电子设备可以在用户触发选中相册应用程序中的图像之后,显示图像浏览界面。
可选地,本申请实施例中,第一图像可以为电子设备中存储的任意一张图像,或可以为拍摄预览界面中电子设备实时获取的图像。
可选地,本申请实施例中,目标控件可以设置在上述界面中的任意区域,且可以为任意可能形状的控件,具体可以根据实际使用需求确定,本申请实施例不作限定。
步骤102、电子设备接收用户对目标控件的第一输入。
可选地,本申请实施例中,第一输入可以为悬浮输入或触控输入等任意可能形式的输入,具体可以根据实际使用需求确定,本申请实施例不作限定。
例如,以第一输入为用户对目标控件的触控输入为例,第一输入可以为用户对目 标控件的点击输入、长按输入或重按输入等任意可能的触控输入。
步骤103、电子设备响应于第一输入,将第一图像调节至与第一输入对应的目标效果。
可选地,本申请实施例中,目标控件可以用于调节色彩或光影。
可选地,本申请实施例中,目标控件的每个位置可以对应不同的色彩参数或光影参数,电子设备可以根据第一输入的结束位置,调节第一图像的色彩参数或光影参数,从而可以将第一图像调节至与第一输入对应的目标效果。
可选地,本申请实施例中,色彩参数可以包括饱和度,或饱和度和明度,以及以下任一项:对比度和暗角,对比度和自然饱和度,对比度、自然饱和度和色温。
可选地,本申请实施例中,光影参数可以包括曝光参数、高光参数和阴影参数。
对于电子设备将第一图像调节至与第一输入对应的目标效果的具体方法,将在下述的实施例中进行详细描述,为了避免重复,此处不予赘述。
下面结合附图对本申请实施例提供的图像处理方法进行示例性地说明。
示例性地,如图2所示,电子设备在图像浏览界面20中显示图像21(即第一图像)和色彩调节控件22(即目标控件);若电子设备接收到用户对色彩调节控件22的点击输入(即第一输入),则电子设备可以根据该输入在色彩调节控件22上的结束位置23,调节图像21的色彩参数,从而可以将图像21调节至与该输入对应的色彩效果(即目标效果)。
需要说明的是,本申请实施例中,用户可以在拍摄预览界面中触发电子设备将第一图像调节至与第一输入对应的目标效果后,在拍摄界面或图像浏览界面中触发电子设备继续对调节后的第一图像进行调节;即电子设备可以在拍摄前期和拍摄后期均对第一图像的色彩或光影进行调节,且拍摄后期可延续拍摄前期调节的参数继续进行调节。
在本申请实施例提供的图像处理方法中,由于电子设备可以通过用户对用于调节色彩或光影的控件的输入,将显示的图像调节至与该输入对应的效果;即电子设备在对图像进行处理时,仅需通过用户的一个输入,便可以调节图像的色彩或光影效果,因此可以简化图像处理的过程。
可选地,本申请实施例中,上述目标控件用于调节色彩,那么在电子设备将第一图像调节至与第一输入对应的目标效果之前,本申请实施例提供的图像处理方法还可以包括下述的步骤104。
步骤104、电子设备获取第一图像的类型。
可选地,本申请实施例中,第一图像可以为包括人脸图像的图像(即下述的第一类型),或可以为不包括人脸图像的图像(即下述的第二类型)。
可选地,本申请实施例中,电子设备可以通过比对第一图像与电子设备中的已训练人脸模型,获取第一图像的类型。
可选地,本申请实施例中,电子设备可以根据第一图像的类型,通过下述的一种可能的实现方式或另一种可能的实现方式,将第一图像调节至与第一输入对应的目标效果。
一种可能的实现方式
可选地,本申请实施例中,上述步骤103具体可以通过下述的步骤103a实现。
步骤103a、电子设备响应于第一输入,在第一图像为第一类型的情况下,以第一方式将第一图像调节至与第一输入对应的第一效果。
可以理解,在第一图像为第一类型的情况下,第一效果即上述目标效果。
可选地,本申请实施例中,上述步骤103a具体可以通过下述的步骤103a1至步骤103a3实现。
步骤103a1、电子设备响应于第一输入,在第一图像为第一类型的情况下,确定第一图像的预设通道。
可选地,本申请实施例中,预设通道可以为第一图像中人脸图像对应的颜色通道。
步骤103a2、电子设备将预设通道的第一色彩调节至与第一输入对应的第一目标色彩值。
可选地,本申请实施例中,第一色彩可以为上述色彩参数中的饱和度、或饱和度和明度。
可选地,本申请实施例中,第一目标色彩值可以为与目标控件中第一输入的结束位置对应的饱和度、或饱和度和明度中与预设通道对应的饱和度、或饱和度和明度。
可选地,本申请实施例中,预设通道可以包括第一通道、第二通道和第三通道,那么上述步骤103a2具体可以通过下述的步骤A、步骤B和步骤C中的至少之一实现。
步骤A、电子设备将第一通道的第一色彩调节至第一目标色彩值中与第一通道对应的第一子色彩值。
可选地,本申请实施例中,第一通道可以为红色通道,电子设备可以将红色通道的饱和度、或饱和度和明度调节至第一目标色彩值中与红色通道对应的饱和度、或饱和度和明度。
步骤B、电子设备将第二通道的第一色彩调节至第一目标色彩值中与第二通道对应的第二子色彩值。
可选地,本申请实施例中,第二通道可以为橙色通道,电子设备可以将橙色通道的饱和度、或饱和度和明度调节至第一目标色彩值中与橙色通道对应的饱和度、或饱和度和明度。
步骤C、电子设备将第三通道的第一色彩调节至第一目标色彩值中与第三通道对应的第三子色彩值。
可选地,本申请实施例中,第三通道可以为黄色通道,电子设备可以将黄色通道的饱和度、或饱和度和明度调节至第一目标色彩值中与黄色通道对应的饱和度、或饱 和度和明度。
可选地,本申请实施例中,目标控件可以包括相连接的第一子控件和第二子控件,例如,假设目标控件为X轴方向的条形控件,且目标控件包括位置范围为[-100,100],那么第一子控件可以为目标控件中位置范围为[-100,0)的子控件,第二子控件可以为目标控件中位置范围为[0,100]的子控件。
可选地,本申请实施例中,若第一输入的结束位置在第一子控件上,则上述步骤103a2具体可以通过上述步骤A实现,且第一色彩为饱和度,并且电子设备还可以将除第一通道、第二通道和第三通道外的其它通道的饱和度和明度调节为与第一输入对应的饱和度和明度;若第一输入的结束位置在第二子控件上,则上述步骤103a2具体可以通过上述步骤A、步骤B和步骤C实现,且第一色彩为饱和度和明度。
需要说明的是,电子设备调节通道的色彩,实际上是电子设备调节通道对应的颜色的色彩。
本申请实施例中,由于电子设备可以根据第一输入,将预设通道中的至少一个通道的第一色彩调节至对应的色彩值,因此可以提高图像处理的灵活性。
步骤103a3、电子设备将第一图像的第二色彩调节至与第一输入对应的第二目标色彩值。
可选地,本申请实施例中,第一效果可以通过第一目标色彩值和第二目标色彩值指示。
可选地,本申请实施例中,第二色彩可以为对比度和暗角,或者,对比度和自然饱和度。
可选地,本申请实施例中,第二目标色彩值可以为与目标控件中第一输入的结束位置对应的对比度和暗角,或者,对比度和自然饱和度。
可以理解,由于电子设备将第一图像的第一色彩调节至第一目标色彩值,并将第一图像的第二色彩调节至第二目标色彩值,因此调节色彩参数后的第一图像可以以第一效果显示,即第一目标色彩值和第二目标色彩值可以指示第一效果。
本申请实施例中,由于在第一图像为第一类型(即包括人脸图像)的情况下,电子设备可以直接确定第一图像的预设通道,并将预设通道的第一色彩和第一图像的第二色彩,分别调至与第一输入对应的色彩值,因此可以确保第一图像中人脸图像的处理效果,提升第一图像的氛围感。
另一种可能的实现方式
可选地,本申请实施例中,上述步骤103具体可以通过下述的步骤103b实现。
步骤103b、电子设备响应于第一输入,在第一图像为第二类型的情况下,以第二方式将第一图像调节至与第一输入对应的第二效果。
可以理解,在第一图像为第二类型的情况下,第二效果即上述目标效果。
可选地,本申请实施例中,电子设备可以通过下述的方式一和/或方式二,以第二 方式将第一图像调节至与第一输入对应的第二效果。
方式一
可选地,本申请实施例中,上述步骤103b具体可以通过下述的步骤103b1至步骤103b4实现。
步骤103b1、电子设备响应于第一输入,在第一图像为第二类型的情况下,确定第一图像的主色通道、辅色通道和杂色通道。
可选地,本申请实施例中,上述步骤103b1具体可以通过下述的步骤D、步骤E、步骤F和步骤G实现。
步骤D、电子设备响应于第一输入,在第一图像为第二类型的情况下,确定第一图像的主颜色和辅颜色。
可选地,本申请实施例中,上述步骤D具体可以通过下述的步骤D1至步骤D3实现。
步骤D1、电子设备响应于第一输入,在第一图像为第二类型的情况下,将第一图像的颜色中饱和度与明度之和最大的颜色,确定为主颜色。
可选地,本申请实施例中,电子设备可以读取第一图像中的颜色的饱和度与明度,并将第一图像中的黑白灰颜色(即饱和度小于20且明度大于20)之外的颜色的饱和度与明度之和进行排序,从而将饱和度与明度之和最大的颜色确定为第一图像的主颜色。
步骤D2、电子设备根据主颜色和色环,确定第一图像中的至少一个颜色区域。
本申请实施例中,色环可以为在彩色光谱中所见的长条形的色彩序列,将首尾连接在一起,使红色连接到另一端的紫色,色环可以包括12-24种不同的颜色。
可选地,本申请实施例中,电子设备可以将色环平均划分为多个单位颜色通道,电子设备划分的单位颜色通道的数量可以为系统默认的,也可以为根据用户的实际使用需求设置的。
可选地,本申请实施例中,每个颜色区域可以对应一种颜色,每个颜色区域对应的颜色在色环中的位置与第一位置的夹角大于或等于预设角度。
本申请实施例中,第一位置为上述主颜色在色环中的位置。
可选地,本申请实施例中,电子设备可以根据至少一个预设角度确定色环中的至少一个角度范围,且设置该至少一个角度范围的优先级,并根据该优先级确定第一图像中的至少一个颜色区域。
步骤D3、电子设备将是上述至少一个颜色区域中面积最大的颜色区域对应的颜色确定为辅颜色。
可选地,本申请实施例中,面积最大的颜色区域可以为包括像素数量最多的颜色区域。
需要说明的是,本申请实施例中,若第一图像中不存在在色环中的位置与第一位 置的夹角大于或等于预设角度的颜色对应的颜色区域,则电子设备可以确定第一图像不存在辅颜色。
下面结合附图对本申请实施例提供的图像处理方法进行示例性地说明。
示例性地,如图3所示,假设第一位置为色环中的位置0,电子设备确定与位置0的夹角等于180度(即预设角度)且有15度余量的角度范围A,确定与位置0的夹角大于或等于150度(即预设角度)且有15度余量的角度范围B,确定与位置0的夹角大于或等于60度(即预设角度)且有15度余量的角度范围C,且优先级顺序为角度范围A、角度范围B、角度范围C;那么,若第一图像中的颜色区域1对应的颜色1’在色环中的位置处于角度范围A,则电子设备可以将颜色1’确定为第一图像的辅颜色;若第一图像中没有颜色区域对应的颜色处于角度范围A,且第一图像中的颜色区域2对应的颜色2’和颜色区域3对应的颜色3’在色环中的位置处于角度范围B,并颜色区域2的面积大于颜色区域3的面积,则电子设备可以将颜色2’确定为第一图像的辅颜色;若第一图像中没有颜色区域对应的颜色处于角度范围A和角度范围B,且第一图像中的颜色区域4对应的颜色4’和颜色区域5对应的颜色5’在色环中的位置处于角度范围C,并颜色区域5的面积大于颜色区域4的面积,则电子设备可以将颜色5’确定为第一图像的辅颜色。
本申请实施例中,由于电子设备可以将第一图像中颜色的饱和度与明度之和最大的颜色,确定为第一图像的主颜色,并可以根据该主颜色和色环确定第一图像的辅颜色,因此电子设备可以准确地获取第一图像的主颜色和辅颜色,以提升图像处理的准确性。
步骤E、电子设备将色环中与第一预设角度范围对应的所有单位颜色通道,确定为主色通道。
本申请实施例中,第一预设角度范围的中心与主颜色在色环中的第一位置重合。
可选地,本申请实施例中,第一预设角度范围可以为系统默认的,或可以为用户根据实际使用需求设置的。
可选地,本申请实施例中,第一预设角度范围对应的所有单位颜色通道可以为色环中与第一预设角度范围存在重合角度的所有单位颜色通道。
步骤F、电子设备将色环中与第二预设角度范围对应的所有单位颜色通道,确定为辅色通道。
本申请实施例中,第二预设角度范围的中心与辅颜色在色环中的第二位置重合。
可选地,本申请实施例中,第二预设角度范围可以为系统默认的,或可以为用户根据实际使用需求设置的。
可选地,本申请实施例中,第二预设角度与第一预设角度可以相同也可以不同。
可选地,本申请实施例中,第二预设角度范围对应的所有单位颜色通道可以为色环中与第二预设角度范围存在重合角度的所有单位颜色通道。
步骤G、电子设备将色环中除主色通道和辅色通道外的其他单位颜色通道,确定为杂色通道。
可选地,本申请实施例中,若第一图像不存在辅颜色,则杂色通道为色环中除主色通道外的其他单位颜色通道。
本申请实施例中,由于在第一图像为第二类型的情况下,电子设备可以确定第一图像的主颜色和辅颜色,进而可以确定主色通道、辅色通道和杂色通道,因此可以进一步提升图像处理的准确性。
需要说明的是,本申请实施例提供的图像处理方法还可以应用于其它场景,例如,在吸色场景中,电子设备可以通过本申请实施例提供的图像处理方法确定桌面壁纸的主颜色和辅颜色后,对桌面中的应用程序的图标进行针对性地赋色,以使显示效果更加协调。
步骤103b2、电子设备将目标通道的第三色彩调节至与第一输入对应的第三目标色彩值。
可选地,本申请实施例中,目标通道可以为主色通道或杂色通道。
可选地,本申请实施例中,第三色彩可以为上述色彩参数中的饱和度和明度。
可选地,本申请实施例中,第三目标色彩值可以为与目标控件中第一输入的结束位置对应的饱和度和明度中与目标通道对应的饱和度和明度,即不同的目标通道可以对应不同的饱和度和明度。
步骤103b3、电子设备将辅色通道的第三色彩调节至与第一输入对应的第四目标色彩值。
可选地,本申请实施例中,第四目标色彩值可以为与目标控件中第一输入的结束位置对应的饱和度和明度中与辅色通道对应的饱和度和明度。
可选地,本申请实施例中,上述主色通道或辅色通道可以包括色环中的至少两个单位颜色通道,电子设备可以确定该至少两个单位颜色通道与目标角度范围的重合角度,得到与该至少两个单位颜色通道一一对应的至少两个重合角度;其中,对于主色通道,上述目标角度范围为第一预设角度范围;对于辅色通道,上述目标角度范围为第二预设角度范围。如此,电子设备在调节主色通道或辅色通道的第三色彩时,可以按照至少一个调节比例,调节其包括的至少两个单位颜色通道的第三色彩;其中每个调节比例可以为一个重合角度与该至少两个重合角度中的最大角度的比值。
可选地,本申请实施例中,电子设备在按照至少一个调节比例,调节主色通道或辅色通道包括的至少两个单位颜色通道的第三色彩时,可以将该至少两个单位颜色通道中,对应的重合角度最大的单位颜色通道的第三色彩调整为第一输入对应的目标色彩值,并将该至少两个单位颜色通道中的其它每个单位颜色通道,按照对应的调节比例,调节该每个单位颜色通道的第三色彩。可以理解,若主色通道或辅色通道包括两个单位颜色通道,且该两个单位颜色通道对应的两个重合角度相等,则电子设备可以 将该两个单位颜色通道的第三色彩均调整为第一输入对应的目标色彩值。
可选地,本申请实施例中,若主色通道与辅色通道包括相同的单位颜色通道,则电子设备可以将该相同的单位颜色通道的第三色彩调整为:上述第三目标色彩值和第四目标色彩值中的最大值。
下面结合附图对本申请实施例提供的图像处理方法进行示例性地说明。
示例性地,以电子设备调节主色通道的第三色彩为例,如图4所示,电子设备可以将色环平均划分为8个单位颜色通道(即单位颜色通道41至单位颜色通道48),假设主色通道包括单位颜色通道41和单位颜色通道42(即至少两个单位颜色通道),且第一预设角度范围为a,那么电子设备可以确定单位颜色通道41与a的重合角度b、单位颜色通道42与a的重合角度c,且b<c。从而电子设备可以将单位颜色通道42的第三色彩调整为第三目标色彩值,并按照调节比例b/c,调节单位颜色通道41的第三色彩;例如,电子设备将单位颜色通道42的饱和度调整为饱和度A(即第三目标色彩值),并按照调节比例b/c,将单位颜色通道41的饱和度调整为A×(b/c)。如此,电子设备可以按比例调节主色通道包括的两个单位颜色通道的第三色彩,以提高图像处理的准确性,进而可以确保处理后的图像有较好的显示效果。
步骤103b4、电子设备将第一图像的第四色彩调节至与第一输入对应的第五目标色彩值。
可选地,本申请实施例中,第二效果可以通过第三目标色彩值、第四目标色彩值和第五目标色彩值指示。
可选地,本申请实施例中,第四色彩可以为对比度和暗角,或者,对比度和自然饱和度。
可选地,本申请实施例中,第五目标色彩值可以为与目标控件中第一输入的结束位置对应的对比度和暗角,或者,对比度和自然饱和度。
可以理解,由于电子设备将第一图像的第三色彩调节至第四目标色彩值,并将第一图像的第四色彩调节至第五目标色彩值,因此调节色彩参数后的第一图像可以以第二效果显示,即第四目标色彩值和第五目标色彩值可以指示第二效果。
本申请实施例中,由于在第一图像为第二类型(即不包括人脸图像)的情况下,电子设备可以确定第一图像的主色通道、辅色通道和杂色通道,并将各通道的第三色彩和第一图像的第四色彩,分别调至与第一输入对应的色彩值,因此可以进一步提升图像处理的准确性,以确保处理后的图像的显示效果。
方式二
可选地,本申请实施例中,上述步骤103b具体可以通过下述的步骤103b5和步骤103b6实现。
步骤103b5、电子设备确定与第一输入对应的两个色温调节量中与目标色相范围对应的目标色温调节量。
本申请实施例中,目标色相范围为第一图像的主颜色的色相所在的色相范围。
可选地,本申请实施例中,目标色相范围可以为暖色色相范围或冷色色相范围,暖色色相范围可以为[0,80]和[330,360],冷色色相范围可以为(80,330)。
可选地,本申请实施例中,第一输入可以对应第一色温调节量和第二色温调节量,且第一色温调节量对应暖色色相范围,第二色温调节量对应冷色色相范围,从而电子设备可以根据第一图像的主颜色的色相所在的色相范围,确定目标色温调节量。
步骤103b6、电子设备基于目标色温调节量,调节第一图像的色温。
可选地,本申请实施例中,第二效果可以通过第一图像调节后的色温指示。
可选地,本申请实施例中,若第一图像的主颜色的色相所在的色相范围为暖色色相范围,则电子设备可以确定目标色温调节量为第一色温调节量,并基于第一色温调节量调节第一图像的色温,例如第一图像的原始色温为50,第一色温调节量为+20,那么调节后的第一图像的色温为70;若第一图像的主颜色的色相所在的色相范围为冷色色相范围,则电子设备可以确定目标色温调节量为第二色温调节量,并基于第二色温调节量调节第一图像的色温,例如第一图像的原始色温为50,第二色温调节量为-20,那么调节后的第一图像的色温为30。
可以理解,由于电子设备可以基于目标色温调节量调节第一图像的色温,因此调节色温后的第一图像可以以第二效果显示,即第一图像调节后的色温可以指示第二效果。
本申请实施例中,由于电子设备可以基于与第一输入对应的两个色温调节量中与目标色相范围对应的目标色温调节量,调节第一图像的色温,因此可以确保处理后的图像的色温的准确性。
本申请实施例中,由于电子设备可以根据获取的第一图像的类型,以不同的方式将第一图像调节至与第一输入对应的效果,因此可以提高图像处理的灵活性。
本申请实施例提供的图像处理方法,执行主体可以为图像处理装置。本申请实施例中以图像处理装置执行图像处理的方法为例,说明本申请实施例提供的图像处理装置。
结合图5,本申请实施例提供一种图像处理装置50,该图像处理装置50可以包括显示模块51、接收模块52和调节模块53。显示模块51,可以用于显示第一图像和目标控件。接收模块52,可以用于接收用户对目标控件的第一输入。调节控件53,可以用于响应于接收模块52接收的第一输入,将第一图像调节至与第一输入对应的目标效果。其中,目标控件可以用于调节色彩或光影。
一种可能的实现方式中,上述目标控件可以用于调节色彩,上述图像处理装置50还可以包括获取模块。获取模块,可以用于在调节模块53将第一图像调节至与第一输入对应的目标效果之前,获取第一图像的类型。调节模块53,具体可以用于在第一图像为第一类型的情况下,以第一方式将第一图像调节至与第一输入对应的第一效果。 调节模块53,具体可以用于在第一图像为第二类型的情况下,以第二方式将第一图像调节至与第一输入对应的第二效果。
一种可能的实现方式中,上述图像处理装置50还可以包括确定模块。确定模块,可以用于确定第一图像的预设通道。调节模块53,具体可以用于将预设通道的第一色彩调节至与第一输入对应的第一目标色彩值。调节模块53,具体可以用于将第一图像的第二色彩调节至与第一输入对应的第二目标色彩值。其中,第一效果可以通过第一目标色彩值和第二目标色彩值指示。
一种可能的实现方式中,上述预设通道可以包括第一通道、第二通道和第三通道。调节模块53,具体可以用于调节以下至少之一:将第一通道的第一色彩调节至第一目标色彩值中与第一通道对应的第一子色彩值;将第二通道的第一色彩调节至第一目标色彩值中与第二通道对应的第二子色彩值;将第三通道的第一色彩调节至第一目标色彩值中与第三通道对应的第三子色彩值。
一种可能的实现方式中,确定模块,具体可以用于确定第一图像的主色通道、辅色通道和杂色通道。调节模块53,具体可以用于将目标通道的第三色彩调节至与第一输入对应的第三目标色彩值,目标通道为主色通道或杂色通道。调节模块53,具体可以用于将辅色通道的第三色彩调节至与第一输入对应的第四目标色彩值。调节模块53,具体可以用于将第一图像的第四色彩调节至与第一输入对应的第五目标色彩值。其中,第二效果可以通过第三目标色彩值、第四目标色彩值和第五目标色彩值指示。
一种可能的实现方式中,确定模块,具体可以用于确定与第一输入对应的两个色温调节量中与目标色相范围对应的目标色温调节量,目标色相范围为第一图像的主颜色的色相所在的色相范围。调节模块53,具体可以用于基于目标色温调节量,调节第一图像的色温。其中,第二效果可以通过第一图像调节后的色温指示。
一种可能的实现方式中,确定模块,具体可以用于确定第一图像的主颜色和辅颜色。确定模块,具体可以用于将色环中与第一预设角度范围对应的所有单位颜色通道,确定为主色通道,第一预设角度范围的中心与主颜色在色环中的第一位置重合。确定模块,具体可以用于将色环中与第二预设角度范围对应的所有单位颜色通道,确定为辅色通道,第二预设角度范围的中心与辅颜色在色环中的第二位置重合。确定模块,具体可以用于将色环中除主色通道和辅色通道外的其他单位颜色通道,确定为杂色通道。
一种可能的实现方式中,确定模块,具体可以用于将第一图像的颜色中饱和度与明度之和最大的颜色,确定为主颜色。确定模块,具体可以用于根据主颜色和色环,确定第一图像中的至少一个颜色区域,每个颜色区域对应一种颜色,每个颜色区域对应的颜色在色环中的位置与第一位置的夹角大于或等于预设角度。确定模块,具体可以用于将至少一个颜色区域中面积最大的颜色区域对应的颜色确定为辅颜色。
在本申请实施例提供的图像处理装置中,由于该图像处理装置可以通过用户对用 于调节色彩或光影的控件的输入,将显示的图像调节至与该输入对应的效果;即该图像处理装置在对图像进行处理时,仅需通过用户的一个输入,便可以调节图像的色彩或光影效果,因此可以简化图像处理的过程。
本实施例中各种实现方式具有的有益效果具体可以参见上述方法实施例中相应实现方式所具有的有益效果,为避免重复,此处不再赘述。
本申请实施例中的图像处理装置可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。
本申请实施例中的图像处理装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。
本申请实施例提供的图像处理装置能够实现图1至图4的方法实施例实现的各个过程,为避免重复,这里不再赘述。
可选地,如图6所示,本申请实施例还提供一种电子设备600,包括处理器601和存储器602,存储器602上存储有可在所述处理器601上运行的程序或指令,该程序或指令被处理器601执行时实现如上述图像处理方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。
图7为实现本申请实施例的一种电子设备的硬件结构示意图。
该电子设备1000包括但不限于:射频单元1001、网络模块1002、音频输出单元1003、输入单元1004、传感器1005、显示单元1006、用户输入单元1007、接口单元1008、存储器1009、以及处理器1010等部件。
本领域技术人员可以理解,电子设备1000还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1010逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图7中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。
其中,显示单元1006,可以用于显示第一图像和目标控件。用户输入单元1007, 可以用于接收用户对目标控件的第一输入。处理器1010,可以用于响应于用户输入单元1007接收的第一输入,将第一图像调节至与第一输入对应的目标效果。其中,目标控件可以用于调节色彩或光影。
一种可能的实现方式中,上述目标控件可以用于调节色彩。处理器1010,还可以用于在将第一图像调节至与第一输入对应的目标效果之前,获取第一图像的类型。处理器1010,具体可以用于在第一图像为第一类型的情况下,以第一方式将第一图像调节至与第一输入对应的第一效果。处理器1010,具体可以用于在第一图像为第二类型的情况下,以第二方式将第一图像调节至与第一输入对应的第二效果。
一种可能的实现方式中,处理器1010,还可以用于确定第一图像的预设通道。处理器1010,具体可以用于将预设通道的第一色彩调节至与第一输入对应的第一目标色彩值。处理器1010,具体可以用于将第一图像的第二色彩调节至与第一输入对应的第二目标色彩值。其中,第一效果可以通过第一目标色彩值和第二目标色彩值指示。
一种可能的实现方式中,上述预设通道可以包括第一通道、第二通道和第三通道。处理器1010,具体可以用于调节以下至少之一:将第一通道的第一色彩调节至第一目标色彩值中与第一通道对应的第一子色彩值;将第二通道的第一色彩调节至第一目标色彩值中与第二通道对应的第二子色彩值;将第三通道的第一色彩调节至第一目标色彩值中与第三通道对应的第三子色彩值。
一种可能的实现方式中,处理器1010,具体可以用于确定第一图像的主色通道、辅色通道和杂色通道。处理器1010,具体可以用于将目标通道的第三色彩调节至与第一输入对应的第三目标色彩值,目标通道为主色通道或杂色通道。处理器1010,具体可以用于将辅色通道的第三色彩调节至与第一输入对应的第四目标色彩值。处理器1010,具体可以用于将第一图像的第四色彩调节至与第一输入对应的第五目标色彩值。其中,第二效果可以通过第三目标色彩值、第四目标色彩值和第五目标色彩值指示。
一种可能的实现方式中,处理器1010,具体可以用于确定与第一输入对应的两个色温调节量中与目标色相范围对应的目标色温调节量,目标色相范围为第一图像的主颜色的色相所在的色相范围。处理器1010,具体可以用于基于目标色温调节量,调节第一图像的色温。其中,第二效果可以通过第一图像调节后的色温指示。
一种可能的实现方式中,处理器1010,具体可以用于确定第一图像的主颜色和辅颜色。处理器1010,具体可以用于将色环中与第一预设角度范围对应的所有单位颜色通道,确定为主色通道,第一预设角度范围的中心与主颜色在色环中的第一位置重合。处理器1010,具体可以用于将色环中与第二预设角度范围对应的所有单位颜色通道,确定为辅色通道,第二预设角度范围的中心与辅颜色在色环中的第二位置重合。处理器1010,具体可以用于将色环中除主色通道和辅色通道外的其他单位颜色通道,确定为杂色通道。
一种可能的实现方式中,处理器1010,具体可以用于将第一图像的颜色中饱和度 与明度之和最大的颜色,确定为主颜色。处理器1010,具体可以用于根据主颜色和色环,确定第一图像中的至少一个颜色区域,每个颜色区域对应一种颜色,每个颜色区域对应的颜色在色环中的位置与第一位置的夹角大于或等于预设角度。处理器1010,具体可以用于将至少一个颜色区域中面积最大的颜色区域对应的颜色确定为辅颜色。
在本申请实施例提供的电子设备中,由于电子设备可以通过用户对用于调节色彩或光影的控件的输入,将显示的图像调节至与该输入对应的效果;即电子设备在对图像进行处理时,仅需通过用户的一个输入,便可以调节图像的色彩或光影效果,因此可以简化图像处理的过程。
本实施例中各种实现方式具有的有益效果具体可以参见上述方法实施例中相应实现方式所具有的有益效果,为避免重复,此处不再赘述。
应理解的是,本申请实施例中,输入单元1004可以包括图形处理器(Graphics Processing Unit,GPU)10041和麦克风10042,图形处理器10041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元1006可包括显示面板10061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板10061。用户输入单元1007包括触控面板10071以及其他输入设备10072中的至少一种。触控面板10071,也称为触摸屏。触控面板10071可包括触摸检测装置和触摸控制器两个部分。其他输入设备10072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。
存储器1009可用于存储软件程序以及各种数据。存储器1009可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器1009可以包括易失性存储器或非易失性存储器,或者,存储器1009可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器1009包括但不限于这些和任意其它适合类型的存储器。
处理器1010可包括一个或多个处理单元;可选的,处理器1010集成应用处理器 和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器1010中。
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现如上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。
本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体 实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。

Claims (21)

  1. 一种图像处理方法,所述方法包括:
    显示第一图像和目标控件;
    接收用户对所述目标控件的第一输入;
    响应于所述第一输入,将所述第一图像调节至与所述第一输入对应的目标效果;
    其中,所述目标控件用于调节色彩或光影。
  2. 根据权利要求1所述的方法,其中,所述目标控件用于调节色彩,所述将所述第一图像调节至与所述第一输入对应的目标效果之前,所述方法还包括:
    获取所述第一图像的类型;
    所述将所述第一图像调节至与所述第一输入对应的目标效果,包括:
    在所述第一图像为第一类型的情况下,以第一方式将所述第一图像调节至与所述第一输入对应的第一效果;
    在所述第一图像为第二类型的情况下,以第二方式将所述第一图像调节至与所述第一输入对应的第二效果。
  3. 根据权利要求2所述的方法,其中,所述以第一方式将所述第一图像调节至与所述第一输入对应的第一效果,包括:
    确定所述第一图像的预设通道;
    将所述预设通道的第一色彩调节至与所述第一输入对应的第一目标色彩值;
    将所述第一图像的第二色彩调节至与所述第一输入对应的第二目标色彩值;
    其中,所述第一效果通过所述第一目标色彩值和所述第二目标色彩值指示。
  4. 根据权利要求3所述的方法,其中,所述预设通道包括第一通道、第二通道和第三通道;
    所述将所述预设通道的第一色彩调节至与所述第一输入对应的第一目标色彩值,包括以下至少之一:
    将所述第一通道的所述第一色彩调节至所述第一目标色彩值中与所述第一通道对应的第一子色彩值;
    将所述第二通道的所述第一色彩调节至所述第一目标色彩值中与所述第二通道对应的第二子色彩值;
    将所述第三通道的所述第一色彩调节至所述第一目标色彩值中与所述第三通道对应的第三子色彩值。
  5. 根据权利要求2所述的方法,其中,所述以第二方式将所述第一图像调节至与所述第一输入对应的第二效果,包括:
    确定所述第一图像的主色通道、辅色通道和杂色通道;
    将目标通道的第三色彩调节至与所述第一输入对应的第三目标色彩值,所述目标通道为所述主色通道或所述杂色通道;
    将所述辅色通道的第三色彩调节至与所述第一输入对应的第四目标色彩值;
    将所述第一图像的第四色彩调节至与所述第一输入对应的第五目标色彩值;
    其中,所述第二效果通过所述第三目标色彩值、所述第四目标色彩值和所述第五目标色彩值指示。
  6. 根据权利要求2或5所述的方法,其中,所述以第二方式将所述第一图像调节至与所述第一输入对应的第二效果,包括:
    确定与所述第一输入对应的两个色温调节量中与目标色相范围对应的目标色温调节量,所述目标色相范围为所述第一图像的主颜色的色相所在的色相范围;
    基于所述目标色温调节量,调节所述第一图像的色温;
    其中,所述第二效果通过所述第一图像调节后的色温指示。
  7. 根据权利要求5所述的方法,其中,所述确定所述第一图像的主色通道、辅色通道和杂色通道,包括:
    确定所述第一图像的主颜色和辅颜色;
    将色环中与第一预设角度范围对应的所有单位颜色通道,确定为所述主色通道,所述第一预设角度范围的中心与所述主颜色在所述色环中的第一位置重合;
    将所述色环中与第二预设角度范围对应的所有单位颜色通道,确定为所述辅色通道,所述第二预设角度范围的中心与所述辅颜色在所述色环中的第二位置重合;
    将所述色环中除所述主色通道和所述辅色通道外的其他单位颜色通道,确定为所述杂色通道。
  8. 根据权利要求7所述的方法,其中,所述确定所述第一图像的主颜色和辅颜色,包括:
    将所述第一图像的颜色中饱和度与明度之和最大的颜色,确定为所述主颜色;
    根据所述主颜色和所述色环,确定所述第一图像中的至少一个颜色区域,每个颜色区域对应一种颜色,每个颜色区域对应的颜色在所述色环中的位置与所述第一位置的夹角大于或等于预设角度;
    将所述至少一个颜色区域中面积最大的颜色区域对应的颜色确定为所述辅颜色。
  9. 一种图像处理装置,所述装置包括显示模块、接收模块和调节模块;
    所述显示模块,用于显示第一图像和目标控件;
    所述接收模块,用于接收用户对所述目标控件的第一输入;
    所述调节控件,用于响应于所述接收模块接收的所述第一输入,将所述第一图像调节至与所述第一输入对应的目标效果;
    其中,所述目标控件用于调节色彩或光影。
  10. 根据权利要求9所述的装置,其中,所述目标控件用于调节色彩,所述装置还包括获取模块;
    所述获取模块,用于在所述调节模块将所述第一图像调节至与所述第一输入对应 的所述目标效果之前,获取所述第一图像的类型;
    所述调节模块,具体用于在所述第一图像为第一类型的情况下,以第一方式将所述第一图像调节至与所述第一输入对应的第一效果;
    所述调节模块,具体用于在所述第一图像为第二类型的情况下,以第二方式将所述第一图像调节至与所述第一输入对应的第二效果。
  11. 根据权利要求10所述的装置,其中,所述装置还包括确定模块;
    所述确定模块,用于确定所述第一图像的预设通道;
    所述调节模块,具体用于将所述预设通道的第一色彩调节至与所述第一输入对应的第一目标色彩值;
    所述调节模块,具体用于将所述第一图像的第二色彩调节至与所述第一输入对应的第二目标色彩值;
    其中,所述第一效果通过所述第一目标色彩值和所述第二目标色彩值指示。
  12. 根据权利要求11所述的装置,其中,所述预设通道包括第一通道、第二通道和第三通道;
    所述调节模块,具体用于调节以下至少之一:
    将所述第一通道的所述第一色彩调节至所述第一目标色彩值中与所述第一通道对应的第一子色彩值;
    将所述第二通道的所述第一色彩调节至所述第一目标色彩值中与所述第二通道对应的第二子色彩值;
    将所述第三通道的所述第一色彩调节至所述第一目标色彩值中与所述第三通道对应的第三子色彩值。
  13. 根据权利要求10所述的装置,其中,
    所述确定模块,具体用于确定所述第一图像的主色通道、辅色通道和杂色通道;
    所述调节模块,具体用于将目标通道的第三色彩调节至与所述第一输入对应的第三目标色彩值,所述目标通道为所述主色通道或所述杂色通道;
    所述调节模块,具体用于将所述辅色通道的第三色彩调节至与所述第一输入对应的第四目标色彩值;
    所述调节模块,具体用于将所述第一图像的第四色彩调节至与所述第一输入对应的第五目标色彩值;
    其中,所述第二效果通过所述第三目标色彩值、所述第四目标色彩值和所述第五目标色彩值指示。
  14. 根据权利要求10或13所述的装置,其中,
    所述确定模块,具体用于确定与所述第一输入对应的两个色温调节量中与目标色相范围对应的目标色温调节量,所述目标色相范围为所述第一图像的主颜色的色相所在的色相范围;
    所述调节模块,具体用于基于所述目标色温调节量,调节所述第一图像的色温;
    其中,所述第二效果通过所述第一图像调节后的色温指示。
  15. 根据权利要求13所述的装置,其中,
    所述确定模块,具体用于确定所述第一图像的主颜色和辅颜色;
    所述确定模块,具体用于将色环中与第一预设角度范围对应的所有单位颜色通道,确定为所述主色通道,所述第一预设角度范围的中心与所述主颜色在所述色环中的第一位置重合;
    所述确定模块,具体用于将所述色环中与第二预设角度范围对应的所有单位颜色通道,确定为所述辅色通道,所述第二预设角度范围的中心与所述辅颜色在所述色环中的第二位置重合;
    所述确定模块,具体用于将所述色环中除所述主色通道和所述辅色通道外的其他单位颜色通道,确定为所述杂色通道。
  16. 根据权利要求15所述的装置,其中,
    所述确定模块,具体用于将所述第一图像的颜色中饱和度与明度之和最大的颜色,确定为所述主颜色;
    所述确定模块,具体用于根据所述主颜色和所述色环,确定所述第一图像中的至少一个颜色区域,每个颜色区域对应一种颜色,每个颜色区域对应的颜色在所述色环中的位置与所述第一位置的夹角大于或等于预设角度;
    所述确定模块,具体用于将所述至少一个颜色区域中面积最大的颜色区域对应的颜色确定为所述辅颜色。
  17. 一种电子设备,包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1至8中任一项所述的图像处理方法的步骤。
  18. 一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1至8中任一项所述的图像处理方法的步骤。
  19. 一种计算机软件产品,所述计算机软件产品被至少一个处理器执行以实现如权利要求1至8中任一项所述的图像处理方法。
  20. 一种电子设备,包括所述电子设备被配置成用于执行如权利要求1至8中任一项所述的图像处理方法。
  21. 一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1至8中任一项所述的图像处理方法。
PCT/CN2022/140408 2021-12-29 2022-12-20 图像处理方法、装置、电子设备及可读存储介质 WO2023125160A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111639868.2A CN114327166A (zh) 2021-12-29 2021-12-29 图像处理方法、装置、电子设备及可读存储介质
CN202111639868.2 2021-12-29

Publications (1)

Publication Number Publication Date
WO2023125160A1 true WO2023125160A1 (zh) 2023-07-06

Family

ID=81016681

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/140408 WO2023125160A1 (zh) 2021-12-29 2022-12-20 图像处理方法、装置、电子设备及可读存储介质

Country Status (2)

Country Link
CN (1) CN114327166A (zh)
WO (1) WO2023125160A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114327166A (zh) * 2021-12-29 2022-04-12 维沃移动通信有限公司 图像处理方法、装置、电子设备及可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2114065A2 (en) * 2008-05-02 2009-11-04 Nintendo Co., Ltd. Color conversion apparatus, imaging apparatus, storage medium storing color conversion program, and storage medium storing imaging program
CN111885298A (zh) * 2020-06-19 2020-11-03 维沃移动通信有限公司 图像处理方法及装置
CN112269522A (zh) * 2020-10-27 2021-01-26 维沃移动通信(杭州)有限公司 图像处理方法、装置、电子设备和可读存储介质
CN114327166A (zh) * 2021-12-29 2022-04-12 维沃移动通信有限公司 图像处理方法、装置、电子设备及可读存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2114065A2 (en) * 2008-05-02 2009-11-04 Nintendo Co., Ltd. Color conversion apparatus, imaging apparatus, storage medium storing color conversion program, and storage medium storing imaging program
CN111885298A (zh) * 2020-06-19 2020-11-03 维沃移动通信有限公司 图像处理方法及装置
CN112269522A (zh) * 2020-10-27 2021-01-26 维沃移动通信(杭州)有限公司 图像处理方法、装置、电子设备和可读存储介质
CN114327166A (zh) * 2021-12-29 2022-04-12 维沃移动通信有限公司 图像处理方法、装置、电子设备及可读存储介质

Also Published As

Publication number Publication date
CN114327166A (zh) 2022-04-12

Similar Documents

Publication Publication Date Title
WO2022063023A1 (zh) 视频拍摄方法、视频拍摄装置及电子设备
CN111654635A (zh) 拍摄参数调节方法、装置及电子设备
CN110113534B (zh) 一种图像处理方法、图像处理装置及移动终端
US10847073B2 (en) Image display optimization method and apparatus
US11825040B2 (en) Image shooting method and device, terminal, and storage medium
WO2022166944A1 (zh) 拍照方法、装置、电子设备及介质
CN108898082B (zh) 图片处理方法、图片处理装置及终端设备
US9799099B2 (en) Systems and methods for automatic image editing
CN105225647A (zh) 亮度调整方法及装置
CN109360261A (zh) 图像处理方法、装置、电子设备及存储介质
WO2023061326A1 (zh) 拍摄方法、装置及电子设备
EP4072131A1 (en) Image processing method and apparatus, terminal and storage medium
CN112770058B (zh) 拍摄方法、装置、电子设备和可读存储介质
WO2023025196A1 (zh) 图像处理方法、装置及电子设备
US20230245441A9 (en) Image detection method and apparatus, and electronic device
WO2023125160A1 (zh) 图像处理方法、装置、电子设备及可读存储介质
WO2023284632A1 (zh) 图像展示方法、装置及电子设备
WO2022068806A1 (zh) 图像处理方法、装置及电子设备
CN111953902B (zh) 图像处理方法及装置
WO2023088183A1 (zh) 图像显示方法、装置及电子设备
WO2022073516A1 (zh) 生成图像的方法、装置、电子设备及介质
WO2022143382A1 (zh) 图像处理方法及装置
WO2024061134A1 (zh) 拍摄方法、装置、电子设备及介质
CN111901519A (zh) 屏幕补光方法、装置及电子设备
WO2023005908A1 (zh) 拍摄方法、装置、设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22914414

Country of ref document: EP

Kind code of ref document: A1