CN109040729B - Image white balance correction method and device, storage medium and terminal - Google Patents

Image white balance correction method and device, storage medium and terminal Download PDF

Info

Publication number
CN109040729B
CN109040729B CN201810934706.3A CN201810934706A CN109040729B CN 109040729 B CN109040729 B CN 109040729B CN 201810934706 A CN201810934706 A CN 201810934706A CN 109040729 B CN109040729 B CN 109040729B
Authority
CN
China
Prior art keywords
light source
image
target sub
white balance
images
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.)
Expired - Fee Related
Application number
CN201810934706.3A
Other languages
Chinese (zh)
Other versions
CN109040729A (en
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810934706.3A priority Critical patent/CN109040729B/en
Publication of CN109040729A publication Critical patent/CN109040729A/en
Application granted granted Critical
Publication of CN109040729B publication Critical patent/CN109040729B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/73Colour balance circuits, e.g. white balance circuits or colour temperature control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N9/00Details of colour television systems
    • H04N9/64Circuits for processing colour signals
    • H04N9/646Circuits for processing colour signals for image enhancement, e.g. vertical detail restoration, cross-colour elimination, contour correction, chrominance trapping filters

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Color Television Image Signal Generators (AREA)
  • Processing Of Color Television Signals (AREA)

Abstract

The embodiment of the application discloses a method, a device, a storage medium and a terminal for correcting white balance of an image, wherein the method comprises the following steps: firstly, segmenting a target image to obtain a plurality of target sub-images; secondly, acquiring a light source direction corresponding to the content of each target sub-image; thirdly, judging whether a light mixing scene exists according to the light source directions corresponding to the target sub-images; and finally, when a mixed light scene exists, white balance correction is carried out according to the light source corresponding to the mixed light scene, so that the image white balance correction effect under the mixed light scene can be improved.

Description

Image white balance correction method and device, storage medium and terminal
Technical Field
The embodiment of the application relates to the technical field of image processing, in particular to an image white balance correction method, an image white balance correction device, a storage medium and a terminal.
Background
With the continuous development of mobile terminals, almost every mobile terminal is configured with a camera function, and photographing can be performed based on the camera function. The mobile terminal tends to an automatic photographing process, and can automatically perform exposure and white balance correction according to a photographing environment.
However, in use, it is found that if a plurality of light sources with different directions exist in a shot picture, namely, a mixed light scene exists, the white balance effect of the shot picture is poor.
Disclosure of Invention
An object of the embodiments of the present application is to provide an image white balance correction method, apparatus, storage medium, and terminal, which can achieve a white balance correction effect in a mixed light scene.
In a first aspect, an embodiment of the present application provides an image white balance correction method, including:
segmenting the target image to obtain a plurality of target sub-images;
acquiring a light source direction corresponding to the content of each target sub-image;
judging whether a light mixing scene exists according to the light source directions corresponding to the target sub-images;
and when a mixed light scene exists, carrying out white balance correction according to the light source corresponding to the mixed light scene.
In a second aspect, an embodiment of the present application provides an image white balance correction apparatus, including:
the segmentation module is used for segmenting the target image to obtain a plurality of target sub-images;
the acquisition module is used for acquiring the light source direction corresponding to the content of each target sub-image obtained by the segmentation module;
the judging module is used for judging whether a light mixing scene exists according to the light source directions corresponding to the target sub-images acquired by the acquiring module;
and the white balance module is used for carrying out white balance correction according to the light source corresponding to the mixed light scene when the judging module judges that the mixed light scene exists.
In a third aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the image white balance correction method as shown in the first aspect.
In a fourth aspect, an embodiment of the present application provides a terminal, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the image white balance correction method according to the first aspect when executing the computer program.
According to the image white balance correction scheme provided by the embodiment of the application, firstly, a target image is segmented to obtain a plurality of target sub-images; secondly, acquiring a light source direction corresponding to the content of each target sub-image; thirdly, judging whether a light mixing scene exists according to the light source directions corresponding to the target sub-images; and finally, when a mixed light scene exists, white balance correction is carried out according to the light source corresponding to the mixed light scene, so that the image white balance correction effect under the mixed light scene can be improved.
Drawings
Fig. 1 is a schematic flowchart of an image white balance correction method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of another image white balance correction method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of another image white balance correction method according to an embodiment of the present disclosure;
fig. 4 is a schematic flowchart of another image white balance correction method according to an embodiment of the present disclosure;
fig. 5 is a schematic flowchart of another image white balance correction method according to an embodiment of the present disclosure;
fig. 6 is a schematic flowchart of another image white balance correction method according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an image white balance correction apparatus according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application.
Detailed Description
The technical scheme of the application is further explained by the specific implementation mode in combination with the attached drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
With the continuous development of mobile terminals, almost every mobile terminal is configured with a camera function, and photographing can be performed based on the camera function. The mobile terminal tends to an automatic photographing process, and can automatically perform exposure and white balance correction according to a photographing environment. However, in use, it is found that if a plurality of light sources in different directions exist in a shot picture, that is, if a mixed light scene exists, the white balance effect of the shot picture is poor, and the color temperature of the shot subject cannot be accurately reflected. The mixed light scene in the embodiment of the application includes a shooting scene with a plurality of light sources in different directions. The light emitted by the plurality of light sources from different angles can cause the color temperature of the collected light to be abnormal when entering the module through the reflection of the shot object. In an automatic white balance program of the current mobile terminal, a mechanism for identifying different light source directions is lacked, so that light sources in different directions cannot be identified, and further, effective white balance processing cannot be performed on a mixed light scene.
The embodiment of the application provides an image white balance correction method, which can identify whether a shooting scene is a mixed light scene or not, and can perform white balance processing based on light sources in multiple light source directions when the shooting scene is the mixed light scene, so that the white balance processing efficiency of the mixed light scene is improved, an image after the white balance processing has more accurate color temperature, and the resource utilization rate is improved. The specific scheme is as follows:
fig. 1 is a schematic flow chart of an image white balance correction method according to an embodiment of the present application, where the method is used in a situation where a mobile terminal is used for taking a picture, especially in a mixed-light scene, and the method may be executed by the mobile terminal, where the mobile terminal may be a smart phone, a tablet computer, a wearable device, a notebook computer, and the method specifically includes the following steps:
and step 110, segmenting the target image to obtain a plurality of target sub-images.
The target image may be a photo taken by the user or a preview image in a preview stage. When a user takes a picture, the mobile terminal automatically performs white balance processing on the picture, or the user modifies the picture based on the picture taken when performing post-production. When a user starts the camera application, the camera application displays the preview frame image acquired by the camera in real time in a preview interface. And when the preview frame image in the preview interface meets the requirements of the user, the user clicks a photographing button to photograph to obtain a photo. Before displaying the preview picture, the mobile terminal performs white balance processing on the preview picture, so that a user can obtain an image with accurate color temperature in a preview stage. Considering that the white balance processing may generate a calculation time, the frame rate of the preview screen may be lowered accordingly.
The target image may be segmented according to a fixed preset segmentation area, e.g. with a fixed size of 50 pixels by 50 pixels. Further, if the fixed-size segmentation mode cannot be matched with the target image, if a sub-image with a smaller segmentation area than the preset segmentation area exists on the side of the target image, the sub-image can be ignored. The target image may be segmented into a fixed number of segments, for example, the target image may be segmented into 10 × 10 target sub-images for a total of 100 target sub-images.
And step 120, acquiring a light source direction corresponding to the content of each target sub-image.
In one implementation, the illumination of the light source is directional, and the direction of the light source can be determined by detecting the light reflection in the target sub-image through the detection of the light source and the reflected light. For example, if the light source directions in at least two target sub-images satisfy the reflection law, reflection information may be determined from the target sub-images. The reflection information may include a correspondence of at least two detection areas in which a reflection relationship exists.
For example, with a flickering light source such as an incandescent lamp, objects such as a table top may reflect light when the incandescent lamp is lit. When the incandescent lamp is extinguished, objects such as a table top do not emit light. It is therefore possible to determine the detection areas where the pixel or luminance change occurs in pairs from the pixel change value. The light source and its illumination area can be determined based on the detection area of the synchronous change in brightness.
In another implementation, the identification of the light source direction in any one target sub-image may be implemented by establishing a preset machine learning model, and if a light source exists in the target sub-image, the light source direction is output as a direction vector representing the light source direction. If no light source is present in the target sub-image, the output may be 0 or a default term, etc.
And step 130, judging whether a light mixing scene exists according to the light source directions corresponding to the multiple target sub-images.
If there are multiple light source directions, it may be determined that a mixed light scene exists, step 140 is performed. If there is only one light source direction, it is determined that there is no mixed light scene, step 150 is performed.
And 140, when a mixed light scene exists, performing white balance correction according to the light source corresponding to the mixed light scene.
The light sources corresponding to the light mixing scene may be all light sources corresponding to the target sub-image. After acquiring the plurality of light sources of the mixed light scene, determining the reference color of the white balance correction according to the light intensities of the plurality of light sources.
And 150, when no mixed light scene exists, carrying out white balance processing according to the whiteboard.
The adjusting board can obtain the environmental color temperature, and white balance processing is carried out according to the environmental color temperature. Optionally, the photosensitivity of blue, green and red is balanced under the condition of 3200K color temperature. When the ambient color temperature is 3200K, the color temperature filter of the camera is placed at 3200K, and the scenery can be correctly restored; when the ambient color temperature is 5600K, the color temperature filter of the camera is placed at 5600K, and the scenery can be correctly color-restored. When the environmental color temperature is within the range of 1000K above or below 3200K and 1000K above or below 5600K, the color restoration acceptable to human eyes can be obtained by utilizing the white balance preset function.
The image white balance correction method provided by the embodiment of the application firstly divides a target image to obtain a plurality of target sub-images. And secondly, acquiring the light source direction corresponding to the content of each target sub-image. And thirdly, judging whether a light mixing scene exists according to the light source directions corresponding to the target sub-images. And finally, when a mixed light scene exists, white balance correction is carried out according to the light source corresponding to the mixed light scene, so that the image white balance correction effect under the mixed light scene can be improved. At present, light sources in different light source directions in a target image cannot be identified, so that the problems of inaccurate judgment of the integral color temperature of the target image and the like are caused, and the white balance effect is poor. According to the embodiment of the application, the light sources in different light source directions can be determined based on the target sub-images obtained through segmentation, then white balance correction is carried out according to the light sources in different directions, and the color temperature of the shot scene can be restored with higher quality.
Fig. 2 is a schematic flow chart of an image white balance correction method provided in an embodiment of the present application, which is used to further explain the foregoing embodiment, and includes:
step 210, segmenting the target image to obtain a plurality of target sub-images.
And step 220, acquiring the light source direction corresponding to the content of each target sub-image.
And step 230, judging whether the light source directions corresponding to the multiple adjacent target sub-images are the same.
One important factor for determining whether a light mixing scene exists is whether a plurality of light sources exist, and one expression form of the plurality of light sources is that the light source directions corresponding to a plurality of adjacent target sub-images are different and the same. The light source direction of each target sub-image can be obtained through algorithms such as a preset machine learning model. By comparing whether the light source directions are the same between adjacent target sub-images, it can be determined whether different light sources are present. Further, when the angle difference of the light source directions between the adjacent target sub-images is smaller than the preset angle, it may be determined that the light source directions between the adjacent target sub-images are the same. The preset angle is 5 degrees and 10 degrees.
If the light source directions corresponding to the multiple adjacent target sub-images are the same, step 240 is performed. If the light source directions corresponding to the multiple adjacent target sub-images are not the same, step 260 is performed.
Step 240, if the light source directions corresponding to the multiple adjacent target sub-images are different, a mixed light scene exists.
And step 250, when a mixed light scene exists, performing white balance correction according to the light source corresponding to the mixed light scene.
And step 260, if the light source directions corresponding to the multiple adjacent target sub-images are the same, no light mixing scene exists, and white balance processing is performed according to the dimming board.
The image white balance correction method provided by the embodiment of the application can determine whether a plurality of light sources exist based on whether the light source directions of the adjacent target sub-images are the same, in other words, whether the light source directions of the adjacent target sub-images are obviously different, so that a mixed light scene is more accurately judged, and the resource utilization rate is improved.
Fig. 3 is a schematic flowchart of an image white balance correction method according to an embodiment of the present application, which is used to further describe the foregoing embodiment, and includes:
step 310, the target image is segmented to obtain a plurality of target sub-images.
And step 320, acquiring the light source direction corresponding to the content of each target sub-image.
And step 330, judging whether a light mixing scene exists according to the light source directions corresponding to the multiple target sub-images.
And 340, when a light mixing scene exists, determining a main light source according to a plurality of light sources corresponding to a plurality of target sub-images.
Optionally, the light intensity of the light source may be determined according to the brightness of the target sub-image, and the light source with the highest light intensity may be determined as the main light source. And performing white balance correction according to the light source color of the main light source.
Further, the weight of each light source can be determined according to the light intensity of the light source, the higher the light intensity is, the higher the weight is, and the main light source color can be obtained according to the weight of each light source and the color of each light source. And performing white balance correction according to the light source color of the main light source.
And 350, performing white balance correction on the target image according to the main light source.
And step 360, when no mixed light scene exists, carrying out white balance processing according to the white adjusting plate.
The image white balance correction method provided by the embodiment of the application can determine the main light source from the plurality of light sources, and carry out white balance processing according to the main light source, so that the color of the main light source is more accurately determined, and the white balance processing efficiency is improved.
Fig. 4 is a schematic flowchart of an image white balance correction method according to an embodiment of the present application, which is used to further describe the foregoing embodiment, and includes:
step 410, segmenting the target image to obtain a plurality of target sub-images.
And step 420, acquiring a light source direction corresponding to the content of each target sub-image.
And step 430, judging whether a light mixing scene exists according to the light source directions corresponding to the multiple target sub-images.
Step 440, when there is a light mixing scene, acquiring a plurality of light source directions corresponding to the plurality of target sub-images.
After the mixed light scene is determined, a plurality of light source directions with stronger illumination can be screened out according to the illumination intensity. Optionally, the colors of the light sources are obtained, and a light source with high light intensity is selected from the same light source colors. It is also possible to read all light source directions determined in step 420.
And step 450, counting the number of target sub-images corresponding to each light source direction.
And counting the number of the target sub-images with the same light source direction to obtain the number of the target sub-images corresponding to each light source direction.
And step 460, determining a main light source according to the counted number of the target sub-images.
And determining the light source direction corresponding to the number of the target sub-images with the highest numerical value as a main light source.
Step 470, white balance correction is performed on the target image according to the main light source.
And step 480, when no mixed light scene exists, performing white balance processing according to the white adjusting plate.
The image white balance correction method provided by the embodiment of the application can determine the light source with the highest light source ratio from the plurality of light sources as the main light source, so that the color of the main light source is more accurately determined, and the white balance processing efficiency is improved.
Fig. 5 is a schematic flowchart of an image white balance correction method according to an embodiment of the present application, which is used to further describe the foregoing embodiment, and includes:
and 510, acquiring a plurality of learning images with a single light source, and inputting the learning images into the convolutional neural network model to obtain a preset machine learning model.
When the light source direction of each target sub-image is acquired, recognition can be performed by means of a preset machine learning model. The predetermined machine learning model may be a convolutional neural network model. Before the embodiment of the application is executed, the convolutional neural network model is trained in a machine learning manner, and the training sample can be a learning image with a single light source. The trained convolutional neural network model, namely the preset machine learning model, can identify the light source direction corresponding to any target subimage.
Step 520, the target image is segmented to obtain a plurality of target sub-images.
And step 530, presetting a machine learning model for each target subimage input value respectively to obtain a light source direction corresponding to each target subimage.
And 540, judging whether a light mixing scene exists according to the light source directions corresponding to the multiple target sub-images.
And step 550, when a mixed light scene exists, performing white balance correction according to the light source corresponding to the mixed light scene.
And step 560, when no mixed light scene exists, performing white balance processing according to the whiteboard.
The image white balance correction method provided by the embodiment of the application can be used for obtaining the preset machine learning model through training of the input learning image with the single light source, so that the problem of inaccurate identification through a fixed algorithm is avoided, and the usability of light source direction identification is improved.
Fig. 6 is a schematic flowchart of an image white balance correction method according to an embodiment of the present application, which is used to further describe the foregoing embodiment, and includes:
and step 610, acquiring an input specification of a preset machine learning model.
If the input specification of the preset machine learning model is an image with a fixed size, the input specification of the preset machine learning model is acquired before the target image is segmented, so that the target image is segmented according to the input specification.
And step 620, segmenting the target image according to the input specification to obtain a plurality of target sub-images.
Step 630, presetting a machine learning model for each target subimage input value respectively to obtain a light source direction corresponding to each target subimage.
And step 640, judging whether a light mixing scene exists according to the light source directions corresponding to the multiple target sub-images.
And 650, when a mixed light scene exists, performing white balance correction according to the light source corresponding to the mixed light scene.
And 660, when no mixed light scene exists, performing white balance processing according to the whiteboard.
The image white balance correction method provided by the embodiment of the application can divide the target image according to the input specification of the preset machine learning model, so that the preset machine learning model can more quickly identify the light source direction of the target sub-image, and the processing efficiency is improved.
Fig. 7 is a schematic structural diagram of an image white balance correction apparatus according to an embodiment of the present application. As shown in fig. 7, the apparatus includes: a segmentation module 710, an acquisition module 720, a determination module 730, a white balance module 740, and a learning module 750.
A segmentation module 710, configured to segment the target image to obtain a plurality of target sub-images;
an obtaining module 720, configured to obtain a light source direction corresponding to each target sub-image content obtained by the segmenting module 710;
a determining module 730, configured to determine whether a light mixing scene exists according to the light source directions corresponding to the multiple target sub-images acquired by the acquiring module 720;
a white balance module 740, configured to, when the determining module 730 determines that a mixed light scene exists, perform white balance correction according to a light source corresponding to the mixed light scene.
Further, the determining module 730 is configured to:
judging whether the light source directions corresponding to a plurality of adjacent target sub-images are the same;
if the light source directions corresponding to a plurality of adjacent target sub-images are different, a mixed light scene exists.
Further, the white balance module 740 is configured to:
determining a main light source according to a plurality of light sources corresponding to the plurality of target sub-images;
and carrying out white balance correction on the target image according to the main light source.
Further, the white balance module 740 determines a main light source according to the plurality of light sources corresponding to the plurality of target sub-images, including:
acquiring a plurality of light source directions corresponding to the plurality of target sub-images;
counting the number of target sub-images corresponding to each light source direction;
and determining a main light source according to the counted number of the target sub-images.
Further, the obtaining module 720 is configured to:
and respectively presetting a machine learning model for each target subimage input value to obtain a light source direction corresponding to each target subimage.
Further, a learning module 750 is included, the learning module 750 is configured to: before presetting each target subimage input value in a machine learning model, acquiring a plurality of learning images with a single light source;
the learning image is input into the convolutional neural network model to obtain a preset machine learning model, so that the determining module 730 determines whether a light mixing scene exists according to the light source directions corresponding to the plurality of target sub-images according to the preset machine learning model obtained by the learning module 750.
Further, the obtaining module 720 is configured to:
acquiring an input specification of the preset machine learning model;
and segmenting the target image according to the input specification to obtain a plurality of target sub-images.
In the image white balance correction device provided in the embodiment of the application, the segmentation module 710 firstly segments a target image to obtain a plurality of target sub-images; secondly, the obtaining module 720 obtains the light source direction corresponding to the content of each target sub-image; thirdly, the judging module 730 judges whether a light mixing scene exists according to the light source directions corresponding to the target sub-images; finally, when there is a mixed light scene, the white balance module 740 performs white balance correction according to the light source corresponding to the mixed light scene, so as to improve the image white balance correction effect in the mixed light scene. At present, light sources in different light source directions in a target image cannot be identified, so that the problems of inaccurate judgment of the integral color temperature of the target image and the like are caused, and the white balance effect is poor. According to the embodiment of the application, the light sources in different light source directions can be determined based on the target sub-images obtained through segmentation, then white balance correction is carried out according to the light sources in different directions, and the color temperature of the shot scene can be restored with higher quality.
The device can execute the methods provided by all the embodiments of the application, and has corresponding functional modules and beneficial effects for executing the methods. For details of the technology not described in detail in this embodiment, reference may be made to the methods provided in all the foregoing embodiments of the present application.
Fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application. As shown in fig. 8, the terminal may include: a housing (not shown), a memory 801, a Central Processing Unit (CPU) 802 (also called a processor, hereinafter referred to as CPU), a computer program stored in the memory 801 and operable on the processor 802, a circuit board (not shown), and a power circuit (not shown). The circuit board is arranged in a space enclosed by the shell; the CPU802 and the memory 801 are provided on the circuit board; the power supply circuit is used for supplying power to each circuit or device of the terminal; the memory 801 is used for storing executable program codes; the CPU802 executes a program corresponding to the executable program code by reading the executable program code stored in the memory 801.
The terminal further comprises: peripheral interface 803, RF (Radio Frequency) circuitry 805, audio circuitry 806, speakers 811, power management chip 808, input/output (I/O) subsystem 809, touch screen 812, other input/control devices 810, and external port 804, which communicate over one or more communication buses or signal lines 807.
It should be understood that the illustrated terminal device 800 is merely one example of a terminal, and that the terminal device 800 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The following describes in detail a terminal device provided in this embodiment, where the terminal device is a smart phone as an example.
A memory 801, the memory 801 being accessible by the CPU802, the peripheral interface 803, and the like, the memory 801 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other volatile solid state storage devices.
A peripheral interface 803, said peripheral interface 803 allowing input and output peripherals of the device to be connected to the CPU802 and the memory 801.
I/O subsystem 809, which I/O subsystem 809 may connect input and output peripherals on the device, such as touch screen 812 and other input/control devices 810, to peripheral interface 803. The I/O subsystem 809 may include a display controller 8091 and one or more input controllers 8092 for controlling other input/control devices 810. Where one or more input controllers 8092 receive electrical signals from or transmit electrical signals to other input/control devices 810, other input/control devices 810 may include physical buttons (push buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels. It is worth noting that the input controller 8092 may be connected to any of the following: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
The touch screen 812 may be a resistive type, a capacitive type, an infrared type, or a surface acoustic wave type, according to the operating principle of the touch screen and the classification of media for transmitting information. The touch screen 812 may be classified by installation method: external hanging, internal or integral. Classified according to technical principles, the touch screen 812 may be: a vector pressure sensing technology touch screen, a resistive technology touch screen, a capacitive technology touch screen, an infrared technology touch screen, or a surface acoustic wave technology touch screen.
A touch screen 812, which touch screen 812 is an input interface and an output interface between the user terminal and the user, displays visual output to the user, which may include graphics, text, icons, video, and the like. Optionally, the touch screen 812 sends an electrical signal (e.g., an electrical signal of the touch surface) triggered by the user on the touch screen to the processor 802.
The display controller 8091 in the I/O subsystem 809 receives electrical signals from the touch screen 812 or sends electrical signals to the touch screen 812. The touch screen 812 detects a contact on the touch screen, and the display controller 8091 converts the detected contact into an interaction with a user interface object displayed on the touch screen 812, that is, implements a human-computer interaction, and the user interface object displayed on the touch screen 812 may be an icon for running a game, an icon networked to a corresponding network, or the like. It is worth mentioning that the device may also comprise a light mouse, which is a touch sensitive surface that does not show visual output, or an extension of the touch sensitive surface formed by the touch screen.
The RF circuit 805 is mainly used to establish communication between the smart speaker and a wireless network (i.e., a network side), and implement data reception and transmission between the smart speaker and the wireless network. Such as sending and receiving short messages, e-mails, etc.
The audio circuit 806 is mainly used to receive audio data from the peripheral interface 803, convert the audio data into an electric signal, and transmit the electric signal to the speaker 811.
Speaker 811 is used to convert the voice signals received by the smart speaker from the wireless network through RF circuit 805 into sound and play the sound to the user.
And the power management chip 808 is used for supplying power and managing power to the hardware connected with the CPU802, the I/O subsystem and the peripheral interface.
In this embodiment, the cpu802 is configured to:
segmenting the target image to obtain a plurality of target sub-images;
acquiring a light source direction corresponding to the content of each target sub-image;
judging whether a light mixing scene exists according to the light source directions corresponding to the target sub-images;
and when a mixed light scene exists, carrying out white balance correction according to the light source corresponding to the mixed light scene.
Further, the determining whether a mixed light scene exists according to the light source directions corresponding to the plurality of target sub-images includes:
judging whether the light source directions corresponding to a plurality of adjacent target sub-images are the same;
if the light source directions corresponding to a plurality of adjacent target sub-images are different, a mixed light scene exists.
Further, the performing white balance correction according to the light source corresponding to the mixed light scene includes:
determining a main light source according to a plurality of light sources corresponding to the plurality of target sub-images;
and carrying out white balance correction on the target image according to the main light source.
Further, the determining a main light source according to the plurality of light sources corresponding to the plurality of target sub-images includes:
acquiring a plurality of light source directions corresponding to the plurality of target sub-images;
counting the number of target sub-images corresponding to each light source direction;
and determining a main light source according to the counted number of the target sub-images.
Further, the acquiring the light source direction corresponding to the content of each target sub-image includes:
and respectively presetting a machine learning model for each target subimage input value to obtain a light source direction corresponding to each target subimage.
Further, before presetting the machine learning model with each target sub-image input value, the method further includes:
acquiring a plurality of learning images with a single light source;
and inputting the learning image into a convolutional neural network model to obtain a preset machine learning model.
Further, the segmenting the target image to obtain a plurality of target sub-images includes:
acquiring an input specification of the preset machine learning model;
and segmenting the target image according to the input specification to obtain a plurality of target sub-images.
Embodiments of the present application further provide a storage medium containing terminal device executable instructions, which when executed by a terminal device processor, are configured to perform a method for correcting white balance of an image, the method including:
segmenting the target image to obtain a plurality of target sub-images;
acquiring a light source direction corresponding to the content of each target sub-image;
judging whether a light mixing scene exists according to the light source directions corresponding to the target sub-images;
and when a mixed light scene exists, carrying out white balance correction according to the light source corresponding to the mixed light scene.
Further, the determining whether a mixed light scene exists according to the light source directions corresponding to the plurality of target sub-images includes:
judging whether the light source directions corresponding to a plurality of adjacent target sub-images are the same;
if the light source directions corresponding to a plurality of adjacent target sub-images are different, a mixed light scene exists.
Further, the performing white balance correction according to the light source corresponding to the mixed light scene includes:
determining a main light source according to a plurality of light sources corresponding to the plurality of target sub-images;
and carrying out white balance correction on the target image according to the main light source.
Further, the determining a main light source according to the plurality of light sources corresponding to the plurality of target sub-images includes:
acquiring a plurality of light source directions corresponding to the plurality of target sub-images;
counting the number of target sub-images corresponding to each light source direction;
and determining a main light source according to the counted number of the target sub-images.
Further, the acquiring the light source direction corresponding to the content of each target sub-image includes:
and respectively presetting a machine learning model for each target subimage input value to obtain a light source direction corresponding to each target subimage.
Further, before presetting the machine learning model with each target sub-image input value, the method further includes:
acquiring a plurality of learning images with a single light source;
and inputting the learning image into a convolutional neural network model to obtain a preset machine learning model.
Further, the segmenting the target image to obtain a plurality of target sub-images includes:
acquiring an input specification of the preset machine learning model;
and segmenting the target image according to the input specification to obtain a plurality of target sub-images.
The computer storage media of the embodiments of the present application may take any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
Of course, the storage medium provided in the embodiments of the present application contains computer-executable instructions, and the computer-executable instructions are not limited to the image white balance correction operation described above, and may also perform related operations in the image white balance correction method provided in any embodiments of the present application.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims (9)

1. An image white balance correction method, comprising:
segmenting the target image to obtain a plurality of target sub-images;
acquiring a light source direction corresponding to the content of each target sub-image;
judging whether a light mixing scene exists according to the light source directions corresponding to the target sub-images;
when a mixed light scene exists, carrying out white balance correction according to a light source corresponding to the mixed light scene;
when no mixed light scene exists, white balance processing is carried out according to the white adjusting plate;
the acquiring of the light source direction corresponding to the content of each target sub-image includes:
and respectively inputting each target subimage into a preset machine learning model to obtain a light source direction corresponding to each target subimage.
2. The method according to claim 1, wherein the determining whether there is a mixed light scene according to the light source directions corresponding to the target sub-images comprises:
judging whether the light source directions corresponding to a plurality of adjacent target sub-images are the same;
if the light source directions corresponding to a plurality of adjacent target sub-images are different, a mixed light scene exists.
3. The image white balance correction method according to claim 1, wherein the performing white balance correction according to the light source corresponding to the mixed light scene includes:
determining a main light source according to a plurality of light sources corresponding to the plurality of target sub-images;
and carrying out white balance correction on the target image according to the main light source.
4. The method according to claim 3, wherein determining a primary light source according to a plurality of light sources corresponding to the plurality of target sub-images comprises:
acquiring a plurality of light source directions corresponding to the plurality of target sub-images;
counting the number of target sub-images corresponding to each light source direction;
and determining a main light source according to the counted number of the target sub-images.
5. The image white balance correction method according to claim 1, before presetting each target sub-image input value to a machine learning model, further comprising:
acquiring a plurality of learning images with a single light source;
and inputting the learning image into a convolutional neural network model to obtain a preset machine learning model.
6. The method according to claim 1, wherein the segmenting the target image into a plurality of target sub-images comprises:
acquiring an input specification of the preset machine learning model;
and segmenting the target image according to the input specification to obtain a plurality of target sub-images.
7. An image white balance correction apparatus, comprising:
the segmentation module is used for segmenting the target image to obtain a plurality of target sub-images;
an obtaining module, configured to obtain a light source direction corresponding to each target sub-image content obtained by the dividing module, and obtain a light source direction corresponding to each target sub-image content, where the obtaining module includes:
respectively inputting each target subimage into a preset machine learning model to obtain a light source direction corresponding to each target subimage;
the judging module is used for judging whether a light mixing scene exists according to the light source directions corresponding to the target sub-images acquired by the acquiring module;
the white balance module is used for carrying out white balance correction according to the light source corresponding to the mixed light scene when the judging module judges that the mixed light scene exists; and when no mixed light scene exists, carrying out white balance processing according to the dimming board.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the image white balance correction method according to any one of claims 1 to 6.
9. A terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the image white balance correction method according to any one of claims 1 to 6 when executing the computer program.
CN201810934706.3A 2018-08-16 2018-08-16 Image white balance correction method and device, storage medium and terminal Expired - Fee Related CN109040729B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810934706.3A CN109040729B (en) 2018-08-16 2018-08-16 Image white balance correction method and device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810934706.3A CN109040729B (en) 2018-08-16 2018-08-16 Image white balance correction method and device, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN109040729A CN109040729A (en) 2018-12-18
CN109040729B true CN109040729B (en) 2020-04-07

Family

ID=64631682

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810934706.3A Expired - Fee Related CN109040729B (en) 2018-08-16 2018-08-16 Image white balance correction method and device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN109040729B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110647930B (en) * 2019-09-20 2022-08-05 北京达佳互联信息技术有限公司 Image processing method and device and electronic equipment
CN112561810B (en) * 2020-12-07 2023-09-08 西安诺瓦星云科技股份有限公司 Light-mixing removing method and device for display screen, storage medium and processor
CN112634182A (en) * 2020-12-18 2021-04-09 平安普惠企业管理有限公司 Image correction method, device and equipment based on light field and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101046847A (en) * 2007-04-29 2007-10-03 中山大学 Human face light alignment method based on secondary multiple light mould
CN106651795A (en) * 2016-12-03 2017-05-10 北京联合大学 Method of using illumination estimation to correct image color
CN107464244A (en) * 2017-03-09 2017-12-12 广东顺德中山大学卡内基梅隆大学国际联合研究院 A kind of image irradiation method of estimation based on neutral net
CN107682685A (en) * 2017-10-30 2018-02-09 广东欧珀移动通信有限公司 White balancing treatment method and device, electronic installation and computer-readable recording medium
CN108401148A (en) * 2017-02-06 2018-08-14 联发科技股份有限公司 Method for executing automatic white balance to image

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4434073B2 (en) * 2005-05-16 2010-03-17 ソニー株式会社 Image processing apparatus and imaging apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101046847A (en) * 2007-04-29 2007-10-03 中山大学 Human face light alignment method based on secondary multiple light mould
CN106651795A (en) * 2016-12-03 2017-05-10 北京联合大学 Method of using illumination estimation to correct image color
CN108401148A (en) * 2017-02-06 2018-08-14 联发科技股份有限公司 Method for executing automatic white balance to image
CN107464244A (en) * 2017-03-09 2017-12-12 广东顺德中山大学卡内基梅隆大学国际联合研究院 A kind of image irradiation method of estimation based on neutral net
CN107682685A (en) * 2017-10-30 2018-02-09 广东欧珀移动通信有限公司 White balancing treatment method and device, electronic installation and computer-readable recording medium

Also Published As

Publication number Publication date
CN109040729A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
EP3579544B1 (en) Electronic device for providing quality-customized image and method of controlling the same
CN107810505B (en) Machine learning of real-time image capture parameters
US10510136B2 (en) Image blurring method, electronic device and computer device
CN109741288B (en) Image processing method, image processing device, storage medium and electronic equipment
CN108881875B (en) Image white balance processing method and device, storage medium and terminal
CN109741281B (en) Image processing method, image processing device, storage medium and terminal
CN107484231B (en) Screen parameter adjusting method, device, terminal and computer readable storage medium
KR102566998B1 (en) Apparatus and method for determining image sharpness
CN109120863B (en) Shooting method, shooting device, storage medium and mobile terminal
US11606501B2 (en) Electronic device and image control method of the electronic device
CN109040524B (en) Artifact eliminating method and device, storage medium and terminal
KR20190035116A (en) Method and apparatus for displaying an ar object
CN109040729B (en) Image white balance correction method and device, storage medium and terminal
CN109327691B (en) Image shooting method and device, storage medium and mobile terminal
CN109040523B (en) Artifact eliminating method and device, storage medium and terminal
KR20160038460A (en) Electronic device and control method of the same
US20100103303A1 (en) Method for displaying image by virtual illumination and portable terminal using the same
CN109120864B (en) Light supplement processing method and device, storage medium and mobile terminal
CN109784252A (en) Image processing method, device, storage medium and electronic equipment
CN108665510B (en) Rendering method and device of continuous shooting image, storage medium and terminal
KR20200117695A (en) Electronic device and method for controlling camera using external electronic device
CN109348206A (en) Image white balancing treatment method, device, storage medium and mobile terminal
CN112116690A (en) Video special effect generation method and device and terminal
CN111459466A (en) Code generation method, device, equipment and storage medium
CN110618852B (en) View processing method, view processing device and terminal equipment

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
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200407

CF01 Termination of patent right due to non-payment of annual fee