WO2016206344A1 - White balance correction method, device and computer storage medium - Google Patents

White balance correction method, device and computer storage medium Download PDF

Info

Publication number
WO2016206344A1
WO2016206344A1 PCT/CN2015/100016 CN2015100016W WO2016206344A1 WO 2016206344 A1 WO2016206344 A1 WO 2016206344A1 CN 2015100016 W CN2015100016 W CN 2015100016W WO 2016206344 A1 WO2016206344 A1 WO 2016206344A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
white balance
reference image
color information
collected
Prior art date
Application number
PCT/CN2015/100016
Other languages
French (fr)
Chinese (zh)
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 WO2016206344A1 publication Critical patent/WO2016206344A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • H04N23/84Camera processing pipelines; Components thereof for processing colour signals
    • H04N23/88Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control

Definitions

  • the present invention relates to the field of information processing, and in particular, to a white balance processing method, apparatus, and computer storage medium.
  • White balance is a process of removing abnormal colors.
  • the human eye can naturally adjust the color of the object to be seen according to the current color temperature of the light source, while the camera equipment such as a digital camera is often difficult to achieve perfect automatic white balance.
  • the white balance module needs to restore the color of the object that appears to the human eye to make it appear white in the photo. To put it simply, it is the process of correcting the color cast of the image.
  • embodiments of the present invention are expected to provide a white balance processing method, apparatus, and computer storage medium for satisfying user image collection requirements.
  • the technical solution of the present invention is implemented as follows:
  • the embodiment of the present invention provides a white balance processing method, where the method includes:
  • the reference color information of the reference image is obtained by:
  • the graphic object in the reference image includes a character object
  • the matching the graphic object in the reference image with the collected object in the collected image comprises:
  • the graphic object is considered to match the collection object.
  • the obtaining reference color information of the reference image includes:
  • the acquiring color information of the collected image includes:
  • a white balance calibration parameter of the collected image including:
  • the gain coefficient is the white balance calibration parameter.
  • the acquiring the white balance calibration parameter according to the gain coefficient includes:
  • the white balance calibration parameter is obtained according to a preset function relationship and at least two gain coefficient calculation function values respectively formed according to the acquired image and each of the reference images.
  • the method further includes:
  • the reference image is set according to a user instruction or according to a built-in indication before acquiring the reference color information of the reference image.
  • a second aspect of the embodiments of the present invention provides a white balance processing apparatus, where the apparatus includes:
  • a first acquiring unit configured to acquire reference color information of the reference image
  • a second acquiring unit configured to acquire collected color information of the collected image
  • a determining unit configured to determine a white balance calibration parameter of the collected image according to the reference color information and the collected color information
  • a calibration unit configured to perform white balance calibration on the acquired image according to the white balance calibration parameter.
  • the first acquiring unit is configured to match the graphic object in the reference image with the collected object in the collected image; if the collected object matches the graphic object in the reference image, Then, color information of the graphic object is extracted as the reference color information.
  • the graphic object in the reference image includes a character object
  • the first acquiring unit is configured to determine, by using face recognition and/or graphic matching, whether the collected object is a graphic object in the reference image; if the collected object is the graphic object, the graphic is considered The object matches the collection object.
  • the first obtaining unit is configured to acquire a first mean value of three primary color components of the reference image specifying graphic object, according to the foregoing solution;
  • the second acquiring unit is configured to acquire a second average value of three primary color components of the specified collection object in the collected image
  • the determining unit is configured to obtain gain coefficients of the three primary color components respectively according to the first mean value and the second mean value; and obtain the white balance calibration parameter according to the gain coefficient;
  • the gain coefficient is the white balance calibration parameter.
  • the determining unit is configured to: when the reference image is at least two, according to a preset function relationship and at least two gain coefficient calculation functions respectively formed according to the collected image and each of the reference images Value, the white balance calibration parameter is obtained.
  • the device further includes:
  • a setting unit configured to set the reference image according to a user indication or according to a built-in indication before acquiring reference color information of the reference image.
  • a third aspect of the embodiments of the present invention provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute at least one of the foregoing white balance processing methods.
  • the white balance processing method, device and computer storage medium when performing white balance processing, enter a reference image to perform white balance processing on the collected object, and after the collected image is subjected to white balance processing, It can be similar to the white balance processing of the reference image, thus providing a new method of white balance correction. If the white balance of the reference image is usually an image formed by white balance that satisfies the user's needs, then a simple implementation of white balance processing that satisfies the user's needs is achieved.
  • FIG. 1 is a schematic flowchart of a white balance processing method according to an embodiment of the present invention.
  • FIG. 2 is a second schematic flowchart of a white balance processing method according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a white balance processing apparatus according to an embodiment of the present invention.
  • FIG. 4 is a third schematic flowchart of a white balance processing method according to an embodiment of the present invention.
  • FIG. 5 is a second schematic structural diagram of a white balance processing apparatus according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a reference image according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of an original image according to an embodiment of the present invention.
  • this embodiment provides a white balance processing method, where the method includes:
  • Step S110 acquiring reference color information of the reference image
  • Step S120 Acquire acquisition color information of the collected image
  • Step S130 determining, according to the reference color information and the collected color information, a white balance calibration parameter of the collected image
  • Step S140 Perform white balance calibration on the acquired image according to the white balance calibration parameter.
  • the reference image in this embodiment may be an image predetermined in advance, such as a user-specified image.
  • the reference image may be an image that may include the same graphical object as the captured image.
  • the reference image is a completely different graphic from the graphic object included in the captured image.
  • the reference image and the captured image are images formed by the same person or the scene, and may also be images collected by different characters or scenes.
  • the reference image is an image formed by image acquisition by the user A
  • the captured image is an image formed by image capture of the user B, but the user B feels the effect of white balance processing on the image formed by the user A.
  • an image formed by the user A is designated as the reference image.
  • the captured image formed by the user A is currently collected by the user as the reference image.
  • Obtaining the reference color information of the reference image in the embodiment may include parsing the reference image, and acquiring color component values of each color in the reference image, for example, acquiring red, The average color component value of the three colors of green and blue.
  • the reference color information is obtained in step S110 in this embodiment, and the reference color information of the reference image may be received from other devices.
  • the user may store the reference image in the cloud platform in order to reduce the information storage in the local device, and the step S110 may include acquiring the reference color information from the cloud platform.
  • step S120 the collected color information in the acquired image is obtained, that is, the color component value corresponding to the reference image in the currently acquired image.
  • the reference color information can reflect the white balance in the reference image.
  • the color information collected can reflect the white balance in the captured image.
  • the white balance calibration parameter of the adjusted image is determined according to the reference color information and the collected color information.
  • the white balance calibration parameter is used to make the difference between the white balance parameter of the acquired image and the white balance parameter of the reference image within a specified threshold range, so that the captured image can be made to the captured image through step S140.
  • the white balance of the acquired image is similar to the white balance of the reference image (ie, within the specified threshold range), which results in an ideal image acquisition effect. It also avoids the problem of color shift or chromatic aberration caused by different white balance of the acquired images obtained by the same acquisition object in different ambient light, thereby improving the image collection effect and user satisfaction.
  • the step S110 may include:
  • the graphic objects in the reference image may include a person object and a scene object.
  • the character object may include a user's avatar, a user's face, a portrait of the user's child, and the like.
  • the scene object may include a scene object such as a building or a plant such as a flower or a grass.
  • the collection objects can also be divided into person objects and scene objects.
  • the reference color information of the collection object and the graphic object are first extracted separately.
  • the reference color information of the graphic object in the reference object may also be extracted and stored in advance. In this way, when the user performs image collection by using an electronic device such as a camera or a mobile phone, the reference color information may be directly extracted from the pre-stored data in step S110 to improve the response rate.
  • the matching of the graphic object and the acquisition object will also be performed in step S110.
  • the shape information is included in addition to the color information.
  • the matching in step S110 is to match the shape information of the collection object and the graphic object.
  • the shape information herein may specifically include various contour-related information such as contour information, a spacing between respective shapes within the contour, and the like.
  • the face object in the matched character object may include an outline matching of the face facial features, and matching between any two organ spacings in the facial features.
  • the color information of the graphic object in the reference image is extracted as the reference color information for determining the white balance.
  • the user likes to take a selfie or the mother takes a picture of the baby.
  • the user's own image or an image of the baby may be included in the reference image.
  • the previously acquired image can be used as the reference image for white balance calibration, so that the photos obtained by the user under different scenes and different ambient illuminations are not well.
  • the calibration of the white balance leads to problems such as chromatic aberration and color shift, thereby improving the intelligence of the electronic device, the image collection effect, and the user satisfaction.
  • the graphic object in the reference image includes a character object
  • the matching the graphic object in the reference image with the collected object in the collected image comprises: determining whether the collected object is a graphic object in the reference image by using face recognition and/or graphic matching; If the collection object is the graphic object, the graphic object is considered to match the collection object.
  • the face recognition feature is used to extract the reference image and the facial features of the person object in the captured image, and the similarity of the facial features is determined by feature matching. If the similarity is greater than the specified matching threshold, the corresponding feature is considered to be matched. Then, using the principle of biostatistics to statistically process whether multiple facial features match, etc., determine whether the collected object is a graphic object. In this way, the face recognition technology can quickly realize the matching and processing of the graphic object and the collected object, and is especially suitable for the white balance calibration of the human shooting.
  • the reference image object is extracted and processed in advance, and the facial features are extracted to form a feature template.
  • the facial features are not re-extracted from the graphic object, and the time can be reduced. Delay.
  • a reference image may be used in multiple image acquisition processes afterwards, so that the method of forming the feature template can reduce the amount of data processing of the device.
  • the mobile phone or the camera is determined by itself to determine the graphic object in the reference image that matches the collected object, and may also be determined based on the user input during the specific implementation process. For example, the user selects a specified graphic object pre-stored in a mobile phone or a camera or a specified image acquired by a current mobile phone or a camera from another electronic device by means of touch or hovering touch, etc., in such a manner, allowing the user Manual input specification is added, which increases user control.
  • the step S110 may include: acquiring a first mean value of the three primary color components of the reference image specifying graphic object.
  • the step S120 may include: acquiring a second mean value of the three primary color components of the specified collection object in the acquired image.
  • the step S130 may include: obtaining gain coefficients of the three primary color components respectively according to the first mean value and the second mean value; and acquiring the white balance calibration parameter according to the gain coefficient;
  • the gain coefficient is the white balance calibration parameter.
  • the three primary colors described in this embodiment may include red, green, and blue.
  • the various color information of the character and the scene can be combined by the three colors. Therefore, when extracting the reference color information and the collected color information in the embodiment, the component values of the three primary colors can be extracted. Obtain.
  • the gain coefficient can be obtained by comparing the reference image with the corresponding three primary colors in the acquired image.
  • the gain factor or the inverse of the gain factor will be used directly as the white balance calibration parameter to calibrate the white balance of the acquired image.
  • the white balance calibration parameter is obtained according to a preset function relationship and at least two gain coefficient calculation function values respectively formed according to the acquired image and each of the reference images.
  • the preset function relationship in this embodiment may be an average function relationship of at least two of the gain coefficients.
  • the function value is the mean of at least two of the gain coefficients.
  • weights may also be set for the gain coefficients corresponding to each reference image, such that the functional relationship may be the mean of the sum of the products of the corresponding weights multiplied by the respective weight coefficients.
  • the weight here may be set for the user for each of the reference images, or may be intelligently allocated according to the time formed by the reference image by a device such as a mobile phone or a camera. Generally, the closer the time the reference image is formed in the device to the current time, the larger the weight can be allocated, and the longer the current time is, the smaller the weight is assigned. Thus, when a plurality of reference images are stored in the mobile phone and the camera, the white balance of the currently formed captured image can be made closer to the white balance of the newly formed reference image.
  • the method further includes:
  • Step S100 Before acquiring the reference color information of the reference image, setting the reference image according to a user instruction or according to a built-in indication.
  • the user indicates that the user may indicate that an image in the sub-mobile phone or the camera has been stored as a reference image by means of touch or hovering touch, keyboard, mouse, or voice.
  • the built-in instruction sets a corresponding built-in instruction to intelligently determine the reference image before the mobile phone or the camera is shipped from the factory.
  • the images taken by themselves are stored in an image database, and all images in the image database are taken as the reference images. It is of course also possible to use the acquired image within the most recent specified period of time as the reference image.
  • the present embodiment provides two methods for setting the reference image, which are specific to implementation and simple to implement.
  • step S100 described in this embodiment only needs to ensure that it is performed before step S110, but in order to further improve the response speed, before the image acquisition before or before the mobile phone or camera image acquisition application is closed, the automatic or The corresponding captured image is set to the corresponding reference image based on the user indication, so that the next time the image is captured, the appropriate reference image can be directly found from the determined reference image, and the white balance calibration can be performed.
  • this embodiment provides a white balance processing apparatus, where the apparatus includes:
  • the first obtaining unit 110 is configured to acquire reference color information of the reference image
  • the second obtaining unit 120 is configured to acquire the collected color information of the collected image.
  • the determining unit 130 is configured to determine a white balance calibration parameter of the collected image according to the reference color information and the collected color information;
  • the calibration unit 140 is configured to perform white balance calibration on the acquired image according to the white balance calibration parameter.
  • the first obtaining unit 110 in this embodiment may include a communication interface, and the communication interface may be a wireless interface or a wired interface, and configured to receive the reference image information from other electronic devices.
  • the specific structure of the first obtaining unit 110 may further include a structure having an information processing structure and a processing circuit, which can be used to extract the reference color information from its reference image, or query the reference color information that has been extracted in advance, and the like.
  • the processor may include an application processor AP, a digital signal processor DSP, a central processing unit CPU, a microprocessor MCU, or a programmable circuit PLC.
  • the processing circuit can include a structure such as an application specific integrated circuit ASIC.
  • the specific structure of the second obtaining unit 120, the determining unit 130, and the calibration unit 140 includes the processor or the processing circuit, and the processor or the processing circuit can perform the obtaining by performing the execution of the executable code. Collect color information, white balance calibration parameter determination, and white balance calibration.
  • These units may correspond to one processor or processing circuit, or may correspond to different processors or processing circuits, respectively.
  • the processor or processing circuit performs a corresponding operation by means of time division multiplexing or concurrent threads.
  • the graphic objects in the reference image in this embodiment include a character object and a scene object.
  • the reference image and the acquired image related definition can be referred to the foregoing method embodiment, and will not be repeated here.
  • the white balance processing device may be a device capable of performing white balance processing such as a mobile phone, a camera, or a tablet, and is further preferably an electronic device further including an image acquisition unit.
  • the image acquisition unit may include a structure capable of image and/or video capture, such as a camera.
  • the embodiment provides a white balance processing device capable of performing white balance processing according to a reference image, so that the acquired image does not use different white balances due to different collection environments, resulting in collection of the same person or scene. This leads to problems such as large color shift, which improves the effect of image acquisition, the intelligence of electronic devices, and user satisfaction.
  • the first acquiring unit 110 is configured to match the graphic object in the reference image with the collected object in the collected image; if the collected object matches the graphic object in the reference image, the extraction device The color information of the graphic object is used as the reference color information.
  • the graphic object in the reference image including the matching image is to be included.
  • the white balance calibration is the white balance that the user wants to use, so that the acquisition and acquisition images obtained by the user can be used to improve the user satisfaction.
  • the graphic object in the reference image includes a character object
  • the first acquiring unit 110 is configured to determine, by using face recognition and/or graphic matching, whether the collected object is a graphic object in the reference image; if the collected object is the graphic object, the A graphical object matches the captured object.
  • the specific structure of the first acquiring unit 110 in this embodiment may include an information processor or a processing circuit having a face recognition technology, and the graphic object corresponding to the collected object in the collected image is determined by the face recognition technology. It has the characteristics of simple structure and simple implementation.
  • the first obtaining unit 110 is configured to acquire a first average value of three primary color components of the reference image specifying graphic object;
  • the second acquiring unit 120 is configured to acquire a second average value of the three primary color components of the specified collection object in the collected image
  • the determining unit 130 is configured to obtain a gain coefficient of the three primary color components according to the first mean value and the second mean value, and obtain the white balance calibration parameter according to the gain coefficient;
  • the gain coefficient is the white balance calibration parameter.
  • the first obtaining unit 110 may include a counter and a calculator, and the counter may be used to count the number of pixels corresponding to the specified graphic in the reference image; the calculator may be used to calculate based on the calculator. The number of pixels determines the three primary color components of the specified graphic object The first mean.
  • the first mean value herein is used to refer to the mean values corresponding to the three primary colors, such as the mean of red, the mean of blue, and the mean of green.
  • the second acquiring unit may also include a counter and a calculator to obtain a second average value of the specified object in the captured image.
  • the second mean value here is used to refer to the mean values corresponding to the three primary colors respectively.
  • the determining unit 130 may include a computing structure such as a multiplier, and the white balance calibration parameter is determined by calculating the gain coefficient.
  • the embodiment provides a structure for determining the white balance calibration parameter, which has the characteristics of simple structure and simple implementation, and can be used to implement the white balance processing method described in the method embodiment.
  • the determining unit 130 is configured to: when the reference image is at least two, obtain a function value according to a preset function relationship and at least two gain coefficients formed according to the collected image and each of the reference images respectively, The white balance calibration parameter.
  • the preset function relationship herein may include an average function relationship, and the specifically calculated function value and the white balance calibration parameter may be an average of the gain coefficients.
  • the function relationship also provides different weights to the gain coefficients corresponding to different reference images, so that the white balance of the acquired image obtained by the device according to the embodiment and at least two reference images are obtained.
  • One of the reference images in the picture is closer.
  • the captured image of the user's specified demand can be provided. If the weight corresponding to the reference image is determined according to the acquisition time formed by the reference image acquisition, and the reference image is formed near the current time, and may correspond to a higher weight, the white balance calibration can be easily realized. At the same time, it is also possible to save as much as possible the color information in the captured image that truly reflects the collected person or scene, and improve the fidelity of the information.
  • the device further includes:
  • a setting unit configured to use the reference color information of the reference image before The reference image is set by the user or according to the built-in indication.
  • the setting unit described in this embodiment may include a storage medium and a processor or a processing circuit, and the storage medium is configured to store the reference image or the identification information of the reference image to facilitate subsequent determination of the reference image.
  • the processor or processing circuitry can be operative to perform a corresponding operation in accordance with the user indication or built-in indication.
  • the setting unit When the setting unit is specifically configured to set a reference image according to a user instruction, the setting unit may include a human-computer interaction interface, such as a touch screen, a floating touch screen or a keyboard, a mouse, a voice input interface, and the like. structure. These structures can all receive the user indication.
  • a human-computer interaction interface such as a touch screen, a floating touch screen or a keyboard, a mouse, a voice input interface, and the like. structure. These structures can all receive the user indication.
  • the apparatus described in this embodiment provides a hardware implementation method for implementing the white balance processing method described in the method embodiment, and has the characteristics of simple structure and white balance calibration to meet user requirements, and improves user satisfaction.
  • Step S1 Reference image setting.
  • Step S2 Acquiring an original image.
  • the photosensor may include a complementary metal oxide semiconductor (CMOS) or an electrical coupling element (Charge- Coupled Device, CCD) sensor and other structures.
  • CMOS complementary metal oxide semiconductor
  • CCD Charge- Coupled Device
  • Step S3 face recognition and/or image matching processing. Specifically, the original image is processed by the image signal processor ISP, so that the matching of the captured object in the captured image and the graphic object in the reference image can be determined.
  • Step S4 It is judged whether the original image and the reference image have a match.
  • the original image here is the acquired image in the foregoing embodiment. If yes, go to step S5, if no, go to step S8.
  • Step S5 Calculate the gain coefficient according to the matching.
  • Step S6 performing white balance correction using the gain coefficient.
  • Step S7 The corrected image display is adjusted.
  • Step S8 Calling other white balance processing to perform white balance processing of the original image.
  • Other white balance processing herein may include white balance processing such as grayscale world algorithm, Weng algorithm, and perfect reflection algorithm. This and other white balance algorithms can be seen in the prior art and will not be listed here.
  • step S1 some object images having a specific color are set as reference images.
  • these reference images are often photographed in normal photos. For example, setting your own face image can meet the needs of frequent self-portraits; setting the child's face image can meet the needs of the photo shooter; and setting the green leaf image can meet the needs of the love scene; You can set face images of family and friends, and more.
  • These reference images can be divided into two groups according to the image content, a face image group and other groups. These reference images can also be set as much as possible according to the specific personal photographing situation; as shown in the following table.
  • Step S2 may specifically include: acquiring an original image by using a CMOS or CCD sensor, and calculating an average value of three color components of the original image R, G, and B by the following method: It is worth noting that in this example red is indicated by the letter R, green is indicated by the letter G, and blue is indicated by the letter B.
  • N is the total number of pixels of the original image
  • Ri, Gi, and Bi are the three colors of red, green, and blue of the i-th pixel, respectively.
  • Step S3 The image signal processor processes the original image obtained by the CMOS or CCD sensor. Through the face recognition technology, all the images in the original image and the reference image group 1 are sequentially subjected to face recognition, and it is judged whether the original image and the reference image can be matched. When it is judged that the original image and the reference image group 1 have a match, the number x of each matching image is recorded, and the average value of the red, green and blue components of the matched reference image is calculated by the following method.
  • n is the total number of pixels of the reference image group 1 that match the original image
  • Ri, Gi, and Bi are respectively the red, green, and blue color components of the ith pixel.
  • all the images in the original image and the reference image group 2 are sequentially image-matched, and it is judged whether or not the original image and the reference image can be matched.
  • the number of matching images y is recorded, and the average value of the red, green and blue components of the matched reference image is calculated by the following method.
  • m is the total number of pixels of the reference image group 2 that match the original image
  • Rj, Gj, and Bj are respectively the red, green, and blue color components of the jth pixel.
  • the step S4 may specifically include: analyzing the matching situation of the original image and the reference image, and the gain coefficients of the original image and the reference image in the three colors of the red, green, and blue components are as follows:
  • the gain coefficients of the original image and the reference image in the three colors of red, green and blue are:
  • the gain coefficients of the original image and the reference image in the three colors of red, green and blue are:
  • the third type is the third type.
  • the gain coefficients of the original image and the reference image in the three colors of red, green, and blue are:
  • Step S5 Perform white balance correction on the gain values of the red, green and blue components of the original image and the reference image analyzed according to the step (4).
  • Ri, Gi, and Bi are the red, green, and blue components of the ith pixel in the original image, respectively, and Ri', Gi', and Bi' are respectively red, green, and blue of the corrected i-th pixel. Three color components.
  • Step (6) Adjust each pixel Ri', Gi', Bi' of the image to within the displayable range [0, 255].
  • the maximum value of the 24-bit true color map is the maximum of all the Ri', Gi', and Bi' components in the image. If adj>1, then red, green, and blue components are re-adjusted for each pixel in the image,
  • the white balance processing apparatus includes a reference image to the setting module 11, the original image obtaining module 12, the identification matching module 13, the gain calculating module 14, and the white balance correcting module 15 in the apparatus.
  • the reference image setting module 11 in this embodiment is equivalent to the setting module in the foregoing embodiment.
  • the original image acquisition module 12 is equivalent to an image acquisition unit for acquiring a captured image to acquire other structures.
  • the identification matching module 13 and the gain calculation module 14 correspond to the determination unit in the foregoing embodiment.
  • the white balance correction module 15 may be the structure of the calibration unit 140 in the foregoing embodiment.
  • the reference image setting module 11 is configured to set an image of an object having a specific color as a reference image after the white balance function is turned on, and is used as a basis for performing white balance contrast adjustment with the original image.
  • the original image obtaining module 12 is configured to acquire an original image by using a CMOS or CCD sensor, and calculate an average value of three colors of the original image, such as red, green, and blue.
  • the identification matching module 13 is configured to sequentially identify and match the original image and all the images in the reference image group 1/group 2 by face recognition technology and/or image matching technology. When it is judged that the original image and the reference image have a match, the average value of the three colors of the red, green and blue of the reference image that can be matched is calculated.
  • the gain calculation module 14 calculates the gain coefficients of the original color of the original image and the reference image in the red, green and blue components according to the analysis of the matching conditions of the original image and the reference image.
  • the white balance correction module 15 is configured to perform white balance correction according to the gain values of the red, green, and blue components of the original image and the reference image analyzed in the gain calculation module.
  • the identification matching module 13 may specifically include:
  • Face recognition sub-module used to sequentially perform face recognition on all images in the original image and the reference image group 1, and determine the matching of the original image and the reference image.
  • the face recognition uses computer image processing technology to extract portrait feature points from images or videos, and uses the principle of biostatistics to analyze and establish a mathematical model, that is, a face feature template. Utilize the built face feature template A feature analysis is performed on the face of the person to be tested, and a similar value is given based on the result of the analysis. Use this value to determine if it is the same person.
  • Face recognition technology consists of three parts: face detection, face tracking, and face contrast. The greatest advantage of face recognition is its convenience, speed, and non-intrusiveness.
  • Face recognition does not need to interfere with people's behavior to achieve recognition, without having to argue for whether they are willing to put their hands on the fingerprint collection device, or speak into the microphone, or point their eyes at the laser scanning device. You just have to walk past a camera or camera and you have been tested quickly.
  • the image matching sub-module is configured to sequentially perform image matching on all the images in the original image and the reference image group 2, and determine the matching of the original image and the reference image.
  • the process of image matching is to spatially align all or part of the known image with the unfamiliar image, and find the sub-image corresponding to the pattern in a strange image according to the image of the known pattern.
  • Image matching can be mainly divided into gray-based matching and feature-based matching.
  • Image matching technology has become an extremely important technology in the field of image information processing, and is widely used in many fields such as image recognition, image analysis and computer vision.
  • the gain calculation module 14 includes:
  • a classification judgment sub-module for classifying according to matching of different objects.
  • the gain sub-module may include a calculator for calculating a gain coefficient.
  • This example provides an automatic white balance processing method for an image of a mobile phone camera.
  • the automatic precision white balance function is turned on when the camera image is taken, the related reference image setting is performed.
  • the set reference images are divided into two groups, group 1 is a face reference image, and group 2 is another image. It is assumed that one of the reference images set is the face image shown in FIG. 6 below.
  • the area enclosed by the dotted line in Fig. 6 is the graphic object in the reference.
  • the original image obtained is shown in Figure 7 below, and the average of the red, green and blue components of the original image in Figure 7 below is obtained.
  • Statistics that is, the original image is counted according to the red, green, and blue color storage modes of the image. It should be noted that the original image described in this example is the captured image described in the foregoing embodiment, and the face of the picture is the collected object.
  • the original image and the images in the reference image group 1 and the group 2 are sequentially identified and matched, respectively.
  • the average values of the red, green and blue components of the reference image that can be matched are calculated.
  • the gain coefficients of the original image and the reference image in the three colors of red, green and blue are:
  • the white balance correction is performed according to the gain values of the red, green, and blue components of the original image and the reference image calculated as described above. That is:
  • Ri, Gi, and Bi are the red, green, and blue components of the ith pixel in the original image, respectively, and Ri', Gi', and Bi' are respectively the red of the ith pixel after the automatic precision white balance correction.
  • Each pixel in the original image is corrected by analogy. If the pixel in the image exceeds the displayable range [0, 255], the pixel is quantized to between the displayable range [0, 255]. The above process completes the automatic precise white balance processing of the original image.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used in at least one of the white balance processing methods provided by the foregoing embodiments; for example, At least one of the methods shown in FIGS. 1, 2, 4, and 5 is performed.
  • the computer storage medium described in this embodiment may be various types of storage media such as an optical disk, a hard disk, or a magnetic disk, and may be a non-transitory storage medium.
  • the disclosed apparatus and method may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner such as: multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored or not executed.
  • the coupling, or direct coupling, or communication connection of the components shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms. of.
  • the units described above as separate components may or may not be physically separated, and the components displayed as the unit may or may not be physical units, that is, may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; the above integration
  • the unit can be implemented in the form of hardware. It can also be implemented in the form of hardware plus software functional units.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing storage device includes the following steps: the foregoing storage medium includes: a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
  • ROM read-only memory
  • RAM random access memory
  • magnetic disk or an optical disk.
  • optical disk A medium that can store program code.

