CN109348206A - Image white balancing treatment method, device, storage medium and mobile terminal - Google Patents

Image white balancing treatment method, device, storage medium and mobile terminal Download PDF

Info

Publication number
CN109348206A
CN109348206A CN201811379008.8A CN201811379008A CN109348206A CN 109348206 A CN109348206 A CN 109348206A CN 201811379008 A CN201811379008 A CN 201811379008A CN 109348206 A CN109348206 A CN 109348206A
Authority
CN
China
Prior art keywords
white balance
original image
image
sample
model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811379008.8A
Other languages
Chinese (zh)
Inventor
朱豪
刘耀勇
陈岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201811379008.8A priority Critical patent/CN109348206A/en
Publication of CN109348206A publication Critical patent/CN109348206A/en
Pending legal-status Critical Current

Links

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

Landscapes

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

Abstract

The embodiment of the present application discloses image white balancing treatment method, device, storage medium and mobile terminal.This method comprises: obtaining original image to be processed;The original image is input to white balance coefficients matrix trained in advance to determine in model or white balance processing model;Determine that model or the white balance handle the output of model as a result, determining target image corresponding with the original image according to the white balance coefficients matrix.The embodiment of the present application is by using above-mentioned technical proposal, not only white balance processing simply and rapidly can be carried out to original image, but also corresponding white balance processing targetedly can be carried out to the different original images of input, the quality that can effectively improve image, makes image closer to realistic colour.

Description

