CN107948619B - Image processing method, device, computer readable storage medium and mobile terminal - Google Patents

Image processing method, device, computer readable storage medium and mobile terminal Download PDF

Info

Publication number
CN107948619B
CN107948619B CN201711332693.4A CN201711332693A CN107948619B CN 107948619 B CN107948619 B CN 107948619B CN 201711332693 A CN201711332693 A CN 201711332693A CN 107948619 B CN107948619 B CN 107948619B
Authority
CN
China
Prior art keywords
color
value
white balance
image
light source
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.)
Active
Application number
CN201711332693.4A
Other languages
Chinese (zh)
Other versions
CN107948619A (en
Inventor
张弓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711332693.4A priority Critical patent/CN107948619B/en
Publication of CN107948619A publication Critical patent/CN107948619A/en
Application granted granted Critical
Publication of CN107948619B publication Critical patent/CN107948619B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/10Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/57Mechanical or electrical details of cameras or camera modules specially adapted for being embedded in other devices
    • 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

This application involves a kind of image processing method, device, computer readable storage medium and mobile terminals.The above method includes: that camera rotation predetermined angle shooting is obtained the first image;The first image is the image for shooting mobile terminal rear shell and obtaining;It identifies rear shell region in the first image, obtains first color in the rear shell region;Preset second color is obtained, second color is color of the mobile terminal rear shell under default light source;Obtain the value of chromatism of first color and the second color, the corresponding first color temperature value value of the default light source;The second color temperature value is obtained according to the first color temperature value value and the value of chromatism, obtains the first white balance gains value corresponding with second color temperature value.The above method, the method for obtaining the color temperature value of environment light source is simple and fast, and the color temperature value of the environment light source obtained is accurate, and the white balance gains value obtained according to the color temperature value of environment light source is also more acurrate.

Description

Image processing method, device, computer readable storage medium and mobile terminal
Technical field
This application involves field of computer technology, more particularly to a kind of image processing method, device, computer-readable deposit Storage media and mobile terminal.
Background technique
With the rapid development of intelligent mobile terminal, the technique for taking of intelligent computer is more and more complete.Shooting is obtained Image, intelligent mobile terminal can carry out a variety of image processing operations.For example, the white balance processing of image, U.S. face are handled etc.. Wherein, it is color in adjustment image to the white balance processing of image, image is enabled accurately to reflect the color of subject Color situation.
Summary of the invention
The embodiment of the present application provides a kind of image processing method, device, computer readable storage medium and mobile terminal, can To carry out white balance processing to image.
A kind of image processing method, comprising:
Camera rotation predetermined angle shooting is obtained into the first image;The first image is that shooting mobile terminal rear shell obtains The image taken;
It identifies rear shell region in the first image, obtains first color in the rear shell region;
Preset second color is obtained, second color is color of the mobile terminal rear shell under default light source;
Obtain the value of chromatism of first color and the second color, the corresponding first color temperature value value of the default light source;
The second color temperature value is obtained according to the first color temperature value value and the value of chromatism, is obtained and second color temperature value pair The the first white balance gains value answered.
A kind of image processing apparatus, comprising:
Shooting module, for camera rotation predetermined angle shooting to be obtained the first image;The first image is shooting The image that mobile terminal rear shell obtains;
Identification module, rear shell region in the first image, obtains first color in the rear shell region for identification;
First obtains module, and for obtaining preset second color, second color is that the mobile terminal rear shell exists Color under default light source;Obtain the value of chromatism of first color and the second color, corresponding first color of the default light source Temperature value value;
Second obtains module, for obtaining the second color temperature value according to the first color temperature value value and the value of chromatism, obtains The first white balance gains value corresponding with second color temperature value.
A kind of computer readable storage medium, is stored thereon with computer program, and the computer program is held by processor Method as described above is realized when row.
A kind of mobile terminal, including memory and processor store computer-readable instruction in the memory, described When instruction is executed by the processor, so that the processor executes method as described above.
In the embodiment of the present application, the method for obtaining the color temperature value of environment light source is simple and fast, and the environment light source obtained Color temperature value is accurate, and the white balance gains value obtained according to the color temperature value of environment light source is also more acurrate, is conducive to according to above-mentioned white flat The yield value that weighs carries out white balance processing to the image that shooting obtains.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of application for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is the schematic diagram of a scenario of image processing method in one embodiment;
Fig. 2 is the flow chart of image processing method in one embodiment;
Fig. 3 is the flow chart of image processing method in another embodiment;
Fig. 4 is the structural block diagram of image processing apparatus in one embodiment;
Fig. 5 is the structural block diagram of image processing apparatus in another embodiment;
Fig. 6 is the schematic diagram of image processing circuit in one embodiment.
Specific embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the objects, technical solutions and advantages of the application are more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only used to explain the application, and It is not used in restriction the application.
In traditional technology, white balance processing is carried out using white point method to the image that shooting obtains.Using white point method to image It carries out needing to identify white point region in image when white balance processing, COLOR COMPOSITION THROUGH DISTRIBUTION in white point region is counted, according to above-mentioned white point area COLOR COMPOSITION THROUGH DISTRIBUTION determines color temperature value in domain, and white balance gains value is determined further according to color temperature value.When there is no can be used as base in image When the white point region of standard, the effect for carrying out white balance processing to image using white point method is poor.
As shown in Figure 1, rotating camera 102 is had in mobile terminal 10, when mobile terminal 10 starts shooting class application journey When sequence, in mobile terminal 10 after rotating camera rotation predetermined angle, mobile terminal rear shell 104 can be shot and obtain the first image 20.It include mobile terminal rear shell 104 in first image 20, mobile terminal 10 can recognize the color of mobile terminal rear shell 104, above-mentioned The color of mobile terminal rear shell 104 is color of the mobile terminal rear shell 104 under environment light source.It is prestored in mobile terminal 10 Color of the mobile terminal rear shell 104 under standard sources, mobile terminal 10 can be by above-mentioned mobile terminal rear shells 104 in environment light source Under color compared with color of the mobile terminal rear shell 104 under standard sources, obtain the color temperature value of above-mentioned environment light source, into And corresponding white balance gains value is obtained according to the color temperature value of above-mentioned environment light source.
Fig. 2 is the flow chart of image processing method in one embodiment.As shown in Fig. 2, a kind of image processing method, packet It includes:
Step 202, camera rotation predetermined angle shooting is obtained into the first image.First image is after shooting mobile terminal The image that shell obtains.
When mobile terminal starts shooting class application program, camera can be rotated predetermined angle by mobile terminal, make to move Terminal camera can take mobile terminal rear shell, then shoot and obtain the first image, then above-mentioned first image is that shooting is mobile eventually The image for holding rear shell to obtain.Above-mentioned predetermined angle can be the angle of mobile terminal setting, can also be angle set by user, such as 30 °, 60 ° etc..In one embodiment, the angle of mobile terminal Non-precondition rotation, mobile terminal rotate according to user instructions Corresponding angle, then shoot and obtain the first image.
Step 204, it identifies rear shell region in the first image, obtains first color in rear shell region.
Mobile terminal can recognize rear shell region in above-mentioned first image after shooting obtains the first image.In mobile terminal It is preset with characteristic point in mobile terminal rear shell color and/or mobile terminal rear shell, above-mentioned mobile terminal rear shell characteristic point can include: Character in rear shell, lines etc. in rear shell.Mobile terminal can by the heterochromia of mobile terminal rear shell color and backcolor come Identify rear shell region in the first image.Mobile terminal also can recognize image in rear shell characteristic point, according to above-mentioned rear shell characteristic point come Determine rear shell region in the first image.The pixel position in rear shell region in the corresponding image of predetermined angle can be also prestored in mobile terminal It sets, rear shell region in the first image is determined according to the location of pixels in the rear shell region prestored.The rear shell area in identifying the first image Behind domain, mobile terminal can obtain first color in above-mentioned rear shell region.Above-mentioned first color is mobile terminal rear shell in environment Color under light source.
Step 206, preset second color is obtained, the second color is color of the mobile terminal rear shell under default light source.
In getting the first image after first color in rear shell region, mobile terminal can obtain preset second color, Above-mentioned second color is color of the mobile terminal rear shell under default light source.For example, color of the mobile terminal rear shell under white light It is color.
Step 208, the value of chromatism of the first color and the second color is obtained, the corresponding first color temperature value value of light source is preset.
Above-mentioned first color is color of the mobile terminal rear shell under environment light source, and the second color is that mobile terminal rear shell exists Color under default light source.Since the color of mobile terminal rear shell itself is fixed value, the then color of the first color and the second color Difference can indicate difference value of the mobile terminal rear shell under the light source of different color, may also indicate that environment light source and default light source Difference value.Above-mentioned value of chromatism is used to indicate the difference between two kinds of colors.In different color spaces, computer equipment is calculated The method of value of chromatism is different.For example, value of chromatism can be in Lab (brightness, color) color space
Mobile terminal can obtain the color temperature value of default light source after the value of chromatism for getting the first color and the second color, That is the first color temperature value value.Colour temperature is the measurement unit indicated in light comprising colour component, and color temperature value can be used for indicating light source Color, above-mentioned first color temperature value value are the color of default light source.
Step 210, the second color temperature value is obtained according to the first color temperature value value and value of chromatism, obtained corresponding with the second color temperature value First white balance gains value.
In one embodiment, obtaining the second color temperature value according to the first color temperature value value and value of chromatism includes:
(1) according to preset color default light source color corresponding with the first color temperature value value of the corresponding relationship of colour temperature lookup.
(2) environment light source color is obtained according to default light source color and value of chromatism.
(3) according to color the second color temperature value corresponding with the corresponding relationship of colour temperature lookup environment light source color.
The corresponding relationship that colored and colour temperature are prestored in mobile terminal, when acquisition for mobile terminal to default light source corresponding It, can be according to above-mentioned color color corresponding with the corresponding relationship of colour temperature the first color temperature value of lookup, i.e., default light source after temperature value of the same colour Corresponding color.After the color for getting default light source, mobile terminal can determine that environment light source is corresponding according to above-mentioned value of chromatism Color, further according to the corresponding colour temperature of the color prestored Relation acquisition environment light source corresponding with colour temperature, i.e. the second color temperature value.
The corresponding relationship of colour temperature Yu white balance gains value is prestored in mobile terminal, mobile terminal is obtaining the second color temperature value Afterwards, then the corresponding white balance gains value of the second color temperature value, the i.e. corresponding white balance gains value of environment light source can be searched.For example, moving Colour temperature and the homologous thread of R/G, the homologous thread of colour temperature and B/G are prestored in dynamic terminal, mobile terminal is getting the second color After temperature value, the value of the corresponding B/G of above-mentioned second color temperature value and the value of the corresponding R/G of the second color temperature value can be searched, above-mentioned R/G is indicated The yield value in the channel R, B/G indicate the yield value of channel B.By the channel R of pixel each in image multiplies the value of R/G, channel B multiplies The value of B/G has carried out white balance processing to image.
Method in the embodiment of the present application can first shoot mobile terminal rear shell in ring when mobile terminal starts photographing program Image under the light source of border, by mobile terminal rear shell, color and mobile terminal the rear shell color under default light source are carried out under environment light source It compares, obtains the color temperature value of environment light source, and then white balance gains value is obtained according to the color temperature value of environment light source.The above method, The method for obtaining the color temperature value of environment light source is simple and fast, and the color temperature value of the environment light source of acquisition is accurate, according to environment light source Color temperature value obtain white balance gains value it is also more acurrate, be conducive to according to above-mentioned white balance gains value to shooting obtain image into The processing of row white balance.
In one embodiment, after step 210, further includes:
Step 212, if receiving image taking instruction, the image to be processed of shooting is obtained.
Step 214, white balance processing is carried out to image to be processed according to the first white balance gains value.
Camera can be rotated and be playbacked after camera rotation predetermined angle shooting is obtained the first image by mobile terminal. After camera rotation playback, if mobile terminal receives image taking instruction, current scene image is shot, is obtained to be processed Image.Above-mentioned image to be processed is the image for needing to carry out white balance processing.Computer equipment is obtaining above-mentioned figure to be processed As after, the first white balance gains value corresponding with the color temperature value of environment light source, i.e. the first white balance gains value can be obtained.Computer Equipment can carry out white balance processing to image to be processed according to above-mentioned first white balance gains value.
Above-mentioned first white balance gains value is the corresponding white balance gains value of color temperature value of environment light source, above-mentioned environment light source Color temperature value be according in the mobile terminal rear shell color under environment light source and the mobile terminal rear shell color under default light source It obtains.
Method in the embodiment of the present application carries out image according to the corresponding white balance gains value of the color temperature value of environment light source white The white balance gains value of Balance Treatment, acquisition is more acurrate, more preferable to the white balance treatment effect of image.The above method is not necessarily to root White balance processing is carried out to image according to white point region in image, it is more accurate to the white balance processing of no white point image.
In one embodiment, step 214 carries out white balance processing to image to be processed according to the first white balance gains value Include:
(1) exist if detecting in image to be processed with reference to color point, determine that the second white balance increases according to reference color point Benefit value.
(2) target white balance gains value is determined according to the first white balance gains value and the second white balance gains value, according to mesh It marks white balance gains value and white balance processing is carried out to image to be processed.
Exist if mobile terminal detects in image to be processed with reference to color point, also can be used white balance algorithm to figure to be processed As carrying out white balance processing.The above-mentioned color referred to reference to color with the value of chromatism of standard color within a preset range, i.e., it is close The color of standard color.Under normal conditions, above-mentioned standard color can be set to white, it is above-mentioned with reference to the as close white of color Color.In one embodiment, above-mentioned standard color can also be set to other colors, such as the colour of skin.
It is above-mentioned with reference to color point be pixel color be with reference to color pixel, if there are reference colors in image to be processed Color spot then can determine the second white balance gains value with reference to color point according to above-mentioned, then carry out white balance processing to image to be processed. Each pixel is made of multiple Color Channels in image, for example, be made of RGB (three kinds of colors of red, green, blue) triple channel or It is made of HSV (tone, saturation degree and lightness) triple channel or by CMY (green, fuchsin or magenta and yellow three kinds of colors) triple channel structure At.To the white balance algorithm of image can include: gray world algorithm, perfect reflection algorithm, white point method etc..By taking white point method as an example, The white balance of image to be processed is handled in RGB triple channel can include: by taking standard color is white as an example, in tri- color of RGB R/G=1.0, B/G=1.0, the then Color Range for approaching the reference color point of white are in the corresponding pixel of white in channel { 0.8 < R/G < 1.2,0.8 < B/G < 1.2 }, if mobile terminal detect in image to be processed pixel meet 0.8 < R/G < 1.2, 0.8 < B/G < 1.2 }, then using above-mentioned pixel as with reference to color point.It averages, can be obtained with reference to color point in image to be processed R/G_average, B/G_average are taken, i.e., the mean value of the mean value of R/G and B/G in pixel.By pixel each in image to be processed The channel R of point multiplies R/G_average, and channel B multiplies B/G_average, and the white balance processing to image to be processed can be completed.
Mobile terminal, can be white according to above-mentioned first after getting the second white balance gains value according to above-mentioned reference color point Balancing gain value and the second white balance gains value choose target white balance gains value, are treated according to above-mentioned target white balance gains value It handles image and carries out white balance processing.Wherein, mobile terminal can obtain the first white balance gains value and the second white balance gains value Mean value as target white balance gains value, mobile terminal can also obtain the first white balance gains value and the second white balance gains value Interior difference as target white balance gains value
When shot subject apart from mobile terminal farther out when, according to mobile terminal rear shell obtain environment light source color temperature value with The color temperature value of environment light source around shot subject has different.Method in the embodiment of the present application, in detecting image There are the white balances that when reference color point, can be obtained according to the above-mentioned white balance gains value obtained with reference to color point and environment colour temperature Yield value determines the white balance gains value of image jointly, is carried out at white balance according to jointly determining white balance gains value to image Reason improves the accuracy to the processing of image white balance.
In one embodiment, further includes: if getting multiple second white balance gains values according to reference color point, from more It is chosen in a second white balance gains value white flat as target with the first the smallest white balance gains value of white balance gains value difference value Weigh yield value.
Due to the diversity and complexity of environment light source, can cause in image to be processed certain pixels by erroneous detection is reference Color point (for example, it by erroneous detection is white that yellow under low color temperature, which is light blue under white, high color temperature by erroneous detection), and it is to be processed Certain pixels are that will cause with reference to color point to detect image to be processed there are multiple color temperature values by erroneous detection in image.Work as movement Terminal detects in image to be processed according to color point is referred in image there are when multiple color temperature values, can be according to above-mentioned multiple colour temperatures Value gets multiple second white balance gains values.Mobile terminal can be chosen from above-mentioned multiple second white balance gains values with it is above-mentioned The first the smallest white balance gains value of white balance gains value difference value is as target white balance gains value.I.e. when mobile terminal is according to figure It is detected in image to be processed with reference to color point there are when multiple color temperature values as in, the environment light source obtained is calculated with mobile terminal Color temperature value as benchmark, choose the immediate white balance gains of white balance gains value corresponding with the color temperature value of environment light source Value can carry out white balance processing to image to be processed according to the white balance gains value of above-mentioned selection.
Method in the embodiment of the present application has multiple color temperature values corresponding when being detected in image to be processed according to white balance algorithm White balance gains value when, choose corresponding with the color temperature value of environment light source white balance gains and be worth immediate white balance increasing Benefit value is used as target white balance gains value, and the accuracy of the white balance gains value of selection can be improved.
In one embodiment, image to be processed is carried out at white balance according to the first white balance gains value in step 214 Reason includes:
(1) if detecting, there are portraits in image to be processed, are divided into background area and portrait area for image to be processed.
(2) third white balance gains value is determined according to the colour of skin in portrait area.
(3) white balance processing is carried out to background area according to the first white balance gains value, according to third white balance gains value White balance processing is carried out to portrait area.
(4) when using computer equipment shooting portrait, that it is generally desirable to portrait areas is more pale by user.Therefore, computer Equipment can be used different white balance gains values and carry out white balance processing respectively to background area in image and portrait area.
When mobile terminal detects in image to be processed there are when portrait, above-mentioned image to be processed can be divided into portrait area Domain and background area.Wherein, mobile terminal can carry out recognition of face to image to be processed, by human face region in image to be processed and Area of skin color is identified as portrait area, using in image to be processed in addition to portrait area other regions as background area.It is mobile whole End can carry out white balance processing to background area according to the corresponding white balance gains value of the second color temperature value, i.e., according to the first white balance Yield value carries out white balance processing to background area.Mobile terminal can also according to face white balance algorithm from portrait area the colour of skin It determines third white balance gains value, white balance processing is carried out to portrait area further according to above-mentioned third white balance gains value.
Method in the embodiment of the present application.It, can portrait area and background to image when detecting in image there are when portrait Region carries out white balance processing respectively, when accurately going back the color of background area in original image, can also make one as imaging effect More preferably, the effect to the processing of image white balance is improved.
In one embodiment, mobile terminal is carrying out at white balance background area according to the first white balance gains value Reason after carrying out white balance processing to portrait area according to third white balance gains value, can carry out transition to the edge of portrait area Processing avoids portrait area and background area difference is larger causes image layered phenomenon.
In one embodiment, step 214 carries out white balance processing to image to be processed according to the first white balance gains value Include:
(1) time interval between the shooting time of image to be processed and the shooting time of the first image is obtained.
(2) if time interval is less than first threshold, white balance is carried out to image to be processed according to the first white balance gains value Processing.
The time difference between the shooting time of image to be processed and the shooting time of the first image is detected when mobile terminal In first threshold, white balance processing can be carried out to image to be processed according to environment light source corresponding first white balance gains value. For example, the shooting time of the first image is 59 minutes and 59 seconds 11 points of on December 6th, 2017, mobile terminal was 6 days 12 December in 2017 Time difference between point 06 minute 59 second beats image to be processed taken the photograph and the shooting time of the first image is 7 minutes, in first threshold In 10 minutes, then white balance processing is carried out to image to be processed according to the first white balance gains value.
Under normal conditions, in specified duration, light source variation is little in the scene of mobile terminal shooting.The embodiment of the present application Middle method can be obtained when the shooting interval for detecting image to be processed and the first image is closer according to by the first image The corresponding first white balance gains value of environment light source to image to be processed carry out white balance processing, improve to image white balance The efficiency of processing.
Fig. 4 is the structural block diagram of image processing apparatus in one embodiment.As shown in figure 4, a kind of image processing apparatus, packet It includes:
Shooting module 402, for camera rotation predetermined angle shooting to be obtained the first image.First image is that shooting moves The image that dynamic terminal rear shell obtains.
Identification module 404, rear shell region in the first image, obtains first color in rear shell region for identification.
First obtains module 406, and for obtaining preset second color, the second color is mobile terminal rear shell in default light Color under source.The value of chromatism of the first color and the second color is obtained, the corresponding first color temperature value value of light source is preset.
Second obtains module 408, for obtaining the second color temperature value according to the first color temperature value value and value of chromatism, obtains and second The corresponding first white balance gains value of color temperature value.
Fig. 5 is the structural block diagram of image processing apparatus in another embodiment.As shown in figure 5, a kind of image processing apparatus, It include: shooting module 502, the acquisition acquisition of module 506, second of identification module 504, first module 508, shooting module 510 and place Manage module 512.Wherein, shooting module 502, identification module 504, first obtain module 506, second and obtain in module 508 and Fig. 4 Corresponding functions of modules is identical.
Shooting module 510, if obtaining the image to be processed of shooting for receiving image taking instruction.
Processing module 512, for carrying out white balance processing to image to be processed according to the first white balance gains value.
In one embodiment, processing module 512 carries out white balance to image to be processed according to the first white balance gains value If processing includes: to detect in image to be processed to exist with reference to color point, the second white balance gains are determined according to reference color point Value.Target white balance gains value is determined according to the first white balance gains value and the second white balance gains value, according to target white balance Yield value carries out white balance processing to image to be processed.
In one embodiment, if processing module 512 is also used to get multiple second white balances according to reference color point Yield value.It chooses from multiple second white balance gains values and makees with the smallest white balance gains value of the first white balance gains value difference value For target white balance gains value.
In one embodiment, processing module 512 carries out white balance to image to be processed according to the first white balance gains value If processing includes: to detect that there are portraits in image to be processed, are divided into background area and portrait area for image to be processed.Root Third white balance gains value is determined according to the colour of skin in portrait area.White balance is carried out to background area according to the first white balance gains value Processing carries out white balance processing to portrait area according to third white balance gains value.
In one embodiment, processing module 512 carries out white balance to image to be processed according to the first white balance gains value Processing includes: the time interval obtained between the shooting time of image to be processed and the shooting time of the first image.If between the time Every being less than first threshold, white balance processing is carried out to image to be processed according to the first white balance gains value.
In one embodiment, second module 508 is obtained according to the first color temperature value value and value of chromatism the second color temperature value of acquisition It include: according to preset color default light source color corresponding with the first color temperature value value of the corresponding relationship of colour temperature lookup.According to pre- If light source color and value of chromatism obtain environment light source color.Environment light source color pair is searched according to color and the corresponding relationship of colour temperature The second color temperature value answered.
The division of modules is only used for for example, in other embodiments, can will scheme in above-mentioned image processing apparatus As processing unit is divided into different modules as required, to complete all or part of function of above-mentioned image processing apparatus.
The embodiment of the present application also provides a kind of computer readable storage mediums.One or more is executable comprising computer The non-volatile computer readable storage medium storing program for executing of instruction, when computer executable instructions are executed by one or more processors, So that processor executes following steps:
(1) camera rotation predetermined angle shooting is obtained into the first image.First image is that shooting mobile terminal rear shell obtains The image taken.
(2) it identifies rear shell region in the first image, obtains first color in rear shell region.
(3) preset second color is obtained, the second color is color of the mobile terminal rear shell under default light source.
(4) value of chromatism for obtaining the first color and the second color, presets the corresponding first color temperature value value of light source.
(5) the second color temperature value is obtained according to the first color temperature value value and value of chromatism, obtains corresponding with the second color temperature value first White balance gains value.
In one embodiment, it also executes: if receiving image taking instruction, obtaining the image to be processed of shooting.According to First white balance gains value carries out white balance processing to image to be processed.
In one embodiment, include: if carrying out white balance processing to image to be processed according to the first white balance gains value It detects in image to be processed and exists with reference to color point, the second white balance gains value is determined according to reference color point.According to first White balance gains value and the second white balance gains value determine target white balance gains value, treat place according to target white balance gains value It manages image and carries out white balance processing.
In one embodiment, it also executes: if getting multiple second white balance gains values according to reference color point.From more It is chosen in a second white balance gains value white flat as target with the first the smallest white balance gains value of white balance gains value difference value Weigh yield value.
In one embodiment, include: if carrying out white balance processing to image to be processed according to the first white balance gains value Detect that there are portraits in image to be processed, are divided into background area and portrait area for image to be processed.According to portrait area The middle colour of skin determines third white balance gains value.White balance processing is carried out to background area according to the first white balance gains value, according to Third white balance gains value carries out white balance processing to portrait area.
In one embodiment, carrying out white balance processing to image to be processed according to the first white balance gains value includes: to obtain Take the time interval between the shooting time of image to be processed and the shooting time of the first image.If time interval is less than the first threshold Value carries out white balance processing to image to be processed according to the first white balance gains value.
In one embodiment, obtaining the second color temperature value according to the first color temperature value value and value of chromatism includes: according to preset Color default light source color corresponding with the first color temperature value value of the corresponding relationship of colour temperature lookup.According to default light source color and color difference Value obtains environment light source color.According to color the second color temperature value corresponding with the corresponding relationship of colour temperature lookup environment light source color.
A kind of computer program product comprising instruction, when run on a computer, so that computer execution is following Step:
(1) camera rotation predetermined angle shooting is obtained into the first image.First image is that shooting mobile terminal rear shell obtains The image taken.
(2) it identifies rear shell region in the first image, obtains first color in rear shell region.
(3) preset second color is obtained, the second color is color of the mobile terminal rear shell under default light source.
(4) value of chromatism for obtaining the first color and the second color, presets the corresponding first color temperature value value of light source.
(5) the second color temperature value is obtained according to the first color temperature value value and value of chromatism, obtains corresponding with the second color temperature value first White balance gains value.
In one embodiment, it also executes: if receiving image taking instruction, obtaining the image to be processed of shooting.According to First white balance gains value carries out white balance processing to image to be processed.
In one embodiment, include: if carrying out white balance processing to image to be processed according to the first white balance gains value It detects in image to be processed and exists with reference to color point, the second white balance gains value is determined according to reference color point.According to first White balance gains value and the second white balance gains value determine target white balance gains value, treat place according to target white balance gains value It manages image and carries out white balance processing.
In one embodiment, it also executes: if getting multiple second white balance gains values according to reference color point.From more It is chosen in a second white balance gains value white flat as target with the first the smallest white balance gains value of white balance gains value difference value Weigh yield value.
In one embodiment, include: if carrying out white balance processing to image to be processed according to the first white balance gains value Detect that there are portraits in image to be processed, are divided into background area and portrait area for image to be processed.According to portrait area The middle colour of skin determines third white balance gains value.White balance processing is carried out to background area according to the first white balance gains value, according to Third white balance gains value carries out white balance processing to portrait area.
In one embodiment, carrying out white balance processing to image to be processed according to the first white balance gains value includes: to obtain Take the time interval between the shooting time of image to be processed and the shooting time of the first image.If time interval is less than the first threshold Value carries out white balance processing to image to be processed according to the first white balance gains value.
In one embodiment, obtaining the second color temperature value according to the first color temperature value value and value of chromatism includes: according to preset Color default light source color corresponding with the first color temperature value value of the corresponding relationship of colour temperature lookup.According to default light source color and color difference Value obtains environment light source color.According to color the second color temperature value corresponding with the corresponding relationship of colour temperature lookup environment light source color.
The embodiment of the present application also provides a kind of mobile terminal.It include image processing circuit in above-mentioned mobile terminal, at image Reason circuit can use hardware and or software component realization, it may include define ISP (Image Signal Processing, figure As signal processing) the various processing units of pipeline.Fig. 6 is the schematic diagram of image processing circuit in one embodiment.Such as Fig. 6 institute Show, for purposes of illustration only, only showing the various aspects of image processing techniques relevant to the embodiment of the present application.
As shown in fig. 6, image processing circuit includes ISP processor 640 and control logic device 650.Imaging device 610 captures Image data handled first by ISP processor 640, ISP processor 640 to image data analyzed with capture can be used for really The image statistics of fixed and/or imaging device 610 one or more control parameters.Imaging device 610 may include having one The camera of a or multiple lens 612 and imaging sensor 614.Imaging sensor 614 may include colour filter array (such as Bayer filter), imaging sensor 614 can obtain the luminous intensity captured with each imaging pixel of imaging sensor 614 and wavelength Information, and the one group of raw image data that can be handled by ISP processor 640 is provided.Sensor 620 (such as gyroscope) can be based on biography The parameter (such as stabilization parameter) of the image procossing of acquisition is supplied to ISP processor 640 by 620 interface type of sensor.Sensor 620 Interface can use SMIA (Standard Mobile Imaging Architecture, Standard Mobile Imager framework) interface, The combination of other serial or parallel camera interfaces or above-mentioned interface.
In addition, raw image data can also be sent to sensor 620 by imaging sensor 614, sensor 620 can be based on biography Raw image data is supplied to ISP processor 640 to 620 interface type of sensor or sensor 620 deposits raw image data It stores up in video memory 630.
ISP processor 640 handles raw image data pixel by pixel in various formats.For example, each image pixel can Bit depth with 8,10,12 or 14 bits, ISP processor 640 can carry out raw image data at one or more images Reason operation, statistical information of the collection about image data.Wherein, image processing operations can be by identical or different bit depth precision It carries out.
ISP processor 640 can also receive image data from video memory 630.For example, 620 interface of sensor will be original Image data is sent to video memory 630, and the raw image data in video memory 630 is available to ISP processor 640 It is for processing.Video memory 630 can be independent special in a part, storage equipment or electronic equipment of memory device It with memory, and may include DMA (Direct Memory Access, direct direct memory access (DMA)) feature.
When receiving from 614 interface of imaging sensor or from 620 interface of sensor or from video memory 630 When raw image data, ISP processor 640 can carry out one or more image processing operations, such as time-domain filtering.Treated schemes As data can be transmitted to video memory 630, to carry out other processing before shown.ISP processor 640 is from image Memory 630 receives processing data, and processing data are carried out with the image in original domain and in RGB and YCbCr color space Data processing.Treated that image data may be output to display 670 for ISP processor 640, so that user watches and/or by scheming Shape engine or GPU (Graphics Processing Unit, graphics processor) are further processed.In addition, ISP processor 640 Output also can be transmitted to video memory 630, and display 670 can read image data from video memory 630.At one In embodiment, video memory 630 can be configured to realize one or more frame buffers.In addition, ISP processor 640 is defeated It is can be transmitted out to encoder/decoder 660, so as to encoding/decoding image data.The image data of coding can be saved, and It is decompressed before being shown in 670 equipment of display.Encoder/decoder 660 can be realized by CPU or GPU or coprocessor.
The statistical data that ISP processor 640 determines, which can be transmitted, gives control logic device Unit 650.For example, statistical data can wrap Include the image sensings such as automatic exposure, automatic white balance, automatic focusing, flicker detection, black level compensation, 612 shadow correction of lens 614 statistical information of device.Control logic device 650 may include the processor and/or micro-control for executing one or more routines (such as firmware) Device processed, one or more routines can statistical data based on the received, determine the control parameter and ISP processor of imaging device 610 640 control parameter.For example, the control parameter of imaging device 610 may include 620 control parameter of sensor (such as gain, exposure The time of integration, stabilization parameter of control etc.), camera flash control parameter, 612 control parameter of lens (such as focus or zoom With focal length) or these parameters combination.ISP control parameter may include for automatic white balance and color adjustment (for example, in RGB During processing) 612 shadow correction parameter of gain level and color correction matrix and lens.
The following are realize image processing method with image processing techniques in Fig. 6:
(1) camera rotation predetermined angle shooting is obtained into the first image.First image is that shooting mobile terminal rear shell obtains The image taken.
(2) it identifies rear shell region in the first image, obtains first color in rear shell region.
(3) preset second color is obtained, the second color is color of the mobile terminal rear shell under default light source.
(4) value of chromatism for obtaining the first color and the second color, presets the corresponding first color temperature value value of light source.
(5) the second color temperature value is obtained according to the first color temperature value value and value of chromatism, obtains corresponding with the second color temperature value first White balance gains value.
In one embodiment, it also executes: if receiving image taking instruction, obtaining the image to be processed of shooting.According to First white balance gains value carries out white balance processing to image to be processed.
In one embodiment, include: if carrying out white balance processing to image to be processed according to the first white balance gains value It detects in image to be processed and exists with reference to color point, the second white balance gains value is determined according to reference color point.According to first White balance gains value and the second white balance gains value determine target white balance gains value, treat place according to target white balance gains value It manages image and carries out white balance processing.
In one embodiment, it also executes: if getting multiple second white balance gains values according to reference color point.From more It is chosen in a second white balance gains value white flat as target with the first the smallest white balance gains value of white balance gains value difference value Weigh yield value.
In one embodiment, include: if carrying out white balance processing to image to be processed according to the first white balance gains value Detect that there are portraits in image to be processed, are divided into background area and portrait area for image to be processed.According to portrait area The middle colour of skin determines third white balance gains value.White balance processing is carried out to background area according to the first white balance gains value, according to Third white balance gains value carries out white balance processing to portrait area.
In one embodiment, carrying out white balance processing to image to be processed according to the first white balance gains value includes: to obtain Take the time interval between the shooting time of image to be processed and the shooting time of the first image.If time interval is less than the first threshold Value carries out white balance processing to image to be processed according to the first white balance gains value.
In one embodiment, obtaining the second color temperature value according to the first color temperature value value and value of chromatism includes: according to preset Color default light source color corresponding with the first color temperature value value of the corresponding relationship of colour temperature lookup.According to default light source color and color difference Value obtains environment light source color.According to color the second color temperature value corresponding with the corresponding relationship of colour temperature lookup environment light source color.
Any reference to memory, storage, database or other media used in this application may include non-volatile And/or volatile memory.Suitable nonvolatile memory may include read-only memory (ROM), programming ROM (PROM), Electrically programmable ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include arbitrary access Memory (RAM), it is used as external cache.By way of illustration and not limitation, RAM is available in many forms, such as It is static RAM (SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM).
Above embodiments only express the several embodiments of the application, and the description thereof is more specific and detailed, but can not Therefore it is interpreted as the limitation to the application the scope of the patents.It should be pointed out that for those of ordinary skill in the art, Without departing from the concept of this application, various modifications and improvements can be made, these belong to the protection model of the application It encloses.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (9)