Landscapes

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

Abstract

A white balance correction method and device, the method comprising: acquiring reference color information of a reference image (S110); acquiring collected color information of a collected image (S120); determining a white balance correction parameter of the collected image according to the reference color information and the collected color information (S130); and performing a white balance correction on the collected image according to the white balance correction parameter (S140). Also provided is a computer storage medium.

Description

白平衡处理方法、装置和计算机存储介质White balance processing method, device and computer storage medium 技术领域Technical field
本发明涉及信息处理领域,尤其涉及一种白平衡处理方法、装置和计算机存储介质。The present invention relates to the field of information processing, and in particular, to a white balance processing method, apparatus, and computer storage medium.
背景技术Background technique
在使用手机或相机进行拍照时,经常会遇到天气或光线不好等原因,造成手机或相机拍照时白平衡处理效果不佳,拍摄图片不理想。特别是在不同的天气和光线中,同一图像在自动白平衡处理后色差较大。When using a mobile phone or a camera to take pictures, there are often reasons such as bad weather or poor light, which may cause poor white balance processing when taking pictures on the mobile phone or camera, and the picture is not ideal. Especially in different weather and light, the same image has a large color difference after the automatic white balance processing.
白平衡(white balance,简称为WB)是一种去除非正常颜色的过程。人眼可以很自然的根据当前光源色温来调整看到的物体颜色,而数码相机等摄像设备却往往很难实现完美的自动白平衡。正因为传感器不具有人眼的不同光照色温下的色彩恒定性,白平衡模块就需要将人眼看来白色的物体进行色彩的还原,使其在照片上也呈现为白色。再简单点的说就是矫正图像偏色的过程。White balance (WB for short) is a process of removing abnormal colors. The human eye can naturally adjust the color of the object to be seen according to the current color temperature of the light source, while the camera equipment such as a digital camera is often difficult to achieve perfect automatic white balance. Just because the sensor does not have the color constancy at different illumination color temperatures of the human eye, the white balance module needs to restore the color of the object that appears to the human eye to make it appear white in the photo. To put it simply, it is the process of correcting the color cast of the image.
故在现有技术中提出一种电子设备自动调节白平衡的方法,是亟待解决的问题。Therefore, in the prior art, a method for automatically adjusting white balance of an electronic device is proposed, which is an urgent problem to be solved.
发明内容Summary of the invention
有鉴于此,本发明实施例期望提能够提供一种满足用户图像采集需求的白平衡处理供一种白平衡处理方法、装置和计算机存储介质。In view of this, embodiments of the present invention are expected to provide a white balance processing method, apparatus, and computer storage medium for satisfying user image collection requirements.
本发明的技术方案是这样实现的:本发明实施例提供一种白平衡处理方法,所述方法包括:The technical solution of the present invention is implemented as follows: The embodiment of the present invention provides a white balance processing method, where the method includes:
获取参考图像的参考颜色信息; Obtaining reference color information of the reference image;
获取采集图像的采集颜色信息;Obtaining the collected color information of the captured image;
依据所述参考颜色信息和所述采集颜色信息,确定所述采集图像的白平衡校准参数;Determining a white balance calibration parameter of the acquired image according to the reference color information and the collected color information;
依据所述白平衡校准参数对所述采集图像进行白平衡校准。Performing white balance calibration on the acquired image according to the white balance calibration parameter.
基于上述方案,所述获取参考图像的参考颜色信息包括:Based on the foregoing solution, the reference color information of the reference image is obtained by:
将所述参考图像中的图形对象与所述采集图像中的采集对象进行匹配;Matching a graphic object in the reference image with an acquisition object in the captured image;
若所述采集对象与所述参考图像中的图形对象匹配,则提取所述图形对象的颜色信息作为所述参考颜色信息。And if the collection object matches the graphic object in the reference image, extracting color information of the graphic object as the reference color information.
基于上述方案,所述参考图像中的图形对象包括人物对象;Based on the above solution, the graphic object in the reference image includes a character object;
所述将所述参考图像中的图形对象与所述采集图像中的采集对象进行匹配,包括:The matching the graphic object in the reference image with the collected object in the collected image comprises:
利用人脸识别和/或图形匹配确定所述采集对象是否为所述参考图像中的图形对象;Determining whether the acquisition object is a graphic object in the reference image by using face recognition and/or graphic matching;
若所述采集对象为所述图形对象,则认为所述图形对象与所述采集对象匹配。If the collection object is the graphic object, the graphic object is considered to match the collection object.
基于上述方案,所述获取参考图像的参考颜色信息,包括:Based on the foregoing solution, the obtaining reference color information of the reference image includes:
获取所述参考图像指定图形对象的三原色分量的第一均值;Obtaining, by the reference image, a first mean value of three primary color components of the graphic object;
所述获取采集图像的采集颜色信息,包括:The acquiring color information of the collected image includes:
获取所述采集图像中指定采集对象的三原色分量的第二均值;Obtaining a second mean value of three primary color components of the specified collection object in the acquired image;
所述依据所述参考颜色信息和所述采集颜色信息,确定所述采集图像的白平衡校准参数,包括:Determining, according to the reference color information and the collected color information, a white balance calibration parameter of the collected image, including:
依据所述第一均值和第二均值,分别获得三原色分量的增益系数;Obtaining gain coefficients of the three primary color components respectively according to the first mean value and the second mean value;
依据所述增益系数获取所述白平衡校准参数;Obtaining the white balance calibration parameter according to the gain coefficient;
其中,所述增益系数为所述白平衡校准参数。 Wherein, the gain coefficient is the white balance calibration parameter.
基于上述方案,所述依据所述增益系数获取所述白平衡校准参数,包括:Based on the foregoing solution, the acquiring the white balance calibration parameter according to the gain coefficient includes:
当所述参考图像为至少两个时,依据预设函数关系及至少两个依据所述采集图像分别与每一个所述参考图像形成的增益系数计算函数值,获得所述白平衡校准参数。When the reference image is at least two, the white balance calibration parameter is obtained according to a preset function relationship and at least two gain coefficient calculation function values respectively formed according to the acquired image and each of the reference images.
基于上述方案,所述方法还包括:Based on the foregoing solution, the method further includes:
在获取所述参考图像的参考颜色信息之前,依据用户指示或根据内置指示,设定所述参考图像。The reference image is set according to a user instruction or according to a built-in indication before acquiring the reference color information of the reference image.
本发明实施例第二方面提供一种白平衡处理装置,所述装置包括:A second aspect of the embodiments of the present invention provides a white balance processing apparatus, where the apparatus includes:
第一获取单元,配置为获取参考图像的参考颜色信息;a first acquiring unit configured to acquire reference color information of the reference image;
第二获取单元,配置为获取采集图像的采集颜色信息;a second acquiring unit configured to acquire collected color information of the collected image;
确定单元,配置为依据所述参考颜色信息和所述采集颜色信息,确定所述采集图像的白平衡校准参数;a determining unit, configured to determine a white balance calibration parameter of the collected image according to the reference color information and the collected color information;
校准单元,配置为于依据所述白平衡校准参数对所述采集图像进行白平衡校准。And a calibration unit configured to perform white balance calibration on the acquired image according to the white balance calibration parameter.
基于上述方案,所述第一获取单元,配置为将所述参考图像中的图形对象与所述采集图像中的采集对象进行匹配;若所述采集对象与所述参考图像中的图形对象匹配,则提取所述图形对象的颜色信息作为所述参考颜色信息。The first acquiring unit is configured to match the graphic object in the reference image with the collected object in the collected image; if the collected object matches the graphic object in the reference image, Then, color information of the graphic object is extracted as the reference color information.
基于上述方案,所述参考图像中的图形对象包括人物对象;Based on the above solution, the graphic object in the reference image includes a character object;
所述第一获取单元,配置为利用人脸识别和/或图形匹配确定所述采集对象是否为所述参考图像中的图形对象;若所述采集对象为所述图形对象,则认为所述图形对象与所述采集对象匹配。The first acquiring unit is configured to determine, by using face recognition and/or graphic matching, whether the collected object is a graphic object in the reference image; if the collected object is the graphic object, the graphic is considered The object matches the collection object.
基于上述方案,所述第一获取单元,配置为获取所述参考图像指定图形对象的三原色分量的第一均值; The first obtaining unit is configured to acquire a first mean value of three primary color components of the reference image specifying graphic object, according to the foregoing solution;
所述第二获取单元,配置为获取所述采集图像中指定采集对象的三原色分量的第二均值;The second acquiring unit is configured to acquire a second average value of three primary color components of the specified collection object in the collected image;
所述确定单元,配置为依据所述第一均值和第二均值,分别获得三原色分量的增益系数;依据所述增益系数获取所述白平衡校准参数;The determining unit is configured to obtain gain coefficients of the three primary color components respectively according to the first mean value and the second mean value; and obtain the white balance calibration parameter according to the gain coefficient;
其中,所述增益系数为所述白平衡校准参数。Wherein, the gain coefficient is the white balance calibration parameter.
基于上述方案,所述确定单元,配置为当所述参考图像为至少两个时,依据预设函数关系及至少两个依据所述采集图像分别与每一个所述参考图像形成的增益系数计算函数值,获得所述白平衡校准参数。The determining unit is configured to: when the reference image is at least two, according to a preset function relationship and at least two gain coefficient calculation functions respectively formed according to the collected image and each of the reference images Value, the white balance calibration parameter is obtained.
基于上述方案,所述装置,还包括:Based on the above solution, the device further includes:
设定单元,配置为在获取所述参考图像的参考颜色信息之前,依据用户指示或根据内置指示,设定所述参考图像。And a setting unit configured to set the reference image according to a user indication or according to a built-in indication before acquiring reference color information of the reference image.
本发明实施例第三方面提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行前述白平衡处理方法的至少其中之一。A third aspect of the embodiments of the present invention provides a computer storage medium, where the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute at least one of the foregoing white balance processing methods.
本发明实施例所述的白平衡处理方法、装置和计算机存储介质,在进行白平衡处理时,进入参考图像来对采集对象进行白平衡处理,这样的话得到的采集图形经过白平衡处理之后,就能与参考图像的白平衡处理相近,这样就提供了一种新的白平衡矫正的方法。若参考图像的白平衡通常为满足用户需求的白平衡形成的图像,这样的话,就达到了简单的实现满足用户需求的白平衡处理。The white balance processing method, device and computer storage medium according to the embodiment of the present invention, when performing white balance processing, enter a reference image to perform white balance processing on the collected object, and after the collected image is subjected to white balance processing, It can be similar to the white balance processing of the reference image, thus providing a new method of white balance correction. If the white balance of the reference image is usually an image formed by white balance that satisfies the user's needs, then a simple implementation of white balance processing that satisfies the user's needs is achieved.
附图说明DRAWINGS
图1为本发明实施例所述的白平衡处理方法流程示意图之一;1 is a schematic flowchart of a white balance processing method according to an embodiment of the present invention;
图2为本发明实施例所述的白平衡处理方法流程示意图之二;2 is a second schematic flowchart of a white balance processing method according to an embodiment of the present invention;
图3为本发明实施例所述的白平衡处理装置的结构示意图之一;3 is a schematic structural diagram of a white balance processing apparatus according to an embodiment of the present invention;
图4为本发明实施例所述的白平衡处理方法流程示意图之三; 4 is a third schematic flowchart of a white balance processing method according to an embodiment of the present invention;
图5为本发明实施例所述的白平衡处理装置的结构示意图之二;FIG. 5 is a second schematic structural diagram of a white balance processing apparatus according to an embodiment of the present invention; FIG.
图6为本发明实施例提供一种参考图像的示意图;FIG. 6 is a schematic diagram of a reference image according to an embodiment of the present invention; FIG.
图7为本发明实施例提供的一种原始图像的示意图。FIG. 7 is a schematic diagram of an original image according to an embodiment of the present invention.
具体实施方式detailed description
以下结合说明书附图及具体实施例对本发明的技术方案做进一步的详细阐述,应当理解,以下所说明的优选实施例仅用于说明和解释本发明,并不用于限定本发明。The present invention will be further described in detail with reference to the accompanying drawings and specific embodiments.
方法实施例:Method embodiment:
如图1所示,本实施例提供一种白平衡处理方法,所述方法包括:As shown in FIG. 1 , this embodiment provides a white balance processing method, where the method includes:
步骤S110:获取参考图像的参考颜色信息;Step S110: acquiring reference color information of the reference image;
步骤S120:获取采集图像的采集颜色信息;Step S120: Acquire acquisition color information of the collected image;
步骤S130:依据所述参考颜色信息和所述采集颜色信息,确定所述采集图像的白平衡校准参数;Step S130: determining, according to the reference color information and the collected color information, a white balance calibration parameter of the collected image;
步骤S140:依据所述白平衡校准参数对所述采集图像进行白平衡校准。Step S140: Perform white balance calibration on the acquired image according to the white balance calibration parameter.
本实施例中所述参考图像可为事先预定的图像,如用户指定的图像。所述参考图像可为与所述采集图像可能包括同样的图形对象的图像。所述参考图像与所述采集图像所包括图形对象完全不同的图形。本实施例中所述参考图像和所述采集图像均对同一人物或景物的采集形成的图像,也可以是对不同人物或景物采集得到的图像。具体如,参考图像是对用户A进行图像采集形成的图像,而所述采集图像则为对用户B进行图像采集形成的图像,但是用户B觉得对用户A采集形成的图像的白平衡处理的效果较好,就可以指定对用户A采集形成的图像作为所述参考图像。当然当前对用户A采集形成的采集图像可以用户之前对用户A采集形成的图像作为参考图像。本实施例中获取所述参考图像的参考颜色信息,可包括解析所述参考图像,获取所述参考图像中各个颜色的颜色分量值,具体如,获取红、 绿及蓝这三个颜色的平均颜色分量值。当然本实施例所述步骤S110中获取所述参考颜色信息,还可以是从其他设备接收所述参考图像的参考颜色信息。具体如,用户为了减少在本地设备中的信息存储,将参考图像存储在云平台中,所述步骤S110中可包括从云平台中获取所述参考颜色信息。The reference image in this embodiment may be an image predetermined in advance, such as a user-specified image. The reference image may be an image that may include the same graphical object as the captured image. The reference image is a completely different graphic from the graphic object included in the captured image. In the embodiment, the reference image and the captured image are images formed by the same person or the scene, and may also be images collected by different characters or scenes. For example, the reference image is an image formed by image acquisition by the user A, and the captured image is an image formed by image capture of the user B, but the user B feels the effect of white balance processing on the image formed by the user A. Preferably, an image formed by the user A is designated as the reference image. Of course, the captured image formed by the user A is currently collected by the user as the reference image. Obtaining the reference color information of the reference image in the embodiment may include parsing the reference image, and acquiring color component values of each color in the reference image, for example, acquiring red, The average color component value of the three colors of green and blue. Of course, the reference color information is obtained in step S110 in this embodiment, and the reference color information of the reference image may be received from other devices. For example, the user may store the reference image in the cloud platform in order to reduce the information storage in the local device, and the step S110 may include acquiring the reference color information from the cloud platform.
步骤S120中获取所述采集图像中采集颜色信息,即为当前采集的图像中对应于所述参考图像对应的颜色分量值。In step S120, the collected color information in the acquired image is obtained, that is, the color component value corresponding to the reference image in the currently acquired image.
参考颜色信息能够反映参考图像中的白平衡。采集颜色信息能够反映采集图像中的白平衡。The reference color information can reflect the white balance in the reference image. The color information collected can reflect the white balance in the captured image.
在本实施例中步骤S130中,将依据所述参考颜色信息和采集颜色信息,确定出调整采集图像的白平衡校准参数。该白平衡校准参数将用于使采集图像的白平衡参数与参考图像的白平衡参数的差值在指定阈值范围内,这样的话,就能够使所述采集图像通过步骤S140对所述采集图像进行白平衡校准之后,得到的采集图像的白平衡就与所述参考图像的白平衡相近(即在所述指定阈值范围内),这样就会得到了较为理想的图像采集效果。也避免了在不同的环境光中,对同一采集对象得到的采集图像因白平衡不同导致的色偏或色差的问题,从而提升了图像采集的采集效果及用户使用满意度。In step S130 in this embodiment, the white balance calibration parameter of the adjusted image is determined according to the reference color information and the collected color information. The white balance calibration parameter is used to make the difference between the white balance parameter of the acquired image and the white balance parameter of the reference image within a specified threshold range, so that the captured image can be made to the captured image through step S140. After the white balance calibration, the white balance of the acquired image is similar to the white balance of the reference image (ie, within the specified threshold range), which results in an ideal image acquisition effect. It also avoids the problem of color shift or chromatic aberration caused by different white balance of the acquired images obtained by the same acquisition object in different ambient light, thereby improving the image collection effect and user satisfaction.
所述步骤S110可包括:The step S110 may include:
将所述参考图像中的图形对象与所述采集图像中的采集对象进行匹配;Matching a graphic object in the reference image with an acquisition object in the captured image;
若所述采集对象与所述参考图像中的图形对象匹配,则提取所述图形对象的颜色信息作为所述参考颜色信息。And if the collection object matches the graphic object in the reference image, extracting color information of the graphic object as the reference color information.
所述参考图像中的图形对象可包括人物对象和景物对象。具体,所述人物对象可包括用户的头像、用户的脸庞、用户子女的人像等。所述景物对象可包括建筑物、植物(如花、草)等景物对象。当然所述采集图像中 的采集对象,也可以分为人物对象和景物对象。The graphic objects in the reference image may include a person object and a scene object. Specifically, the character object may include a user's avatar, a user's face, a portrait of the user's child, and the like. The scene object may include a scene object such as a building or a plant such as a flower or a grass. Of course in the captured image The collection objects can also be divided into person objects and scene objects.
在本实施例中为了提供精确的白平衡校准参数,在提取所述参考颜色信息时,首先会分别提取所述采集对象和图形对象的颜色信息。在具体的实现过程中,若为了提高处理速率,也可以事先提取并存储所述参考对象中图形对象的参考颜色信息。这样当用户利用相机或手机等电子设备进行图像采集时,所述步骤S110中可以直接从预先存储的数据中提取所述参考颜色信息,提高响应速率。In the embodiment, in order to provide accurate white balance calibration parameters, when extracting the reference color information, color information of the collection object and the graphic object are first extracted separately. In a specific implementation process, if the processing rate is increased, the reference color information of the graphic object in the reference object may also be extracted and stored in advance. In this way, when the user performs image collection by using an electronic device such as a camera or a mobile phone, the reference color information may be directly extracted from the pre-stored data in step S110 to improve the response rate.
在步骤S110中还将进行图形对象和采集对象的匹配。不管是所述采集对象和图形对象,除了有颜色信息之外还会包括形状信息,在本实施例中步骤S110中的匹配即为匹配采集对象和图形对象的形状信息。这里的形状信息具体可包括轮廓信息,轮廓内各个形状之间的间距等各种与形状相关的信息。具体如匹配的人物对象中的人脸对象,这时可包括提取人脸五官的轮廓匹配,五官中任意两个器官间距之间匹配等操作。通过本实施例中所述图形对象和采集对象的形状信息的匹配,若确定采集图像中采集对象与参考图像中的图形对象是源于通过同一人物或景物,则认为采集对象和图形对象匹配。The matching of the graphic object and the acquisition object will also be performed in step S110. Regardless of the collection object and the graphic object, the shape information is included in addition to the color information. In the present embodiment, the matching in step S110 is to match the shape information of the collection object and the graphic object. The shape information herein may specifically include various contour-related information such as contour information, a spacing between respective shapes within the contour, and the like. Specifically, the face object in the matched character object may include an outline matching of the face facial features, and matching between any two organ spacings in the facial features. By matching the shape information of the graphic object and the collected object in the embodiment, if it is determined that the captured object in the captured image and the graphic object in the reference image originate from the same person or the scene, the collected object and the graphic object are considered to match.
若匹配,则提取参考图像中图形对象的颜色信息,作为所述参考颜色信息,用来确定所述白平衡。If it matches, the color information of the graphic object in the reference image is extracted as the reference color information for determining the white balance.
这样的话,若用户喜欢自拍或母亲对宝宝进行拍照。所述参考图像中可包括用户自身的图像或宝宝的图像。这样的话,在进行当前的采集图像的白平衡校准时,就可以利用之前采集图像作为参考图像来进行白平衡校准,这样用户在不同场景下、不同环境光照下得到的照片不因为设备无法很好的校准白平衡而导致色差和色偏等问题,从而提高了电子设备的智能性、图像采集效果及用户使用满意度。In this case, if the user likes to take a selfie or the mother takes a picture of the baby. The user's own image or an image of the baby may be included in the reference image. In this case, when performing the white balance calibration of the current captured image, the previously acquired image can be used as the reference image for white balance calibration, so that the photos obtained by the user under different scenes and different ambient illuminations are not well The calibration of the white balance leads to problems such as chromatic aberration and color shift, thereby improving the intelligence of the electronic device, the image collection effect, and the user satisfaction.
所述参考图像中的图形对象包括人物对象; The graphic object in the reference image includes a character object;
所述将所述参考图像中的图形对象与所述采集图像中的采集对象进行匹配,包括:利用人脸识别和/或图形匹配确定所述采集对象是否为所述参考图像中的图形对象;若所述采集对象为所述图形对象,则认为所述图形对象与所述采集对象匹配。本实施例中利用人脸识别技术提取参考图像和采集图像中人物对象的脸部特征,通过特征匹配来确定脸部特征的相似度,若相似度大于指定的匹配阈值,则认为对应的特征匹配,再利用生物统计学原理来对多个脸部特征是否匹配的统计处理等,确定出采集对象是否为图形对象。这样通过人脸识别技术,能够快速实现图形对象和采集对象的匹配和处理,尤其适用于人物拍摄的白平衡校准。The matching the graphic object in the reference image with the collected object in the collected image comprises: determining whether the collected object is a graphic object in the reference image by using face recognition and/or graphic matching; If the collection object is the graphic object, the graphic object is considered to match the collection object. In this embodiment, the face recognition feature is used to extract the reference image and the facial features of the person object in the captured image, and the similarity of the facial features is determined by feature matching. If the similarity is greater than the specified matching threshold, the corresponding feature is considered to be matched. Then, using the principle of biostatistics to statistically process whether multiple facial features match, etc., determine whether the collected object is a graphic object. In this way, the face recognition technology can quickly realize the matching and processing of the graphic object and the collected object, and is especially suitable for the white balance calibration of the human shooting.
当然在具体的实现过程中,所述参考图像对象的进行事先提取和处理,提取出脸部特征,形成特征模板,在进行比对时,就不用从图形对象重新提取脸部特征,可以减少时延。且一个参考图像可能事后会给到多次图像采集过程中使用,这样实现形成特征模板的方式,就可以减少设备数据处理量。Of course, in a specific implementation process, the reference image object is extracted and processed in advance, and the facial features are extracted to form a feature template. When the comparison is performed, the facial features are not re-extracted from the graphic object, and the time can be reduced. Delay. And a reference image may be used in multiple image acquisition processes afterwards, so that the method of forming the feature template can reduce the amount of data processing of the device.
在本实施例中使手机或相机通过自行的匹配,确定出参考图像中与采集对象匹配的图形对象,在具体的实行过程中也可以基于用户输入来确定。具体如,用户通过触控或悬浮触控等方式,选择了预先存储在手机或相机中或当前手机或相机从其他电子设备获取的指定图像中的指定图形对象等方式,这种方式,允许用户进行手动输入指定,这样增加了用户控制性。In this embodiment, the mobile phone or the camera is determined by itself to determine the graphic object in the reference image that matches the collected object, and may also be determined based on the user input during the specific implementation process. For example, the user selects a specified graphic object pre-stored in a mobile phone or a camera or a specified image acquired by a current mobile phone or a camera from another electronic device by means of touch or hovering touch, etc., in such a manner, allowing the user Manual input specification is added, which increases user control.
所述步骤S110可包括:获取所述参考图像指定图形对象的三原色分量的第一均值。The step S110 may include: acquiring a first mean value of the three primary color components of the reference image specifying graphic object.
所述步骤S120可包括:获取所述采集图像中指定采集对象的三原色分量的第二均值。The step S120 may include: acquiring a second mean value of the three primary color components of the specified collection object in the acquired image.
所述步骤S130可包括:依据所述第一均值和第二均值,分别获得三原色分量的增益系数;及依据所述增益系数获取所述白平衡校准参数; The step S130 may include: obtaining gain coefficients of the three primary color components respectively according to the first mean value and the second mean value; and acquiring the white balance calibration parameter according to the gain coefficient;
其中,所述增益系数为所述白平衡校准参数。Wherein, the gain coefficient is the white balance calibration parameter.
本实施例中所述的三原色可包括红色、绿色以及蓝色。人物和景物的各种颜色信息都可以通过这三种颜色组合而成,故在本实施例中提取所述参考颜色信息和所述采集颜色信息时,都可通过提取所述三原色的分量值来获取。The three primary colors described in this embodiment may include red, green, and blue. The various color information of the character and the scene can be combined by the three colors. Therefore, when extracting the reference color information and the collected color information in the embodiment, the component values of the three primary colors can be extracted. Obtain.
分别将参考图像和采集图像中对应的三原色进行比较,就能得到上述增益系数。所述增益系数或所述增益系数的倒数将可直接作为所述白平衡校准参数用于校准所述采集图像的白平衡。The gain coefficient can be obtained by comparing the reference image with the corresponding three primary colors in the acquired image. The gain factor or the inverse of the gain factor will be used directly as the white balance calibration parameter to calibrate the white balance of the acquired image.
采用这种方式获取所述白平衡校准参数,就有实现简便快捷的特点。Obtaining the white balance calibration parameters in this way has the characteristics of being simple and quick to implement.
所述依据所述增益系数获取所述白平衡校准参数,包括:Obtaining the white balance calibration parameter according to the gain coefficient, including:
当所述参考图像为至少两个时,依据预设函数关系及至少两个依据所述采集图像分别与每一个所述参考图像形成的增益系数计算函数值,获得所述白平衡校准参数。When the reference image is at least two, the white balance calibration parameter is obtained according to a preset function relationship and at least two gain coefficient calculation function values respectively formed according to the acquired image and each of the reference images.
本实施例中所述预设函数关系可为至少两个所述增益系数的均值函数关系。这样所述函数值即为至少两个所述增益系数的均值。The preset function relationship in this embodiment may be an average function relationship of at least two of the gain coefficients. Thus the function value is the mean of at least two of the gain coefficients.
当然在具体的实现过程中,还可以为每一个参考图像对应的增益系数设置权重,这样的话,所述函数关系可为每一个增益系数乘上对应的权重的乘积的和的均值。Of course, in a specific implementation process, weights may also be set for the gain coefficients corresponding to each reference image, such that the functional relationship may be the mean of the sum of the products of the corresponding weights multiplied by the respective weight coefficients.
这里的权重,可以为用户针对每一个所述参考图像进行设置的,也可以是手机或相机等设备根据参考图像形成的时间智能分配的。通常所述参考图像在所述设备中形成的时间离当前时间越近则可以分配一个较大的权重,离当前时间越久则分配一个较小的权重。这样当手机和相机中存储有多个参考图像时,这样的话,就能够使得当前形成的采集图像的白平衡与最新形成的参考图像的白平衡更为相近。这种智能分配的权重的方式,考虑时间上的延续性,考虑人物和景物随时间流逝发生的变化,从而能够一 方便精确校准白平衡,同时另一方面也能精确反映采集对象的变化性,进一步提高了电子设备的智能性和用户使用满意度。The weight here may be set for the user for each of the reference images, or may be intelligently allocated according to the time formed by the reference image by a device such as a mobile phone or a camera. Generally, the closer the time the reference image is formed in the device to the current time, the larger the weight can be allocated, and the longer the current time is, the smaller the weight is assigned. Thus, when a plurality of reference images are stored in the mobile phone and the camera, the white balance of the currently formed captured image can be made closer to the white balance of the newly formed reference image. This way of intelligently assigning weights, considering the continuity of time, considering the changes in the characters and scenes over time, so that one can It is convenient to accurately calibrate the white balance, and on the other hand, it can accurately reflect the variability of the collected objects, further improving the intelligence of the electronic device and the satisfaction of the user.
如图2所示,所述方法还包括:As shown in FIG. 2, the method further includes:
步骤S100:在获取所述参考图像的参考颜色信息之前,依据用户指示或根据内置指示,设定所述参考图像。Step S100: Before acquiring the reference color information of the reference image, setting the reference image according to a user instruction or according to a built-in indication.
本实施例中所述用户指示,可包括用户通过触控或悬浮触控、键盘、鼠标或语音等方式,指示某一个已经存储子手机或相机中的图像为参考图像。所述内置指令,在所述手机或相机出厂之前,就设置对应的内置指令,智能的确定参考图像。将自身拍摄的图像存储到图像数据库中,将图像数据库中的所有图像都作为所述参考图像。当然也可以将最近一段指定时长内的采集图像作为所述参考图像。总之本实施例提供了两种设定所述参考图像的方法,具有实现简单及实现简便的特定。In the embodiment, the user indicates that the user may indicate that an image in the sub-mobile phone or the camera has been stored as a reference image by means of touch or hovering touch, keyboard, mouse, or voice. The built-in instruction sets a corresponding built-in instruction to intelligently determine the reference image before the mobile phone or the camera is shipped from the factory. The images taken by themselves are stored in an image database, and all images in the image database are taken as the reference images. It is of course also possible to use the acquired image within the most recent specified period of time as the reference image. In summary, the present embodiment provides two methods for setting the reference image, which are specific to implementation and simple to implement.
通常本实施例所述步骤S100仅需保证在步骤S110之前执行就好,但是为了进一步提高响应速度,可以在所述手机或相机图像采集应用前一次关闭之前或之前的图像采集完成之前,自动或基于用户指示将对应的采集图像设置对应的参考图像,这样的话,就能方便下一次图像采集时,直接从已确定的参考图像中找到合适的参考图像,进行白平衡校准。Generally, the step S100 described in this embodiment only needs to ensure that it is performed before step S110, but in order to further improve the response speed, before the image acquisition before or before the mobile phone or camera image acquisition application is closed, the automatic or The corresponding captured image is set to the corresponding reference image based on the user indication, so that the next time the image is captured, the appropriate reference image can be directly found from the determined reference image, and the white balance calibration can be performed.
设备实施例:Equipment embodiment:
如图3所示,本实施例提供一种白平衡处理装置,所述装置包括:As shown in FIG. 3, this embodiment provides a white balance processing apparatus, where the apparatus includes:
第一获取单元110,配置为获取参考图像的参考颜色信息;The first obtaining unit 110 is configured to acquire reference color information of the reference image;
第二获取单元120,配置为于获取采集图像的采集颜色信息;The second obtaining unit 120 is configured to acquire the collected color information of the collected image.
确定单元130,配置为依据所述参考颜色信息和所述采集颜色信息,确定所述采集图像的白平衡校准参数;The determining unit 130 is configured to determine a white balance calibration parameter of the collected image according to the reference color information and the collected color information;
校准单元140,配置为依据所述白平衡校准参数对所述采集图像进行白平衡校准。 The calibration unit 140 is configured to perform white balance calibration on the acquired image according to the white balance calibration parameter.
本实施例所述第一获取单元110可包括通信接口,所述通信接口可为无线接口或有线接口,配置为从其他电子设备中接收所述参考图像信息。所述第一获取单元110的具体结构还可包括具有信息处理结构和处理电路的结构,能够用于从其参考图像中提取所述参考颜色信息,或查询预先已经提取的所述参考颜色信息等。所述处理器可包括应用处理器AP、数字信号处理器DSP、中央处理器CPU、微处理器MCU或可编程电路PLC等结构。所述处理电路可包括专用集成电路ASIC等结构。The first obtaining unit 110 in this embodiment may include a communication interface, and the communication interface may be a wireless interface or a wired interface, and configured to receive the reference image information from other electronic devices. The specific structure of the first obtaining unit 110 may further include a structure having an information processing structure and a processing circuit, which can be used to extract the reference color information from its reference image, or query the reference color information that has been extracted in advance, and the like. . The processor may include an application processor AP, a digital signal processor DSP, a central processing unit CPU, a microprocessor MCU, or a programmable circuit PLC. The processing circuit can include a structure such as an application specific integrated circuit ASIC.
所述第二获取单元120、确定单元130和所述校准单元140的具体结构即包括所述处理器或处理电路,所述处理器或处理电路通过对可执行代码的执行,能够执行获取所述采集颜色信息、白平衡校准参数确定以及白平衡校准等操作。The specific structure of the second obtaining unit 120, the determining unit 130, and the calibration unit 140 includes the processor or the processing circuit, and the processor or the processing circuit can perform the obtaining by performing the execution of the executable code. Collect color information, white balance calibration parameter determination, and white balance calibration.
这些单元可以对应于一个处理器或处理电路,也可以分别对应不同的处理器或处理电路。当前前述任意两个单元集成对应于同一处理器或处理电路时,所述处理器或处理电路采用时分复用或并发线程的方式,执行对应的操作。These units may correspond to one processor or processing circuit, or may correspond to different processors or processing circuits, respectively. When any two of the foregoing unit integrations correspond to the same processor or processing circuit, the processor or processing circuit performs a corresponding operation by means of time division multiplexing or concurrent threads.
本实施例中所述参考图像中的图形对象包括人物对象和景物对象。所述参考图像和采集图像相关定义可以参见前述方法实施例,再此就不再重复了。The graphic objects in the reference image in this embodiment include a character object and a scene object. The reference image and the acquired image related definition can be referred to the foregoing method embodiment, and will not be repeated here.
本实施例所述的白平衡处理装置,可为手机、相机或平板等能够进行白平衡处理的装置,进一步优选为还包括图像采集单元的电子设备中。所述图像采集单元可包括摄像头等能够进行图像和/或视频采集的结构。The white balance processing device according to the embodiment may be a device capable of performing white balance processing such as a mobile phone, a camera, or a tablet, and is further preferably an electronic device further including an image acquisition unit. The image acquisition unit may include a structure capable of image and/or video capture, such as a camera.
总之本实施例提供了一种白平衡处理装置,能够依据参考图像进行白平衡处理,这样的话采集的图像不会因为采集环境的不同,出现利用不同的白平衡,导致对同一人物或景物进行采集,导致出现较大的色偏等问题,从而提高了图像采集的效果、电子设备的智能性及用户使用满意度。 In summary, the embodiment provides a white balance processing device capable of performing white balance processing according to a reference image, so that the acquired image does not use different white balances due to different collection environments, resulting in collection of the same person or scene. This leads to problems such as large color shift, which improves the effect of image acquisition, the intelligence of electronic devices, and user satisfaction.
所述第一获取单元110,配置为将所述参考图像中的图形对象与所述采集图像中的采集对象进行匹配;若所述采集对象与所述参考图像中的图形对象匹配,则提取所述图形对象的颜色信息作为所述参考颜色信息。The first acquiring unit 110 is configured to match the graphic object in the reference image with the collected object in the collected image; if the collected object matches the graphic object in the reference image, the extraction device The color information of the graphic object is used as the reference color information.
在本实施例中所述第一获取单元110在提取参考颜色信息时,为了提高白平衡校准的精确度,在本实施例中,将从包括与采集图像中相匹配的参考图像中的图形对象中提取,这样的话,能够保证白平衡校准是用户想用的白平衡等,从而采集处理获得用户想用的采集效果的采集图像,提高用户使用满意度。In the embodiment, when the first acquiring unit 110 extracts the reference color information, in order to improve the accuracy of the white balance calibration, in the embodiment, the graphic object in the reference image including the matching image is to be included. In this case, it can ensure that the white balance calibration is the white balance that the user wants to use, so that the acquisition and acquisition images obtained by the user can be used to improve the user satisfaction.
所述参考图像中的图形对象包括人物对象;The graphic object in the reference image includes a character object;
所述第一获取单元110,配置为利用人脸识别和/或图形匹配确定所述采集对象是否为所述参考图像中的图形对象;若所述采集对象为所述图形对象,则认为所述图形对象与所述采集对象匹配。The first acquiring unit 110 is configured to determine, by using face recognition and/or graphic matching, whether the collected object is a graphic object in the reference image; if the collected object is the graphic object, the A graphical object matches the captured object.
本实施例中所述第一获取单元110的具体结构可包括具有人脸识别技术处理的信息处理器或处理电路,通过人脸识别技术,确定出与所述采集图像中采集对象对应的图形对象,具有结构简单及实现简便的特点。The specific structure of the first acquiring unit 110 in this embodiment may include an information processor or a processing circuit having a face recognition technology, and the graphic object corresponding to the collected object in the collected image is determined by the face recognition technology. It has the characteristics of simple structure and simple implementation.
所述第一获取单元110,配置为获取所述参考图像指定图形对象的三原色分量的第一均值;The first obtaining unit 110 is configured to acquire a first average value of three primary color components of the reference image specifying graphic object;
所述第二获取单元120,配置为获取所述采集图像中指定采集对象的三原色分量的第二均值;The second acquiring unit 120 is configured to acquire a second average value of the three primary color components of the specified collection object in the collected image;
所述确定单元130,配置为依据所述第一均值和第二均值,分别获得三原色分量的增益系数;依据所述增益系数获取所述白平衡校准参数;The determining unit 130 is configured to obtain a gain coefficient of the three primary color components according to the first mean value and the second mean value, and obtain the white balance calibration parameter according to the gain coefficient;
其中,所述增益系数为所述白平衡校准参数。Wherein, the gain coefficient is the white balance calibration parameter.
在本实施例中所述第一获取单元110可包括计数器及计算器等结构,所述计数器可用于统计所述参考图像中指定图形对应的像素个数;所述计算器可用于基于计算器统计的像素个数确定出指定图形对象的三原色分量 的第一均值。In the embodiment, the first obtaining unit 110 may include a counter and a calculator, and the counter may be used to count the number of pixels corresponding to the specified graphic in the reference image; the calculator may be used to calculate based on the calculator. The number of pixels determines the three primary color components of the specified graphic object The first mean.
这里的所述第一均值用于分别泛指三原色对应的均值,如红色的均值、蓝色的均值及绿色的均值。The first mean value herein is used to refer to the mean values corresponding to the three primary colors, such as the mean of red, the mean of blue, and the mean of green.
所述第二获取单元同样可包括计数器及计算器等结构,分别获取采集图像中指定对象的第二均值。同样的,这里的第二均值用于分别泛指三原色对应的均值。The second acquiring unit may also include a counter and a calculator to obtain a second average value of the specified object in the captured image. Similarly, the second mean value here is used to refer to the mean values corresponding to the three primary colors respectively.
所述确定单元130可包括乘法器等计算结构,通过计算所述增益系数,确定出所述白平衡校准参数。The determining unit 130 may include a computing structure such as a multiplier, and the white balance calibration parameter is determined by calculating the gain coefficient.
总之本实施例提供一种确定所述白平衡校准参数的结构,具有结构简单及实现简便的特点,可以用来实现方法实施例中所述的白平衡处理方法。In summary, the embodiment provides a structure for determining the white balance calibration parameter, which has the characteristics of simple structure and simple implementation, and can be used to implement the white balance processing method described in the method embodiment.
所述确定单元130,配置为当所述参考图像为至少两个时,依据预设函数关系及至少两个依据所述采集图像分别与每一个所述参考图像形成的增益系数计算函数值,获得所述白平衡校准参数。这里的所述预设函数关系可包括均值函数关系,则具体计算得到的所述函数值和所述白平衡校准参数可为所述增益系数的均值。The determining unit 130 is configured to: when the reference image is at least two, obtain a function value according to a preset function relationship and at least two gain coefficients formed according to the collected image and each of the reference images respectively, The white balance calibration parameter. The preset function relationship herein may include an average function relationship, and the specifically calculated function value and the white balance calibration parameter may be an average of the gain coefficients.
当然在具体的实现过程中,所述函数关系中还对不同的参考图像对应的增益系数提供不同的权重,从而使依据本实施例所述装置得到的采集图像的白平衡与至少两个参考图像中的某一个参考图像更为接近。这样的话,显然能够提供用户指定需求的采集图像。若所述参考图像对应的权重是依据参考图像采集形成的采集时间而定的,且参考图像越靠近当前时间采集形成的,可能对应更到的权值的话,则能够实现简便实现白平衡校准的同时,还能够尽可能的保存采集图像中真实反映被采集人物或景物的颜色信息,提高信息的逼真度。Of course, in the specific implementation process, the function relationship also provides different weights to the gain coefficients corresponding to different reference images, so that the white balance of the acquired image obtained by the device according to the embodiment and at least two reference images are obtained. One of the reference images in the picture is closer. In this case, it is obvious that the captured image of the user's specified demand can be provided. If the weight corresponding to the reference image is determined according to the acquisition time formed by the reference image acquisition, and the reference image is formed near the current time, and may correspond to a higher weight, the white balance calibration can be easily realized. At the same time, it is also possible to save as much as possible the color information in the captured image that truly reflects the collected person or scene, and improve the fidelity of the information.
所述装置,还包括:The device further includes:
设定单元,配置为在获取所述参考图像的参考颜色信息之前,依据用 户指示或根据内置指示,设定所述参考图像。a setting unit configured to use the reference color information of the reference image before The reference image is set by the user or according to the built-in indication.
本实施例中所述的设定单元,可包括存储介质及处理器或处理电路,所述存储介质用于存储所述参考图像或所述参考图像的标识信息,方便后续确定所述参考图像。所述处理器或处理电路可用于根据所述用户指示或内置指示执行对应的操作。The setting unit described in this embodiment may include a storage medium and a processor or a processing circuit, and the storage medium is configured to store the reference image or the identification information of the reference image to facilitate subsequent determination of the reference image. The processor or processing circuitry can be operative to perform a corresponding operation in accordance with the user indication or built-in indication.
当所述设定单元具体用于根据用户指示,设定参考图像时,所述设定单元可包括人机交互接口,具体如触控屏、悬浮触控屏或键盘、鼠标及语音输入接口等结构。这些结构都可以接收所述用户指示。When the setting unit is specifically configured to set a reference image according to a user instruction, the setting unit may include a human-computer interaction interface, such as a touch screen, a floating touch screen or a keyboard, a mouse, a voice input interface, and the like. structure. These structures can all receive the user indication.
总之本实施例所述的装置,为实现方法实施例中所述的白平衡处理方法,提供了实现硬件,具有结构简单及白平衡校准能够满足用户需求的特点,提高了用户使用满意度。In summary, the apparatus described in this embodiment provides a hardware implementation method for implementing the white balance processing method described in the method embodiment, and has the characteristics of simple structure and white balance calibration to meet user requirements, and improves user satisfaction.
以下结合上述任意实施例,提供几个具体示例。Several specific examples are provided below in connection with any of the above embodiments.
示例一:Example 1:
如图4所示,本示例通过以下技术方案实现的一种对图像进行精准白平衡处理的方法,分为如下几个步骤:As shown in FIG. 4, the method for performing precise white balance processing on an image implemented by the following technical solution is divided into the following steps:
步骤S1:参考图像设置。Step S1: Reference image setting.
步骤S2:获取原始图像,具体如可如图4中所示,通过光传感获取图像,这里的光传感器可包括互补金属氧化物半导体(Complementary Metal Oxide Semiconductor,CMOS)或电耦合元件(Charge-coupled Device,CCD)传感器等结构。Step S2: Acquiring an original image. Specifically, as shown in FIG. 4, an image is acquired by optical sensing, where the photosensor may include a complementary metal oxide semiconductor (CMOS) or an electrical coupling element (Charge- Coupled Device, CCD) sensor and other structures.
步骤S3:人脸识别和/或图像匹配处理。具体利用图像信号处理器ISP对原始图像进行处理,这样的话,就能确定出采集图像中采集对象和参考图像中的图形对象的匹配与否。Step S3: face recognition and/or image matching processing. Specifically, the original image is processed by the image signal processor ISP, so that the matching of the captured object in the captured image and the graphic object in the reference image can be determined.
步骤S4:判断原始图像与参考图像是否有匹配。这里的原始图像即为前述实施例中的采集图像。若是,则进入步骤S5,若否,则进入步骤S8. Step S4: It is judged whether the original image and the reference image have a match. The original image here is the acquired image in the foregoing embodiment. If yes, go to step S5, if no, go to step S8.
步骤S5:根据匹配计算增益系数。Step S5: Calculate the gain coefficient according to the matching.
步骤S6:利用增益系数较进行白平衡校正。Step S6: performing white balance correction using the gain coefficient.
步骤S7:校正后的图像显示调整。Step S7: The corrected image display is adjusted.
步骤S8:调用其他白平衡处理进行所述原始图像的白平衡处理。这里的其他白平衡处理可包括灰度世界算法、Weng算法以及完美反射算法等白平衡处理。这与这些其他白平衡算法可以参见现有技术,在此就不再一一列明了。Step S8: Calling other white balance processing to perform white balance processing of the original image. Other white balance processing herein may include white balance processing such as grayscale world algorithm, Weng algorithm, and perfect reflection algorithm. This and other white balance algorithms can be seen in the prior art and will not be listed here.
在步骤S1中:设置一些有特定颜色的物体图像作为参考图像。其中这些参考图像是平时拍照中经常拍到的。比如设置自己的人脸图像,可以满足经常自拍的这类需求;设置孩子的人脸图像,可以满足拍娃党这类拍照需求;设置绿色树叶图像,可以满足爱拍景色的这类需求;还可以设置家人和朋友的人脸图像等等。其中这些参考图像可根据图像内容分为两组,人脸图像组和其它组。这些参考图像也可根据具体个人拍照情况尽量多设置一些;如下表所示。In step S1: some object images having a specific color are set as reference images. Among them, these reference images are often photographed in normal photos. For example, setting your own face image can meet the needs of frequent self-portraits; setting the child's face image can meet the needs of the photo shooter; and setting the green leaf image can meet the needs of the love scene; You can set face images of family and friends, and more. These reference images can be divided into two groups according to the image content, a face image group and other groups. These reference images can also be set as much as possible according to the specific personal photographing situation; as shown in the following table.
参考图像组1Reference image group 1 描述description
图像1Image 1 自拍Selfie
图像2Image 2 宝宝baby
图像3Image 3 另一半The other half
图像4Image 4 老妈Mom
图像5Image 5 老爸Dad
图像6Image 6 闺蜜Girlfriend
图像7Image 7 宝宝玩伴Baby playmate
……...... ……......
                 …… ......
