CN108377372B - A kind of white balancing treatment method, device, terminal device and storage medium - Google Patents

A kind of white balancing treatment method, device, terminal device and storage medium Download PDF

Info

Publication number
CN108377372B
CN108377372B CN201810204577.2A CN201810204577A CN108377372B CN 108377372 B CN108377372 B CN 108377372B CN 201810204577 A CN201810204577 A CN 201810204577A CN 108377372 B CN108377372 B CN 108377372B
Authority
CN
China
Prior art keywords
white
image
value
white area
quasi
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
CN201810204577.2A
Other languages
Chinese (zh)
Other versions
CN108377372A (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.)
TP Link Technologies Co Ltd
Original Assignee
TP Link Technologies Co 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 TP Link Technologies Co Ltd filed Critical TP Link Technologies Co Ltd
Priority to CN201810204577.2A priority Critical patent/CN108377372B/en
Publication of CN108377372A publication Critical patent/CN108377372A/en
Application granted granted Critical
Publication of CN108377372B publication Critical patent/CN108377372B/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

Landscapes

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

Abstract

The present invention relates to technical field of image processing, a kind of white balancing treatment method, device, terminal device and computer storage medium are proposed.The white balancing treatment method includes: to obtain image to be processed;Acquire the rgb value of each pixel of the image to be processed;The white balance statistics point of the image to be processed is determined according to the rgb value of each pixel;If the ratio of the statistics point in the white balance statistics point in quasi- white area is greater than first threshold, the average value of the statistics point in quasi- white area is then calculated as the first yield value, the quasi- white area extends a certain distance by the white area of white balance around and formed;If first yield value is in the quasi- white area and outside the white area, by the mobile preset distance in the direction in first yield value towards the white area, the second yield value is obtained;White balance processing is carried out to the image to be processed using second yield value.

Description