1. a kind of image processing method characterized by comprising
Camera rotation predetermined angle shooting is obtained into the first image;The first image is that shooting mobile terminal rear shell obtains Image;
It identifies rear shell region in the first image, obtains first color in the rear shell region;First color is movement Color of the terminal rear shell under environment light source;
Preset second color is obtained, second color is color of the mobile terminal rear shell under default light source;
Obtain the value of chromatism of first color and the second color, corresponding first color temperature value of the default light source;
The second color temperature value is obtained according to first color temperature value and the value of chromatism, obtains corresponding with second color temperature value the One white balance gains value;
If receiving image taking instruction, the image to be processed of shooting is obtained;
White balance processing is carried out to the image to be processed according to the first white balance gains value.
2. the method according to claim 1, wherein it is described according to the first white balance gains value to it is described to Processing image carries out white balance processing
Exist if detecting in the image to be processed with reference to color point, determines that the second white balance increases with reference to color point according to described Benefit value;
Target white balance gains value is determined according to the first white balance gains value and the second white balance gains value, according to institute It states target white balance gains value and white balance processing is carried out to the image to be processed.
3. according to the method described in claim 2, it is characterized by further comprising:
If getting multiple second white balance gains values with reference to color point according to described;
It chooses from the multiple second white balance gains value and increases with the smallest white balance of the first white balance gains value difference value Benefit value is used as target white balance gains value.
4. the method according to claim 1, wherein it is described according to the first white balance gains value to it is described to Processing image carries out white balance processing
If detecting, there are portraits in the image to be processed, are divided into background area and portrait area for the image to be processed Domain;
Third white balance gains value is determined according to the colour of skin in the portrait area;
White balance processing is carried out to the background area according to the first white balance gains value, is increased according to the third white balance Benefit value carries out white balance processing to the portrait area.
5. the method according to claim 1, wherein it is described according to the first white balance gains value to it is described to Processing image carries out white balance processing
Obtain the time interval between the shooting time of the image to be processed and the shooting time of the first image;
If the time interval is less than first threshold, the image to be processed is carried out according to the first white balance gains value white Balance Treatment.
6. method according to claim 1 to 4, which is characterized in that it is described according to first color temperature value and The value of chromatism obtains the second color temperature value
According to preset color default light source color corresponding with the corresponding relationship of colour temperature the first color temperature value of lookup;
Environment light source color is obtained according to the default light source color and the value of chromatism;
According to the color the second color temperature value corresponding with the corresponding relationship of colour temperature lookup environment light source color.
7. a kind of image processing apparatus characterized by comprising
Shooting module, for camera rotation predetermined angle shooting to be obtained the first image;The first image is shooting movement The image that terminal rear shell obtains;
Identification module, rear shell region in the first image, obtains first color in the rear shell region for identification;Described One color is color of the mobile terminal rear shell under environment light source;
First obtains module, and for obtaining preset second color, second color is the mobile terminal rear shell default Color under light source;Obtain the value of chromatism of first color and the second color, corresponding first color temperature value of the default light source;
Second obtains module, for obtaining the second color temperature value according to first color temperature value and the value of chromatism, obtain with it is described The corresponding first white balance gains value of second color temperature value;
Shooting module, if obtaining the image to be processed of shooting for receiving image taking instruction;
Processing module, for carrying out white balance processing to image to be processed according to the first white balance gains value.
8. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program quilt Such as method described in any one of claims 1 to 6 is realized when processor executes.
9. a kind of mobile terminal, including memory and processor, computer-readable instruction, the finger are stored in the memory When enabling by processor execution, so that the processor executes such as method described in any one of claims 1 to 6.
CN201711332693.4A 2017-12-13 2017-12-13 Image processing method, device, computer readable storage medium and mobile terminal Active CN107948619B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711332693.4A CN107948619B (en) 2017-12-13 2017-12-13 Image processing method, device, computer readable storage medium and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711332693.4A CN107948619B (en) 2017-12-13 2017-12-13 Image processing method, device, computer readable storage medium and mobile terminal