参考图像组2Reference image group 2 描述description
图像1Image 1 绿萝Green radish
图像2Image 2 snow
图像3Image 3 爱车Car
图像4Image 4 黑板/白板Blackboard/whiteboard
图像5Image 5 关闭电源的显示器Power off display
图像6Image 6 天安门Tiananmen Square
图像7Image 7 人民币Renminbi
……...... |……|......
步骤S2可具体包括:利用CMOS或CCD传感器获取原始图像,并通过如下方法计算原始图像R、G、B三色分量的平均值
Figure PCTCN2015100016-appb-000001
值得注意的是在本示例中红色用字母R表示,绿色用字母G表示,蓝色用字母B表示。
Step S2 may specifically include: acquiring an original image by using a CMOS or CCD sensor, and calculating an average value of three color components of the original image R, G, and B by the following method:
Figure PCTCN2015100016-appb-000001
It is worth noting that in this example red is indicated by the letter R, green is indicated by the letter G, and blue is indicated by the letter B.
Figure PCTCN2015100016-appb-000002
Figure PCTCN2015100016-appb-000002
Figure PCTCN2015100016-appb-000003
Figure PCTCN2015100016-appb-000003
Figure PCTCN2015100016-appb-000004
Figure PCTCN2015100016-appb-000004
上式中N为原始图像的像素总数,Ri、Gi、Bi分别为第i个像素的红、绿、蓝三色分量。In the above formula, N is the total number of pixels of the original image, and Ri, Gi, and Bi are the three colors of red, green, and blue of the i-th pixel, respectively.
步骤S3:图像信号处理器对CMOS或CCD传感器获取原始图像进行处理。通过人脸识别技术,将原始图像和参考图像组1中的所有图像依次进行人脸识别,并判断原始图像和参考图像是否能匹配。当判断出原始图像和参考图像组1有匹配,则记录各匹配图像数x,并通过如下方法计算到匹配的参考图像红、绿、蓝三色分量的平均值
Figure PCTCN2015100016-appb-000005
Step S3: The image signal processor processes the original image obtained by the CMOS or CCD sensor. Through the face recognition technology, all the images in the original image and the reference image group 1 are sequentially subjected to face recognition, and it is judged whether the original image and the reference image can be matched. When it is judged that the original image and the reference image group 1 have a match, the number x of each matching image is recorded, and the average value of the red, green and blue components of the matched reference image is calculated by the following method.
Figure PCTCN2015100016-appb-000005
Figure PCTCN2015100016-appb-000006
Figure PCTCN2015100016-appb-000006
Figure PCTCN2015100016-appb-000007
Figure PCTCN2015100016-appb-000007
Figure PCTCN2015100016-appb-000008
Figure PCTCN2015100016-appb-000008
上式中n为参考图像组1中与原始图像有匹配的参考图像的像素总数,Ri、Gi、Bi分别为第i个像素的红、绿、蓝三色分量。In the above formula, n is the total number of pixels of the reference image group 1 that match the original image, and Ri, Gi, and Bi are respectively the red, green, and blue color components of the ith pixel.
同样将原始图像和参考图像组2中的所有图像依次进行图像匹配,并判断原始图像和参考图像是否能匹配。当判断出原始图像和参考图像组2有匹配,则记录各匹配图象数y,并通过如下方法计算到匹配的参考图像红、绿、蓝三色分量的平均值
Figure PCTCN2015100016-appb-000009
Similarly, all the images in the original image and the reference image group 2 are sequentially image-matched, and it is judged whether or not the original image and the reference image can be matched. When it is judged that there is a match between the original image and the reference image group 2, the number of matching images y is recorded, and the average value of the red, green and blue components of the matched reference image is calculated by the following method.
Figure PCTCN2015100016-appb-000009
Figure PCTCN2015100016-appb-000010
Figure PCTCN2015100016-appb-000010
Figure PCTCN2015100016-appb-000011
Figure PCTCN2015100016-appb-000011
Figure PCTCN2015100016-appb-000012
Figure PCTCN2015100016-appb-000012
上式中m为参考图像组2中与原始图像有匹配的参考图像的像素总数,Rj、Gj、Bj分别为第j个像素的红、绿、蓝三色分量。In the above formula, m is the total number of pixels of the reference image group 2 that match the original image, and Rj, Gj, and Bj are respectively the red, green, and blue color components of the jth pixel.
步骤S4具体可包括:分析原始图像和参考图像的匹配情况,原始图像与参考图像在红、绿、蓝三色分量的增益系数有如下几种:The step S4 may specifically include: analyzing the matching situation of the original image and the reference image, and the gain coefficients of the original image and the reference image in the three colors of the red, green, and blue components are as follows:
第一种:当原始图像仅与参考图像组1有匹配时,则原始图像与参考图像在红、绿、蓝三色分量的增益系数分别是:First: When the original image only matches the reference image group 1, the gain coefficients of the original image and the reference image in the three colors of red, green and blue are:
Figure PCTCN2015100016-appb-000013
Figure PCTCN2015100016-appb-000013
当原始图像与参考图像组1有1个图像匹配时(x=1),When the original image matches one of the reference image groups 1 (x=1),
则Kr=Krx=Kr1,Kg=Kgx=Kg1,Kb=Kbx=Kb1;Then Kr=Krx=Kr1, Kg=Kgx=Kg1, Kb=Kbx=Kb1;
当原始图像与参考图像组1有2个图像匹配时(x=2),When the original image matches 2 images of the reference image group 1 (x=2),
则有
Figure PCTCN2015100016-appb-000014
Then there is
Figure PCTCN2015100016-appb-000014
Figure PCTCN2015100016-appb-000015
Figure PCTCN2015100016-appb-000015
当原始图像与参考图像组1有3个图像匹配时(x=3),When the original image matches 3 images of the reference image group 1 (x=3),
则有
Figure PCTCN2015100016-appb-000016
Figure PCTCN2015100016-appb-000017
Then there is
Figure PCTCN2015100016-appb-000016
Figure PCTCN2015100016-appb-000017
依次类推,当原始图像与参考图像组1有x个图像匹配时,And so on, when the original image matches the reference image group 1 with x images,
则有
Figure PCTCN2015100016-appb-000018
Then there is
Figure PCTCN2015100016-appb-000018
Figure PCTCN2015100016-appb-000019
Figure PCTCN2015100016-appb-000019
Figure PCTCN2015100016-appb-000020
Figure PCTCN2015100016-appb-000020
第二种:Second:
当原始图像仅与参考图像组2有匹配时,则原始图像与参考图像在红、绿、蓝三色分量的增益系数分别是:When the original image only matches the reference image group 2, the gain coefficients of the original image and the reference image in the three colors of red, green and blue are:
Figure PCTCN2015100016-appb-000021
Figure PCTCN2015100016-appb-000021
当原始图像与参考图像组2有1个图像匹配时(y=1),When the original image matches one of the reference image groups 2 (y=1),
则Kr=Krx=Kr1,Kg=Kgx=Kg1,Kb=Kbx=Kb1;Then Kr=Krx=Kr1, Kg=Kgx=Kg1, Kb=Kbx=Kb1;
当原始图像与参考图像组2有2个图像匹配时(y=2),When the original image matches 2 images of the reference image group 2 (y=2),
则有
Figure PCTCN2015100016-appb-000022
Then there is
Figure PCTCN2015100016-appb-000022
当原始图像与参考图像组2有3个图像匹配时(y=3),When the original image matches 3 images of the reference image group 2 (y=3),
则有
Figure PCTCN2015100016-appb-000023
Figure PCTCN2015100016-appb-000024
Then there is
Figure PCTCN2015100016-appb-000023
Figure PCTCN2015100016-appb-000024
依次类推,当原始图像与参考图像组2有y个图像匹配时,则有And so on, when the original image has y images matching the reference image group 2, then there is
Figure PCTCN2015100016-appb-000025
Figure PCTCN2015100016-appb-000025
Figure PCTCN2015100016-appb-000026
Figure PCTCN2015100016-appb-000026
Figure PCTCN2015100016-appb-000027
Figure PCTCN2015100016-appb-000027
第三种:The third type:
当原始图像与参考图像组1和参考图像组2都有匹配时,则原始图像与参考图像在红、绿、蓝三色分量的增益系数分别是:When the original image matches the reference image group 1 and the reference image group 2, the gain coefficients of the original image and the reference image in the three colors of red, green, and blue are:
Figure PCTCN2015100016-appb-000028
Figure PCTCN2015100016-appb-000028
Figure PCTCN2015100016-appb-000029
Figure PCTCN2015100016-appb-000029
Figure PCTCN2015100016-appb-000030
Figure PCTCN2015100016-appb-000030
第四种:当原始图像与参考图像组1和参考图像组2都没有匹配时,调用其他白平衡处理方式进行处理。Fourth: When the original image does not match the reference image group 1 and the reference image group 2, other white balance processing methods are called for processing.
步骤S5:根据步骤(4)分析的原始图像与参考图像在红、绿、蓝三色分量的增益值进行白平衡校正。Step S5: Perform white balance correction on the gain values of the red, green and blue components of the original image and the reference image analyzed according to the step (4).
即有:That is:
Ri’=Kr*Ri,Gi’=Kg*Gi,Bi’=Kb*BiRi’=Kr*Ri, Gi’=Kg*Gi, Bi’=Kb*Bi
上式中Ri、Gi、Bi分别为原始图像中第i个像素的红、绿、蓝三色分量,Ri’、Gi’、Bi’分别为校正后的第i个像素的红、绿、蓝三色分量。In the above formula, Ri, Gi, and Bi are the red, green, and blue components of the ith pixel in the original image, respectively, and Ri', Gi', and Bi' are respectively red, green, and blue of the corrected i-th pixel. Three color components.
步骤(6):将图像各个像素Ri’、Gi’、Bi’调整到可显示范围之内[0,255]。例如对于24位真彩图最大值为图像中所有Ri’、Gi’、Bi’三个分量的最大值,使
Figure PCTCN2015100016-appb-000031
如果adj>1,则对于图像中的每个像素重新调整其红、绿、蓝分量,使得
Step (6): Adjust each pixel Ri', Gi', Bi' of the image to within the displayable range [0, 255]. For example, the maximum value of the 24-bit true color map is the maximum of all the Ri', Gi', and Bi' components in the image.
Figure PCTCN2015100016-appb-000031
If adj>1, then red, green, and blue components are re-adjusted for each pixel in the image,
Figure PCTCN2015100016-appb-000032
Figure PCTCN2015100016-appb-000032
示例二:Example two:
如图5所示,本示例提供的一种白平衡处理装置,在该装置中包括参考图像给设置模块11、原始图像获取模块12、识别匹配模块13、增益计算模块14及白平衡矫正模块15。其中,本实施例所述参考图像设置模块11相当于前述实施例中的设定模块。所述原始图像获取模块12相当于用于获取采集图像的图像采集单元获取其他结构。所述识别匹配模块13和所述增益计算模块14相当于前述实施例中的确定单元。所述白平衡校正模块15可为前述实施例中的校准单元140的结构。As shown in FIG. 5, the white balance processing apparatus provided in this example includes a reference image to the setting module 11, the original image obtaining module 12, the identification matching module 13, the gain calculating module 14, and the white balance correcting module 15 in the apparatus. . The reference image setting module 11 in this embodiment is equivalent to the setting module in the foregoing embodiment. The original image acquisition module 12 is equivalent to an image acquisition unit for acquiring a captured image to acquire other structures. The identification matching module 13 and the gain calculation module 14 correspond to the determination unit in the foregoing embodiment. The white balance correction module 15 may be the structure of the calibration unit 140 in the foregoing embodiment.
参考图像设置模块11:用于在白平衡功能开启后设置一些有特定颜色的物体图像作为参考图像,用作和原始图像进行白平衡对比调整的依据。The reference image setting module 11 is configured to set an image of an object having a specific color as a reference image after the white balance function is turned on, and is used as a basis for performing white balance contrast adjustment with the original image.
原始图像获取模块12:用于利用CMOS或CCD传感器获取原始图像,及统计出原始图像红、绿、蓝三色分量的平均值。The original image obtaining module 12 is configured to acquire an original image by using a CMOS or CCD sensor, and calculate an average value of three colors of the original image, such as red, green, and blue.
识别匹配模块13:用于通过人脸识别技术和/或图像匹配技术,将原始图像分别和参考图像组1/组2中的所有图像依次进行识别和匹配判断。当判断出原始图像和参考图像有匹配,计算出可以匹配的参考图像红、绿、蓝三色分量的平均值。The identification matching module 13 is configured to sequentially identify and match the original image and all the images in the reference image group 1/group 2 by face recognition technology and/or image matching technology. When it is judged that the original image and the reference image have a match, the average value of the three colors of the red, green and blue of the reference image that can be matched is calculated.
增益计算模块14:根据分析原始图像和参考图像的几种匹配情况,算出原始图像与参考图像在红、绿、蓝三色分量的增益系数。The gain calculation module 14 calculates the gain coefficients of the original color of the original image and the reference image in the red, green and blue components according to the analysis of the matching conditions of the original image and the reference image.
白平衡校正模块15:用于根据增益计算模块中分析的原始图像与参考图像在红、绿、蓝三色分量的增益值进行白平衡校正。The white balance correction module 15 is configured to perform white balance correction according to the gain values of the red, green, and blue components of the original image and the reference image analyzed in the gain calculation module.
所述的识别匹配模块13具体可包括:The identification matching module 13 may specifically include:
人脸识别子模块:用于将原始图像和参考图像组1中的所有图像依次进行人脸识别,并判断原始图像和参考图像的匹配情况。其人脸识别是利用计算机图像处理技术从图像或视频中提取人像特征点,利用生物统计学的原理进行分析建立数学模型,即人脸特征模板。利用已建成的人脸特征模板 与被测者的人的面像进行特征分析,根据分析的结果来给出一个相似值。通过这个值即可确定是否为同一人。人脸识别技术包含三个部分:人脸检测、人脸跟踪、人脸对比。人脸识别最大的优越性在于它的方便性,快速性,而且是非侵扰的。人脸识别无需干扰人们行为而达到识别效果,无需为是否愿意将手放在指纹采集设备上,或对着麦克风讲话,或是将他们的眼睛对准激光扫描装置而进行争辩。你只要很快从一架照相机或摄像机前走过,你就已经被快速的检验。Face recognition sub-module: used to sequentially perform face recognition on all images in the original image and the reference image group 1, and determine the matching of the original image and the reference image. The face recognition uses computer image processing technology to extract portrait feature points from images or videos, and uses the principle of biostatistics to analyze and establish a mathematical model, that is, a face feature template. Utilize the built face feature template A feature analysis is performed on the face of the person to be tested, and a similar value is given based on the result of the analysis. Use this value to determine if it is the same person. Face recognition technology consists of three parts: face detection, face tracking, and face contrast. The greatest advantage of face recognition is its convenience, speed, and non-intrusiveness. Face recognition does not need to interfere with people's behavior to achieve recognition, without having to argue for whether they are willing to put their hands on the fingerprint collection device, or speak into the microphone, or point their eyes at the laser scanning device. You just have to walk past a camera or camera and you have been tested quickly.
图像匹配子模块:用于将原始图像和参考图像组2中的所有图像依次进行图像匹配,并判断原始图像和参考图像的匹配情况。其图像匹配的过程就是将已知图像与陌生图像的全部或部分在空间上对准,根据已知模式的图像在一副陌生图像中寻找对应该模式的子图像。图像匹配主要可分为以灰度为基础的匹配和以特征为基础的匹配。图像匹配技术已成为图像信息处理领域中极为重要的一项技术,被广泛应用于图像识别、图像分析和计算机视觉等许多领域。The image matching sub-module is configured to sequentially perform image matching on all the images in the original image and the reference image group 2, and determine the matching of the original image and the reference image. The process of image matching is to spatially align all or part of the known image with the unfamiliar image, and find the sub-image corresponding to the pattern in a strange image according to the image of the known pattern. Image matching can be mainly divided into gray-based matching and feature-based matching. Image matching technology has become an extremely important technology in the field of image information processing, and is widely used in many fields such as image recognition, image analysis and computer vision.
所述增益计算模块14包括:The gain calculation module 14 includes:
分类判断子模块,用于根据不同的对象的匹配进行分类。A classification judgment sub-module for classifying according to matching of different objects.
所述增益子模块,可包括计算器,用于计算增益系数。The gain sub-module may include a calculator for calculating a gain coefficient.
示例三:Example three:
本示例提供了一种手机摄像头拍照后对图像自动精准白平衡处理方法。当手机摄像图拍照时开启该自动精准白平衡功能,则进行相关参考图像设置。将设置的参考图像分为两组,组1是人脸参考图像,组2是其他图像。假设设置的参考图像中有其中一张图像为下图6中所示的人脸图像。图6中被虚线框圈住的区域即为所述参考中的图形对象。This example provides an automatic white balance processing method for an image of a mobile phone camera. When the automatic precision white balance function is turned on when the camera image is taken, the related reference image setting is performed. The set reference images are divided into two groups, group 1 is a face reference image, and group 2 is another image. It is assumed that one of the reference images set is the face image shown in FIG. 6 below. The area enclosed by the dotted line in Fig. 6 is the graphic object in the reference.
用手机进行拍照,获得的原始图像如下图7所示,并将下图7中的原始图像红、绿、蓝三色分量的平均值
Figure PCTCN2015100016-appb-000033
统计出,即根据 图像的红、绿、蓝三色存储方式统计到原始图像
Figure PCTCN2015100016-appb-000034
Figure PCTCN2015100016-appb-000035
值得注意的是:本示例中所述的原始图像即为前述实施例中所述的采集图像,图相的人脸即为所述采集对象。
Taking a picture with a mobile phone, the original image obtained is shown in Figure 7 below, and the average of the red, green and blue components of the original image in Figure 7 below is obtained.
Figure PCTCN2015100016-appb-000033
Statistics, that is, the original image is counted according to the red, green, and blue color storage modes of the image.
Figure PCTCN2015100016-appb-000034
Figure PCTCN2015100016-appb-000035
It should be noted that the original image described in this example is the captured image described in the foregoing embodiment, and the face of the picture is the collected object.
再分别将原始图像与参考图像组1和组2中的图像依次进行识别和匹配判断。当判断出原始图像和参考图像有匹配,计算出可以匹配的参考图像红、绿、蓝三色分量的平均值
Figure PCTCN2015100016-appb-000036
该实施例中是原始图像与参考图像组1中的上述1个人脸图像有匹配,则x=1,且可以统计到与原始图像匹配的参考图像红、绿、蓝三色分量的平均值
Figure PCTCN2015100016-appb-000037
Figure PCTCN2015100016-appb-000038
The original image and the images in the reference image group 1 and the group 2 are sequentially identified and matched, respectively. When it is judged that the original image and the reference image have a match, the average values of the red, green and blue components of the reference image that can be matched are calculated.
Figure PCTCN2015100016-appb-000036
In this embodiment, the original image has a matching with the above-mentioned 1 human face image in the reference image group 1, then x=1, and the average value of the red, green and blue components of the reference image matching the original image can be counted.
Figure PCTCN2015100016-appb-000037
Figure PCTCN2015100016-appb-000038
则原始图像与参考图像在红、绿、蓝三色分量的增益系数分别是:Then the gain coefficients of the original image and the reference image in the three colors of red, green and blue are:
Figure PCTCN2015100016-appb-000039
Figure PCTCN2015100016-appb-000039
Figure PCTCN2015100016-appb-000040
Figure PCTCN2015100016-appb-000040
Figure PCTCN2015100016-appb-000041
Figure PCTCN2015100016-appb-000041
再根据上述计算的原始图像与参考图像在红、绿、蓝三色分量的增益值进行白平衡校正。即有:Then, the white balance correction is performed according to the gain values of the red, green, and blue components of the original image and the reference image calculated as described above. That is:
Ri’=Kr1*Ri=1.27*RiRi’=Kr1*Ri=1.27*Ri
Gi’=Kg1*Gi=0.95*GiGi’=Kg1*Gi=0.95*Gi
Bi’=Kb1*Bi=0.84*BiBi'=Kb1*Bi=0.84*Bi
上式中Ri、Gi、Bi分别为原始图像中第i个像素的红、绿、蓝三色分量,Ri’、Gi’、Bi’分别为自动精准白平衡校正后的第i个像素的红、绿、蓝三色分量。即当原始图像中的第i个像素点Ri、Gi、Bi三色分量(Ri、Gi、Bi)=(108、155、130),则该像素点自动精准白平衡校正后的红、绿、蓝三色分量就是(Ri、Gi、Bi)=(Kr1*Ri、Kg1*Gi、Kb1*Bi) =(137、147、109)。依次类推就对原始图像中的每个像素点进行校正。如果当图像中像素点超过可显示范围[0,255],则将像素点量化到可显示范围[0,255]之间。以上过程就完成了对该原始图像的自动精准白平衡处理。In the above formula, Ri, Gi, and Bi are the red, green, and blue components of the ith pixel in the original image, respectively, and Ri', Gi', and Bi' are respectively the red of the ith pixel after the automatic precision white balance correction. , green, blue three color components. That is, when the i-th pixel point Ri, Gi, and Bi three-color components (Ri, Gi, Bi) = (108, 155, 130) in the original image, the pixel is automatically corrected by the white balance corrected red, green, The blue three-color component is (Ri, Gi, Bi) = (Kr1*Ri, Kg1*Gi, Kb1*Bi) = (137, 147, 109). Each pixel in the original image is corrected by analogy. If the pixel in the image exceeds the displayable range [0, 255], the pixel is quantized to between the displayable range [0, 255]. The above process completes the automatic precise white balance processing of the original image.
本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于前述实施例提供的白平衡处理方法的至少其中之一;例如可执行图1、图2、图4及图5所示方法的至少其中之一。The embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used in at least one of the white balance processing methods provided by the foregoing embodiments; for example, At least one of the methods shown in FIGS. 1, 2, 4, and 5 is performed.
本实施例所述的计算机存储介质可为光盘、硬盘或磁盘等各种类型的存储介质,可选为非瞬间存储介质。The computer storage medium described in this embodiment may be various types of storage media such as an optical disk, a hard disk, or a magnetic disk, and may be a non-transitory storage medium.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, such as: multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, or direct coupling, or communication connection of the components shown or discussed may be indirect coupling or communication connection through some interfaces, devices or units, and may be electrical, mechanical or other forms. of.
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as the unit may or may not be physical units, that is, may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各实施例中的各功能单元可以全部集成在一个处理模块中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现, 也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may be separately used as one unit, or two or more units may be integrated into one unit; the above integration The unit can be implemented in the form of hardware. It can also be implemented in the form of hardware plus software functional units.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to the program instructions. The foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The foregoing storage device includes the following steps: the foregoing storage medium includes: a mobile storage device, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. A medium that can store program code.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,凡按照本发明原理所作的修改,都应当理解为落入本发明的保护范围。 The above is only the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and modifications made in accordance with the principles of the present invention should be understood as falling within the scope of the present invention.