A kind of white balancing treatment method, device, terminal device and storage medium
Technical field
The present invention relates to technical field of image processing more particularly to a kind of white balancing treatment method, device, terminal device and Computer storage medium.
Background technique
White balance is directed under the conditions of different-colour, makes to shoot the shadow come by adjusting the color circuit inside video camera As offsetting colour cast, closer to the visual custom of human eye.White balance can be simply interpreted as under the conditions of any colour temperature, video camera Adjustment of the reference white captured by camera lens through oversampling circuit, remains as white after imaging.
Currently, a kind of common white balancing treatment method is the grey-world method in the white area based on priori knowledge.It should A white area is arranged in priori knowledge of the method based on optional network specific digit imaging sensor, and the statistics point for falling into the white area is considered as White point, and the statistics point for not falling within the white area is considered as non-white point, i.e., grey-world method is applied in white area.Using this For method to handle each color object more, when details scene abundant, has good effect, but obtains under certain special scenes Image effect and do not meet the visual custom of human eye.For example, when in face of the scene of superelevation or ultralow colour temperature, human eye at this time Certain colour cast (such as under candle light, human eye sees that white paper can be partially yellow) also will appear to the observation of scene.And it should using When method carries out white balance processing, if the statistics point overwhelming majority of scene can do completely image white inside white area;If field The statistics point overwhelming majority of scape then can carry out blank level adjustment according to default method, may cause so serious outside white area Colour cast.
Summary of the invention
In view of this, the embodiment of the invention provides a kind of white balancing treatment method, device, terminal device and computers to deposit Storage media, it is intended to solve the image effect that existing white balancing treatment method obtains under certain special scenes and not meet human eye view The problem of feeling habit.
The first aspect of the embodiment of the present invention provides a kind of white balancing treatment method, comprising:
Obtain image to be processed;
Acquire the rgb value of each pixel of the image to be processed;
The white balance statistics point of the image to be processed is determined according to the rgb value of each pixel;
If the ratio of the statistics point in the white balance statistics point in the quasi- white area is greater than first threshold, calculate described in As the first yield value, the quasi- white area is extended the average value of statistics point in quasi- white area around by the white area of white balance A certain distance is formed;
If first yield value is in the quasi- white area and outside the white area, by first yield value towards institute The mobile preset distance in direction for stating white area, obtains the second yield value;
White balance processing is carried out to the image to be processed using second yield value.
The second aspect of the embodiment of the present invention provides a kind of white balance processing equipment, comprising:
Image collection module, for obtaining image to be processed;
Rgb value acquisition module, the rgb value of each pixel for acquiring the image to be processed;
Statistics point determining module, for determining the white flat of the image to be processed according to the rgb value of each pixel Weighing apparatus statistics point;
Gain calculation module, if the ratio of the statistics point for being in quasi- white area in the white balance statistics point is greater than the One threshold value then calculates the average value of the statistics point in quasi- white area as the first yield value, and the quasi- white area is by white flat The white area of weighing apparatus extends a certain distance around and is formed;
Gain regulation module will if being in the quasi- white area and outside the white area for first yield value The mobile preset distance in the direction in first yield value towards the white area, obtains the second yield value;
White balance processing module, for carrying out white balance processing to the image to be processed using second yield value.
The third aspect of the embodiment of the present invention provides a kind of terminal device, including memory, processor and is stored in In the memory and the computer program that can run on the processor, when the processor executes the computer program The step of realizing the white balancing treatment method that the first aspect such as the embodiment of the present invention provides.
The fourth aspect of the embodiment of the present invention provides a kind of computer readable storage medium, the computer-readable storage Media storage has computer program, and the first aspect such as the embodiment of the present invention is realized when the computer program is executed by processor The step of white balancing treatment method of offer.
The white balancing treatment method that the embodiment of the present invention proposes includes: to obtain image to be processed;Acquire the figure to be processed The rgb value of each pixel of picture;The white balance statistics of the image to be processed are determined according to the rgb value of each pixel Point;If the ratio of the statistics point in the white balance statistics point in quasi- white area is greater than first threshold, it is in described in calculating As the first yield value, the quasi- white area is extended centainly the average value of statistics point in quasi- white area around by the white area of white balance Distance formed;If first yield value is in the quasi- white area and outside the white area, by first yield value Towards the mobile preset distance in direction in the white area, the second yield value is obtained;Using second yield value to described to be processed Image carries out white balance processing.The present invention extends to obtain quasi- white area by the white area for handling white balance, when in face of superelevation or super When the scene of low color temperature, if the statistics point overwhelming majority of scene is in quasi- white area and outside white area, by white balance processing The direction in yield value towards white area adjusts certain degree so that white balance treated image there are it is a degree of partially Color meets the visual custom of human eye.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 a is a kind of flow chart of one embodiment of white balancing treatment method provided in an embodiment of the present invention;
Fig. 1 b is the schematic diagram in white area and quasi- white area in white balancing treatment method that Fig. 1 a is proposed;
Fig. 2 is a kind of flow chart of second embodiment of white balancing treatment method provided in an embodiment of the present invention;
Fig. 3 is a kind of flow chart of the third embodiment of white balancing treatment method provided in an embodiment of the present invention;
Fig. 4 is a kind of structure chart of one embodiment of white balance processing equipment provided in an embodiment of the present invention;
Fig. 5 is a kind of schematic diagram of terminal device provided in an embodiment of the present invention.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, in case unnecessary details interferes description of the invention.
The embodiment of the invention provides a kind of white balancing treatment method, device, terminal device and computer storage medium, purports Human eye vision habit is not met solving the image effect that existing white balancing treatment method obtains under certain special scenes Problem.
Please refer to Fig. 1 a, a kind of one embodiment of white balancing treatment method includes: in the embodiment of the present invention
101, image to be processed is obtained;
In the white balancing treatment method of the embodiment of the present invention, obtain image to be processed first, the image to be processed be into Original image before the processing of row white balance.
102, the rgb value of each pixel of the image to be processed is acquired;
After getting image to be processed, the rgb value of each pixel of the image to be processed is acquired.Specifically, The rgb value of each pixel of image to be processed can be obtained by digital image sensor.
103, the white balance statistics point of the image to be processed is determined according to the rgb value of each pixel;
After the rgb value for getting each pixel, the white balance statistics of image to be processed are determined according to these rgb values Point.It determines that the mode of white balance statistics point is similar with the grey-world method in the existing white area based on priori knowledge, that is, exists Indicate each rgb value under preset three basic color coordinates (such as R/G-B/G coordinate system), each rgb value can correspond to one it is white flat Weighing apparatus statistics point.
104, judge whether the ratio of the statistics point in the white balance statistics point in quasi- white area is greater than first threshold;
After obtaining each white balance statistics point, the statistics point in these white balance statistics points in quasi- white area is judged Whether ratio is greater than first threshold.The quasi- white area extends a certain distance (amplitude of extension by the white area of white balance around Can be determined according to test result, be subject to and obtain preferable white balance effect) it is formed, i.e., quasi- white area includes white area.In addition, white The specific setting method in area can refer to the prior art.Since counting for image to be processed puts the number for falling into quasi- white area under normal conditions It measures and few, therefore the first threshold is generally set to a lesser numerical value, such as 10%.If in the white balance statistics point It is greater than first threshold in the ratio of the statistics point in quasi- white area (comprising in white area), thens follow the steps 105, otherwise directly execute step Rapid 109.
Optionally, the white area can be preset by following steps:
(1) under the scene of different-colour, multiple the first images comprising white object are obtained;
(2) rgb value of the white pixel point of the first image is indicated under preset coordinate system, obtains multiple white areas Statistics point;
(3) white area is set by the distributed areas of the white area statistics point under the coordinate system.
For example, the image that several include common white object is obtained under various colour temperature scenes, it will be white in these images The rgb value of colour vegetarian refreshments indicates under some three basic color coordinates (such as R/G-B/G coordinate system or G/R-G/B coordinate system), meeting Obtain multiple statistics points.Then, the white area is set by the distributed areas of these statistics points or densely distributed region.
Optionally, the quasi- white area can be preset by following steps:
(1) it in the case where colour temperature is higher than the scene of the first color temperature value and colour temperature lower than the second color temperature value, obtains multiple comprising white Second image of color object, first color temperature value are higher than second color temperature value;
(2) rgb value of the white pixel point of second image is indicated under preset coordinate system, it is white obtains multiple standards Area counts point;
(3) the quasi- white area is set by the distributed areas of the quasi- white area statistics point under the coordinate system.
The setting method in quasi- white area and the setting method in white area are similar, are higher than the first color temperature value and colour temperature in colour temperature first Under scene lower than the second color temperature value, the image that several include common white object is obtained, by the white pixel in these images The rgb value of point indicates under some three basic color coordinates (such as R/G-B/G coordinate system or G/R-G/B coordinate system), can obtain more A statistics point.Then, the quasi- white area is set by the distributed areas of these statistics points or densely distributed region.Here Temperature value of the same colour indicates that a higher color temperature value, such as 8000K or more, the second color temperature value indicate a lower color temperature value, than Such as 2000K or less.
Fig. 1 b is the schematic diagram of the white area and quasi- white area of the embodiment of the present invention under R/G-B/G coordinate system.In the schematic diagram In, abscissa R/G, ordinate B/G, X are Planck curve, and Y is that (white area is inside closed curve Y for the boundary line in white area Region), the boundary line (quasi- white area is the region inside closed curve Z) in white area subject to Z, it is seen that quasi- white area includes white area.Tool Body, Planck curve can obtain in the following manner: specific digital image sensor is directed to, under different standard sources Standard color card is shot, obtains the rgb value of the white blocks of standard color card, these rgb values are fitted on R/G-B/G coordinate system can Obtain a curve, i.e. Planck curve.
105, the average value of the statistics point in quasi- white area is calculated as the first yield value;
The ratio of statistics point in the white balance statistics point in quasi- white area is greater than first threshold, at this time described in calculating The average value of statistics point in quasi- white area, using this average value as the first yield value.
106, judge whether first yield value is in the quasi- white area and outside the white area;
After the first yield value is calculated, judge whether it is in the quasi- white area and outside the white area.By In the average value that first yield value is the statistics point in quasi- white area, therefore first yield value is in quasi- white area certainly It is interior.Again since quasi- white area includes white area, therefore step 106 is essentially further to judge whether first yield value is in described Outside white area.If first yield value is in the quasi- white area and outside the white area, 107-108 is thened follow the steps, otherwise Directly execute step 109.
107, by the mobile preset distance in the direction in first yield value towards the white area, the second yield value is obtained;
First yield value is in the quasi- white area and outside the white area, at this time by first yield value towards described white The mobile preset distance in the direction in area, obtains the second yield value.Mobile again may be by test determination apart from size, to obtain On the basis of ideal white balance effect.Obviously, which may be at outside white area, in white area boundary or white area.
Preferably, step 107 is specifically as follows: the direction in the first yield value towards the white area being moved to nearest White area boundary point obtains second yield value.
For example, in Figure 1b, stain (1) indicates the first yield value, the direction in stain (1) towards white area is moved to white recently The boundary point in area obtains the second yield value, i.e. stain (2).It is found by test data, by first yield value towards described white The direction in area is moved to nearest white area boundary point, using the boundary point as second yield value, can obtain preferably white Balance Treatment effect.
108, white balance processing is carried out to the image to be processed using second yield value;
After obtaining the second yield value, the image to be processed is carried out at white balance using second yield value Reason, namely white balance correction is carried out using each rgb value of second yield value to the image to be processed.It sets in this way It sets, it, both will not be as the grey-world method in white area is by image when in face of the image to be processed of superelevation or ultralow colour temperature scene It does completely white, serious colour cast will not be generated as other white balance adjustment methods (such as D50 gain method), it can The image with colour cast to a certain degree is obtained, the visual custom of human eye is more in line with.
In addition, the setting in quasi- white area, not only can solve the scene under superelevation or ultralow colour temperature, while under normal color temperature Large area light color scene also have same effect.The statistics point of the light color scene of large area falls into quasi- white area sometimes, is white It outside area, is allowed to retain certain colour cast by the way that white balance gains are pulled to white area at this time, rather than does completely white, be also more in line with The observation of human eye.
109, preset processing step is executed.
The ratio of statistics point in the white balance statistics point in quasi- white area is less than first threshold, can execute at this time Preset processing step, for example end processing or image to be processed is carried out using some preset white balance gains value white flat Weighing apparatus processing.
The white balancing treatment method that the embodiment of the present invention proposes includes: to obtain image to be processed;Acquire the figure to be processed The rgb value of each pixel of picture;The white balance statistics of the image to be processed are determined according to the rgb value of each pixel Point;If the ratio of the statistics point in the white balance statistics point in quasi- white area is greater than first threshold, it is in described in calculating As the first yield value, the quasi- white area is extended centainly the average value of statistics point in quasi- white area around by the white area of white balance Distance formed;If first yield value is in the quasi- white area and outside the white area, by first yield value Towards the mobile preset distance in direction in the white area, the second yield value is obtained;Using second yield value to described to be processed Image carries out white balance processing.The present invention extends to obtain quasi- white area by the white area for handling white balance, when in face of superelevation or super When the scene of low color temperature, if the statistics point overwhelming majority of scene is in quasi- white area and outside white area, by white balance processing The direction in yield value towards white area adjusts certain degree so that white balance treated image there are it is a degree of partially Color meets the visual custom of human eye.
Referring to Fig. 2, a kind of second embodiment of white balancing treatment method includes: in the embodiment of the present invention
201, image to be processed is obtained;
202, the rgb value of each pixel of the image to be processed is acquired;
Step 201-202 is identical as step 101-102, specifically can refer to the related description of step 101-102.
203, by the image block to be processed, multiple block images are obtained;
In order to reduce calculation amount, the image block to be processed is obtained multiple block images by the embodiment of the present invention.Than Such as, image to be processed is divided into multiple block images of 32*32 or 16*16.
204, each block image is crossed into dark pixel point and the rejecting of overexposure pixel, obtains each block diagram The effective pixel points of picture;
There may be certain excessively dark or overexposure pixels, steps 204 to reject these pixels for image to be processed, thus Obtain the effective pixel points (pixel of i.e. non-excessively dark, non-overexposure) of each block image.
205, the average RGB value of each block image is calculated;
After obtaining multiple block images, calculate separately the average RGB value of each block image, i.e., each block image The average RGB value of all effective pixel points.
206, the average RGB value of each block image is indicated under preset coordinate system, is obtained described to be processed The white balance statistics point of image;
After the average RGB value for obtaining each block image, by these average RGB values in preset coordinate system (such as R/ G-B/G coordinate system) under indicate, obtain the white balance statistics point of the image to be processed, each average RGB value correspond to one it is white Balance statistics point.
207, judge whether the ratio of the statistics point in the white balance statistics point in quasi- white area is greater than first threshold;
Step 207 is identical as step 104, specifically can refer to the related description of step 104.If in the white balance statistics point The ratio of statistics point in quasi- white area is greater than first threshold, thens follow the steps 208, otherwise directly executes step 212.
208, the average value that the statistics point in quasi- white area is calculated using average weighted mode, will be calculated Average value as the first yield value;
The average value of the statistics point in quasi- white area is calculated using average weighted mode, it is flat by what is be calculated Mean value is as the first yield value.The weight of weighting is the effective of the corresponding block image of the statistics point in quasi- white area The quantity of the quantity of pixel, i.e. effective pixel points is more, then corresponding weight is bigger.Assuming that in R/G-B/G coordinate system following table The statistics point for showing each block image, then can use formulaAnd formulaIt is average to calculate this Value, wherein i=1,2,3 ... n, n are the quantity of the statistics point in quasi- white area, and Wi is i-th of statistics in quasi- white area The weight of point, the weight are equal to the quantity that the statistics puts the effective pixel points of corresponding block image.In a step 208, pass through Dark and overexposure pixel was rejected, the quantity of effective pixel points is applied in weighted average method, image is effectively considered In luminance information, maximum possible reduces the part that brightness is moderate in image to be processed.
209, judge whether first yield value is in the quasi- white area and outside the white area;
If first yield value is in the quasi- white area and outside the white area, 210-211 is thened follow the steps, otherwise Directly execute step 212.
210, by the mobile preset distance in the direction in first yield value towards the white area, the second yield value is obtained;
211, white balance processing is carried out to the image to be processed using second yield value;
212, preset processing step is executed.
Step 209-212 is identical as step 106-109, specifically can refer to the related description of step 106-109.
It is equal that the embodiment of the present invention depends on the RGB after image block provided by digital image sensor and its hardware The pixel quantity (pass through dark and overexposure handle) of value and each piecemeal, can be in most image imaging devices Obtain these information.Therefore, the white balancing treatment method that the embodiment of the present invention proposes is equal on most image imaging devices It is applicable in, and the adjustment and modification that need to make are smaller.
Compared with one embodiment of the invention, the present embodiment has carried out piecemeal to image to be processed, then utilizes and divides Statistics point of the average RGB value of block image as white balance can effectively reduce calculation amount, reduce the burden of system processing.Separately Outside, each block image is crossed into dark pixel point and the rejecting of overexposure pixel, obtains the effective pixel points of each block image, so The average value of the point of the statistics in quasi- white area is calculated using average weighted mode afterwards, the weight of weighting is described in quasi- white The quantity of the effective pixel points of block image corresponding to statistics point in area, to effectively consider the brightness letter in image Breath, maximum possible reduce the part that brightness is moderate in image to be processed.
Referring to Fig. 3, a kind of third embodiment of white balancing treatment method includes: in the embodiment of the present invention
301, image to be processed is obtained;
302, the rgb value of each pixel of the image to be processed is acquired;
303, the white balance statistics point of the image to be processed is determined according to the rgb value of each pixel;
304, judge whether the ratio of the statistics point in the white balance statistics point in quasi- white area is greater than first threshold;
If the ratio of the statistics point in the white balance statistics point in quasi- white area is greater than first threshold, then follow the steps 305, otherwise directly execute step 310.
305, the average value of the statistics point in quasi- white area is calculated as the first yield value;
306, judge whether first yield value is in the quasi- white area and outside the white area;
If first yield value is in the quasi- white area and outside the white area, 307-308 is thened follow the steps, otherwise Directly execute step 309.
307, by the mobile preset distance in the direction in first yield value towards the white area, the second yield value is obtained;
308, white balance processing is carried out to the image to be processed using second yield value;
Step 301-308 is identical as step 101-108, specifically can refer to the related description of step 101-108.
309, white balance processing is carried out to the image to be processed using first yield value;
First yield value is in white area, directly adopt at this time first yield value to the image to be processed into The processing of row white balance.That is, as the processing mode of the grey-world method in white area.
310, white balance processing is carried out to the image to be processed using preset white balance gains value.
The ratio of statistics point in the white balance statistics point in quasi- white area is less than first threshold, at this time using default White balance gains value white balance processing is carried out to the image to be processed.For example, can be using D50 gain method to be processed Image carries out white balance processing.At this time eye-observation to image also can be that there are the various colorss of colour cast phenomenon, and use D50 Gain method exactly can preferably restore these colors.
In the present embodiment, when most of statistics are put outside all in quasi- white area, using preset white balance gains value pair Image to be processed carries out white balance processing;When most of statistics points are all in white area, using first yield value to institute It states image to be processed and carries out white balance processing.Compared with one embodiment of the invention, the perfect processing step of the present embodiment Each branch, enable this white balancing treatment method be suitable for all kinds of colour temperature scenes image to be processed.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-mentioned each embodiment, respectively The execution sequence of process should be determined by its function and internal logic, and the implementation process without coping with the embodiment of the present invention constitutes any It limits.
A kind of white balancing treatment method is essentially described above, a kind of white balance processing equipment will be described below.
Referring to Fig. 4, a kind of one embodiment of white balance processing equipment includes: in the embodiment of the present invention
Image collection module 401, for obtaining image to be processed;
Rgb value acquisition module 402, the rgb value of each pixel for acquiring the image to be processed;
Statistics point determining module 403, for determining the white of the image to be processed according to the rgb value of each pixel Balance statistics point;
Gain calculation module 404, if the ratio of the statistics point for being in quasi- white area in the white balance statistics point is big In first threshold, then calculate the average value of the statistics point in quasi- white area as the first yield value, the quasi- white area by The white area of white balance extends a certain distance around and is formed;
Gain regulation module 405, if being in the quasi- white area and outside the white area for first yield value, By the mobile preset distance in the direction in first yield value towards the white area, the second yield value is obtained;
White balance processing module 406, for being carried out at white balance using second yield value to the image to be processed Reason.
The embodiment of the present invention also provides a kind of terminal device, including memory, processor and is stored in the memory In and the computer program that can run on the processor, the processor realize such as Fig. 1 a when executing the computer program To Fig. 3 indicate any one white balancing treatment method the step of.
The embodiment of the present invention also provides a kind of computer readable storage medium, and the computer-readable recording medium storage has Computer program is realized at any one white balance indicated such as Fig. 1 a to Fig. 3 when the computer program is executed by processor The step of reason method.
Fig. 5 is the schematic diagram for the terminal device that one embodiment of the invention provides.As shown in figure 5, the terminal of the embodiment is set Standby 5 include: processor 50, memory 51 and are stored in the meter that can be run in the memory 51 and on the processor 50 Calculation machine program 52.The processor 50 realizes the implementation of above-mentioned each white balancing treatment method when executing the computer program 52 Step in example, such as step 101 shown in Fig. 1 a is to 109.Alternatively, when the processor 50 executes the computer program 52 Realize the function of each module/unit in above-mentioned each Installation practice, such as the function of module 401 to 406 shown in Fig. 4.
The computer program 52 can be divided into one or more module/units, and one or more of modules/ Unit is stored in the memory 51, and is executed by the processor 50, to complete the present invention.One or more of moulds Block/unit can be the series of computation machine program instruction section that can complete specific function, the instruction segment by describe it is described based on Implementation procedure of the calculation machine program 52 in the terminal device 5.
The terminal device 5 can be various types of mobile phones, desktop PC, notebook, palm PC and cloud Server etc. calculates equipment.The terminal device may include, but be not limited only to, processor 50, memory 51.Those skilled in the art Member is appreciated that Fig. 5 is only the example of terminal device 5, does not constitute the restriction to terminal device 5, may include than diagram More or fewer components perhaps combine certain components or different components, such as the terminal device 5 can also include Input-output equipment, network access equipment, bus etc..
Alleged processor 50 can be central processing unit (Central Processing Unit, CPU), can also be Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field- Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic, Discrete hardware components etc..General processor can be microprocessor or the processor is also possible to any conventional processor Deng.
The memory 51 can be the internal storage unit of the terminal device 5, such as the hard disk or interior of terminal device 5 It deposits.The memory 51 is also possible to the External memory equipment of the terminal device 5, such as be equipped on the terminal device 5 Plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card dodge Deposit card (Flash Card) etc..Further, the memory 51 can also both include the storage inside list of the terminal device 5 Member also includes External memory equipment.The memory 51 is for storing needed for the computer program and the terminal device Other programs and data.The memory 51 can be also used for temporarily storing the data that has exported or will export.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of described device is divided into different functional unit or module, more than completing The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device and method can pass through others Mode is realized.For example, system embodiment described above is only schematical, for example, the division of the module or unit, Only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can be with In conjunction with or be desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed Mutual coupling or direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING of device or unit or Communication connection can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-described embodiment side All or part of the process in method can also instruct relevant hardware to complete, the computer by computer program Program can be stored in a computer readable storage medium, and the computer program is when being executed by processor, it can be achieved that above-mentioned each The step of a embodiment of the method.Wherein, the computer program includes computer program code, and the computer program code can Think source code form, object identification code form, executable file or certain intermediate forms etc..The computer-readable medium can be with It include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, light that can carry the computer program code Disk, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that the computer The content that readable medium includes can carry out increase and decrease appropriate according to the requirement made laws in jurisdiction with patent practice, such as In certain jurisdictions, according to legislation and patent practice, computer-readable medium do not include be electric carrier signal and telecommunications letter Number.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of white balancing treatment method characterized by comprising
Obtain image to be processed;
Acquire the rgb value of each pixel of the image to be processed;
The white balance statistics point of the image to be processed is determined according to the rgb value of each pixel;
If the ratio of the statistics point in the white balance statistics point in quasi- white area is greater than first threshold, it is in described in calculating As the first yield value, the quasi- white area is extended centainly the average value of statistics point in quasi- white area around by the white area of white balance Distance formed;
If first yield value is in the quasi- white area and outside the white area, by first yield value towards described white The mobile preset distance in the direction in area, obtains the second yield value;
White balance processing is carried out to the image to be processed using second yield value;
Wherein, the quasi- white area is preset by following steps:
In the case where colour temperature is higher than the scene of the first color temperature value and colour temperature lower than the second color temperature value, obtaining multiple includes white object Second image, first color temperature value are higher than second color temperature value;
The rgb value of the white pixel point of second image is indicated under preset coordinate system, obtains multiple quasi- white area statistics Point;
The quasi- white area is set by the distributed areas of the quasi- white area statistics point under the coordinate system.
2. white balancing treatment method as described in claim 1, which is characterized in that the white area is set in advance by following steps It sets:
Under the scene of different-colour, multiple the first images comprising white object are obtained;
The rgb value of the white pixel point of the first image is indicated under preset coordinate system, obtains multiple white area statistics points;
The white area is set by the distributed areas of the white area statistics point under the coordinate system.
3. white balancing treatment method as described in claim 1, which is characterized in that it is described by first yield value towards described white The mobile preset distance in the direction in area, obtains the second yield value are as follows:
The direction in the first yield value towards the white area is moved to nearest white area boundary point, obtains second gain Value.
4. white balancing treatment method as described in claim 1, which is characterized in that the RGB according to each pixel Value determines that the white balance statistics point of the image to be processed includes:
By the image block to be processed, multiple block images are obtained;
Calculate the average RGB value of each block image;
The average RGB value of each block image is indicated under preset coordinate system, obtains the white of the image to be processed Balance statistics point.
5. white balancing treatment method as claimed in claim 4, which is characterized in that in the average RGB for calculating each block image Before value, further includes:
Each block image is crossed into dark pixel point and the rejecting of overexposure pixel, obtains the effective of each block image Pixel;
The average value of statistics point described in the calculating in the quasi- white area includes: as the first yield value
The average value of the statistics point in quasi- white area, the average value that will be calculated are calculated using average weighted mode As the first yield value, the weight of weighting is the valid pixel of the corresponding block image of the statistics point in quasi- white area The quantity of point.
6. the white balancing treatment method as described in any one of claims 1 to 5, which is characterized in that further include:
If the ratio of the statistics point in the white balance statistics point in quasi- white area is less than or equal to the first threshold, adopt White balance processing is carried out to the image to be processed with preset white balance gains value.
7. the white balancing treatment method as described in any one of claims 1 to 5, which is characterized in that further include:
If first yield value is in the white area, the image to be processed is carried out using first yield value white Balance Treatment.
8. a kind of white balance processing equipment characterized by comprising
Image collection module, for obtaining image to be processed;
Rgb value acquisition module, the rgb value of each pixel for acquiring the image to be processed;
Statistics point determining module, for determining that the white balance of the image to be processed is united according to the rgb value of each pixel Enumeration;
Gain calculation module, if the ratio of the statistics point for being in quasi- white area in the white balance statistics point is greater than the first threshold Value then calculates the average value of the statistics point in quasi- white area as the first yield value, and the quasi- white area is by white balance White area extends a certain distance around and is formed;
Gain regulation module will be described if being in the quasi- white area and outside the white area for first yield value The mobile preset distance in the direction in the first yield value towards the white area, obtains the second yield value;
White balance processing module, for carrying out white balance processing to the image to be processed using second yield value;
Wherein, the quasi- white area is preset by following steps:
In the case where colour temperature is higher than the scene of the first color temperature value and colour temperature lower than the second color temperature value, obtaining multiple includes white object Second image, first color temperature value are higher than second color temperature value;
The rgb value of the white pixel point of second image is indicated under preset coordinate system, obtains multiple quasi- white area statistics Point;
The quasi- white area is set by the distributed areas of the quasi- white area statistics point under the coordinate system.
9. a kind of terminal device, including memory, processor and storage are in the memory and can be on the processor The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 7 when executing the computer program Any one of described in white balancing treatment method the step of.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In white balancing treatment method of the realization as described in any one of claims 1 to 7 when the computer program is executed by processor The step of.
CN201810204577.2A 2018-03-13 2018-03-13 A kind of white balancing treatment method, device, terminal device and storage medium Active CN108377372B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810204577.2A CN108377372B (en) 2018-03-13 2018-03-13 A kind of white balancing treatment method, device, terminal device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810204577.2A CN108377372B (en) 2018-03-13 2018-03-13 A kind of white balancing treatment method, device, terminal device and storage medium