Publications (2)

Publication Number Publication Date
CN107948619A CN107948619A (en) 2018-04-20
CN107948619B true CN107948619B (en) 2019-07-16

Family

ID=61942993

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711332693.4A Active CN107948619B (en) 2017-12-13 2017-12-13 Image processing method, device, computer readable storage medium and mobile terminal

Country Status (1)

Country Link
CN (1) CN107948619B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113556525B (en) * 2020-04-23 2023-08-15 深圳市万普拉斯科技有限公司 Color temperature adjusting method, device, computer equipment and storage medium
CN112477437B (en) * 2020-11-13 2021-09-21 深圳汉弘软件技术有限公司 Color difference processing method and device, ink-jet printer and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101262617A (en) * 2007-03-02 2008-09-10 富士胶片株式会社 White balance correction apparatus and method
CN101282489A (en) * 2008-04-24 2008-10-08 北京中星微电子有限公司 Light source detection apparatus and method as well as image processing method
CN101711482A (en) * 2007-03-23 2010-05-19 摩托罗拉公司 Apparatus and method for image color correction in a portable device
CN104661003A (en) * 2015-02-04 2015-05-27 苏州佳世达电通有限公司 Electronic device and color correction method thereof
CN105278689A (en) * 2015-10-16 2016-01-27 深圳市金立通信设备有限公司 Environment light color obtaining method and terminal
CN107396079A (en) * 2017-08-31 2017-11-24 广东欧珀移动通信有限公司 White balance adjustment method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105981379B (en) * 2014-09-17 2018-09-25 深圳市大疆创新科技有限公司 Auto white balance system and method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101262617A (en) * 2007-03-02 2008-09-10 富士胶片株式会社 White balance correction apparatus and method
CN101711482A (en) * 2007-03-23 2010-05-19 摩托罗拉公司 Apparatus and method for image color correction in a portable device
CN101282489A (en) * 2008-04-24 2008-10-08 北京中星微电子有限公司 Light source detection apparatus and method as well as image processing method
CN104661003A (en) * 2015-02-04 2015-05-27 苏州佳世达电通有限公司 Electronic device and color correction method thereof
CN105278689A (en) * 2015-10-16 2016-01-27 深圳市金立通信设备有限公司 Environment light color obtaining method and terminal
CN107396079A (en) * 2017-08-31 2017-11-24 广东欧珀移动通信有限公司 White balance adjustment method and device