Claims (13)

  1. 一种白平衡处理方法,所述方法包括:A white balance processing method, the method comprising:
    获取参考图像的参考颜色信息;Obtaining reference color information of the reference image;
    获取采集图像的采集颜色信息;Obtaining the collected color information of the captured image;
    依据所述参考颜色信息和所述采集颜色信息,确定所述采集图像的白平衡校准参数;Determining a white balance calibration parameter of the acquired image according to the reference color information and the collected color information;
    依据所述白平衡校准参数对所述采集图像进行白平衡校准。Performing white balance calibration on the acquired image according to the white balance calibration parameter.
  2. 根据权利要求1所述的方法,其中,The method of claim 1 wherein
    所述获取参考图像的参考颜色信息包括:The reference color information of the reference image is obtained by:
    将所述参考图像中的图形对象与所述采集图像中的采集对象进行匹配;Matching a graphic object in the reference image with an acquisition object in the captured image;
    若所述采集对象与所述参考图像中的图形对象匹配,则提取所述图形对象的颜色信息作为所述参考颜色信息。And if the collection object matches the graphic object in the reference image, extracting color information of the graphic object as the reference color information.
  3. 根据权利要求2所述的方法,其中,The method of claim 2, wherein
    所述参考图像中的图形对象包括人物对象;The graphic object in the reference image includes a character object;
    所述将所述参考图像中的图形对象与所述采集图像中的采集对象进行匹配,包括:The matching the graphic object in the reference image with the collected object in the collected image comprises:
    利用人脸识别和/或图形匹配确定所述采集对象是否为所述参考图像中的图形对象;Determining whether the acquisition object is a graphic object in the reference image by using face recognition and/or graphic matching;
    若所述采集对象为所述图形对象,则认为所述图形对象与所述采集对象匹配。If the collection object is the graphic object, the graphic object is considered to match the collection object.
  4. 根据权利要求1所述的方法,其中,The method of claim 1 wherein
    所述获取参考图像的参考颜色信息,包括:The obtaining reference color information of the reference image includes:
    获取所述参考图像指定图形对象的三原色分量的第一均值; Obtaining, by the reference image, a first mean value of three primary color components of the graphic object;
    所述获取采集图像的采集颜色信息,包括:The acquiring color information of the collected image includes:
    获取所述采集图像中指定采集对象的三原色分量的第二均值;Obtaining a second mean value of three primary color components of the specified collection object in the acquired image;
    所述依据所述参考颜色信息和所述采集颜色信息,确定所述采集图像的白平衡校准参数,包括:Determining, according to the reference color information and the collected color information, a white balance calibration parameter of the collected image, including:
    依据所述第一均值和第二均值,分别获得三原色分量的增益系数;Obtaining gain coefficients of the three primary color components respectively according to the first mean value and the second mean value;
    依据所述增益系数获取所述白平衡校准参数;Obtaining the white balance calibration parameter according to the gain coefficient;
    其中,所述增益系数为所述白平衡校准参数。Wherein, the gain coefficient is the white balance calibration parameter.
  5. 根据权利要求4所述的方法,其中,The method of claim 4, wherein
    所述依据所述增益系数获取所述白平衡校准参数,包括:Obtaining the white balance calibration parameter according to the gain coefficient, including:
    当所述参考图像为至少两个时,依据预设函数关系及至少两个依据所述采集图像分别与每一个所述参考图像形成的增益系数计算函数值,获得所述白平衡校准参数。When the reference image is at least two, the white balance calibration parameter is obtained according to a preset function relationship and at least two gain coefficient calculation function values respectively formed according to the acquired image and each of the reference images.
  6. 根据权利要求1所述的方法,其中,The method of claim 1 wherein
    所述方法还包括:The method further includes:
    在获取所述参考图像的参考颜色信息之前,依据用户指示或根据内置指示,设定所述参考图像。The reference image is set according to a user instruction or according to a built-in indication before acquiring the reference color information of the reference image.
  7. 一种白平衡处理装置,所述装置包括:A white balance processing device, the device comprising:
    第一获取单元,配置为获取参考图像的参考颜色信息;a first acquiring unit configured to acquire reference color information of the reference image;
    第二获取单元,配置为获取采集图像的采集颜色信息;a second acquiring unit configured to acquire collected color information of the collected image;
    确定单元,配置为依据所述参考颜色信息和所述采集颜色信息,确定所述采集图像的白平衡校准参数;a determining unit, configured to determine a white balance calibration parameter of the collected image according to the reference color information and the collected color information;
    校准单元,配置为依据所述白平衡校准参数对所述采集图像进行白平衡校准。And a calibration unit configured to perform white balance calibration on the acquired image according to the white balance calibration parameter.
  8. 根据权利要求7所述的装置,其中,The apparatus according to claim 7, wherein
    所述第一获取单元,配置为将所述参考图像中的图形对象与所述采集 图像中的采集对象进行匹配;若所述采集对象与所述参考图像中的图形对象匹配,则提取所述图形对象的颜色信息作为所述参考颜色信息。The first acquiring unit is configured to map the graphic object in the reference image with the collecting The collected objects in the image are matched; if the collected objects match the graphic objects in the reference image, the color information of the graphic objects is extracted as the reference color information.
  9. 根据权利要求8所述的装置,其中,The device according to claim 8, wherein
    所述参考图像中的图形对象包括人物对象;The graphic object in the reference image includes a character object;
    所述第一获取单元,配置为利用人脸识别和/或图形匹配确定所述采集对象是否为所述参考图像中的图形对象;若所述采集对象为所述图形对象,则认为所述图形对象与所述采集对象匹配。The first acquiring unit is configured to determine, by using face recognition and/or graphic matching, whether the collected object is a graphic object in the reference image; if the collected object is the graphic object, the graphic is considered The object matches the collection object.
  10. 根据权利要求7所述的装置,其中,The apparatus according to claim 7, wherein
    所述第一获取单元,配置为获取所述参考图像指定图形对象的三原色分量的第一均值;The first acquiring unit is configured to acquire a first average value of three primary color components of the reference image specifying graphic object;
    所述第二获取单元,配置为获取所述采集图像中指定采集对象的三原色分量的第二均值;The second acquiring unit is configured to acquire a second average value of three primary color components of the specified collection object in the collected image;
    所述确定单元,配置为依据所述第一均值和第二均值,分别获得三原色分量的增益系数;依据所述增益系数获取所述白平衡校准参数;The determining unit is configured to obtain gain coefficients of the three primary color components respectively according to the first mean value and the second mean value; and obtain the white balance calibration parameter according to the gain coefficient;
    其中,所述增益系数为所述白平衡校准参数。Wherein, the gain coefficient is the white balance calibration parameter.
  11. 根据权利要求10所述的装置,其中,The device according to claim 10, wherein
    所述确定单元,配置为当所述参考图像为至少两个时,依据预设函数关系及至少两个依据所述采集图像分别与每一个所述参考图像形成的增益系数计算函数值,获得所述白平衡校准参数。The determining unit is configured to: when the reference image is at least two, calculate a function value according to a preset function relationship and at least two gain coefficients formed according to the collected image and each of the reference images respectively, and obtain a Describe the white balance calibration parameters.
  12. 根据权利要求7所述的装置,其中,The apparatus according to claim 7, wherein
    所述装置,还包括:The device further includes:
    设定单元,配置为在获取所述参考图像的参考颜色信息之前,依据用户指示或根据内置指示,设定所述参考图像。And a setting unit configured to set the reference image according to a user indication or according to a built-in indication before acquiring reference color information of the reference image.
  13. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1至6所述白平衡处理 方法的至少其中之一。 A computer storage medium having stored therein computer executable instructions for performing the white balance processing of claims 1 to 6 At least one of the methods.