Publications (2)

Publication Number Publication Date
CN108377372A CN108377372A (en) 2018-08-07
CN108377372B true CN108377372B (en) 2019-10-29

Family

ID=63018617

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810204577.2A Active CN108377372B (en) 2018-03-13 2018-03-13 A kind of white balancing treatment method, device, terminal device and storage medium

Country Status (1)

Country Link
CN (1) CN108377372B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2022186166A (en) * 2021-06-04 2022-12-15 キヤノン株式会社 Imaging apparatus, control method for the same, program, and storage medium
CN113676716B (en) * 2021-08-23 2022-10-14 深圳创维-Rgb电子有限公司 White balance control method, device, terminal equipment and storage medium
CN115334295B (en) * 2022-08-10 2024-05-03 杭州联吉技术有限公司 Image white balance processing method and electronic equipment

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1443009A (en) * 2002-02-20 2003-09-17 佳能株式会社 White balance correction device and white balance correction method
CN101193317A (en) * 2006-11-30 2008-06-04 北京思比科微电子技术有限公司 Method and device for automatic white balance processing of the image
TW200906202A (en) * 2007-07-20 2009-02-01 Novatek Microelectronics Corp Estimation method for white-point and correction method of the white balance
CN103297789A (en) * 2013-05-20 2013-09-11 周宇 White balance correcting method and white balance correcting device
TW201340727A (en) * 2012-03-19 2013-10-01 Altek Corp White balance method and apparatus thereof
CN103929632A (en) * 2014-04-15 2014-07-16 浙江宇视科技有限公司 Automatic white balance correcting method and device
CN105430367A (en) * 2015-12-30 2016-03-23 浙江宇视科技有限公司 Automatic white balance method and device
CN105472365A (en) * 2015-12-30 2016-04-06 浙江宇视科技有限公司 Automatic white balance method and device
CN105959662A (en) * 2016-05-24 2016-09-21 深圳英飞拓科技股份有限公司 Self-adaptive white balance adjusting method and device
CN106033596A (en) * 2015-03-16 2016-10-19 联想(北京)有限公司 Information processing method and electronic device
CN106454305A (en) * 2016-11-14 2017-02-22 浙江宇视科技有限公司 White balance correcting method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004312139A (en) * 2003-04-03 2004-11-04 Canon Inc Imaging unit
TWI316371B (en) * 2006-10-25 2009-10-21 Hon Hai Prec Ind Co Ltd White balance method for a digital image capture device
JP2011029866A (en) * 2009-07-24 2011-02-10 Panasonic Corp Image pickup device, image processing device, and image processing method

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1443009A (en) * 2002-02-20 2003-09-17 佳能株式会社 White balance correction device and white balance correction method
CN101193317A (en) * 2006-11-30 2008-06-04 北京思比科微电子技术有限公司 Method and device for automatic white balance processing of the image
TW200906202A (en) * 2007-07-20 2009-02-01 Novatek Microelectronics Corp Estimation method for white-point and correction method of the white balance
TW201340727A (en) * 2012-03-19 2013-10-01 Altek Corp White balance method and apparatus thereof
CN103297789A (en) * 2013-05-20 2013-09-11 周宇 White balance correcting method and white balance correcting device
CN103929632A (en) * 2014-04-15 2014-07-16 浙江宇视科技有限公司 Automatic white balance correcting method and device
CN106033596A (en) * 2015-03-16 2016-10-19 联想(北京)有限公司 Information processing method and electronic device
CN105430367A (en) * 2015-12-30 2016-03-23 浙江宇视科技有限公司 Automatic white balance method and device
CN105472365A (en) * 2015-12-30 2016-04-06 浙江宇视科技有限公司 Automatic white balance method and device
CN105959662A (en) * 2016-05-24 2016-09-21 深圳英飞拓科技股份有限公司 Self-adaptive white balance adjusting method and device
CN106454305A (en) * 2016-11-14 2017-02-22 浙江宇视科技有限公司 White balance correcting method and device

Also Published As

Publication number Publication date
CN108377372A (en) 2018-08-07

Similar Documents

Publication Publication Date Title
CN107680056B (en) Image processing method and device
CN103826066B (en) Automatic exposure adjusting method and system
CN109754377B (en) Multi-exposure image fusion method
CN106375740B (en) Generate the methods, devices and systems of RGB image
CN108377372B (en) A kind of white balancing treatment method, device, terminal device and storage medium
CN105681775B (en) A kind of white balance method and device
JP6615917B2 (en) Real-time video enhancement method, terminal, and non-transitory computer-readable storage medium
CN109361910A (en) Self-adapted white balance correction method and device
CN108337496A (en) White balancing treatment method, processing unit, processing equipment and storage medium
CN109309826B (en) Image color balancing method and device, terminal equipment and readable storage medium
CN107895350B (en) HDR image generation method based on self-adaptive double gamma transformation
CN109427041B (en) Image white balance method and system, storage medium and terminal equipment
CN108234971A (en) White balance parameter determines method, white balance adjustment method and device, storage medium, terminal
CN106683063B (en) A kind of method and apparatus of image denoising
CN109035183A (en) A kind of luminance regulating method, device and electronic equipment
CN109215614A (en) A kind of image quality adjusting method, regulating device and terminal device
CN109040579A (en) A kind of filming control method, terminal and computer-readable medium
CN106600524A (en) Image processing method and terminal
CN110570384A (en) method and device for carrying out illumination equalization processing on scene image, computer equipment and computer storage medium
CN108805873A (en) Image processing method and device
CN104715735B (en) A kind of method and apparatus of backlight adjustment
CN110444181A (en) Display methods, device, terminal and computer readable storage medium
CN114037641A (en) Low-illumination image enhancement method, device, equipment and medium
CN104732487A (en) Method and system for enhancing picture contrast
CN109003246A (en) Eye repairs graph parameter detection method

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
GR01 Patent grant
GR01 Patent grant