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 PDFInfo
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/80—Camera processing pipelines; Components thereof
- H04N23/84—Camera processing pipelines; Components thereof for processing colour signals
- H04N23/88—Camera processing pipelines; Components thereof for processing colour signals for colour balance, e.g. white-balance circuits or colour temperature control
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/10—Cameras or camera modules comprising electronic image sensors; Control thereof for generating image signals from different wavelengths
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/61—Control of cameras or camera modules based on recognised objects
- H04N23/611—Control 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
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)
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)
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)
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 |
-
2017
- 2017-12-25 CN CN201711422350.7A patent/CN107959842B/en active Active
Patent Citations (8)
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 |