PCT/CN2015/100016 2015-06-25 2015-12-30 White balance correction method, device and computer storage medium WO2016206344A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510363521.8 2015-06-25
CN201510363521.8A CN106331661A (en) 2015-06-25 2015-06-25 White balance processing method and device

Publications (1)

Publication Number Publication Date
WO2016206344A1 true WO2016206344A1 (en) 2016-12-29

Family

ID=57584304

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/100016 WO2016206344A1 (en) 2015-06-25 2015-12-30 White balance correction method, device and computer storage medium

Country Status (2)

Country Link
CN (1) CN106331661A (en)
WO (1) WO2016206344A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878695A (en) * 2017-02-13 2017-06-20 广东欧珀移动通信有限公司 Method, device and computer equipment that white balance is processed
CN108040240B (en) * 2017-11-08 2020-06-30 维沃移动通信有限公司 White balance adjustment method and device and mobile terminal
CN107948527A (en) * 2017-12-26 2018-04-20 北京传嘉科技有限公司 The treating method and apparatus of image taking
CN108833780B (en) * 2018-06-15 2021-01-15 Oppo广东移动通信有限公司 Image parameter adjusting method, image parameter adjusting device and mobile terminal
CN109462745B (en) * 2018-12-29 2020-01-21 维沃移动通信有限公司 White balance processing method and mobile terminal
WO2021016845A1 (en) * 2019-07-30 2021-02-04 深圳市大疆创新科技有限公司 White balance calibration method and device, and photographing device
CN111698493A (en) * 2020-06-02 2020-09-22 Oppo广东移动通信有限公司 White balance processing method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101860761A (en) * 2010-04-16 2010-10-13 浙江大学 Correction method of color distortion of projected display images
CN103957396A (en) * 2014-05-14 2014-07-30 姚杰 Image processing method and device used when tongue diagnosis is conducted with intelligent device and equipment
CN104735434A (en) * 2013-12-18 2015-06-24 诺基亚公司 Methods and apparatus for color balance correction

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5453812B2 (en) * 2009-01-08 2014-03-26 株式会社ニコン Image processing device
US8878957B2 (en) * 2012-04-18 2014-11-04 Texas Instruments Incorporated Method, system and computer program product for enhancing white balance of an image
CN104394392B (en) * 2014-11-14 2016-09-28 广东欧珀移动通信有限公司 A kind of white balance adjusting method, device and terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101860761A (en) * 2010-04-16 2010-10-13 浙江大学 Correction method of color distortion of projected display images
CN104735434A (en) * 2013-12-18 2015-06-24 诺基亚公司 Methods and apparatus for color balance correction
CN103957396A (en) * 2014-05-14 2014-07-30 姚杰 Image processing method and device used when tongue diagnosis is conducted with intelligent device and equipment

Also Published As

Publication number Publication date
CN106331661A (en) 2017-01-11

Similar Documents

Publication Publication Date Title
WO2016206344A1 (en) White balance correction method, device and computer storage medium
US10783354B2 (en) Facial image processing method and apparatus, and storage medium
WO2020015470A1 (en) Image processing method and apparatus, mobile terminal, and computer-readable storage medium
US11233933B2 (en) Method and device for processing image, and mobile terminal
EP3554070B1 (en) Photograph-capture method, apparatus and storage medium
CN105187810B (en) A kind of auto white balance method and electronic medium device based on face color character
CN108875619B (en) Video processing method and device, electronic equipment and computer readable storage medium
CN111401324A (en) Image quality evaluation method, device, storage medium and electronic equipment
US20170163953A1 (en) Method and electronic device for processing image containing human face
CN110163810B (en) Image processing method, device and terminal
US20170161553A1 (en) Method and electronic device for capturing photo
CN109844804B (en) Image detection method, device and terminal
TWI532385B (en) White balance method and apparatus thereof
CN107507144B (en) Skin color enhancement processing method and device and image processing device
CN111935479B (en) Target image determination method and device, computer equipment and storage medium
JP6157165B2 (en) Gaze detection device and imaging device
WO2019210707A1 (en) Image sharpness evaluation method, device and electronic device
US20220360707A1 (en) Photographing method, photographing device, storage medium and electronic device
CN108875625B (en) Identification method and electronic equipment
WO2017113850A1 (en) Method and apparatus for obtaining parallax parameters of stereoscopic film source
CN110581950A (en) Camera, system and method for selecting camera settings
CN112396016B (en) Face recognition system based on big data technology
JPWO2018078806A1 (en) Image processing apparatus, image processing method, and image processing program
US9323981B2 (en) Face component extraction apparatus, face component extraction method and recording medium in which program for face component extraction method is stored
CN110766631A (en) Face image modification method and device, electronic equipment and computer readable medium

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: 15896227

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15896227

Country of ref document: EP

Kind code of ref document: A1