Image white balancing treatment method, device, storage medium and mobile terminal
Technical field
The invention relates to technical field of image processing more particularly to image white balancing treatment method, device, storages Medium and mobile terminal.
Background technique
With the rapid development of mobile terminals, also more next to the quality requirement of the image by mobile terminal camera head shooting It is higher.However, for the scene under different-colour light source, the color of the imaging sensor captured images inside camera And realistic colour usually has certain deviation, and therefore, in practical applications, the obtained raw image data of imaging sensor is not Output can directly be carried out to show, and need to carry out raw image data white balance processing, raw image data is reverted to After image with realistic colour, ability final output is shown, makes output image closer to the visual custom of human eye.Therefore, effectively White balance processing mode most important is become to the quality for the image effect that camera is shot.
Summary of the invention
The embodiment of the present application provides image white balancing treatment method, device, storage medium and mobile terminal, can effectively mention The quality of hi-vision, makes image closer to realistic colour.
In a first aspect, the embodiment of the present application provides a kind of image white balancing treatment method, comprising:
Obtain original image to be processed;
The original image is input to white balance coefficients matrix trained in advance and determines model or white balance processing model In;
Determine that model or the white balance handle the output of model as a result, determining and institute according to the white balance coefficients matrix State the corresponding target image of original image.
Second aspect, the embodiment of the present application provide a kind of image white balance processing equipment, comprising:
Original image obtains module, for obtaining original image to be processed;
Original image input module is determined for the original image to be input to white balance coefficients matrix trained in advance In model or white balance processing model;
Target image determining module, for determining that model or the white balance handle mould according to the white balance coefficients matrix The output of type is as a result, determine target image corresponding with the original image.
The third aspect, the embodiment of the present application provide a kind of computer readable storage medium, are stored thereon with computer journey Sequence realizes the image white balancing treatment method as described in the embodiment of the present application first aspect when the program is executed by processor.
Fourth aspect, the embodiment of the present application provide a kind of mobile terminal, including memory, processor and are stored in storage It can realize on device and when the computer program of processor operation, the processor execute the computer program as the application is real Apply image white balancing treatment method described in a first aspect.
The image white balance processing scheme provided in the embodiment of the present application obtains original image to be processed, and will be described Original image is input to white balance coefficients matrix trained in advance and determines in model or white balance processing model, then according to White balance coefficients matrix determines that model or the white balance handle the output of model as a result, determination is corresponding with the original image Target image.By using above-mentioned technical proposal, not only white balance processing simply and rapidly can be carried out to original image, and And corresponding white balance processing targetedly can also be carried out to the different original images of input, it can effectively improve image Quality makes image closer to realistic colour.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of image white balancing treatment method provided by the embodiments of the present application;
Fig. 2 is the flow diagram of another image white balancing treatment method provided by the embodiments of the present application;
Fig. 3 is the flow diagram of another image white balancing treatment method provided by the embodiments of the present application;
Fig. 4 is a kind of structural schematic diagram of image white balance processing equipment provided by the embodiments of the present application;
Fig. 5 is a kind of structural schematic diagram of mobile terminal provided by the embodiments of the present application;
Fig. 6 is the structural schematic diagram of another mobile terminal provided by the embodiments of the present application.
Specific embodiment
Further illustrate the technical solution of the application below with reference to the accompanying drawings and specific embodiments.It is understood that It is that specific embodiment described herein is used only for explaining the application, rather than the restriction to the application.It further needs exist for illustrating , part relevant to the application is illustrated only for ease of description, in attached drawing rather than entire infrastructure.
It should be mentioned that some exemplary embodiments are described as before exemplary embodiment is discussed in greater detail The processing or method described as flow chart.Although each step is described as the processing of sequence by flow chart, many of these Step can be implemented concurrently, concomitantly or simultaneously.In addition, the sequence of each step can be rearranged.When its operation The processing can be terminated when completion, it is also possible to have the additional step being not included in attached drawing.The processing can be with Corresponding to method, function, regulation, subroutine, subprogram etc..
Automatic white balance (Automatic white balance, AWB) algorithm is most important for camera imaging effect. In traditional technology, common automatic white balance algorithm is usually that global white balance namely full figure use a white balance coefficients, is led to The original image raw image for crossing the white object that imaging sensor is shot under different-colour in acquisition camera, is then based on raw Image calculates separately R/G and B/G, and the R/G based on calculating and B/G draws colour temperature curve, finally imports the colour temperature curve and moves In dynamic terminal.When the camera in mobile terminal in the open state, no matter camera is in shooting preview state, is in figure White block in picture shooting state, real-time detection shooting preview image or shooting image, and calculate the R/G and B/ of white block G, and take with the immediate point of the R/G and B/G of white block in the colour temperature curve for importing mobile terminal as color temperature point, by this The corresponding R/G of color temperature point and B/G is as shooting preview image or the white balance coefficients of shooting image.
However, having following defects that one, the shooting image for mixing colour temperature in above-mentioned overall situation white balance algorithm, use Global white balance algorithm can not restore image white well;Two, in the white block of detection image, ash is generallyd use at present World's approximation method is spent, can not accurately detect the white block in image, especially upper image or mixing for shooting at night The image of colour temperature;Third, the shooting image for pure color object after carrying out white balance processing using global white balance algorithm, are held Easily leading to pure color object, there are biggish misalignments.Based on considerations above, the scheme of following image white balance processing is now provided.
Fig. 1 is the flow diagram of image white balancing treatment method provided by the embodiments of the present application, and this method can be by scheming As white balance processing equipment execution, wherein the device be can be implemented by software and/or hardware, and can generally integrate in the terminal. As shown in Figure 1, this method comprises:
Step 101 obtains original image to be processed.
Illustratively, the mobile terminal in the embodiment of the present application may include that mobile phone, tablet computer and video camera etc. have bat According to the mobile device of function.
In the embodiment of the present application, when the camera for detecting mobile terminal in the open state, i.e., ought detect shifting When the camera of dynamic terminal be in shooting preview state or shooting image, the raw image of camera acquisition is obtained, at this point, can be by The raw image of camera acquisition is as original image to be processed.Optionally, the raw of other terminal devices transmission can also be obtained Image or the image of pending white balance processing, and as original image to be processed.It is of course also possible to directly from movement In the image library stored in terminal, the image for needing to carry out white balance processing is obtained, as original image to be processed.It needs It is bright, source or acquisition modes of the embodiment of the present application to original image to be processed, without limitation.
Optionally, when detecting that image white balance processing event is triggered, original image to be processed is obtained.It can manage The touching of image white balance processing event can be preset in order to carry out white balance processing to image on suitable opportunity in solution Clockwork spring part.Illustratively, in order to meet user to the visual demand of acquisition image, it can detect that camera is in the open state When, triggering image white balance handles event.It optionally, can when saturation degree of the user to certain image in mobile terminal is dissatisfied When detecting that user actively opens image white balance processing authority, triggering image white balance handles event.Optionally, in order to make The processing of image white balance is applied to more valuable Time window, handles brought extra power consumption to save image white balance, The Time window and application scenarios of image white balance processing can be analyzed or investigated, reasonably default scene is set, When detecting mobile terminal in default scene, triggering image white balance handles event.It should be noted that the embodiment of the present application pair The specific manifestation form that image white balance processing event is triggered is without limitation.
The original image is input in advance trained white balance coefficients matrix and determines model or white balance by step 102 It handles in model.
In the embodiment of the present application, white balance coefficients matrix determines that model can be understood as inputting original graph to be processed As after, the learning model of white balance coefficients matrix corresponding with the original image to be processed is quickly determined.White balance coefficients square Battle array determines that model can be and is trained generation to the sample original image of acquisition and corresponding sample white balance coefficients matrix Learning model, wherein sample white balance coefficients matrix includes the white balance processing that sample original image is adjusted to best effects Matrix when image.It is understood that by sample original image and corresponding sample white balance coefficients matrix and the two Between corresponding relationship learnt, white balance coefficients matrix can be generated and determine model.
White balance processing model can be understood as after inputting original image to be processed, quickly the determining and original to be processed The learning model of the corresponding target image of beginning image, wherein target image corresponding with the original image to be processed is to original Beginning image carries out white balance treated image.White balance processing model can be through the sample original image to acquisition and incite somebody to action Sample original image is adjusted to the white balance processing image of best effects, is trained the learning model of generation.It is understood that It is, by handling image to sample original image and by the white balance that sample original image is adjusted to best effects, and between the two Corresponding relationship learnt, can be generated white balance processing model.It is end-to-end learning model that white balance, which handles model, i.e., Input and output are the learning model of image.
Step 103, determined according to the white balance coefficients matrix model or the white balance processing model output as a result, Determine target image corresponding with the original image.
Optionally, determine the output of model as a result, the determining and original image pair according to the white balance coefficients matrix The target image answered, comprising: determine the output of model as a result, the determining and original image according to the white balance coefficients matrix Corresponding white balance coefficients matrix;According to the original image and the white balance coefficients matrix, the determining and original image Corresponding target image.Illustratively, original image to be processed is input to after white balance coefficients matrix determines model, Bai Ping Weighing apparatus coefficient matrix determines that model analyzes the original image, and original image pair determining and to be processed based on the analysis results Then the white balance coefficients matrix answered can carry out white balance processing to original image to be processed based on white balance coefficients matrix, Generate target image corresponding with original image.Optionally, the output of model is handled as a result, determining and institute according to the white balance State the corresponding target image of original image, comprising: determine the output image of the white balance processing model;By the output image As target image corresponding with the original image.Illustratively, original image to be processed is input to white balance processing After model, white balance processing model analyzes original image, and carries out white balance to the original image based on the analysis results Processing is obtained carrying out white balance treated target image to original image, and is exported.It is understood that by be processed After original image inputs white balance processing model, white balance handles model after analyzing, directly output image, then can be by the output Image is as target image corresponding with original image.
The image white balancing treatment method provided in the embodiment of the present application obtains original image to be processed, and will be described Original image is input to white balance coefficients matrix trained in advance and determines in model or white balance processing model, then according to White balance coefficients matrix determines that model or the white balance handle the output of model as a result, determination is corresponding with the original image Target image.By using above-mentioned technical proposal, not only white balance processing simply and rapidly can be carried out to original image, and And corresponding white balance processing targetedly can also be carried out to the different original images of input, it can effectively improve image Quality makes image closer to realistic colour.
In some embodiments, according to the original image and the white balance coefficients matrix, the determining and original graph As corresponding target image, comprising: obtain the first RGB component value of each pixel in the original image;For the original All pixels point in beginning image, by corresponding position in the first RGB component value of each pixel and the white balance coefficients matrix White balance coefficients product, the 2nd RGB of the pixel as target image corresponding with pixel described in original image points Magnitude.The advantages of this arrangement are as follows can be determined for each pixel in original image to be processed one it is independent white flat Weigh coefficient, and carries out white balance processing to pixel each in original image based on white balance coefficients matrix, can solve and is based on When global white balance algorithm carries out white balance processing, it is easy to cause the misalignment of pure color object larger, mixing can not under colour temperature The technical issues of accurately detecting white block can effectively improve the quality of image, make image closer to realistic colour.
Illustratively, the first RGB component value of each pixel in original image is obtained, and is owned in original image Pixel, by the first RGB component value of each pixel multiplied by the white balance system with corresponding position in white balance coefficients matrix Number, and using the result after product as the second RGB component value of target image vegetarian refreshments corresponding with pixel described in original image, I.e. using the result after product as the second RGB component value for carrying out white balance treated pixel to original image.It is exemplary , the first RGB component value of first pixel (pixel of the first row first row in original image) in original image is obtained, Then by the first RGB component value of the white balance coefficients of the first row first row in white balance coefficients matrix and first pixel Product, as first pixel carried out to original image in white balance treated target image (first in target image The pixel of row first row) the second RGB component value.And so on, it is based on white balance coefficients matrix, to each in original image Pixel does similar processing operation, to obtain carrying out white balance treated target image to original image.
Fig. 2 is the flow diagram of image white balancing treatment method provided by the embodiments of the present application, as shown in Fig. 2, the party Method includes:
Step 201 acquires first sample original image of the standard color card under different-colour by camera.
In the embodiment of the present application, standard color card is white colour atla, acquires standard color card in different-colour by camera Under image, as first sample original image.Illustratively, standard color card is acquired under different-colour by camera Raw image, as first sample original image.Different-colour can be realized by artificial light sources, illustratively, in laboratory ring Under border, different colour temperature environment is built by different types of light source.For example, 2000k can be built using candle as light source Colour temperature environment, the colour temperature environment of 1950-2250k can be built using high-pressure sodium lamp as light source, using tengsten lamp as light Source can build the colour temperature environment of 2700k, and the colour temperature environment of 3000k can be built using halogen lamp as light source, utilizes warm colour Fluorescent lamp can build the colour temperature environment etc. of 4000k-4600k as light source.It can be provided by different types of light source a series of The continuous shooting environmental of color temperature value.Standard color card is shot under different-colour using camera, obtains the colour atla under every color temperature Image, to obtain first sample original image of the standard color card under different-colour.
Step 202 carries out white balance processing to the first sample original image, obtains and the first sample original graph As corresponding first sample target image.
In the embodiment of the present application, white balance is carried out to first sample original image using existing white balancing treatment method Processing, obtains first sample target image corresponding with first sample original image.Optionally, first sample original image is defeated Enter into ISP (Image Signal Processor, image-signal processor) tool, manually to first sample original image into Row white balance adjusting will be adjusted to the best image of white balance effect as first sample corresponding with first sample original image Target image.Wherein, when carrying out white balance adjusting to first sample original image, if be adjusted to the best figure of white balance effect As that can be confirmed by the first visual sense of human eye, can also be assessed by image quality measure standard, until obtaining Take the image that white balance effect is best.
Step 203, according to the first sample original image and the first sample target image, determine described first The variation of sample original image is the corresponding sample white balance coefficients matrix of the first sample target image.
In the embodiment of the present application, according to first sample original image and the first sample corresponding with first sample original image This target image determines when changing first sample original image for first sample target image, corresponding sample white balance system Matrix number, that is, when determining that carrying out white balance to first sample original image handles to obtain first sample target image, at white balance The white balance coefficients matrix used during reason.
Optionally, it according to the first sample original image and the first sample target image, determines described first The variation of sample original image is the corresponding sample white balance coefficients matrix of the first sample target image, comprising: described in acquisition Each pixel in the third RGB component value of each pixel and the first sample target image in first sample original image The 4th RGB component value;For all pixels point, by the corresponding 4th RGB component value of each pixel and third RGB component value Ratio, as the corresponding white balance coefficients of pixel described in sample white balance coefficients matrix.The advantages of this arrangement are as follows It is corresponding white flat when can accurately determine out the original image progress white balance processing under different-colour environment to standard color card Weigh coefficient matrix.
Illustratively, the third RGB component value and the first sample of each pixel in first sample original image are obtained respectively The 4th RGB component value of each pixel calculates separately the 4th of corresponding pixel points for each pixel in this target image The ratio of RGB component value and third RGB component value, and using the ratio as the white balance coefficients matrix of the pixel.It is exemplary , obtain first pixel (pixel of the first row first row in first sample original image) in first sample original image Third RGB component value and first sample target image in first pixel (the first row first in first sample target image The pixel of column) the 4th RGB component value, and by the ratio of the 4th RGB component value and the third RGB component value, as white The white balance coefficients of the first row first row in coefficient of balance matrix.In the manner described above, and so on, white balance system is determined respectively The white balance coefficients of each element in matrix number.
Step 204 is marked the first sample original image according to the sample white balance coefficients matrix, obtains First training sample set.
Illustratively, according to obtained each sample white balance coefficients matrix respectively to corresponding first sample original image The first sample original image for being marked, and corresponding sample white balance coefficients matrix being marked, as white balance coefficients square Battle array determines the training sample set of model, i.e. the first training sample set.
Step 205 is trained the first default machine learning model using first training sample set, obtains white flat Weighing apparatus coefficient matrix determines model.
Illustratively, the first default machine learning model is trained using the first training sample set, generates white balance Coefficient matrix determines model.Wherein, the first default machine learning model may include that convolutional neural networks model or length are remembered in short-term Recall the machine learning models such as network model.The embodiment of the present application to the first default machine learning model without limitation.
Step 206 obtains original image to be processed.
The original image is input in advance trained white balance coefficients matrix and determines in model by step 207.
Step 208 determines the output of model as a result, the determining and original image pair according to the white balance coefficients matrix The white balance coefficients matrix answered.
Step 209, according to the original image and the white balance coefficients matrix, determination is corresponding with the original image Target image.
Illustratively, the first RGB component value for obtaining each pixel in the original image, for the original image Middle all pixels point puts down the white of corresponding position in the first RGB component value of each pixel and the white balance coefficients matrix The product of weighing apparatus coefficient, the second RGB component value of the pixel as target image corresponding with pixel described in original image.
Wherein, it before obtaining original image to be processed, obtains white balance coefficients matrix and determines model.It needs to illustrate It is that can be above-mentioned first training sample set of acquisition for mobile terminal, using the first training sample set to default machine learning model It is trained, directly generates white balance coefficients matrix and determine model.It can also be that mobile terminal calls directly other mobile terminals The white balance coefficients matrix that training generates determines model, for example, utilizing a training sample of acquisition for mobile terminal first before factory This collection simultaneously generates white balance coefficients matrix and determines model, and the white balance coefficients matrix is then determined that model storage is arrived and other shiftings In dynamic terminal, directly used for other mobile terminals.Alternatively, server obtains a large amount of first sample original image and with first The corresponding white balance coefficients matrix of sample original image, and according to corresponding white balance coefficients matrix to first sample original image It is marked, obtains the first training sample set.Server to based on the first default machine learning model to the first training sample set It is trained, obtains white balance coefficients matrix and determine model.When mobile terminal needs to carry out the processing of image white balance, from service Trained white balance coefficients matrix determines model to device calling.
In the embodiment of the present application, determine that model is determined and original image pair to be processed by white balance coefficients matrix The white balance coefficients matrix answered can be not only used for carrying out white balance processing to original image to be processed, white can also will put down Weighing apparatus coefficient matrix is supplied to user, makes user by white balance coefficients matrix with used for other purposes, certainly, if user is to based on white balance Coefficient matrix to original image to be processed carry out white balance treated target image it is dissatisfied when, can also be to the white balance Coefficient matrix is adjusted, and to adjust the effect for carrying out white balance processing to original image, or obtains the white flat of different-effect Weighing apparatus treated image.
Image white balancing treatment method provided by the embodiments of the present application, obtains original image to be processed, and by original graph It is determined in model as being input to the white balance coefficients matrix trained in advance, the defeated of model is determined according to the white balance coefficients matrix Out as a result, determining corresponding with original image white balance coefficients matrix, then according to the original image and described white put down Weigh coefficient matrix, determines target image corresponding with the original image, wherein white balance coefficients matrix determines that model is to be based on The first sample original image of white balance coefficients matrix has been marked to be trained generation.It, can by using above-mentioned technical proposal To efficiently use the first sample original image of the standard color card acquired under different-colour, and first sample original image is carried out White balance coefficients matrix when white balance processing carries out the training study that white balance coefficients matrix determines model, can effectively mention High white balance coefficients matrix determines the accuracy of model, while determining that model can accurately determine out using white balance coefficients matrix With the matched white balance coefficients matrix of original image to be processed, white balance processing is carried out to original image, can effectively be provided Picture quality.
Fig. 3 is the flow diagram of image white balancing treatment method provided by the embodiments of the present application, as shown in figure 3, the party Method includes:
Step 301 acquires second sample original image of the standard color card under different-colour by camera.
In the embodiment of the present application, standard color card is white colour atla, acquires standard color card in different-colour by camera Under image, as the second sample original image.Illustratively, standard color card is acquired under different-colour by camera Raw image, as the second sample original image.Different-colour can be realized by artificial light sources, illustratively, in laboratory ring Under border, different colour temperature environment is built by different types of light source.For example, 2000k can be built using candle as light source Colour temperature environment, the colour temperature environment of 1950-2250k can be built using high-pressure sodium lamp as light source, using tengsten lamp as light Source can build the colour temperature environment of 2700k, and the colour temperature environment of 3000k can be built using halogen lamp as light source, utilizes warm colour Fluorescent lamp can build the colour temperature environment etc. of 4000k-4600k as light source.It can be provided by different types of light source a series of The continuous shooting environmental of color temperature value.Standard color card is shot under different-colour using camera, obtains the colour atla under every color temperature Image, to obtain second sample original image of the standard color card under different-colour.
It should be noted that corresponding colour temperature value and acquisition first sample original graph when the second sample original image of acquisition As when corresponding colour temperature value may be the same or different.Second sample original image and first sample original image can be with It is identical, it can also be different, the embodiment of the present application does not limit this.
Step 302 carries out white balance processing to the second sample original image, obtains and the second sample original graph As corresponding second sample object image.
In the embodiment of the present application, white balance is carried out to the second sample original image using existing white balancing treatment method Processing, obtains the second sample object image corresponding with the second sample original image.Optionally, the second sample original image is defeated Enter into ISP (Image Signal Processor, image-signal processor) tool, manually to the second sample original image into Row white balance adjusting will be adjusted to the best image of white balance effect as the second sample corresponding with the second sample original image Target image.Wherein, when carrying out white balance adjusting to the second sample original image, if be adjusted to the best figure of white balance effect As that can be confirmed by the first visual sense of human eye, can also be assessed by image quality measure standard, until obtaining Take the image that white balance effect is best.
It should be noted that the embodiment of the present application to the second sample original image carry out white balance processing mode with it is above-mentioned The mode for carrying out white balance processing to first sample original image in embodiment may be the same or different, and the application is implemented Example carries out the concrete mode of white balance processing without limitation to first sample original image and the second sample original image.
Step 303, using the second sample original image and the second sample object image as the second training sample Collection.
Using the second sample original image and the second sample object image corresponding with the second sample original image as white flat The training sample set of weighing apparatus processing model, i.e. the second training sample set.
Step 304 is trained the second default machine learning model using second training sample set, obtains white flat Weighing apparatus processing model.
Illustratively, the second default machine learning model is trained using the second training sample set, generates white balance Handle model.Wherein, the second default machine learning model may include convolutional neural networks model or long memory network mould in short-term The machine learning models such as type can also include model-naive Bayesian.It should be noted that the embodiment of the present application is default to second Machine learning model is without limitation, wherein and the second default machine learning model can be identical with the first default machine learning model, It can also be different.
Step 305 obtains original image to be processed.
The original image is input in white balance processing model trained in advance by step 306.
Step 307, the output image for determining the white balance processing model.
Step 308, using the output image as target image corresponding with the original image.
Wherein, it before obtaining original image to be processed, obtains white balance and handles model.It should be noted that can be with It is above-mentioned second training sample set of acquisition for mobile terminal, the second default machine learning model is carried out using the second training sample set Training directly generates white balance processing model.It can also be that mobile terminal calls directly the white of other mobile terminals training generation Balance Treatment model, for example, using second training sample set of acquisition for mobile terminal and generating white balance processing before factory Then model directly uses white balance processing model storage to other mobile terminals for other mobile terminals.Or Person, server obtain a large amount of second sample original image and carry out white balance treated second to the second sample original image Sample object image obtains the second training sample set.Server trains sample to second to based on the second default machine learning model This collection is trained, and obtains white balance processing model.When mobile terminal needs to carry out the processing of image white balance, from server tune Model is handled with trained white balance.
Image white balancing treatment method provided by the embodiments of the present application, obtains original image to be processed, and by original graph As being input in advance trained white balance processing model, by the output image of white balance processing model, as with it is described The corresponding target image of original image, wherein white balance processing model is based on the second sample original image and to the second sample Original image carries out white balance, and treated that the second sample object image is trained generation.By using above-mentioned technical side Case can efficiently use the second sample original image of the standard color card acquired under different-colour, and to the second sample original graph As carrying out white balance treated the second sample object image, the training study of white balance processing model is carried out, can effectively be mentioned The accuracy of high white balance processing model, while can be accurately and rapidly to original graph to be processed using white balance processing model As carrying out white balance processing, picture quality can be effectively improved.
Fig. 4 is a kind of structural schematic diagram of image white balance processing equipment provided by the embodiments of the present application, which can be by Software and or hardware realization is typically integrated in mobile terminal, can by execute image white balancing treatment method come to image into The processing of row white balance.As shown in figure 4, the device includes:
Original image obtains module 401, for obtaining original image to be processed;
Original image input module 402, for the original image to be input to white balance coefficients matrix trained in advance It determines in model or white balance processing model;
Target image determining module 403, for being determined at model or the white balance according to the white balance coefficients matrix The output of model is managed as a result, determining target image corresponding with the original image.
The image white balance processing equipment provided in the embodiment of the present application obtains original image to be processed, and will be described Original image is input to white balance coefficients matrix trained in advance and determines in model or white balance processing model, then according to White balance coefficients matrix determines that model or the white balance handle the output of model as a result, determination is corresponding with the original image Target image.By using above-mentioned technical proposal, not only white balance processing simply and rapidly can be carried out to original image, and And corresponding white balance processing targetedly can also be carried out to the different original images of input, it can effectively improve image Quality makes image closer to realistic colour.
Optionally, the target image determining module, comprising:
White balance coefficients matrix determination unit, for determining the output of model according to the white balance coefficients matrix as a result, Determine white balance coefficients matrix corresponding with the original image;
Target image determination unit, for according to the original image and the white balance coefficients matrix, it is determining with it is described The corresponding target image of original image.
Optionally, the target image determination unit, is used for:
Obtain the first RGB component value of each pixel in the original image;
For all pixels point in the original image, by the first RGB component value of each pixel and the white balance The product of the white balance coefficients of corresponding position in coefficient matrix, as target image corresponding with pixel described in original image Second RGB component value of pixel.
Optionally, described device further include:
Matrix determines that model obtains module, for obtaining white balance coefficients square before obtaining original image to be processed Battle array determines model;
Wherein, the white balance coefficients matrix determines that model is obtained by such as under type:
First sample original image of the standard color card under different-colour is acquired by camera;Wherein, the reference colour Card is white colour atla;
White balance processing is carried out to the first sample original image, is obtained corresponding with the first sample original image First sample target image;
According to the first sample original image and the first sample target image, determination is original by the first sample Image change is the corresponding sample white balance coefficients matrix of the first sample target image;
The first sample original image is marked according to the sample white balance coefficients matrix, obtains the first training Sample set;
The first default machine learning model is trained using first training sample set, obtains white balance coefficients square Battle array determines model.
Optionally, it according to the first sample original image and the first sample target image, determines described first The variation of sample original image is the corresponding sample white balance coefficients matrix of the first sample target image, comprising:
Obtain the third RGB component value of each pixel and the first sample target in the first sample original image 4th RGB component value of each pixel in image;
For all pixels point, by the ratio of each pixel corresponding 4th RGB component value and third RGB component value, As the corresponding white balance coefficients of pixel described in sample white balance coefficients matrix.
Optionally, the target image determining module, is used for:
Determine the output image of the white balance processing model;
Using the output image as target image corresponding with the original image.
Optionally, described device further include:
White balance handles model and obtains module, for obtaining the white balance before obtaining original image to be processed Handle model;
Wherein, the white balance processing model is obtained by such as under type:
Second sample original image of the standard color card under different-colour is acquired by camera;
White balance processing is carried out to the second sample original image, is obtained corresponding with the second sample original image Second sample object image;
Using the second sample original image and the second sample object image as the second training sample set;
The second default machine learning model is trained using second training sample set, obtains white balance processing mould Type.
The embodiment of the present application also provides a kind of storage medium comprising computer executable instructions, and the computer is executable Instruction is used to execute image white balancing treatment method when being executed by computer processor, this method comprises:
Obtain original image to be processed;
The original image is input to white balance coefficients matrix trained in advance and determines model or white balance processing model In;
Determine that model or the white balance handle the output of model as a result, determining and institute according to the white balance coefficients matrix State the corresponding target image of original image.
Storage medium --- any various types of memory devices or storage equipment.Term " storage medium " is intended to wrap It includes: install medium, such as CD-ROM, floppy disk or magnetic tape equipment;Computer system memory or random access memory, such as DRAM, DDRRAM, SRAM, EDORAM, blue Bath (Rambus) RAM etc.;Nonvolatile memory, such as flash memory, magnetic medium (example Such as hard disk or optical storage);Register or the memory component of other similar types etc..Storage medium can further include other types Memory or combinations thereof.In addition, storage medium can be located at program in the first computer system being wherein performed, or It can be located in different second computer systems, second computer system is connected to the first meter by network (such as internet) Calculation machine system.Second computer system can provide program instruction to the first computer for executing.Term " storage medium " can To include two or more that may reside in different location (such as in the different computer systems by network connection) Storage medium.Storage medium can store the program instruction that can be performed by one or more processors and (such as be implemented as counting Calculation machine program).
Certainly, a kind of storage medium comprising computer executable instructions, computer provided by the embodiment of the present application The image white balance processing operation that executable instruction is not limited to the described above, can also be performed the application any embodiment and is provided Image white balancing treatment method in relevant operation.
The embodiment of the present application provides a kind of mobile terminal, and figure provided by the embodiments of the present application can be integrated in the mobile terminal As white balance processing equipment.Fig. 5 is a kind of structural schematic diagram of mobile terminal provided by the embodiments of the present application.Mobile terminal 500 It may include: memory 501, processor 502 and storage are on a memory and can be described in the computer program of processor operation Processor 502 realizes the image white balancing treatment method as described in the embodiment of the present application when executing the computer program.
Mobile terminal provided by the embodiments of the present application not only can simply and rapidly carry out at white balance original image Reason, but also corresponding white balance processing targetedly can be carried out to the different original images of input, it can effectively improve The quality of image, makes image closer to realistic colour.
Fig. 6 is the structural schematic diagram of another mobile terminal provided by the embodiments of the present application, which may include: Shell (not shown), memory 601, central processing unit (central processing unit, CPU) 602 (are also known as located Manage device, hereinafter referred to as CPU), circuit board (not shown) and power circuit (not shown).The circuit board is placed in institute State the space interior that shell surrounds;The CPU602 and the memory 601 are arranged on the circuit board;The power supply electricity Road, for each circuit or the device power supply for the mobile terminal;The memory 601, for storing executable program generation Code;The CPU602 is run and the executable journey by reading the executable program code stored in the memory 601 The corresponding computer program of sequence code, to perform the steps of
Obtain original image to be processed;
The original image is input to white balance coefficients matrix trained in advance and determines model or white balance processing model In;
Determine that model or the white balance handle the output of model as a result, determining and institute according to the white balance coefficients matrix State the corresponding target image of original image.
The mobile terminal further include: Peripheral Interface 603, RF (Radio Frequency, radio frequency) circuit 605, audio-frequency electric Road 606, loudspeaker 611, power management chip 608, input/output (I/O) subsystem 609, other input/control devicess 610, Touch screen 612, other input/control devicess 610 and outside port 604, these components pass through one or more communication bus Or signal wire 607 communicates.
It should be understood that illustrating the example that mobile terminal 600 is only mobile terminal, and mobile terminal 600 It can have than shown in the drawings more or less component, can combine two or more components, or can be with It is configured with different components.Various parts shown in the drawings can include one or more signal processings and/or dedicated It is realized in the combination of hardware, software or hardware and software including integrated circuit.
Just the mobile terminal provided in this embodiment for the processing of image white balance is described in detail below, the movement Terminal takes the mobile phone as an example.
Memory 601, the memory 601 can be accessed by CPU602, Peripheral Interface 603 etc., and the memory 601 can It can also include nonvolatile memory to include high-speed random access memory, such as one or more disk memory, Flush memory device or other volatile solid-state parts.
The peripheral hardware that outputs and inputs of equipment can be connected to CPU602 and deposited by Peripheral Interface 603, the Peripheral Interface 603 Reservoir 601.
I/O subsystem 609, the I/O subsystem 609 can be by the input/output peripherals in equipment, such as touch screen 612 With other input/control devicess 610, it is connected to Peripheral Interface 603.I/O subsystem 609 may include 6091 He of display controller For controlling one or more input controllers 6092 of other input/control devicess 610.Wherein, one or more input controls Device 6092 processed receives electric signal from other input/control devicess 610 or sends electric signal to other input/control devicess 610, Other input/control devicess 610 may include physical button (push button, rocker buttons etc.), dial, slide switch, behaviour Vertical pole clicks idler wheel.It is worth noting that input controller 6092 can with it is following any one connect: keyboard, infrared port, The indicating equipment of USB interface and such as mouse.
Touch screen 612, the touch screen 612 are the input interface and output interface between customer mobile terminal and user, Visual output is shown to user, visual output may include figure, text, icon, video etc..
Display controller 6091 in I/O subsystem 609 receives electric signal from touch screen 612 or sends out to touch screen 612 Electric signals.Touch screen 612 detects the contact on touch screen, and the contact that display controller 6091 will test is converted to and is shown The interaction of user interface object on touch screen 612, i.e. realization human-computer interaction, the user interface being shown on touch screen 612 Object can be the icon of running game, the icon for being networked to corresponding network etc..It is worth noting that equipment can also include light Mouse, light mouse are the extensions for the touch sensitive surface for not showing the touch sensitive surface visually exported, or formed by touch screen.
RF circuit 605 is mainly used for establishing the communication of mobile phone Yu wireless network (i.e. network side), realizes mobile phone and wireless network The data receiver of network and transmission.Such as transmitting-receiving short message, Email etc..Specifically, RF circuit 605 receives and sends RF letter Number, RF signal is also referred to as electromagnetic signal, and RF circuit 605 converts electrical signals to electromagnetic signal or electromagnetic signal is converted to telecommunications Number, and communicated by the electromagnetic signal with communication network and other equipment.RF circuit 605 may include for executing The known circuit of these functions comprising but it is not limited to antenna system, RF transceiver, one or more amplifiers, tuner, one A or multiple oscillators, digital signal processor, CODEC (COder-DECoder, coder) chipset, user identifier mould Block (Subscriber Identity Module, SIM) etc..
Voicefrequency circuit 606 is mainly used for receiving audio data from Peripheral Interface 603, which is converted to telecommunications Number, and the electric signal is sent to loudspeaker 611.
Loudspeaker 611 is reduced to sound for mobile phone to be passed through RF circuit 605 from the received voice signal of wireless network And the sound is played to user.
Power management chip 608, the hardware for being connected by CPU602, I/O subsystem and Peripheral Interface are powered And power management.
Image white balance processing equipment, storage medium and the mobile terminal provided in above-described embodiment can be performed the application and appoint Image white balancing treatment method provided by embodiment of anticipating has and executes the corresponding functional module of this method and beneficial effect.Not The technical detail of detailed description in the above-described embodiments, reference can be made to image white balance provided by the application any embodiment is handled Method.
Note that above are only the preferred embodiment and institute's application technology principle of the application.It will be appreciated by those skilled in the art that The application is not limited to specific embodiment described here, be able to carry out for a person skilled in the art it is various it is apparent variation, The protection scope readjusted and substituted without departing from the application.Therefore, although being carried out by above embodiments to the application It is described in further detail, but the application is not limited only to above embodiments, in the case where not departing from the application design, also It may include more other equivalent embodiments, and scope of the present application is determined by the scope of the appended claims.

