CN110351542A - A kind of color correcting method and device for video frame - Google Patents
A kind of color correcting method and device for video frame Download PDFInfo
- Publication number
- CN110351542A CN110351542A CN201910600689.4A CN201910600689A CN110351542A CN 110351542 A CN110351542 A CN 110351542A CN 201910600689 A CN201910600689 A CN 201910600689A CN 110351542 A CN110351542 A CN 110351542A
- Authority
- CN
- China
- Prior art keywords
- image
- channel
- range
- correction
- variance
- 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.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
- H04N9/68—Circuits for processing colour signals for controlling the amplitude of colour signals, e.g. automatic chroma control circuits
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
- H04N9/73—Colour balance circuits, e.g. white balance circuits or colour temperature control
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Processing Of Color Television Signals (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
A kind of color correcting method and device for video frame, this method calculate separately the average value and variance yields of R, G, B triple channel;Recycle the characteristic mean and variance in each channel, design normalization range;It is normalized within the scope of the normalization, the histogram distribution range in three channels of image after available correction, then exports image.It may be implemented in video image pretreatment stage, by the colour correction carried out to colour cast image, to reach the application requirement for meeting later image and quickly identifying.
Description
Technical field
The present invention relates to technical field of image processing, and in particular to a kind of color correcting method and dress for video frame
It sets.
Background technique
Color is the important evidence of one of important feature of image, generally also image procossing and analysis, particularly with mesh
Research of the mark not with the computer vision fields such as detection, image segmentation and video frequency searching has a very important significance.Object
Color be reflected by it rate characteristic and determined, since human visual system has color constancy, can disappear to a certain extent
An influence except factors such as illumination conditions on color, but imaging device does not have this " adjusting " function, will receive the extraneous ring of light
The influence of the factors such as the characteristic in border, imaging photosensitive component itself, causes between image color and object realistic colour that there are one
Determine the error in degree, i.e. " colour cast ".Especially most of cameras can only realize simple Image Acquisition at present, transmit function
Can, it cannot be guaranteed that the quality of acquisition image, during color image obtains, same scenery acquires under varying environment light source
Image color value difference it is larger, this not only influences the visual effect of image, while can be to image segmentation, after target identification etc.
Continuous processing has an impact, so color cast correction is image procossing and the indispensable step of computer vision field.
For colour cast caused by light source, most of color cast correction algorithms are all divided into two steps: colour cast detection and colour cast school at present
Just, common colour cast detection and bearing calibration have:
1. white balance method, it is assumed that in piece image, high light reflectivity or white surface portions in scene cause RGB tri-
Color Channel responds maximum value, and 80% pixel of maximum value is greater than using the maximum value or brightness value of image RGB triple channel
Estimation illumination of the luminance information as scene, to achieve the purpose that colour cast detection and color cast correction.
2. gray world method, it is assumed that coloury image R under classical light source, G, the color mean value of B triple channel
Answer it is equal, one should be intended to known to " grey " constant, using the mean value of Color Channel as the key statistics of unknown light source
Amount, using the R of image, G, channel B mean value is as " gray scale " the mean value comparison under circumstances not known light source, with classical light source, to reach
To the purpose of colour cast detection and color cast correction.
3. statistics with histogram method is analyzed by the histogram distribution to color image R, G, B triple channel, judges image
With the presence or absence of color offset phenomenon, then realized between triple channel by adjusting the intensity profile of triple channel.
In the prior art, above-mentioned mentioned method all has certain limitation, the main means of detection and correction
Be carried out in rgb space, but rgb space have it is not intuitive, unevenly, the features such as device dependence, in some cases .., no
It can preferably meet the requirements.The major defect of three kinds of methods is as follows:
1. without white or high light reflectivity part being that the result of detection and the correction of white balance method is with regard to unreliable in the scene;
2. when the number of colours in image is less or when there is bulk solid color, gray world method can not just be obtained
Desired effect;
3. statistics with histogram method is only applicable to the serious image of colour cast, the image small for colour cast degree, effect is unobvious,
Limit its applicability.
Summary of the invention
The application provides a kind of color correcting method for video frame, in video image pretreatment stage, by color
The colour correction that inclined image carries out, to reach the application requirement for meeting later image and quickly identifying.
According in a first aspect, providing a kind of color correcting method for video frame in a kind of embodiment, comprising:
Step S100: the average value and variance yields of R, G, B triple channel are calculated separately;
Step S200: the characteristic mean and variance in each channel, design normalization range are utilized;
Step S300: being normalized in the normalization range, three channels of image after available correction
Histogram distribution range, then export image.
In some embodiments, the normalization range are as follows:
Wherein, c ∈ (R, G, B),WithThe mean value in each channel of representative image,Representative image is each logical
The variance in road,WithRespectively normalized maximum value and minimum value, lambda parameter are one for controlling dynamic range of images
Weight.
In some embodiments, λ ∈ (4,5).
In some embodiments, the histogram distribution range covers entire X-axis, and X-axis indicates that each channel is the model of 0-255
It encloses.
In some embodiments, the step S300 further include: the rgb space of image after correction is transformed into HSV space, base
In Retinex model, Illumination adjusting is carried out to the channel V, then rgb space is converted back by HSV space, export image.
According to second aspect, a kind of device of colour correction for video frame is provided in a kind of embodiment, comprising:
For calculating separately the average value of R, G, B triple channel and the module of variance yields
For the characteristic mean and variance using each channel, the module of design normalization range;
For being normalized in the normalization range, the histogram in three channels of image after available correction
Distribution, then export the module of image.
In some embodiments, device described in second aspect further include:
For the rgb space of image after correction to be transformed into HSV space, it is based on Retinex model, light is carried out to the channel V
Rgb space is converted back according to adjusting, then by HSV space, exports the module of image.
According to the third aspect, a kind of device of colour correction for video frame is provided in a kind of embodiment, feature exists
In including:
Memory, for storing program;
Processor, for the program by executing the memory storage to realize method as described in relation to the first aspect.
According to fourth aspect, a kind of computer readable storage medium is provided in a kind of embodiment, which is characterized in that including journey
Sequence, described program can be executed by processor to realize method as described in relation to the first aspect.
According to above-described embodiment, a kind of color correcting method for video frame provided by the present application utilizes each channel
Characteristic mean and variance, design normalization range, are normalized in normalization range, so that video image pre-processes rank
Section, by the colour correction carried out to colour cast image, to reach the application requirement for meeting later image and quickly identifying, so that each
Under kind of light environment, can effectively solve colour temperature it is too high or too low caused by shooting acquisition there are a degree of colour casts
Image, to obtain the image of unified non-colour cast.
Detailed description of the invention
Fig. 1 is a kind of color correcting method flow chart for video frame of embodiment;
Fig. 2 is the color correcting method flow chart for video frame of another embodiment.
Specific embodiment
Below by specific embodiment combination attached drawing, invention is further described in detail.Wherein different embodiments
Middle similar component uses associated similar element numbers.In the following embodiments, many datail descriptions be in order to
The application is better understood.However, those skilled in the art can recognize without lifting an eyebrow, part of feature
It is dispensed, or can be substituted by other elements, material, method in varied situations.In some cases, this Shen
Please it is relevant it is some operation there is no in the description show or describe, this is the core in order to avoid the application by mistake
More descriptions are flooded, and to those skilled in the art, these relevant operations, which are described in detail, not to be necessary, they
Relevant operation can be completely understood according to the general technology knowledge of description and this field in specification.
It is formed respectively in addition, feature described in this description, operation or feature can combine in any suitable way
Kind embodiment.Meanwhile each step in method description or movement can also can be aobvious and easy according to those skilled in the art institute
The mode carry out sequence exchange or adjustment seen.Therefore, the various sequences in the description and the appended drawings are intended merely to clearly describe a certain
A embodiment is not meant to be necessary sequence, and wherein some sequentially must comply with unless otherwise indicated.
Referring to FIG. 1, the application provides a kind of color correcting method for video frame, comprising:
Step S100: firstly, assuming that theory, the color based on the R of colour cast image, G, B triple channel are equal according to gray world
Value should tend to equal principle, independently calculate the average value and variance yields of triple channel, calculate separately the flat of R, G, B triple channel
Mean value and variance yields;
Step S200: the characteristic mean and variance in each channel, design normalization range are utilized;
Step S300: it is normalized in normalization range, the histogram in three channels of image after available correction
Figure distribution, then export image.
In step S200, range is normalized are as follows:
Wherein, c ∈ (R, G, B),WithThe mean value in each channel of representative image,Representative image is each logical
The variance in road,WithRespectively normalized maximum value and minimum value, lambda parameter are one for controlling dynamic range of images
Weight.
Preferably, it is preferable in the range calibration result of (4,5) that λ is obtained based on experience value.If parameter is too low, knot will lead to
Fruit image excessively enhances, and parameter is excessively high, will lead to image and owes enhancing.In some embodiments, λ ∈ (4,5).
In step S200,It is normalized in range, three channels of image after available correction
Histogram distribution range, party's figure distribution covers entire X-axis, and X-axis indicates that each channel is the range of 0-255.
Image after colour correction may possibly still be present under-exposed problem.It, can be according to reality with reference to Fig. 2
It is further processed in application scenarios, i.e., the rgb space for correcting image is transformed into HSV space, can be based on
Retinex model, then Illumination adjusting individually is carried out to the channel V, to achieve the effect that image enhancement.
In some embodiments, step S300 further include: the rgb space of image after correction is transformed into HSV space, is based on
Retinex model carries out Illumination adjusting to the channel V, then converts back rgb space by HSV space, exports image.
Correspondingly, the application also provides a kind of device of colour correction for video frame, comprising:
For calculating separately the average value of R, G, B triple channel and the module of variance yields;
For the characteristic mean and variance using each channel, the module of design normalization range;
For being normalized in normalization range, the histogram distribution in three channels of image after available correction
Range, then export the module of image.
In some embodiments, the device further include:
For the rgb space of image after correction to be transformed into HSV space, it is based on Retinex model, light is carried out to the channel V
Rgb space is converted back according to adjusting, then by HSV space, exports the module of image.
In some embodiments, the application also provides a kind of device of colour correction for video frame, comprising:
Memory, for storing program;
Processor, for the program by executing the memory storage to realize the above method.
In some embodiments, the application also provides a kind of computer readable storage medium, including program, and described program can
It is executed by processor to realize the above method.
It will be understood by those skilled in the art that all or part of function of various methods can pass through in above embodiment
The mode of hardware is realized, can also be realized by way of computer program.When function all or part of in above embodiment
When being realized by way of computer program, which be can be stored in a computer readable storage medium, and storage medium can
To include: read-only memory, random access memory, disk, CD, hard disk etc., it is above-mentioned to realize which is executed by computer
Function.For example, program is stored in the memory of equipment, when executing program in memory by processor, can be realized
State all or part of function.In addition, when function all or part of in above embodiment is realized by way of computer program
When, which also can store in storage mediums such as server, another computer, disk, CD, flash disk or mobile hard disks
In, through downloading or copying and saving into the memory of local device, or version updating is carried out to the system of local device, when logical
When crossing the program in processor execution memory, all or part of function in above embodiment can be realized.
Use above specific case is illustrated the present invention, is merely used to help understand the present invention, not to limit
The system present invention.For those skilled in the art, according to the thought of the present invention, can also make several simple
It deduces, deform or replaces.
Claims (9)
1. a kind of color correcting method for video frame characterized by comprising
Step S100: the average value and variance yields of R, G, B triple channel are calculated separately;
Step S200: the characteristic mean and variance in each channel, design normalization range are utilized;
Step S300: being normalized in the normalization range, the histogram in three channels of image after available correction
Figure distribution, then export image.
2. the method as described in claim 1, which is characterized in that the normalization range are as follows:
Wherein, c ∈ (R, G, B),WithThe mean value in each channel of representative image,The each channel of representative image
Variance,WithRespectively normalized maximum value and minimum value, lambda parameter are a power for controlling dynamic range of images
Weight.
3. method according to claim 2, which is characterized in that λ ∈ (4,5).
4. the method as described in claim 1, which is characterized in that the histogram distribution range covers entire X-axis, and X-axis indicates
Each channel is the range of 0-255.
5. method according to any one of claims 1 to 4, which is characterized in that the step S300 further include: after correction
The rgb space of image is transformed into HSV space, is based on Retinex model, carries out Illumination adjusting to the channel V, then turned by HSV space
Rgb space is gained, image is exported.
6. a kind of device of the colour correction for video frame characterized by comprising
For calculating separately the average value of R, G, B triple channel and the module of variance yields
For the characteristic mean and variance using each channel, the module of design normalization range;
For being normalized in the normalization range, the histogram distribution in three channels of image after available correction
Range, then export the module of image.
7. device as described in claim 1, which is characterized in that further include:
For the rgb space of image after correction to be transformed into HSV space, it is based on Retinex model, illumination tune is carried out to the channel V
Section, then rgb space is converted back by HSV space, export the module of image.
8. a kind of device of the colour correction for video frame, characterized by comprising:
Memory, for storing program;
Processor, for the program by executing the memory storage to realize as of any of claims 1-4
Method.
9. a kind of computer readable storage medium, which is characterized in that including program, described program can be executed by processor with reality
Now such as method of any of claims 1-4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910600689.4A CN110351542A (en) | 2019-07-04 | 2019-07-04 | A kind of color correcting method and device for video frame |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910600689.4A CN110351542A (en) | 2019-07-04 | 2019-07-04 | A kind of color correcting method and device for video frame |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110351542A true CN110351542A (en) | 2019-10-18 |
Family
ID=68177548
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910600689.4A Pending CN110351542A (en) | 2019-07-04 | 2019-07-04 | A kind of color correcting method and device for video frame |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110351542A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110996173A (en) * | 2019-12-18 | 2020-04-10 | 腾讯科技(深圳)有限公司 | Image data processing method and device and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160360174A1 (en) * | 2015-06-02 | 2016-12-08 | Samsung Electronics Co., Ltd. | Tonal-zone adaptive tone mapping |
CN107507138A (en) * | 2017-07-27 | 2017-12-22 | 北京大学深圳研究生院 | A kind of underwater picture Enhancement Method based on Retinex model |
-
2019
- 2019-07-04 CN CN201910600689.4A patent/CN110351542A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160360174A1 (en) * | 2015-06-02 | 2016-12-08 | Samsung Electronics Co., Ltd. | Tonal-zone adaptive tone mapping |
CN107507138A (en) * | 2017-07-27 | 2017-12-22 | 北京大学深圳研究生院 | A kind of underwater picture Enhancement Method based on Retinex model |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110996173A (en) * | 2019-12-18 | 2020-04-10 | 腾讯科技(深圳)有限公司 | Image data processing method and device and storage medium |
CN110996173B (en) * | 2019-12-18 | 2021-11-05 | 腾讯科技(深圳)有限公司 | Image data processing method and device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9020243B2 (en) | Image adjustment | |
US10949958B2 (en) | Fast fourier color constancy | |
US9292911B2 (en) | Automatic image adjustment parameter correction | |
US11323676B2 (en) | Image white balance processing system and method | |
US9275445B2 (en) | High dynamic range and tone mapping imaging techniques | |
Hwang et al. | Context-based automatic local image enhancement | |
US8903169B1 (en) | Automatic adaptation to image processing pipeline | |
US20150170389A1 (en) | Automatic selection of optimum algorithms for high dynamic range image processing based on scene classification | |
US20120219218A1 (en) | Automatic localized adjustment of image shadows and highlights | |
WO2018149253A1 (en) | Image processing method and device | |
JP2014520446A (en) | Automatic exposure compensation for images | |
CN108230256A (en) | Image processing method, device, computer installation and computer readable storage medium | |
US20220292635A1 (en) | Method and apparatus with image correction | |
JP2002232728A (en) | Image processing program, computer readable recording medium with image processing program recorded thereon, image processing apparatus, and image processing method | |
US7885458B1 (en) | Illuminant estimation using gamut mapping and scene classification | |
Abebe et al. | Towards an automatic correction of over-exposure in photographs: Application to tone-mapping | |
US8565523B2 (en) | Image content-based color balancing | |
US9734561B2 (en) | Image enhancement based on the reflectance component | |
Hassan | A uniform illumination image enhancement via linear transformation in CIELAB color space | |
TW202004662A (en) | Method and computer system of image enhancement | |
CN110351542A (en) | A kind of color correcting method and device for video frame | |
WO2016113407A1 (en) | Methods and apparatus for groupwise contrast enhancement | |
CN114266803A (en) | Image processing method, image processing device, electronic equipment and storage medium | |
Ulucan et al. | Multi-scale color constancy based on salient varying local spatial statistics | |
CN112883989A (en) | Picture processing 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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20191018 |