CN107948619A - Image processing method, device, computer-readable recording medium and mobile terminal - Google Patents

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

Info

Publication number
CN107948619A
CN107948619A CN201711332693.4A CN201711332693A CN107948619A CN 107948619 A CN107948619 A CN 107948619A CN 201711332693 A CN201711332693 A CN 201711332693A CN 107948619 A CN107948619 A CN 107948619A
Authority
CN
China
Prior art keywords
value
color
white balance
image
balance gains
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.)
Granted
Application number
CN201711332693.4A
Other languages
Chinese (zh)
Other versions
CN107948619B (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 recording medium and mobile terminal.The above method includes:Camera rotation predetermined angle shooting is obtained into the first image;Described first image is to shoot the image that mobile terminal rear shell obtains;Identify rear shell region in described first image, obtain first color in the rear shell region;Default 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;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, obtains the method simple and fast of the color temperature value of environment light source, and the color temperature value of the environment light source obtained is accurate, also more accurate according to the white balance gains value that the color temperature value of environment light source obtains.

Description

Image processing method, device, computer-readable recording 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 technology
With developing rapidly for 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 to image is handled, U.S. face is handled etc.. Wherein, the white balance processing to image is color in adjustment image so that image can accurately reflect the color of subject Color situation.
The content of the invention
The embodiment of the present application provides a kind of image processing method, device, computer-readable recording medium and mobile terminal, can To carry out white balance processing to image.
A kind of image processing method, including:
Camera rotation predetermined angle shooting is obtained into the first image;Described first image is that shooting mobile terminal rear shell obtains The image taken;
Identify rear shell region in described first image, obtain first color in the rear shell region;
Default 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;
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, including:
Taking module, for camera rotation predetermined angle shooting to be obtained the first image;Described first image is shooting The image that mobile terminal rear shell obtains;
Identification module, for identifying rear shell region in described first image, obtains first color in the rear shell region;
First acquisition module, for obtaining default 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 acquisition 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 recording medium, is stored thereon with computer program, and the computer program is held by processor Method as described above is realized during row.
A kind of mobile terminal, including memory and processor, store computer-readable instruction in the memory, described When instruction is performed by the processor so that the processor performs method as described above.
In the embodiment of the present application, the method simple and fast of the color temperature value of environment light source is obtained, 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 accurate, 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.
Brief description of the drawings
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, below will be to embodiment or existing There is attached drawing needed in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of application, for those of ordinary skill in the art, without creative efforts, can be with Other attached drawings are obtained according to these attached 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 structure diagram of image processing apparatus in one embodiment;
Fig. 5 is the structure diagram of image processing apparatus in another embodiment;
Fig. 6 is the schematic diagram of image processing circuit in one embodiment.
Embodiment
It is with reference to the accompanying drawings and embodiments, right in order to which the object, technical solution and advantage of the application are more clearly understood The application is further elaborated.It should be appreciated that specific embodiment described herein is only to explain the application, and It is not used in restriction the application.
In conventional art, white balance processing is carried out using white point method to the image that shooting obtains.Using white point method to image Carry out needing to identify white point region in image during 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 During 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 carried in mobile terminal 10, when mobile terminal 10 starts shooting class application journey During 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.First image 20 includes mobile terminal rear shell 104, and mobile terminal 10 can recognize that 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.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 of the color with mobile terminal rear shell 104 under standard sources contrast, obtain the color temperature value of above-mentioned environment light source, into And corresponding white balance gains value is worth to according to the colour temperature 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, bag Include:
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 movement Terminal camera can photograph 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.The angle that above-mentioned predetermined angle can set for mobile terminal, or the angle of user's setting, such as 30 °, 60 ° etc..In one embodiment, the rotating angle of mobile terminal Non-precondition, mobile terminal are rotated according to user instruction Corresponding angle, then shoot and obtain the first image.
Step 204, identify rear shell region in the first image, obtain first color in rear shell region.
Mobile terminal can recognize that rear shell region in above-mentioned first image after shooting obtains the first image.In mobile terminal Characteristic point in mobile terminal rear shell color and/or mobile terminal rear shell is preset with, above-mentioned mobile terminal rear shell characteristic point may 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 that image in rear shell characteristic point, according to above-mentioned rear shell characteristic point come Determine rear shell region in the first image.Can also prestore the pixel position in rear shell region in the corresponding image of predetermined angle in mobile terminal Put, rear shell region in the first image is determined according to the location of pixels in the rear shell region to prestore.The rear shell area in the first image is identified 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, default second color is obtained, the second color is color of the mobile terminal rear shell under default light source.
After first color in rear shell region in getting the first image, mobile terminal can obtain default 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, presets the corresponding first color temperature value value of light source.
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 in itself is fixed value, then the color of the first color and the second color Difference can represent 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 represent the difference between two kinds of colors.In different color spaces, computer equipment calculates The method of value of chromatism is different.For example, in Lab (brightness, color) color space, value of chromatism can be
Mobile terminal can obtain the color temperature value of default light source after the value of chromatism of the first color and the second color is got, That is the first color temperature value value.Colour temperature is the measurement unit for representing to include colour component in light, and color temperature value can be used for representing 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 default color default light source color corresponding with the first color temperature value value of correspondence lookup of colour temperature.
(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 correspondence lookup environment light source color of colour temperature.
Prestore colored and the correspondence of colour temperature in mobile terminal, when acquisition for mobile terminal to default light source corresponding , can be according to above-mentioned color color corresponding with correspondence the first color temperature value of lookup of colour temperature, i.e., default light source after temperature value of the same colour Corresponding color.After the color of default light source is got, mobile terminal can determine that environment light source is corresponded to according to above-mentioned value of chromatism Color, further according to the corresponding colour temperature of the color to prestore Relation acquisition environment light source corresponding with colour temperature, i.e. the second color temperature value.
The correspondence of colour temperature and 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, move The homologous thread of colour temperature and the homologous thread of R/G, colour temperature and B/G is 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 represented The yield value of R passages, B/G represent the yield value of channel B.By the R passages of each pixel in image multiply 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, when mobile terminal starts photographing program, can first shoot mobile terminal rear shell in ring Border light source hypograph, by mobile terminal rear shell, the color under default light source carries out color with mobile terminal rear shell under environment light source Compare, obtain the color temperature value of environment light source, and then white balance gains value is worth to according to the colour temperature of environment light source.The above method, The method simple and fast of the color temperature value of environment light source is obtained, the color temperature value of the environment light source of acquisition is accurate, according to environment light source The white balance gains value that color temperature value obtains is also more accurate, be conducive to according to above-mentioned white balance gains value to the image that shooting obtains into The processing of row white balance.
In one embodiment, after step 210, further include:
Step 212, if receiving image taking instruction, the pending image of shooting is obtained.
Step 214, white balance processing is carried out to pending image according to the first white balance gains value.
Camera can be rotated and 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 pending Image.Above-mentioned pending image is the image for needing to carry out white balance processing.Computer equipment is obtaining above-mentioned pending figure 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 according to above-mentioned first white balance gains value to pending image.
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 to the mobile terminal rear shell color under environment light source and the mobile terminal rear shell color under default light source Obtain.
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 Balance Treatment, the white balance gains value of acquisition is more accurate, more preferable to the white balance treatment effect of image.The above method, without root White balance processing is carried out to image according to white point region in image, the white balance processing to no white-dot pattern picture is more accurate.
In one embodiment, step 214 carries out white balance processing according to the first white balance gains value to pending image Including:
(1) color point is referred to if detecting and existing in pending image, determines that the second white balance increases according to reference to 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 Mark white balance gains value and white balance processing is carried out to pending image.
If mobile terminal, which detects to exist in pending image, refers to color point, white balance algorithm is also can use to pending figure 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 arranged to white, it is above-mentioned with reference to the as close white of color Color.In one embodiment, above-mentioned standard color can be also arranged 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 color in pending image Color spot, then can determine the second white balance gains value according to above-mentioned with reference to color point, then carry out white balance processing to pending image. 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 (blue or green, fuchsin or magenta and yellow three kinds of colors) triple channel structure Into.The white balance algorithm of image may include:Gray world algorithm, perfect reflection algorithm, white point method etc..By taking white point method as an example, White balance processing to pending image in RGB triple channels may include:By taking standard color is white as an example, in tri- colors 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 passage {0.8<R/G<1.2,0.8<B/G<1.2 }, if mobile terminal detects that pixel meets { 0.8 in pending image<R/G<1.2 0.8<B/G<1.2 }, then using above-mentioned pixel as referring to color point.To averaging in pending image with reference to color point, can obtain R/G_average, B/G_average are taken, i.e., the average of R/G and the average of B/G in pixel.By each pixel in pending image The R passages of point multiply R/G_average, and channel B multiplies B/G_average, you can complete to handle the white balance of pending image.
Mobile terminal, can be white according to above-mentioned first after the second white balance gains value is got 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 Handle image and carry out white balance processing.Wherein, mobile terminal can obtain the first white balance gains value and the second white balance gains value Average can also obtain the first white balance gains value and the second white balance gains value as target white balance gains value, mobile terminal 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 image is detected , can be according to the above-mentioned white balance gains value obtained with reference to color point and the white balance of environment colour temperature acquisition during in the presence of with reference to color point Yield value determines the white balance gains value of image jointly, and image is carried out at white balance according to jointly definite white balance gains value Reason, improves the accuracy to the processing of image white balance.
In one embodiment, further include:If according to getting multiple second white balance gains values with reference to color point, from more Choose in a second white balance gains value and put down in vain as target with the white balance gains value of the first white balance gains value difference value minimum Weigh yield value.
Due to the diversity and complexity of environment light source, it by flase drop is reference that can cause in pending image some pixels Color point (for example, yellow under low colour temperature is that light blue under white, high color temperature by flase drop is white by flase drop), and it is pending Some pixels are that can cause to detect pending image that there are multiple color temperature values with reference to color point by flase drop in image.Work as movement Terminal detected in pending image there are during multiple color temperature values according in image with reference to color point, 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 white balance gains value of first white balance gains value difference value minimum is as target white balance gains value.I.e. when mobile terminal is according to figure Detected as in reference to color point in pending image there are during multiple color temperature values, 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 according to the white balance gains value of above-mentioned selection to pending image.
Method in the embodiment of the present application, has multiple color temperature values to correspond to when being detected according to white balance algorithm in pending image 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, can improve the accuracy of the white balance gains value of selection.
In one embodiment, pending image is carried out at white balance according to the first white balance gains value in step 214 Reason includes:
(1) if detecting in pending image there are portrait, pending image is divided into background area and portrait area.
(2) the 3rd 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 the 3rd white balance gains value White balance processing is carried out to portrait area.
(4) when using computer equipment shooting portrait, it is more pale that user it is generally desirable to portrait area.Therefore, computer Equipment can carry out white balance processing respectively using different white balance gains values to background area in image and portrait area.
When mobile terminal is detected in pending image there are during portrait, above-mentioned pending image can be divided into portrait area Domain and background area.Wherein, mobile terminal can carry out recognition of face to pending image, by human face region in pending image and Area of skin color is identified as portrait area, using in pending image in addition to portrait area other regions as background area.It is mobile whole End can carry out white balance processing according to the corresponding white balance gains value of the second color temperature value to background area, 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 To determine the 3rd white balance gains value, white balance processing is carried out to portrait area further according to above-mentioned 3rd white balance gains value.
Method in the embodiment of the present application., can be to the portrait area and background of image when detecting in image there are during 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 being carried 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 the 3rd 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 according to the first white balance gains value to pending image Including:
(1) time interval between the shooting time of pending image 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 pending image according to the first white balance gains value Processing.
The time difference between the shooting time of pending image and the shooting time of the first image is detected when mobile terminal In first threshold, white balance processing can be carried out to pending image according to the corresponding first white balance gains value of environment light source. For example, the shooting time of the first image is 59 seconds December 6 day 11 point 59 minute in 2017, mobile terminal was 6 days 12 December in 2017 Time difference between pending image and the shooting time of the first image that 06 minute 59 second beats of point are taken the photograph is 7 minutes, in first threshold In 10 minutes, then white balance processing is carried out to pending image according to the first white balance gains value.
Under normal conditions, specifying in duration, light source change is little in the scene of mobile terminal shooting.The embodiment of the present application Middle method, can be according to by the first image acquisition when the shooting time interval for detecting pending image and the first image is nearer The corresponding first white balance gains value of environment light source to pending image carry out white balance processing, improve to image white balance The efficiency of processing.
Fig. 4 is the structure diagram of image processing apparatus in one embodiment.As shown in figure 4, a kind of image processing apparatus, bag Include:
Taking 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, for identifying rear shell region in the first image, obtains first color in rear shell region.
First acquisition module 406, for obtaining default 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, presets the corresponding first color temperature value value of light source.
Second acquisition 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 structure diagram of image processing apparatus in another embodiment.As shown in figure 5, a kind of image processing apparatus, Including:Taking module 502, identification module 504, the first acquisition module 506, the second acquisition module 508, taking module 510 and place Manage module 512.Wherein, in taking module 502, identification module 504, the first acquisition module 506, second acquisition module 508 and Fig. 4 Corresponding functions of modules is identical.
Taking module 510, if for receiving image taking instruction, obtains the pending image of shooting.
Processing module 512, for carrying out white balance processing to pending image according to the first white balance gains value.
In one embodiment, processing module 512 carries out white balance according to the first white balance gains value to pending image Processing includes:Color point is referred to if detecting and existing in pending image, the second white balance gains are determined according to reference to 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 pending image.
In one embodiment, if processing module 512 is additionally operable to get multiple second white balances according to reference to color point Yield value.Choose from multiple second white balance gains values and make with the white balance gains value of the first white balance gains value difference value minimum For target white balance gains value.
In one embodiment, processing module 512 carries out white balance according to the first white balance gains value to pending image Processing includes:If detecting in pending image there are portrait, pending image is divided into background area and portrait area.Root The 3rd 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, white balance processing is carried out according to the 3rd white balance gains value to portrait area.
In one embodiment, processing module 512 carries out white balance according to the first white balance gains value to pending image Processing includes:Obtain the time interval between the shooting time of pending image and the shooting time of the first image.If between the time Every less than first threshold, white balance processing is carried out to pending image according to the first white balance gains value.
In one embodiment, the second acquisition module 508 obtains the second color temperature value according to the first color temperature value value and value of chromatism Including:According to default color default light source color corresponding with the first color temperature value value of correspondence lookup of colour temperature.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 correspondence of colour temperature The second color temperature value answered.
The division of modules is only used for for example, in other embodiments, will can 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 additionally provides a kind of computer-readable recording medium.One or more can perform 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 performs 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) identify rear shell region in the first image, obtain first color in rear shell region.
(3) default second color is obtained, the second color is color of the mobile terminal rear shell under default light source.
(4) value of chromatism of the first color and the second color is obtained, 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, also perform:If receiving image taking instruction, the pending image of shooting is obtained.According to First white balance gains value carries out white balance processing to pending image.
In one embodiment, carrying out white balance processing to pending image according to the first white balance gains value includes:If Detect to exist in pending image and refer to color point, the second white balance gains value is determined according to reference to color point.According to first White balance gains value and the second white balance gains value determine target white balance gains value, and place is treated according to target white balance gains value Manage image and carry out white balance processing.
In one embodiment, also perform:If get multiple second white balance gains values according to reference to color point.From more Choose in a second white balance gains value and put down in vain as target with the white balance gains value of the first white balance gains value difference value minimum Weigh yield value.
In one embodiment, carrying out white balance processing to pending image according to the first white balance gains value includes:If Detect in pending image there are portrait, pending image is divided into background area and portrait area.According to portrait area The middle colour of skin determines the 3rd white balance gains value.White balance processing is carried out to background area according to the first white balance gains value, according to 3rd white balance gains value carries out white balance processing to portrait area.
In one embodiment, carrying out white balance processing to pending image according to the first white balance gains value includes:Obtain Take the time interval between the shooting time of pending image and the shooting time of the first image.If time interval is less than the first threshold Value, white balance processing is carried out according to the first white balance gains value to pending image.
In one embodiment, obtaining the second color temperature value according to the first color temperature value value and value of chromatism includes:According to default Color default light source color corresponding with the first color temperature value value of correspondence lookup of colour temperature.According to default light source color and aberration Value obtains environment light source color.According to color the second color temperature value corresponding with the correspondence lookup environment light source color of colour temperature.
A kind of computer program product for including instruction, when run on a computer so that computer performs 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) identify rear shell region in the first image, obtain first color in rear shell region.
(3) default second color is obtained, the second color is color of the mobile terminal rear shell under default light source.
(4) value of chromatism of the first color and the second color is obtained, 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, also perform:If receiving image taking instruction, the pending image of shooting is obtained.According to First white balance gains value carries out white balance processing to pending image.
In one embodiment, carrying out white balance processing to pending image according to the first white balance gains value includes:If Detect to exist in pending image and refer to color point, the second white balance gains value is determined according to reference to color point.According to first White balance gains value and the second white balance gains value determine target white balance gains value, and place is treated according to target white balance gains value Manage image and carry out white balance processing.
In one embodiment, also perform:If get multiple second white balance gains values according to reference to color point.From more Choose in a second white balance gains value and put down in vain as target with the white balance gains value of the first white balance gains value difference value minimum Weigh yield value.
In one embodiment, carrying out white balance processing to pending image according to the first white balance gains value includes:If Detect in pending image there are portrait, pending image is divided into background area and portrait area.According to portrait area The middle colour of skin determines the 3rd white balance gains value.White balance processing is carried out to background area according to the first white balance gains value, according to 3rd white balance gains value carries out white balance processing to portrait area.
In one embodiment, carrying out white balance processing to pending image according to the first white balance gains value includes:Obtain Take the time interval between the shooting time of pending image and the shooting time of the first image.If time interval is less than the first threshold Value, white balance processing is carried out according to the first white balance gains value to pending image.
In one embodiment, obtaining the second color temperature value according to the first color temperature value value and value of chromatism includes:According to default Color default light source color corresponding with the first color temperature value value of correspondence lookup of colour temperature.According to default light source color and aberration Value obtains environment light source color.According to color the second color temperature value corresponding with the correspondence lookup environment light source color of colour temperature.
The embodiment of the present application also provides a kind of mobile terminal.Above-mentioned mobile terminal includes image processing circuit, at image Managing circuit can utilize hardware and or software component to realize, 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 institutes Show, for purposes of illustration only, only showing the various aspects with the relevant image processing techniques of the embodiment of the present application.
As shown in fig. 6, image processing circuit includes ISP processors 640 and control logic device 650.Imaging device 610 is caught View data handled first by ISP processors 640, ISP processors 640 view data is analyzed with catch can be used for it is true The image statistics of fixed and/or imaging device 610 one or more control parameters.Imaging device 610 may include there is one The camera of a or multiple lens 612 and imaging sensor 614.Imaging sensor 614 may include colour filter array (such as Bayer filters), imaging sensor 614 can obtain the luminous intensity caught 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 processors 640 is provided.Sensor 620 (such as gyroscope) can be based on passing The parameter (such as stabilization parameter) of the image procossing of collection is supplied to ISP processors 640 by 620 interface type of sensor.Sensor 620 Interface can utilize 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 be also sent to sensor 620 by imaging sensor 614, sensor 620 can be based on passing 620 interface type of sensor is supplied to ISP processors 640, or sensor 620 to deposit raw image data raw image data Store up in video memory 630.
ISP processors 640 handle 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 processors 640 can carry out raw image data at one or more images Reason operation, statistical information of the collection on view data.Wherein, image processing operations can be by identical or different bit depth precision Carry out.
ISP processors 640 can also receive view data from video memory 630.For example, 620 interface of sensor will be original View data is sent to video memory 630, and the raw image data in video memory 630 is available to ISP processors 640 It is for processing.Video memory 630 can be independent special in the part of storage arrangement, storage device or electronic equipment With memory, and it 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 During raw image data, ISP processors 640 can carry out one or more image processing operations, such as time-domain filtering.Figure after processing As data can be transmitted to video memory 630, to carry out other processing before shown.ISP processors 640 are 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 spaces Data processing.View data after the processing of ISP processors 640 may be output to display 670, so that user watches and/or by scheming Shape engine or GPU (Graphics Processing Unit, graphics processor) are further handled.In addition, ISP processors 640 Output also can be transmitted to video memory 630, and display 670 can read view data from video memory 630.At one In embodiment, video memory 630 can be configured as realizing one or more frame buffers.In addition, ISP processors 640 is defeated Go out can be transmitted to encoder/decoder 660, so as to encoding/decoding image data.The view data of coding can be saved, and Decompressed before being shown in 670 equipment of display.Encoder/decoder 660 can be realized by CPU or GPU or coprocessor.
The definite statistics of ISP processors 640, which can be transmitted, gives control logic device Unit 650.For example, statistics 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 performing one or more routines (such as firmware) Device processed, one or more routines according to the statistics of reception, can determine the control parameter and ISP processors 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 Time of integration of control, stabilization parameter etc.), camera flash control parameter, 612 control parameter of lens (such as focus on or zoom With focal length) or these parameters combination.ISP control parameters may include to be used for automatic white balance and color adjustment (for example, in RGB During processing) gain level and color correction matrix, and 612 shadow correction parameter of lens.
It it is below the step of realizing 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) identify rear shell region in the first image, obtain first color in rear shell region.
(3) default second color is obtained, the second color is color of the mobile terminal rear shell under default light source.
(4) value of chromatism of the first color and the second color is obtained, 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, also perform:If receiving image taking instruction, the pending image of shooting is obtained.According to First white balance gains value carries out white balance processing to pending image.
In one embodiment, carrying out white balance processing to pending image according to the first white balance gains value includes:If Detect to exist in pending image and refer to color point, the second white balance gains value is determined according to reference to color point.According to first White balance gains value and the second white balance gains value determine target white balance gains value, and place is treated according to target white balance gains value Manage image and carry out white balance processing.
In one embodiment, also perform:If get multiple second white balance gains values according to reference to color point.From more Choose in a second white balance gains value and put down in vain as target with the white balance gains value of the first white balance gains value difference value minimum Weigh yield value.
In one embodiment, carrying out white balance processing to pending image according to the first white balance gains value includes:If Detect in pending image there are portrait, pending image is divided into background area and portrait area.According to portrait area The middle colour of skin determines the 3rd white balance gains value.White balance processing is carried out to background area according to the first white balance gains value, according to 3rd white balance gains value carries out white balance processing to portrait area.
In one embodiment, carrying out white balance processing to pending image according to the first white balance gains value includes:Obtain Take the time interval between the shooting time of pending image and the shooting time of the first image.If time interval is less than the first threshold Value, white balance processing is carried out according to the first white balance gains value to pending image.
In one embodiment, obtaining the second color temperature value according to the first color temperature value value and value of chromatism includes:According to default Color default light source color corresponding with the first color temperature value value of correspondence lookup of colour temperature.According to default light source color and aberration Value obtains environment light source color.According to color the second color temperature value corresponding with the correspondence lookup environment light source color of colour temperature.
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 storage (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 example only expresses the several embodiments of the application, its description is more specific and detailed, but can not Therefore it is interpreted as the limitation to the application the scope of the claims.It should be pointed out that for those of ordinary skill in the art, On the premise of the application design is not departed from, various modifications and improvements can be made, these belong to the protection model of the application Enclose.Therefore, the protection domain of the application patent should be determined by the appended claims.

Claims (10)

  1. A kind of 1. image processing method, it is characterised in that including:
    Camera rotation predetermined angle shooting is obtained into the first image;Described first image is that shooting mobile terminal rear shell obtains Image;
    Identify rear shell region in described first image, obtain first color in the rear shell region;
    Default 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;
    Second color temperature value is obtained according to the first color temperature value value and the value of chromatism, is obtained corresponding with second color temperature value First white balance gains value.
  2. 2. according to the method described in claim 1, it is characterized in that, further include:
    If receiving image taking instruction, the pending image of shooting is obtained;
    White balance processing is carried out to the pending image according to the first white balance gains value.
  3. 3. according to the method described in claim 2, it is characterized in that, described treat according to the first white balance gains value to described Processing image, which carries out white balance processing, to be included:
    Color point is referred to if detecting and existing in the pending image, 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 State target white balance gains value and white balance processing is carried out to the pending image.
  4. 4. according to the method described in claim 3, it is characterized in that, further include:
    If multiple second white balance gains values are got with reference to color point according to described;
    Choose from the multiple second white balance gains value and increase with the white balance of the first white balance gains value difference value minimum Benefit value is used as target white balance gains value.
  5. 5. according to the method described in claim 2, it is characterized in that, described treat according to the first white balance gains value to described Processing image, which carries out white balance processing, to be included:
    If detecting in the pending image there are portrait, the pending image is divided into background area and portrait area Domain;
    3rd 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 3rd white balance Benefit value carries out white balance processing to the portrait area.
  6. 6. according to the method described in claim 2, it is characterized in that, described treat according to the first white balance gains value to described Processing image, which carries out white balance processing, to be included:
    Obtain the time interval between the shooting time of the pending image and the shooting time of described first image;
    If the time interval is less than first threshold, the pending image is carried out according to the first white balance gains value white Balance Treatment.
  7. 7. method according to any one of claim 1 to 5, it is characterised in that described according to the first color temperature value value Obtaining the second color temperature value with the value of chromatism includes:
    According to default color default light source color corresponding with the first color temperature value value of correspondence lookup of colour temperature;
    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 correspondence lookup environment light source color of colour temperature.
  8. A kind of 8. image processing apparatus, it is characterised in that including:
    Taking module, for camera rotation predetermined angle shooting to be obtained the first image;Described first image is shooting movement The image that terminal rear shell obtains;
    Identification module, for identifying rear shell region in described first image, obtains first color in the rear shell region;
    First acquisition module, for obtaining default 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 Value;
    Second acquisition module, for obtaining the second color temperature value, acquisition and institute according to the first color temperature value value and the value of chromatism State the corresponding first white balance gains value of the second color temperature value.
  9. 9. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the computer program quilt The method as any one of claim 1 to 7 is realized when processor performs.
  10. 10. a kind of mobile terminal, including memory and processor, computer-readable instruction is stored in the memory, it is described When instruction is performed by the processor so that the processor performs the method as any one of claim 1 to 7.
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 true CN107948619A (en) 2018-04-20
CN107948619B 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)

Cited By (2)

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

Citations (7)

* 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
CN105981379A (en) * 2014-09-17 2016-09-28 深圳市大疆创新科技有限公司 Automatic white balancing system and method
CN107396079A (en) * 2017-08-31 2017-11-24 广东欧珀移动通信有限公司 White balance adjustment method and device

Patent Citations (7)

* 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
CN105981379A (en) * 2014-09-17 2016-09-28 深圳市大疆创新科技有限公司 Automatic white balancing system and 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

Cited By (4)

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

Also Published As

Publication number Publication date
CN107948619B (en) 2019-07-16

Similar Documents

Publication Publication Date Title
EP3542347B1 (en) Fast fourier color constancy
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
CN107886484A (en) U.S. face method, apparatus, computer-readable recording medium and electronic equipment
CN107948617A (en) Image processing method, device, computer-readable recording medium and computer equipment
CN110022469A (en) Image processing method, device, storage medium and electronic equipment
CN107945135A (en) Image processing method, device, storage medium and electronic equipment
CN108063891A (en) Image processing method, device, computer readable storage medium and computer equipment
US11050987B2 (en) Method and apparatus for determining fisheye camera shadow correction parameter
CN107872663B (en) Image processing method and device, computer readable storage medium and computer equipment
CN108198152A (en) Image processing method and device, electronic equipment, computer readable storage medium
CN107800971B (en) Auto-exposure control processing method, device and the equipment of pan-shot
CN109712177A (en) Image processing method, device, electronic equipment and computer readable storage medium
CN107194900A (en) Image processing method, device, computer-readable recording medium and mobile terminal
CN108322651A (en) Image pickup method and device, electronic equipment, computer readable storage medium
CN109360254A (en) Image processing method and device, electronic equipment, computer readable storage medium
CN108804658A (en) Image processing method and device, storage medium, electronic equipment
CN104113743A (en) Colour camera automatic white balance processing method and device under low illumination
CN109685853A (en) Image processing method, device, electronic equipment and computer readable storage medium
CN108616700A (en) Image processing method and device, electronic equipment, computer readable storage medium
CN107465903A (en) Image white balance method, device and computer-readable recording medium
CN107920205B (en) Image processing method, device, storage medium and electronic equipment
CN107580205B (en) White balance adjustment method and device
CN108012135A (en) Image processing method and device, computer-readable recording medium and computer equipment
CN107948619B (en) Image processing method, device, computer readable 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
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