Claims (10)

1. a kind of image white balancing treatment method characterized by comprising
Obtain original image to be processed;
The original image is input to white balance coefficients matrix trained in advance to determine in model or white balance processing model;
Determine that model or the white balance handle the output of model as a result, the determining and original according to the white balance coefficients matrix The corresponding target image of beginning image.
2. the method according to claim 1, wherein determining the output of model according to the white balance coefficients matrix As a result, determining target image corresponding with the original image, comprising:
The output of model is determined according to the white balance coefficients matrix as a result, determining white balance corresponding with original image system Matrix number;
According to the original image and the white balance coefficients matrix, target image corresponding with the original image is determined.
3. according to the method described in claim 2, it is characterized in that, according to the original image and the white balance coefficients square Battle array determines target image corresponding with the original image, comprising:
Obtain the first RGB component value of each pixel in the original image;
For all pixels point in the original image, by the first RGB component value of each pixel and the white balance coefficients The product of the white balance coefficients of corresponding position in matrix, the pixel as target image corresponding with pixel described in original image Second RGB component value of point.
4. according to the method described in claim 2, it is characterized in that, before obtaining original image to be processed, further includes:
It obtains white balance coefficients matrix and determines model;
Wherein, the white balance coefficients matrix determines that model is obtained by such as under type:
First sample original image of the standard color card under different-colour is acquired by camera;Wherein, the standard color card is White colour atla;
White balance processing is carried out to the first sample original image, is obtained and the first sample original image corresponding first Sample object image;
According to the first sample original image and the first sample target image, determine the first sample original image Variation is the corresponding sample white balance coefficients matrix of the first sample target image;
The first sample original image is marked according to the sample white balance coefficients matrix, obtains the first training sample Collection;
The first default machine learning model is trained using first training sample set, it is true to obtain white balance coefficients matrix Cover half type.
5. according to the method described in claim 4, it is characterized in that, according to the first sample original image and first sample This target image is determined to change the first sample original image and be put down for the corresponding sample of the first sample target image is white Weigh coefficient matrix, comprising:
Obtain the third RGB component value of each pixel and the first sample target image in the first sample original image In each pixel the 4th RGB component value;
For all pixels point, by the ratio of each pixel corresponding 4th RGB component value and third RGB component value, as The corresponding white balance coefficients of pixel described in sample white balance coefficients matrix.
6. the method according to claim 1, wherein handling the output of model as a result, really according to the white balance Fixed target image corresponding with the original image, comprising:
Determine the output image of the white balance processing model;
Using the output image as target image corresponding with the original image.
7. according to the method described in claim 6, it is characterized in that, before obtaining original image to be processed, further includes:
Obtain the white balance processing model;
Wherein, the white balance processing model is obtained by such as under type:
Second sample original image of the standard color card under different-colour is acquired by camera;
White balance processing is carried out to the second sample original image, is obtained and the second sample original image corresponding second Sample object image;
Using the second sample original image and the second sample object image as the second training sample set;
The second default machine learning model is trained using second training sample set, obtains white balance processing model.
8. a kind of image white balance processing equipment characterized by comprising
Original image obtains module, for obtaining original image to be processed;
Original image input module determines model for the original image to be input to white balance coefficients matrix trained in advance Or in white balance processing model;
Target image determining module, for determining that model or the white balance handle model according to the white balance coefficients matrix Output is as a result, determine target image corresponding with the original image.
9. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor The image white balancing treatment method as described in any in claim 1-7 is realized when row.
10. a kind of mobile terminal, which is characterized in that including memory, processor and storage are on a memory and can be in processor The computer program of operation, the processor realize figure as claimed in claim 1 when executing the computer program As white balancing treatment method.
CN201811379008.8A 2018-11-19 2018-11-19 Image white balancing treatment method, device, storage medium and mobile terminal Pending CN109348206A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811379008.8A CN109348206A (en) 2018-11-19 2018-11-19 Image white balancing treatment method, device, storage medium and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811379008.8A CN109348206A (en) 2018-11-19 2018-11-19 Image white balancing treatment method, device, storage medium and mobile terminal

Publications (1)

Publication Number Publication Date
CN109348206A true CN109348206A (en) 2019-02-15

Family

ID=65316467

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811379008.8A Pending CN109348206A (en) 2018-11-19 2018-11-19 Image white balancing treatment method, device, storage medium and mobile terminal

Country Status (1)

Country Link
CN (1) CN109348206A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110267024A (en) * 2019-07-26 2019-09-20 惠州视维新技术有限公司 Adjust the method, apparatus and computer readable storage medium of TV white balance value
CN110647930A (en) * 2019-09-20 2020-01-03 北京达佳互联信息技术有限公司 Image processing method and device and electronic equipment
US20210160470A1 (en) 2019-11-22 2021-05-27 Samsung Electronics Co., Ltd. Apparatus and method for white balance editing
CN113891055A (en) * 2020-07-03 2022-01-04 华为技术有限公司 Image processing method, image processing apparatus, and computer-readable storage medium
WO2022257713A1 (en) * 2021-06-07 2022-12-15 荣耀终端有限公司 Ai automatic white balance algorithm and electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179663A (en) * 2006-11-07 2008-05-14 明基电通股份有限公司 Picture-taking method and system and machine readable medium
CN106412547A (en) * 2016-08-29 2017-02-15 厦门美图之家科技有限公司 Image white balance method and device based on convolutional neural network, and computing device
CN107578390A (en) * 2017-09-14 2018-01-12 长沙全度影像科技有限公司 A kind of method and device that image white balance correction is carried out using neutral net
CN108133462A (en) * 2017-12-08 2018-06-08 泉州装备制造研究所 A kind of restored method of the single image based on gradient fields region segmentation
CN108712639A (en) * 2018-05-29 2018-10-26 凌云光技术集团有限责任公司 Image color correction method, apparatus and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179663A (en) * 2006-11-07 2008-05-14 明基电通股份有限公司 Picture-taking method and system and machine readable medium
CN106412547A (en) * 2016-08-29 2017-02-15 厦门美图之家科技有限公司 Image white balance method and device based on convolutional neural network, and computing device
CN107578390A (en) * 2017-09-14 2018-01-12 长沙全度影像科技有限公司 A kind of method and device that image white balance correction is carried out using neutral net
CN108133462A (en) * 2017-12-08 2018-06-08 泉州装备制造研究所 A kind of restored method of the single image based on gradient fields region segmentation
CN108712639A (en) * 2018-05-29 2018-10-26 凌云光技术集团有限责任公司 Image color correction method, apparatus and system

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110267024A (en) * 2019-07-26 2019-09-20 惠州视维新技术有限公司 Adjust the method, apparatus and computer readable storage medium of TV white balance value
CN110647930A (en) * 2019-09-20 2020-01-03 北京达佳互联信息技术有限公司 Image processing method and device and electronic equipment
US20210160470A1 (en) 2019-11-22 2021-05-27 Samsung Electronics Co., Ltd. Apparatus and method for white balance editing
CN114930811A (en) * 2019-11-22 2022-08-19 三星电子株式会社 Method and apparatus for deep white balance editing
EP4054185A4 (en) * 2019-11-22 2023-04-12 Samsung Electronics Co., Ltd. Method and apparatus for deep white-balancing editing
EP4207755A1 (en) * 2019-11-22 2023-07-05 Samsung Electronics Co., Ltd. Method and apparatus for deep learning based white-balancing editing
US11849264B2 (en) 2019-11-22 2023-12-19 Samsung Electronics Co., Ltd. Apparatus and method for white balance editing
CN114930811B (en) * 2019-11-22 2024-08-13 三星电子株式会社 Method and device for deep white balance editing
CN113891055A (en) * 2020-07-03 2022-01-04 华为技术有限公司 Image processing method, image processing apparatus, and computer-readable storage medium
WO2022257713A1 (en) * 2021-06-07 2022-12-15 荣耀终端有限公司 Ai automatic white balance algorithm and electronic device
CN115514947A (en) * 2021-06-07 2022-12-23 荣耀终端有限公司 AI automatic white balance algorithm and electronic equipment
CN115514947B (en) * 2021-06-07 2023-07-21 荣耀终端有限公司 Algorithm for automatic white balance of AI (automatic input/output) and electronic equipment

Similar Documents

Publication Publication Date Title
CN109523485A (en) Image color correction method, device, storage medium and mobile terminal
CN109348206A (en) Image white balancing treatment method, device, storage medium and mobile terminal
CN106469302B (en) A kind of face skin quality detection method based on artificial neural network
CN108307125B (en) Image acquisition method, device and storage medium
WO2020224479A1 (en) Method and apparatus for acquiring positions of target, and computer device and storage medium
CN109547701A (en) Image capturing method, device, storage medium and electronic equipment
CN108566516A (en) Image processing method, device, storage medium and mobile terminal
CN109741279A (en) Image saturation method of adjustment, device, storage medium and terminal
CN109685746A (en) Brightness of image method of adjustment, device, storage medium and terminal
CN109167931A (en) Image processing method, device, storage medium and mobile terminal
CN113132704B (en) Image processing method, device, terminal and storage medium
CN109327691B (en) Image shooting method and device, storage medium and mobile terminal
CN109639896A (en) Block object detecting method, device, storage medium and mobile terminal
CN109120863A (en) Image pickup method, device, storage medium and mobile terminal
CN109086742A (en) scene recognition method, scene recognition device and mobile terminal
CN108881875B (en) Image white balance processing method and device, storage medium and terminal
CN112840636A (en) Image processing method and device
CN109101931A (en) A kind of scene recognition method, scene Recognition device and terminal device
CN108494996A (en) Image processing method, device, storage medium and mobile terminal
CN113887599A (en) Screen light detection model training method, and ambient light detection method and device
CN108765380A (en) Image processing method, device, storage medium and mobile terminal
CN109120864B (en) Light supplement processing method and device, storage medium and mobile terminal
CN108683845B (en) Image processing method, device, storage medium and mobile terminal
CN109040729B (en) Image white balance correction method and device, storage medium and terminal
CN109561291A (en) Color temperature compensating method, device, storage medium and mobile terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190215

RJ01 Rejection of invention patent application after publication