[go: up one dir, main page]

CN107959842B - Image processing method and device, computer readable storage medium and computer device - Google Patents

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

Info

Publication number
CN107959842B
CN107959842B CN201711422350.7A CN201711422350A CN107959842B CN 107959842 B CN107959842 B CN 107959842B CN 201711422350 A CN201711422350 A CN 201711422350A CN 107959842 B CN107959842 B CN 107959842B
Authority
CN
China
Prior art keywords
image
light source
scene
module
processing
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
CN201711422350.7A
Other languages
Chinese (zh)
Other versions
CN107959842A (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 CN201711422350.7A priority Critical patent/CN107959842B/en
Publication of CN107959842A publication Critical patent/CN107959842A/en
Application granted granted Critical
Publication of CN107959842B publication Critical patent/CN107959842B/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/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
    • 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/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body

Landscapes

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

Abstract

The application discloses an image processing method for a computer device. The image processing method comprises the following steps: processing the first image to determine whether a light source exists in the first scene; if not, acquiring a second image when the computer equipment is connected with the selfie stick, wherein at least part of the first image and the second image are not overlapped; processing the second image to determine whether a light source is present in the second scene; and white balancing the first image according to the color temperature when the light source exists in the second scene. The application also discloses an image processing apparatus, a computer readable storage medium and a computer device. According to the image processing method and device, the computer readable storage medium and the computer equipment, when no light source exists in the first scene and the computer equipment is connected with the selfie stick, white balance processing is performed on the first image according to the color temperature of the light source detected by the second image, so that the color of the first image after the white balance processing is more real.

Description

Image processing method and device, computer readable storage medium and computer equipment
Technical field
This application involves technical field of image processing, in particular to a kind of image processing method, image processing apparatus, calculating Machine readable storage medium storing program for executing and computer equipment.
Background technique
The white balancing techniques of the relevant technologies can pass through the colour temperature of detection light source and carry out white balance according to colour temperature, however, When the white balancing techniques of this mode are applied to the not scene of point light source, image can not often be carried out at accurately white balance Reason.
Summary of the invention
Embodiments herein provides a kind of image processing method, image processing apparatus, computer readable storage medium And computer equipment.
The image processing method of the application embodiment is used for computer equipment, and described image processing method includes following Step:
The first image is handled to judge the first scene with the presence or absence of light source;
When the light source is not present in first scene, judge whether the computer equipment connects self-shooting bar;
The second image, the first image and second figure are obtained when the computer equipment connects the self-shooting bar As not being overlapped at least partly;
Second image is handled to judge the second scene with the presence or absence of the light source;With
In second scene there are the colour temperature for detecting the light source when light source and according to the colour temperature to described One image carries out white balance processing.
The image processing apparatus of the application embodiment, is used for computer equipment, and described image processing unit includes:
First processing module, the first processing module judge the first scene with the presence or absence of light for handling the first image Source;
First judgment module, the first judgment module are used for the judgement when the light source is not present in first scene Whether the computer equipment connects self-shooting bar;
Module is obtained, the acquisition module is used to obtain the second figure when the computer equipment connects the self-shooting bar Picture, the first image and second image be not at least partly be overlapped;
Second processing module, the Second processing module is for handling second image to judge whether the second scene deposits In the light source;With
Third processing module, the third processing module is in second scene, there are described in detection when the light source The colour temperature of light source simultaneously carries out white balance processing to the first image according to the colour temperature.
The one or more of the application embodiment, which includes that the non-volatile computer of computer executable instructions is readable, deposits Storage media, when the computer executable instructions are executed by one or more processors, so that described in processor execution Image processing method.
The computer equipment of the application embodiment includes memory and processor, stores computer in the memory Readable instruction, when described instruction is executed by the processor, so that the processor executes described image processing method.
The image processing method and device of the application embodiment, computer readable storage medium and computer equipment are One scene is there is no when light source and computer equipment connection self-shooting bar, and the colour temperature of the light source arrived according to the second image detection is to first Image carries out white balance processing, so that the color of white balance treated the first image is truer.
The additional aspect and advantage of the application will be set forth in part in the description, and will partially become from the following description It obtains obviously, or recognized by the practice of the application.
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 flow diagram of the image processing method of the application certain embodiments.
Fig. 2 is the module diagram of the image processing apparatus of the application certain embodiments.
Fig. 3 is the floor map of the computer equipment of the application certain embodiments.
Fig. 4 is the positional diagram of the first camera of the application certain embodiments, second camera, light source.
Fig. 5 is the flow diagram of the image processing method of the application certain embodiments.
Fig. 6 is the module diagram of the image processing apparatus of the application certain embodiments.
Fig. 7 is the flow diagram of the image processing method of the application certain embodiments.
Fig. 8 is the module diagram of the image processing apparatus of the application certain embodiments.
Fig. 9 is the schematic diagram of a scenario of the white balance processing of the application certain embodiments.
Figure 10 is the flow diagram of the image processing method of the application certain embodiments.
Figure 11 is the module diagram of the image processing apparatus of the application certain embodiments.
Figure 12 is the flow diagram of the image processing method of the application certain embodiments.
Figure 13 is the schematic diagram of a scenario of the white balance processing of the application certain embodiments.
Figure 14 is the module diagram of the fourth processing module of the application certain embodiments.
Figure 15 is the colour temperature curve synoptic diagram of the application certain embodiments.
Figure 16 is the flow diagram of the image processing method of the application certain embodiments.
Figure 17 is the module diagram of the image processing apparatus of the application certain embodiments.
Figure 18 is the flow diagram of the image processing method of the application certain embodiments.
Figure 19 is the module diagram of the image processing apparatus of the application certain embodiments.
Figure 20 is the flow diagram of the image processing method of the application certain embodiments.
Figure 21 is the module diagram of the third processing module of the application certain embodiments.
Figure 22 is the flow diagram of the image processing method of the application certain embodiments.
Figure 23 is the module diagram of the image processing apparatus of the application certain embodiments.
Figure 24 is the flow diagram of the image processing method of the application certain embodiments.
Figure 25 is the module diagram of the image processing apparatus of the application certain embodiments.
Figure 26 is the module diagram of the computer equipment of the application certain embodiments.
Figure 27 is the module diagram of the image processing circuit of the application certain embodiments.
Main element symbol description:
Computer equipment 1000, the first camera 100, the first lens 120, the first imaging sensor 140, second camera 200, the second lens 220, the second imaging sensor 240, image processing apparatus 300, first processing module 312, first judge mould Block 313, the first judging unit 3124, the first determination unit 3126, the second determination unit 3128, obtains first division unit 3122 Modulus block 314, Second processing module 316, the second division unit 3162, second judgment unit 3164, the 5th determination unit 3166, 6th determination unit 3168, third processing module 318, the 7th determination unit 3182, the second processing unit the 3184, the 8th determine single First 3186, second judgment module 322, the first splicing module 324, the first determining module 326, fourth processing module 328, third are true Order member 3282, first processing units 3284, the 4th determination unit 3286, third judgment module 332, the second splicing module 334, Second determining module 336, the first computing module 338, third determining module 342, the 5th processing module 344, the second computing module 346, the 4th determining module 348, the 6th processing module 352, system bus 510, processor 520, memory 530, built-in storage 540, display screen 550, input unit 560, image processing circuit 800, the first ISP processor 812, the 2nd ISP processor 814, Control logic device 820, video memory 850, display 870.
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.
It is appreciated that term " first " used in this application, " second " etc. can be used to describe various elements herein, But these elements should not be limited by these terms.These terms are only used to distinguish the first element from the other element.Citing comes It says, in the case where not departing from scope of the present application, the first image can be known as the second image, and similarly, it can be by second Image is known as the first image.First image and the second image both image, but be not same image.
Fig. 1 and Fig. 3 are please referred to, the image processing method of the application embodiment can be used for computer equipment 1000.Figure As processing method the following steps are included:
S312: the first image of processing is to judge the first scene with the presence or absence of light source;
S313: when light source is not present in the first scene, judge whether computer equipment 1000 connects self-shooting bar;
S314: the second image is obtained when computer equipment 1000 connects self-shooting bar, the first image and the second image are at least Part is not overlapped;
S316: the second image of processing is to judge the second scene with the presence or absence of light source;With
S318: in the second scene there are the colour temperature for detecting light source when light source and according to colour temperature to the first image progress white balance Processing.
Fig. 2 and Fig. 3 are please referred to, the image processing apparatus 300 of the application embodiment can be used for computer equipment 1000. Image processing apparatus 300 includes first processing module 312, first judgment module 313, obtains module 314, Second processing module 316 and third processing module 318.First processing module 312 judges the first scene with the presence or absence of light for handling the first image Source.First judgment module 313 is used to judge whether computer equipment 1000 connects self-shooting bar when light source is not present in the first scene; Module 314 is obtained to be used to obtain the second image when computer equipment 1000 connects self-shooting bar.Second processing module 316 is for locating The second image is managed to judge the second scene with the presence or absence of light source.Third processing module 318 is in the second scene, there are when light source It detects the colour temperature of light source and white balance processing is carried out to the first image according to colour temperature.
The image processing method of the application embodiment can be real by the image processing apparatus 300 of the application embodiment It is existing, wherein step S312 can be realized that step S313 can be realized by first judgment module 313 by first processing module 312, Step S314 can be realized that step S316 can be realized by Second processing module 316 by acquisition module 314, and step S318 can be with It is realized by third processing module 318.
Referring to Fig. 3, the image processing apparatus 300 of the application embodiment can be applied to the meter of the application embodiment It calculates in machine equipment 1000, in other words, the computer equipment 1000 of the application embodiment may include the application embodiment Image processing apparatus 300.
Image processing method, image processing apparatus 300 and the computer equipment 1000 of the application embodiment are at first Scape is there is no light source and when computer equipment 1000 connects self-shooting bar, and the colour temperature of the light source arrived according to the second image detection is to first Image carries out white balance processing, so that the color of white balance treated the first image is truer.
In some embodiments, when computer equipment 1000 does not connect self-shooting bar, general user is handheld computer Equipment 1000, the visual field of the camera in computer equipment 1000 are easy to be influenced by user, i.e., computer equipment 1000 away from Closer from user, the head of user or body are easy to shelter from camera.Therefore it may determine that whether computer equipment 1000 connects It is connected to dabber, when computer equipment 1000 connects self-shooting bar, the visual field of camera is not readily susceptible to the influence of user, can be compared with To easily detect light source;When computer equipment 1000 does not connect self-shooting bar, the visual field of camera is easy by user's It influences, it is difficult to detect light source.For example, being shot when computer equipment 1000 does not connect self-shooting bar using camera, facing In the camera acquired image of face, the accounting of face in the picture is generally more than 30%, i.e., the visual field of camera by Greatly limitation, it is difficult to detect light source in the image of its acquisition.
In some embodiments, the corresponding relationship of colour temperature and white balance parameter, root are prestored in computer equipment 1000 It can be searched in the corresponding relationship of colour temperature and white balance parameter according to colour temperature and obtain corresponding white balance parameter, so as to basis White balance parameter carries out white balance processing to image.
In some embodiments, due to the position of light source, the property (point light source or area source) of light source, the view of camera The reasons such as field and the visual field of camera, in real scene there are when light source, the first image of processing can not recognize light source, that is, handle When first image judges the first scene with the presence or absence of light source, the judging result that light source is not present in the first scene is obtained, but is being counted When calculating the connection self-shooting bar of machine equipment 1000, the visual field of camera is broader, therefore available and the first image is at least partly Nonoverlapping second image, the second image may can recognize light source, that is, handle the second image and judge whether the second scene deposits In light source, obtain the second scene there are the judging result of light source, due to the first image color and the second image color all It is influenced by light source, therefore, the colour temperature that can use the light source that the second image detection arrives carries out at white balance the first image Reason, so that the color of the first image is truer.
It should be noted that the first image is not at least partly be overlapped with the second image, it can be understood as, the first image and second Image be not overlapped completely or the first image and the second image section it is not be overlapped.
In some embodiments, judge the first scene with the presence or absence of light source, it can be understood as, judge be in the first image It is no to be able to detect that light source.Judge the second scene with the presence or absence of light source, it can be understood as, judge whether can examine in the second image Measure light source.When detecting light source in the first image, determine that there are light sources for the first scene;Light is not detected in the first image When source, determining the first scene, there is no light sources.When detecting light source in the second image, determine that there are light sources for the second scene;? When not detecting light source in the second image, determining the second scene, there is no light sources.
Referring to Fig. 4, in some embodiments, computer equipment 1000 includes the first camera 100 and the second camera shooting First 200, the first camera 100 is for obtaining the first image, and second camera 200 is for obtaining the second image, the first camera 100 visual field is not at least partly be overlapped with the visual field of second camera 200.
In this way, the second image that the first image and second camera 200 that the first camera 100 obtains obtain is at least partly It is not overlapped.
In some embodiments, the visual field of the first camera 100 and the visual field of second camera 200 do not weigh at least partly It is folded, it can be understood as, the visual field of the first camera 100 and the visual field of second camera 200 be not completely be overlapped or the first camera 100 visual field and the field of view portion of second camera 200 be not be overlapped.
In some embodiments, the direction of the first camera 100 and second camera 200 is on the contrary, the such as first camera shooting First 100 be rear camera, and second camera 200 is front camera.It is appreciated that in other embodiments, first takes the photograph As first 100 and second camera 200 direction on the contrary, be also possible to the first camera 100 be front camera, second camera 200 be rear camera.First camera 100 and second camera 200 towards it is opposite when, the first camera 100 and second The visual field of camera 200 is not overlapped completely, and the first image is not completely be overlapped with the second image.
In some embodiments, the direction of the first camera 100 and second camera 200 is mutually perpendicular to, such as first Camera 100 is front camera or rear camera, and second camera 200 is that (such as second camera 200 is set side camera It sets in the left or right side of computer equipment 1000).It is appreciated that in other embodiments, the first camera 100 and second The direction of camera 200 is mutually perpendicular to, and being also possible to the first camera 100 is side camera, and second camera 200 is preposition Camera or rear camera.When the direction of first camera 100 and second camera 200 is mutually perpendicular to, the first camera 100 It is not overlapped with the field of view portion of second camera 200, the first image and the second image section be not be overlapped.
In some embodiments, the first camera 100 and second camera 200 towards identical, such as the first camera shooting First 100 and second camera 200 be front camera or the first camera 100 and second camera 200 be postposition camera shooting Head.First camera 100 and second camera 200 towards identical, but the view of the first camera 100 and second camera 200 Field part is not overlapped, and the first image and the second image section be not be overlapped.
Certainly, the first camera 100 and second camera 200 are also possible to towards other feelings such as intersections towards relationship Condition, as long as making the visual field of the first camera 100 at least partly not be overlapped with the visual field of second camera 200, so that the first figure Picture and the second image are not overlapped at least partly, are not specifically limited herein.
Referring to Fig. 4, in one embodiment, the positional relationship of the first camera 100, second camera 200 and light source As shown, light source is located at outside the visual field of the first camera 100, at light source when computer equipment 1000 does not connect self-shooting bar It is sheltered from in the visual field of second camera 200 but by user.When computer equipment 1000 connects self-shooting bar, light source is in the Outside the visual field of one camera 100, light source is in the visual field of second camera 200 and is not blocked by user, the light of light source transmitting Line in the first image that the first camera 100 acquires close to parallel rays (light source may be regarded as area source in the first image), For non-collimated light sources, (light source can in the second image in the second image that second camera 200 acquires for the light of light source transmitting It is regarded as point light source), therefore possibly light source can not be recognized in the first image of the first camera 100 acquisition, and taken the photograph second Light source may can be recognized in the second image acquired as first 200, therefore can use the light source pair that the second image recognition arrives First image carries out white balance processing.
In certain modes, computer equipment 100 only includes a camera, can rotate camera by user So that camera obtains at least partly nonoverlapping first image and the second image, it is of course also possible to be by camera from Turn is dynamic to obtain at least partly nonoverlapping first image and the second image, wherein camera can be rotating camera or Person's optical anti-vibration camera.
Referring to Fig. 5, in some embodiments, step S312 the following steps are included:
S3122: the first image is divided into multiple regions;
S3124: judge whether region is the target area for including light source according to the histogram in each region;
S3126: when there are at least one target area, determine that there are light sources for the first scene;With
S3128: when target area is not present, determining the first scene, there is no light sources.
Referring to Fig. 6, in some embodiments, first processing module 312 is sentenced including the first division unit 3122, first Disconnected unit 3124, the first determination unit 3126 and the second determination unit 3128.First division unit 3122 is used for the first image It is divided into multiple regions.First judging unit 3124 be used for according to the histogram in each region judge region whether be include light source Target area.First determination unit 3126 is used for when there are at least one target area, determines that there are light sources for the first scene.The Two determination units 3128 are used for when target area is not present, and determining the first scene, there is no light sources.
In other words, step S3122 can be realized by the first division unit 3122, and step S3124 can be by the first judgement Unit 3124 realizes that step S3126 can be realized that step S3128 can be by the second determination unit by the first determination unit 3126 3128 realize.
In this way, can judge the first scene with the presence or absence of light source by the histogram in each region of the first image.
Specifically, the first image can be divided into multiple regions, such as the first image is divided into 64*48 region.According to Whether the accounting that the histogram in each region may determine that pixel value in each region is more than the pixel of presetted pixel value P is more than pre- If ratio, presetted pixel value P is, for example, 239, and preset ratio is, for example, 5%, that is, judges that pixel value is more than 239 in each region Whether more than 5%, pixel value is more than that the accounting of the pixel of presetted pixel value P is more than the corresponding region of preset ratio to the accounting of pixel It is the target area for including light source.Judge that there are target areas in the first image with the presence or absence of target area in the first image When, illustrate that there are light sources for the corresponding scene of the first image;When target area being not present in the first image, illustrate the first image pair Light source is not present in the scene answered.
Referring to Fig. 7, in some embodiments, after step S312 the following steps are included:
S322: in the first scene, there are when light source, judge whether there is adjacent multiple target areas;
S324: adjacent multiple target areas are spliced into light source when there are adjacent multiple target areas;With
S326: target area is determined as light source when adjacent multiple target areas are not present.
Referring to Fig. 8, in some embodiments, image processing apparatus 300 is spelled including the second judgment module 322, first Connection module 324 and the first determining module 326.Second judgment module 322 is used to judge whether to deposit there are when light source in the first scene In adjacent multiple target areas.First splicing module 324 is for will be adjacent more when there are adjacent multiple target areas A target area is spliced into light source.First determining module 326 is used for target area when adjacent multiple target areas are not present Domain is determined as light source.
In other words, step S322 can be realized that step S324 can be by the first splicing module by the second judgment module 322 324 realize, step S326 can be realized by the first determining module 326.
In this way, the light source position in the first image can be determined.
There are when target area, judging whether there is adjacent multiple target areas in the first image, there are adjacent Multiple target areas when, adjacent multiple target areas belong to the same light source in real scene, therefore can will be adjacent Multiple target areas are spliced into light source;When adjacent multiple target areas are not present, target area is regarded as light source.Cause This, can determine the light source position in the first image by target area.
Referring to Fig. 9, in one example, there are light sources for scene, region may determine that according to the histogram in each region A, region B, region C and region D be include the target area of light source, such as from the histogram of region A, it can be determined that go out region It has been more than preset ratio that pixel value, which is more than the accounting of the pixel of presetted pixel value P, in A, due to region A, region B, region C and area Domain D is adjacent multiple target areas, therefore region A, region B, region C and region D can be stitched together, thus obtain compared with For complete light source.
Referring to Fig. 10, in some embodiments, after step S312 the following steps are included:
S328: in the first scene, there are when light source, detect the colour temperature of light source and carried out according to colour temperature to the first image white flat Weighing apparatus processing.
Figure 11 is please referred to, in some embodiments, image processing apparatus 300 includes fourth processing module 328.Everywhere Reason module 328 is in the first scene, there are when light source, detect the colour temperature of light source and carried out according to colour temperature to the first image white flat Weighing apparatus processing.
In other words, step S328 can be realized by fourth processing module 328.
In this way, white balance processing can be carried out to the first image according to the colour temperature of light source in the first scene there are when light source, So that the color of white balance treated the first image is truer.
Please refer to Figure 12 and Figure 13, in some embodiments, step S328 the following steps are included:
S3282: highlight regions H and middle bright area M are determined according to the Luminance Distribution of the center of light source radially;
S3284: the primary color channels pixel that the primary color channels pixel average of highlight regions H subtracts middle bright area M is averaged Value is to determine light source colour;With
S3286: colour temperature is determined according to light source colour.
Figure 13 and Figure 14 are please referred to, in some embodiments, fourth processing module 328 includes third determination unit 3282, first processing units 3284 and the 4th determination unit 3286.Third determination unit 3282 is used for the center edge according to light source Radially outer Luminance Distribution determines highlight regions H and middle bright area M.First processing units 3284 are used for highlight regions H's Primary color channels pixel average subtracts the primary color channels pixel average of middle bright area M to determine light source colour.4th determines list Member 3286 is for determining colour temperature according to light source colour.
In other words, step S3282 can be realized by third determination unit 3282, and step S3284 can be by the first processing Unit 3284 realizes that step S3286 can be realized by the 4th determination unit 3286.
In this way, can determine light source colour by the highlight regions H and middle bright area M of the first image.
Referring to Figure 13, after the light source position in the first image determines, it will be understood that the light source in the first image Central area O be overexposure region, generally Great White Spot, the information not comprising light source colour.Light source colour can be by highlighted The primary color channels pixel average of region H and middle bright area M determine.Highlight regions H can refer to the center of light source radially to Outer brightness value is in the region that the pixel of the first brightness range L1 is constituted, the first brightness range L1 be, for example, [200,239). Middle bright area M can refer to that the brightness value of the center of light source radially is in what the pixel of the second brightness range L2 was constituted Region, the second brightness range L2 be, for example, [150,200).It should be noted that the first brightness range L1 and the second brightness range The specific value of L2 can be determined according to the Luminance Distribution of the center O of light source radially, such as the brightness decay of light source obtains Than very fast, the first brightness range L1 and the second brightness range L2 can be increased;Such as the brightness decay of light source obtain it is slow, can be with Reduce the first brightness range L1 and the second brightness range L2.
In some embodiments, primary color channels refer to Color Channel, (green red) logical for example including R (red) channel, Gr At least one of road, Gb (turquoise) channel, B (blue) channel, in some embodiments, can pass through the pixel in the channel Gr The pixel value in value and the channel Gb obtains the pixel value in G (green) channel.Pixel average can refer to the arithmetic of multiple pixel values Average value, multiple pixel values can be the pixel of the pixel value of all pixels of highlight regions or all pixels of middle bright area Value.In one example, each primary color channels pixel average (R of highlight regionsavg, Gavg, Bavg) it is (200,210,220), Each primary color channels pixel average (R of middle bright areaavg, Gavg, Bavg) it is (160,180,190), the then channel of light source colour (R, G, B) is (200-160,210-180,220-190), i.e., (40,30,30).
In some embodiments, colour temperature is determined according to light source colour, be specifically as follows: according to light source colour, light source face Color and the corresponding relationship of colour temperature determine light source color temperature.Wherein, light source colour and the corresponding relationship of colour temperature can be mapping table and/or Colour temperature curve.
Figure 15 is please referred to, can be respectively 3000K, 4000K, 5000K, 6000K in setting colour temperature in one embodiment Under equal light boxs, obtains uncalibrated image and the corresponding light source face of the uncalibrated image under above-mentioned different-colour is obtained by calculation The colour temperature curve it is possible thereby to form the colour temperature curve of light source colour and colour temperature, and can be stored in computer equipment by color In 1000.Being searched in colour temperature curve by light source colour can be obtained corresponding colour temperature.
Please refer to Figure 16, in some embodiments, step S316 the following steps are included:
S3162: the second image is divided into multiple regions;
S3164: judge whether region is the target area for including light source according to the histogram in each region;
S3166: when there are at least one target area, determine that there are light sources for the second scene;With
S3168: when target area is not present, determining the second scene, there is no light sources.
Figure 17 is please referred to, in some embodiments, Second processing module 316 includes the second division unit 3162, second Judging unit 3164, the 5th determination unit 3166 and the 6th determination unit 3168.Second division unit 3162 is used for the second figure As being divided into multiple regions.Second judgment unit 3164 be used for according to the histogram in each region judge region whether be include light source Target area.5th determination unit 3166 is used for when there are at least one target area, determines that there are light sources for the second scene. 6th determination unit 3168 is used for when target area is not present, and determining the second scene, there is no light sources.
In other words, step S3162 can be realized by the second division unit 3162, and step S3164 can be by the second judgement Unit 3164 realizes that step S3166 can be realized that step S3168 can be by the 6th determination unit by the 5th determination unit 3166 3168 realize.
In this way, can judge the second scene with the presence or absence of light source by the histogram in each region of the second image.
Judge that the second scene is led to the presence or absence of the method for light source with above-mentioned by the histogram in each region of the second image The histogram for crossing each region of the first image judges that the first scene is similar with the presence or absence of the method for light source, and this will not be repeated here.
Please refer to Figure 18, in some embodiments, after step S316 the following steps are included:
S332: in the second scene, there are when light source, judge whether there is adjacent multiple target areas;
S334: adjacent multiple target areas are spliced into light source when there are adjacent multiple target areas;With
S336: target area is determined as light source when adjacent multiple target areas are not present.
Figure 19 is please referred to, in some embodiments, image processing apparatus 300 is spelled including third judgment module 332, second Connection module 334 and the second determining module 336.Third judgment module 332 is used to judge whether to deposit there are when light source in the second scene In adjacent multiple target areas.Second splicing module 334 is for will be adjacent more when there are adjacent multiple target areas A target area is spliced into light source.Second determining module 336 is used for target area when adjacent multiple target areas are not present Domain is determined as light source.
In other words, step S332 can be realized by third judgment module 332, and step S334 can be by the second splicing module 334 realize, step S336 can be realized by the second determining module 336.
In this way, the light source position in the second image can be determined.
Determine the method for the light source position in the second image and the method class of the light source position in above-mentioned the first image of determination Seemingly, this will not be repeated here.
Please refer to Figure 20, in some embodiments, step S318 the following steps are included:
S3182: highlight regions and middle bright area are determined according to the Luminance Distribution of the center of light source radially;
S3184: the primary color channels pixel average of highlight regions is subtracted to the primary color channels pixel average of middle bright area To determine light source colour;With
S3186: colour temperature is determined according to light source colour.
Figure 21 is please referred to, in some embodiments, third processing module 318 includes the 7th determination unit 3182, second Processing unit 3184 and the 8th determination unit 3186.7th determination unit 3182 is used for according to the center of light source radially Luminance Distribution determines highlight regions and middle bright area.The second processing unit 3184 is for equalling the primary color channels pixel of highlight regions Mean value subtracts the primary color channels pixel average of middle bright area to determine light source colour.8th determination unit 3186 is used for according to light Source color determines colour temperature.
In other words, step S3182 can be realized that step S3184 can be by second processing by the 7th determination unit 3182 Unit 3184 realizes that step S3186 can be realized by the 8th determination unit 3186.
In this way, can determine light source colour by the highlight regions and middle bright area of the second image.
The method of light source colour is determined by the highlight regions and middle bright area of the second image and above by the first image Highlight regions determine that the method for light source colour is similar with middle bright area, this will not be repeated here.
Please refer to Figure 22, in some embodiments, after step S313 the following steps are included:
S338: when computer equipment 1000 does not connect self-shooting bar, the primary color channels pixel average of the first image is calculated;
S342: the primary color channels adjusted value of the first image is determined according to the primary color channels pixel average of the first image;With
S344: white balance processing is carried out to the first image according to primary color channels adjusted value.
Figure 23 is please referred to, in some embodiments, image processing apparatus 300 is true including the first computing module 338, third Cover half block 342 and the 5th processing module 344.First computing module 338 is used for when computer equipment 1000 does not connect self-shooting bar, Calculate the primary color channels pixel average of the first image.Third determining module 342 is used for the primary color channels picture according to the first image Plain average value determines the primary color channels adjusted value of the first image.5th processing module 344 is used for according to primary color channels adjusted value pair First image carries out white balance processing.
In other words, step S338 can be realized that step S342 can be by third determining module by the first computing module 338 342 realize, step S344 can be realized by the 5th processing module 344.
In this way, the first image or the second image may only collect people when computer equipment 1000 does not connect self-shooting bar Face to be difficult to carry out white balance processing to image by the method for the colour temperature for detecting light source, therefore can pass through the first image Primary color channels pixel average to the first image carry out white balance processing.
Specifically, firstly, calculating the arithmetic mean of instantaneous value of the pixel value of entire first image all pixels to obtain each base Chrominance channel pixel average, such as the primary color channels pixel average (R of entire first imageavg, Gavg, Bavg) be (50,100, 150).Secondly, the primary color channels adjusted value of the first image can be determined according to the primary color channels pixel average of the first image, it can To be interpreted as, adjustment a reference value K, such as (R are determined according to the primary color channels pixel average of entire first imageavg, Gavg, Bavg) it is (50,100,50), then K=(Ravg+Gavg+Bavg)/3=200/3, according to adjustment a reference value K and each primary color channels picture Plain average value determines each primary color channels adjusted value of the first image, such as the channel R adjusted value is K/Ravg=(200/3)/50=4/ 3, G channel adjusted values are K/Gavg=(200/3)/100=2/3, channel B adjusted value are K/Bavg=(200/3)/50=4/3.Most Afterwards, white balance processing is carried out to the first image according to primary color channels adjusted value, it can be understood as, by each picture in the first image Each primary color channels of element obtain pixel adjusted multiplied by corresponding primary color channels adjusted value, merge each picture adjusted The primary color channels pixel value that element can be obtained white balance treated a pixel in the first image, such as the first image is (100,200,150) carry out the primary color channels picture of the pixel after white balance processing according to primary color channels adjusted value to the first image Element value is (100*4/3,200*2/3,150*4/3)=(400/3,400/3,200).
Please refer to Figure 24, in some embodiments, after step S316 the following steps are included:
S346: when light source is not present in the second scene, the primary color channels pixel average of the first image is calculated;
S348: the primary color channels adjusted value of the first image is determined according to the primary color channels pixel average of the first image;With
S352: white balance processing is carried out to the first image according to primary color channels adjusted value.
Figure 25 is please referred to, in some embodiments, image processing apparatus 300 includes that the second computing module the 346, the 4th is true Cover half block 348 and the 6th processing module 352.Second computing module 346 is used to calculate first when light source is not present in the second scene The primary color channels pixel average of image.4th determining module 348 is used for the primary color channels pixel average according to the first image Determine the primary color channels adjusted value of the first image.6th processing module 352 is used for according to primary color channels adjusted value to the first image Carry out white balance processing.
In other words, step S346 can be realized that step S348 can be by the 4th determining module by the second computing module 346 348 realize, step S352 can be realized by the 6th processing module 352.
It, can be by the primary color channels pixel average of the first image to the in this way, when light source is not present in the second scene One image carries out white balance processing.
The method for carrying out white balance processing to the first image by the primary color channels pixel average of the first image is above By the agency of, this will not be repeated here.
The division of modules is only used for for example, in other embodiments, can incite somebody to action in above-mentioned image processing apparatus 300 Image processing apparatus 300 is divided into different modules as required, to complete all or part of above-mentioned image processing apparatus 300 Function.
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:
S312: the first image of processing is to judge the first scene with the presence or absence of light source;
S313: when light source is not present in the first scene, judge whether computer equipment 1000 connects self-shooting bar;
S314: the second image is obtained when computer equipment 1000 connects self-shooting bar, the first image and the second image are at least Part is not overlapped;
S316: the second image of processing is to judge the second scene with the presence or absence of light source;With
S318: in the second scene there are the colour temperature for detecting light source when light source and according to colour temperature to the first image progress white balance Processing.
Figure 26 is the schematic diagram of internal structure of computer equipment in one embodiment.As shown in figure 26, the computer equipment 1000 include the processor 520 connected by system bus 510, memory 530 (for example, non-volatile memory medium), memory Reservoir 540, display screen 550 and input unit 560.Wherein, the memory 530 of computer equipment 1000 be stored with operating system and Computer-readable instruction.The computer-readable instruction can be executed by processor 520, at the image to realize the application embodiment Reason method.The processor 520 supports the operation of entire computer equipment 1000 for providing calculating and control ability.Computer The built-in storage 530 of equipment 1000 provides environment for the operation of the computer-readable instruction in memory 520.Computer equipment 1000 display screen 550 can be liquid crystal display or electric ink display screen etc., and input unit 560 can be display screen The touch layer covered on 550 is also possible to key, trace ball or the Trackpad being arranged on 1000 shell of computer equipment, can also To be external keyboard, Trackpad or mouse etc..The computer equipment 1000 can be mobile phone, tablet computer, laptop, Personal digital assistant or wearable device (such as Intelligent bracelet, smartwatch, intelligent helmet, intelligent glasses) etc..This field skill Art personnel are appreciated that structure shown in Figure 26, only the schematic diagram of part-structure relevant to application scheme, not The restriction for the computer equipment 1000 being applied thereon to application scheme is constituted, specific computer equipment 1000 can wrap It includes than more or fewer components as shown in the figure, perhaps combines certain components or with different component layouts.
Figure 27 is please referred to, includes image processing circuit 800, image procossing in the computer equipment 1000 of the embodiment of the present application Circuit 800 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.Figure 27 is the schematic diagram of image processing circuit 800 in one embodiment.Such as figure Shown in 27, 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 figure 27, image processing circuit 800 includes that (the first ISP processor 812 can be place to the first ISP processor 812 Manage a part of device 520) and control logic device 820.The first image that first camera 100 captures is handled by the first ISP first The processing of device 812, the first ISP processor 812 analyze to capture and can be used for determining the 1 of the first camera 100 first image The image statistics of a or multiple control parameters.First camera 100 may include one or more first lens 120 and first Imaging sensor 140.First imaging sensor 140 may include colour filter array (such as Bayer filter), the first imaging sensor 140 can obtain the luminous intensity and wavelength information that each imaging pixel captures, and provide and can be handled by the first ISP processor 812 One group of raw image data (i.e. the first image).
Image processing circuit 800 further includes that (the 2nd ISP processor 814 can be processor 520 to the 2nd ISP processor 814 A part).The second image that second camera 200 captures is handled by the 2nd ISP processor 814 first, the 2nd ISP processor 814 pair of second image is analyzed to capture the image for the one or more control parameters that can be used for determining second camera 200 Statistical information.Second camera 200 may include one or more second lens 220 and the second imaging sensor 240.Second image Sensor 240 may include colour filter array (such as Bayer filter), and the second imaging sensor 240 can obtain each imaging pixel The luminous intensity and wavelength information of capture, and providing can be by one group of raw image data that the 2nd ISP processor 814 is handled (i.e. the Two images).
First ISP processor 812 and the 2nd ISP processor 814 handle the first figure respectively pixel by pixel in various formats Picture and the second image.For example, each image pixel can have the bit depth of 8,10,12 or 14 bits, the first ISP processor 812 One or more image processing operations can be carried out to the first image and the second image respectively with the 2nd ISP processor 814, collect and close In the statistical information of image data.Wherein, image processing operations can be carried out by identical or different bit depth precision.
First ISP processor 812 and the 2nd ISP processor 814 can also receive image data from video memory 850.Figure As memory 850 can be independent dedicated in memory 530, a part of memory 530, storage equipment or electronic equipment Memory, and may include DMA (Direct Memory Access, direct direct memory access (DMA)) feature.
First ISP processor 812 and the 2nd ISP processor 814 can carry out one to the first image and the second image respectively Or multiple images processing operation, such as time-domain filtering.Treated the first image and the second image can be transmitted to video memory 850, to carry out other processing before shown.First ISP processor 812 and the 2nd ISP processor 814 are deposited from image Reservoir 850 receives processing data, and carries out the figure in original domain and in RGB and YCbCr color space to the processing data As data processing.Treated that image data may be output to display for first ISP processor 812 and the 2nd ISP processor 814 870 (display 870 may include display screen 550), so that user watches and/or by graphics engine or GPU (Graphics Processing Unit, graphics processor) it is further processed.In addition, the first ISP processor 812 and the 2nd ISP processor 814 Output also can be transmitted to video memory 850, and display 870 can read image data from video memory 850.At one In embodiment, video memory 850 can be configured to realize one or more frame buffers.
The statistical data that first ISP processor 812 and the 2nd ISP processor 814 determine can be transmitted to control logic device 820 Unit.For example, statistical data may include automatic exposure, automatic white balance, automatic focusing, flicker detection, black level compensation, lens The imaging sensors statistical information such as shadow correction.Control logic device 820 may include executing one or more routines (such as firmware) Processing element and/or microcontroller, one or more routines can statistical data based on the received, determine 100 He of the first camera The control parameter of the control parameter of second camera 200 and the first ISP processor 812 and the 2nd ISP processor 814.For example, the The control parameter of one camera 100 may include the time of integration of spectrum assignment, stabilization parameter, camera flash control parameter, thoroughly The combination of mirror control parameter (such as focusing or zoom focal length) or these parameters.The control parameter of first ISP processor 812 It may include the gain level and color correction matrix for automatic white balance and color adjustment (for example, during RGB processing), with And correcting lens shadow parameter.
The following are realize image processing method with image processing techniques in Figure 27:
S312: the first image of processing is to judge the first scene with the presence or absence of light source;
S313: when light source is not present in the first scene, judge whether computer equipment 1000 connects self-shooting bar;
S314: the second image is obtained when computer equipment 1000 connects self-shooting bar, the first image and the second image are at least Part is not overlapped;
S316: the second image of processing is to judge the second scene with the presence or absence of light source;With
S318: in the second scene there are the colour temperature for detecting light source when light source and according to colour temperature to the first image progress white balance Processing.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in that a non-volatile computer is readable to be deposited In storage media, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium It can be magnetic disk, CD, read-only memory (Read-Only Memory, ROM) etc..
The several embodiments of the application above described embodiment only expresses, the description thereof is more specific and detailed, but simultaneously The limitation to the application the scope of the patents therefore cannot be interpreted as.It should be pointed out that for those of ordinary skill in the art For, without departing from the concept of this application, various modifications and improvements can be made, these belong to the guarantor of the application Protect range.Therefore, the scope of protection shall be subject to the appended claims for the application patent.

Claims (20)

1.一种图像处理方法,用于计算机设备,其特征在于,所述图像处理方法包括以下步骤:1. an image processing method for computer equipment, it is characterized in that, described image processing method comprises the following steps: 处理第一图像以判断第一场景是否存在光源;processing the first image to determine whether there is a light source in the first scene; 在所述第一场景不存在所述光源时,判断所述计算机设备是否连接自拍杆;When the light source does not exist in the first scene, determine whether the computer device is connected to a selfie stick; 在所述计算机设备连接所述自拍杆时获取第二图像,所述第一图像与所述第二图像至少部分不重叠;acquiring a second image when the computer device is connected to the selfie stick, the first image and the second image at least partially non-overlapping; 处理所述第二图像以判断第二场景是否存在所述光源;和processing the second image to determine whether the light source is present in the second scene; and 在所述第二场景存在所述光源时检测所述光源的色温并根据所述色温对所述第一图像进行白平衡处理;Detecting the color temperature of the light source when the light source exists in the second scene, and performing white balance processing on the first image according to the color temperature; 所述在所述第二场景存在所述光源时检测所述光源的色温并根据所述色温对所述第一图像进行白平衡处理的步骤包括以下步骤:The step of detecting the color temperature of the light source when the light source exists in the second scene and performing white balance processing on the first image according to the color temperature includes the following steps: 根据所述光源的中心沿径向向外的亮度分布确定围绕所述光源的中心区域的高亮区域和中亮区域;determining a high-brightness area and a medium-brightness area around the center area of the light source according to the brightness distribution radially outward from the center of the light source; 将所述高亮区域的基色通道像素平均值减去所述中亮区域的基色通道像素平均值以确定所述场景的光源颜色;和subtracting the base color channel pixel average of the highlighted area from the base color channel pixel average of the mid-bright area to determine a light source color for the scene; and 根据所述光源颜色确定所述色温。The color temperature is determined according to the color of the light source. 2.根据权利要求1所述的图像处理方法,其特征在于,所述处理第一图像以判断第一场景是否存在光源的步骤包括以下步骤:2. The image processing method according to claim 1, wherein the step of processing the first image to determine whether there is a light source in the first scene comprises the following steps: 将所述第一图像分成多个区域;dividing the first image into a plurality of regions; 根据每个所述区域的直方图判断所述区域是否为包括所述光源的目标区域;Determine whether the area is a target area including the light source according to the histogram of each of the areas; 在存在至少一个所述目标区域时,确定所述第一场景存在所述光源;和When at least one of the target areas exists, determining that the light source exists in the first scene; and 在不存在所述目标区域时,确定所述第一场景不存在所述光源。When the target area does not exist, it is determined that the light source does not exist in the first scene. 3.根据权利要求2所述的图像处理方法,其特征在于,所述处理第一图像以判断第一场景是否存在光源的步骤后包括以下步骤:3. The image processing method according to claim 2, wherein the step of processing the first image to determine whether there is a light source in the first scene comprises the following steps: 在所述第一场景存在所述光源时,判断是否存在相邻的多个所述目标区域;When the light source exists in the first scene, determine whether there are multiple adjacent target areas; 在存在相邻的多个所述目标区域时将相邻的多个所述目标区域拼接为所述光源;和When there are a plurality of adjacent target areas, splicing the adjacent plurality of target areas into the light source; and 在不存在相邻的多个所述目标区域时将所述目标区域确定为所述光源。The target area is determined as the light source when there are no adjacent multiple target areas. 4.根据权利要求1所述的图像处理方法,其特征在于,所述处理第一图像以判断第一场景是否存在光源的步骤后包括以下步骤:4. The image processing method according to claim 1, wherein the step of processing the first image to determine whether there is a light source in the first scene comprises the following steps: 在所述第一场景存在所述光源时,检测所述光源的色温并根据所述色温对所述第一图像进行白平衡处理。When the light source exists in the first scene, the color temperature of the light source is detected, and white balance processing is performed on the first image according to the color temperature. 5.根据权利要求4所述的图像处理方法,其特征在于,所述在所述第一场景存在所述光源时,检测所述光源的色温并根据所述色温对所述第一图像进行白平衡处理的步骤包括以下步骤:5 . The image processing method according to claim 4 , wherein when the light source exists in the first scene, detecting a color temperature of the light source and performing whitening on the first image according to the color temperature. 6 . The steps of the equilibration process include the following steps: 根据所述光源的中心沿径向向外的亮度分布确定高亮区域和中亮区域;Determine the highlight area and the middle-brightness area according to the brightness distribution radially outward from the center of the light source; 将所述高亮区域的基色通道像素平均值减去所述中亮区域的基色通道像素平均值以确定光源颜色;和subtracting the base color channel pixel mean value of the highlighted area from the base color channel pixel mean value of the mid-bright area to determine the light source color; and 根据所述光源颜色确定所述色温。The color temperature is determined according to the color of the light source. 6.根据权利要求1所述的图像处理方法,其特征在于,所述处理所述第二图像以判断第二场景是否存在所述光源的步骤包括以下步骤:6. The image processing method according to claim 1, wherein the step of processing the second image to determine whether the light source exists in the second scene comprises the following steps: 将所述第二图像分成多个区域;dividing the second image into a plurality of regions; 根据每个所述区域的直方图判断所述区域是否为包括所述光源的目标区域;Determine whether the area is a target area including the light source according to the histogram of each of the areas; 在存在至少一个所述目标区域时,确定所述第二场景存在所述光源;和When at least one of the target areas exists, determining that the light source exists in the second scene; and 在不存在所述目标区域时,确定所述第二场景不存在所述光源。When the target area does not exist, it is determined that the light source does not exist in the second scene. 7.根据权利要求6所述的图像处理方法,其特征在于,所述处理所述第二图像以判断第二场景是否存在所述光源的步骤后包括以下步骤:7. The image processing method according to claim 6, wherein the step of processing the second image to determine whether the light source exists in the second scene comprises the following steps: 在所述第二场景存在所述光源时,判断是否存在相邻的多个所述目标区域;When the light source exists in the second scene, determine whether there are multiple adjacent target areas; 在存在相邻的多个所述目标区域时将相邻的多个所述目标区域拼接为所述光源;和When there are a plurality of adjacent target areas, splicing the adjacent plurality of target areas into the light source; and 在不存在相邻的多个所述目标区域时将所述目标区域确定为所述光源。The target area is determined as the light source when there are no adjacent multiple target areas. 8.根据权利要求1所述的图像处理方法,其特征在于,所述在所述第一场景不存在所述光源时,判断所述计算机设备是否连接自拍杆的步骤后包括以下步骤:8. The image processing method according to claim 1, wherein the step of judging whether the computer device is connected to a selfie stick when the light source does not exist in the first scene comprises the following steps: 在所述计算机设备没连接所述自拍杆时,计算所述第一图像的基色通道像素平均值;When the computer device is not connected to the selfie stick, calculating the pixel average value of the primary color channel of the first image; 根据所述第一图像的基色通道像素平均值确定所述第一图像的基色通道调整值;和determining a primary color channel adjustment value for the first image based on the primary color channel pixel average of the first image; and 根据所述基色通道调整值对所述第一图像进行白平衡处理。White balance processing is performed on the first image according to the primary color channel adjustment value. 9.根据权利要求1所述的图像处理方法,其特征在于,所述处理所述第二图像以判断第二场景是否存在所述光源的步骤后包括以下步骤:9 . The image processing method according to claim 1 , wherein the step of processing the second image to determine whether the light source exists in the second scene comprises the following steps: 10 . 在所述第二场景的不存在光源时,计算所述第一图像的基色通道像素平均值;When there is no light source in the second scene, calculating the pixel average value of the primary color channel of the first image; 根据所述第一图像的基色通道像素平均值确定所述第一图像的基色通道调整值;和determining a primary color channel adjustment value for the first image based on the primary color channel pixel average of the first image; and 根据所述基色通道调整值对所述第一图像进行白平衡处理。White balance processing is performed on the first image according to the primary color channel adjustment value. 10.一种图像处理装置,用于计算机设备,其特征在于,所述图像处理装置包括:10. An image processing apparatus for computer equipment, wherein the image processing apparatus comprises: 第一处理模块,所述第一处理模块用于处理第一图像以判断第一场景是否存在光源;a first processing module, the first processing module is configured to process the first image to determine whether there is a light source in the first scene; 第一判断模块,所述第一判断模块用于在所述第一场景不存在所述光源时,判断所述计算机设备是否连接自拍杆;a first judging module, the first judging module is configured to judge whether the computer device is connected to a selfie stick when the light source does not exist in the first scene; 获取模块,所述获取模块用于在所述计算机设备连接所述自拍杆时获取第二图像,所述第一图像与所述第二图像至少部分不重叠;an acquisition module, configured to acquire a second image when the computer device is connected to the selfie stick, the first image and the second image at least partially not overlapping; 第二处理模块,所述第二处理模块用于处理所述第二图像以判断第二场景是否存在所述光源;和a second processing module, the second processing module is configured to process the second image to determine whether the light source exists in the second scene; and 第三处理模块,所述第三处理模块用于在所述第二场景存在所述光源时检测所述光源的色温并根据所述色温对所述第一图像进行白平衡处理;a third processing module, configured to detect the color temperature of the light source when the light source exists in the second scene, and perform white balance processing on the first image according to the color temperature; 所述第三处理模块包括:The third processing module includes: 第七确定单元,所述第七确定单元用于根据所述光源的中心沿径向向外的亮度分布确定围绕所述光源的中心区域的高亮区域和中亮区域;a seventh determining unit, which is configured to determine a high-brightness area and a medium-brightness area surrounding the center area of the light source according to the brightness distribution of the center of the light source along the radially outward; 第二处理单元,所述第二处理单元用于将所述高亮区域的基色通道像素平均值减去所述中亮区域的基色通道像素平均值以确定所述场景的光源颜色;和a second processing unit, the second processing unit is configured to subtract the pixel average value of the primary color channel of the highlighted area from the pixel average value of the primary color channel of the mid-brightness area to determine the light source color of the scene; and 第八确定单元,所述第八确定单元用于根据所述光源颜色确定所述色温。an eighth determination unit, configured to determine the color temperature according to the color of the light source. 11.根据权利要求10所述的图像处理装置,其特征在于,所述第一处理模块包括:11. The image processing apparatus according to claim 10, wherein the first processing module comprises: 第一划分单元,所述第一划分单元用于将所述第一图像分成多个区域;a first dividing unit, the first dividing unit is configured to divide the first image into a plurality of regions; 第一判断单元,所述第一判断单元用于根据每个所述区域的直方图判断所述区域是否为包括所述光源的目标区域;a first judging unit, the first judging unit is configured to judge whether the area is a target area including the light source according to the histogram of each of the areas; 第一确定单元,所述第一确定单元用于在存在至少一个所述目标区域时,确定所述第一场景存在所述光源;和a first determination unit, configured to determine that the light source exists in the first scene when at least one of the target areas exists; and 第二确定单元,所述第二确定单元用于在不存在所述目标区域时,确定所述第一场景不存在所述光源。A second determining unit, configured to determine that the light source does not exist in the first scene when the target area does not exist. 12.根据权利要求11所述的图像处理装置,其特征在于,所述图像处理装置包括:12. The image processing apparatus according to claim 11, wherein the image processing apparatus comprises: 第二判断模块,所述第二判断模块用于在所述第一场景存在所述光源时,判断是否存在相邻的多个所述目标区域;a second judging module, the second judging module is configured to judge whether there are multiple adjacent target areas when the light source exists in the first scene; 第一拼接模块,所述第一拼接模块用于在存在相邻的多个所述目标区域时将相邻的多个所述目标区域拼接为所述光源;和a first splicing module, the first splicing module is used for splicing a plurality of adjacent target areas into the light source when there are a plurality of adjacent target areas; and 第一确定模块,所述第一确定模块用于在不存在相邻的多个所述目标区域时将所述目标区域确定为所述光源。A first determination module, the first determination module is configured to determine the target area as the light source when there are no adjacent multiple target areas. 13.根据权利要求10所述的图像处理装置,其特征在于,所述图像处理装置包括:13. The image processing apparatus according to claim 10, wherein the image processing apparatus comprises: 第四处理模块,所述第四处理模块用于在所述第一场景存在所述光源时,检测所述光源的色温并根据所述色温对所述第一图像进行白平衡处理。A fourth processing module, configured to detect the color temperature of the light source when the light source exists in the first scene, and perform white balance processing on the first image according to the color temperature. 14.根据权利要求13所述的图像处理装置,其特征在于,所述第四处理模块包括:14. The image processing apparatus according to claim 13, wherein the fourth processing module comprises: 第三确定单元,所述第三确定单元用于根据所述光源的中心沿径向向外的亮度分布确定高亮区域和中亮区域;a third determining unit, the third determining unit is configured to determine a highlight area and a medium-brightness area according to the brightness distribution of the center of the light source along the radially outward direction; 第一处理单元,所述第一处理单元用于将所述高亮区域的基色通道像素平均值减去所述中亮区域的基色通道像素平均值以确定光源颜色;和a first processing unit, the first processing unit is configured to subtract the average value of the pixels of the primary color channel of the highlighted area from the average value of the pixels of the primary color channel of the highlighted area to determine the color of the light source; and 第四确定单元,所述第四确定单元用于根据所述光源颜色确定所述色温。a fourth determination unit, configured to determine the color temperature according to the color of the light source. 15.根据权利要求10所述的图像处理装置,其特征在于,所述第二处理模块包括:15. The image processing apparatus according to claim 10, wherein the second processing module comprises: 第二划分单元,所述第二划分单元用于将所述第二图像分成多个区域;a second dividing unit, the second dividing unit is configured to divide the second image into a plurality of regions; 第二判断单元,所述第二判断单元用于根据每个所述区域的直方图判断所述区域是否为包括所述光源的目标区域;a second judging unit, the second judging unit is configured to judge whether the area is a target area including the light source according to the histogram of each of the areas; 第五确定单元,所述第五确定单元用于在存在至少一个所述目标区域时,确定所述第二场景存在所述光源;和a fifth determination unit, configured to determine that the light source exists in the second scene when at least one of the target areas exists; and 第六确定单元,所述第六确定单元用于在不存在所述目标区域时,确定所述第二场景不存在所述光源。a sixth determination unit, configured to determine that the light source does not exist in the second scene when the target area does not exist. 16.根据权利要求15所述的图像处理装置,其特征在于,所述图像处理装置包括:16. The image processing apparatus according to claim 15, wherein the image processing apparatus comprises: 第三判断模块,所述第三判断模块用于在所述第二场景存在所述光源时,判断是否存在相邻的多个所述目标区域;a third judging module, the third judging module is configured to judge whether there are multiple adjacent target areas when the light source exists in the second scene; 第二拼接模块,所述第二拼接模块用于在存在相邻的多个所述目标区域时将相邻的多个所述目标区域拼接为所述光源;和a second splicing module, the second splicing module is used for splicing a plurality of adjacent target areas into the light source when there are a plurality of adjacent target areas; and 第二确定模块,所述第二确定模块用于在不存在相邻的多个所述目标区域时将所述目标区域确定为所述光源。A second determining module, the second determining module is configured to determine the target area as the light source when there are no adjacent multiple target areas. 17.根据权利要求10所述的图像处理装置,其特征在于,所述图像处理装置包括:17. The image processing apparatus according to claim 10, wherein the image processing apparatus comprises: 第一计算模块,所述第一计算模块用于在所述计算机设备没连接所述自拍杆时,计算所述第一图像的基色通道像素平均值;a first calculation module, the first calculation module is configured to calculate the pixel average value of the primary color channel of the first image when the computer device is not connected to the selfie stick; 第三确定模块,所述第三确定模块用于根据所述第一图像的基色通道像素平均值确定所述第一图像的基色通道调整值;和a third determination module configured to determine a primary color channel adjustment value of the first image based on the primary color channel pixel average value of the first image; and 第五处理模块,所述第五处理模块用于根据所述基色通道调整值对所述第一图像进行白平衡处理。A fifth processing module, the fifth processing module is configured to perform white balance processing on the first image according to the primary color channel adjustment value. 18.根据权利要求10所述的图像处理装置,其特征在于,所述图像处理装置包括:18. The image processing apparatus according to claim 10, wherein the image processing apparatus comprises: 第二计算模块,所述第二计算模块用于在所述第二场景的不存在光源时,计算所述第一图像的基色通道像素平均值;a second calculation module, the second calculation module is configured to calculate the pixel average value of the primary color channel of the first image when there is no light source in the second scene; 第四确定模块,所述第四确定模块用于根据所述第一图像的基色通道像素平均值确定所述第一图像的基色通道调整值;和a fourth determination module configured to determine a primary color channel adjustment value of the first image based on the primary color channel pixel average value of the first image; and 第六处理模块,所述第六处理模块用于根据所述基色通道调整值对所述第一图像进行白平衡处理。The sixth processing module is configured to perform white balance processing on the first image according to the primary color channel adjustment value. 19.一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当所述计算机可执行指令被一个或多个处理器执行时,使得所述处理器执行权利要求1至9中任一项所述的图像处理方法。19. One or more non-volatile computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform claims 1 to 9 The image processing method described in any one of. 20.一种计算机设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行权利要求1至9中任一项所述的图像处理方法。20. A computer device comprising a memory and a processor, wherein computer-readable instructions are stored in the memory, the instructions, when executed by the processor, cause the processor to execute any one of claims 1 to 9 the image processing method.
CN201711422350.7A 2017-12-25 2017-12-25 Image processing method and device, computer readable storage medium and computer device Active CN107959842B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711422350.7A CN107959842B (en) 2017-12-25 2017-12-25 Image processing method and device, computer readable storage medium and computer device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711422350.7A CN107959842B (en) 2017-12-25 2017-12-25 Image processing method and device, computer readable storage medium and computer device

Publications (2)

Publication Number Publication Date
CN107959842A CN107959842A (en) 2018-04-24
CN107959842B true CN107959842B (en) 2019-06-07

Family

ID=61956972

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711422350.7A Active CN107959842B (en) 2017-12-25 2017-12-25 Image processing method and device, computer readable storage medium and computer device

Country Status (1)

Country Link
CN (1) CN107959842B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108965845B (en) * 2018-08-16 2019-10-01 Oppo广东移动通信有限公司 Image white balance calibration method and device, storage medium and terminal
CN115918103B (en) * 2020-06-02 2024-12-20 Oppo广东移动通信有限公司 Electronic device, method of controlling electronic device, and computer-readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003224863A (en) * 2002-01-29 2003-08-08 Fuji Photo Film Co Ltd White balance control method and digital camera
CN102469243A (en) * 2010-11-04 2012-05-23 卡西欧计算机株式会社 Image pickup device capable of adjusting white balance
CN104618645A (en) * 2015-01-20 2015-05-13 广东欧珀移动通信有限公司 Method and device for shooting through two cameras
CN105227945A (en) * 2015-10-21 2016-01-06 维沃移动通信有限公司 A kind of control method of Automatic white balance and mobile terminal
CN105635593A (en) * 2014-10-13 2016-06-01 广达电脑股份有限公司 Multiple exposure imaging system and white balance method thereof
CN105959661A (en) * 2016-05-06 2016-09-21 联想(北京)有限公司 Color temperature estimation method and electronic equipment
CN106534835A (en) * 2016-11-30 2017-03-22 珠海市魅族科技有限公司 Image processing method and device
CN106851121A (en) * 2017-01-05 2017-06-13 广东欧珀移动通信有限公司 Control method and control device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003224863A (en) * 2002-01-29 2003-08-08 Fuji Photo Film Co Ltd White balance control method and digital camera
CN102469243A (en) * 2010-11-04 2012-05-23 卡西欧计算机株式会社 Image pickup device capable of adjusting white balance
CN105635593A (en) * 2014-10-13 2016-06-01 广达电脑股份有限公司 Multiple exposure imaging system and white balance method thereof
CN104618645A (en) * 2015-01-20 2015-05-13 广东欧珀移动通信有限公司 Method and device for shooting through two cameras
CN105227945A (en) * 2015-10-21 2016-01-06 维沃移动通信有限公司 A kind of control method of Automatic white balance and mobile terminal
CN105959661A (en) * 2016-05-06 2016-09-21 联想(北京)有限公司 Color temperature estimation method and electronic equipment
CN106534835A (en) * 2016-11-30 2017-03-22 珠海市魅族科技有限公司 Image processing method and device
CN106851121A (en) * 2017-01-05 2017-06-13 广东欧珀移动通信有限公司 Control method and control device

Also Published As

Publication number Publication date
CN107959842A (en) 2018-04-24

Similar Documents

Publication Publication Date Title
CN108419028B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN108174172B (en) Photographing method and apparatus, computer-readable storage medium, and computer device
CN107959851B (en) Color temperature detection method and device, computer readable storage medium and computer equipment
US10798358B2 (en) Image processing method and device for accomplishing white balance regulation, computer-readable storage medium and computer device
CN109040607B (en) Imaging control method, imaging control device, electronic device and computer-readable storage medium
CN108012134A (en) Photographing method and apparatus, computer-readable storage medium, and computer device
US8285135B2 (en) Method and device for adjusting weighting values in light metering
CN110475063A (en) Image-pickup method and device and storage medium
CN108063926B (en) Image processing method and device, computer readable storage medium and computer device
CN107465903A (en) Image white balance method, device and computer-readable storage medium
US20140184586A1 (en) Depth of field visualization
CN109302566A (en) A kind of method, apparatus and terminal device of determining screening-mode
CN107635124B (en) White balance processing method, device and equipment for face shooting
CN108174173B (en) Photographing method and apparatus, computer-readable storage medium, and computer device
CN107454317B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN107959842B (en) Image processing method and device, computer readable storage medium and computer device
CN108156434B (en) Image processing method and apparatus, computer-readable storage medium and computer device
CN108063934B (en) Image processing method and device, computer readable storage medium and computer device
CN108063933B (en) Image processing method and device, computer readable storage medium and computer device
CN107959843B (en) Image processing method and device, computer readable storage medium and computer device
CN114268774A (en) Image acquisition method, image sensor, device, equipment and storage medium
CN111800626B (en) Photographing consistency evaluation method and device, mobile terminal and storage medium
TWI524279B (en) Image capturing device and vignetting compensation method thereof
CN108111831B (en) Photographing method, imaging apparatus, computer-readable storage medium, and computer device
CN114125302A (en) Image adjustment method and device

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
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.

GR01 Patent grant
GR01 Patent grant