Also Published As

Publication number Publication date
CN107948619A (en) 2018-04-20

Similar Documents

Publication Publication Date Title
US10997696B2 (en) Image processing method, apparatus and device
CN108716983B (en) Optical element detection method and device, electronic equipment, storage medium
CN108805103A (en) Image processing method and device, electronic equipment, computer readable storage medium
CN109767467A (en) Image processing method, device, electronic equipment and computer readable storage medium
US11431915B2 (en) Image acquisition method, electronic device, and non-transitory computer readable storage medium
CN108174172B (en) Image pickup method and device, computer readable storage medium and computer equipment
CN107886484A (en) U.S. face method, apparatus, computer-readable recording medium and electronic equipment
CN110225248A (en) Image-pickup method and device, electronic equipment, computer readable storage medium
CN107948617B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN110022469A (en) Image processing method, device, storage medium and electronic equipment
CN109360254B (en) Image processing method and device, electronic equipment and computer readable storage medium
CN108063891B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN107945135A (en) Image processing method, device, storage medium and electronic equipment
CN109191403A (en) Image processing method and device, electronic equipment, computer readable storage medium
CN110536068A (en) Focusing method and device, electronic equipment, computer readable storage medium
CN109685853B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN107800971B (en) Auto-exposure control processing method, device and the equipment of pan-shot
CN108600740A (en) Optical element detection method, device, electronic equipment and storage medium
CN108322651A (en) Image pickup method and device, electronic equipment, computer readable storage medium
CN108804658A (en) Image processing method and device, storage medium, electronic equipment
CN109712177A (en) Image processing method, device, electronic equipment and computer readable storage medium
CN111277699B (en) Flash lamp color temperature calibration method and device, electronic equipment and readable storage medium
CN108616700A (en) Image processing method and device, electronic equipment, computer readable storage medium
CN110121031A (en) Image-pickup method and device, electronic equipment, computer readable storage medium
CN107920205B (en) Image processing method, device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant before: Guangdong OPPO Mobile Communications Co., Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant