A kind of luminance video adjusting method and electronic equipment
Technical field
The present invention relates to video field, more particularly to a kind of luminance video adjusting method and electronic equipment.
Background technology
User during instant video interactive, where any one in video interactive both sides environment light source intensity compared with
It when weak, can cause in video that region is dimmed or fuzzy some or all of in the video frame such as corresponding user face, influence to use
The instant video at family interacts, to reduce the interactive experience of user.
When region is dimmed or fuzzy weaker and fuzzy due to the intensity of light source some or all of in video frame, user is only
The above problem can be overcome by adjusting the intensity of light source size of place environment or being moved to the stronger place of light intensity, still
In practical applications, the light source size of environment where user is uncontrollable or adjusts inconvenience, and user moves
It moves to the stronger place of light intensity and also results in inconvenience of user during instant video;In actual use, on
User experience of user during instant video can be reduced by stating two kinds of solutions all.
Invention content
In order to improve user experience of user during instant video, an embodiment of the present invention provides a kind of luminance videos
Adjusting method and electronic equipment.The technical solution is as follows:
In a first aspect, a kind of luminance video adjusting method is provided, the method includes:
Obtain the brightness of current video frame;
According to the brightness regulation parameter of the brightness of the current video frame and preceding video frame, the bright of current video frame is obtained
Spend adjustment parameter;
According to mapping equation corresponding with the brightness regulation parameter of the current video frame, the current video frame is generated
Brightness after the adjusting of each pixel.
With reference to first aspect, in the first possible implementation, it is described obtain current video frame brightness include:
If the color space of the current video frame is YUV, the data of the current video frame are obtained, are obtained current
The mean value of the brightness of video frame all pixels point is the brightness of the current video frame;
If the color space of the current video frame is RGB, the color space of the current video frame is converted to
YUV, and the data of the current video frame are obtained, the mean value for obtaining the brightness of current video frame all pixels point is described current
The brightness of video frame.
With reference to first aspect or the first possible realization method of first aspect, in second of possible realization method
In, it is described according to the brightness of the current video frame and the brightness regulation parameter of preceding video frame, obtain the bright of current video frame
It spends before adjustment parameter, the method further includes:
Transition parameter and brightness regulation range [the first brightness, the second brightness] are set;
With reference to first aspect to second of first aspect any one possible realization method, in the third possible reality
It is described according to the brightness of the current video frame and the brightness of preceding video frame in existing mode, obtain the brightness of current video frame
Adjustment parameter includes:
According to the brightness of the current video frame, the brightness regulation parameter of the preceding video frame, first brightness, institute
The second brightness and the transition parameter are stated, the brightness regulation parameter of the current video frame is generated.
The third possible realization method with reference to first aspect, in the 4th kind of possible realization method, the basis
The brightness of the current video frame, the brightness regulation parameter of the preceding video frame, first brightness, second brightness with
And the transition parameter, the brightness regulation parameter for generating the current video frame include:
Determine the minimum value between the brightness of the current video frame and the second brightness, and determine the minimum value with it is described
Maximum value between first brightness;
If the maximum value is less than or equal to the brightness regulation parameter of the preceding video frame, the first parameter, which is arranged, is
Default value;
If the brightness regulation parameter that the maximum value is more than the preceding video frame passes through according to the transition parameter
First preset formula calculates first parameter;
According to the brightness regulation parameter of the preceding video frame and first parameter, the bright of the current video frame is generated
Spend adjustment parameter.
Second with reference to first aspect is to the 4th kind of any one possible realization method, in the 5th kind of possible realization
In mode, basis mapping equation corresponding with the brightness regulation parameter of the current video frame generates the current video
Brightness after the adjusting of each pixel of frame includes:
According to the brightness regulation parameter and the second brightness, the mapping equation is generated;
According to the mapping equation, the brightness after the adjusting of each pixel of the current video frame is generated.
The 5th kind of possible realization method with reference to first aspect, in the 6th kind of possible realization method, the basis
The brightness regulation parameter and second brightness, generating the mapping equation includes:
Mapping equation is generated according to the secondary Lagrange's interpolation formula of preset three points, wherein described preset three
A point includes the first preset, the second preset and using the brightness regulation parameter and second brightness as the point of coordinate.
With reference to first aspect to the 6th kind of first aspect any one possible realization method, in the 7th kind of possible reality
In existing mode, the method further includes:
The current video frame is shown according to the brightness after the adjusting of each pixel of the current video frame
Show and/or encodes.
Second aspect, provides a kind of electronic equipment, and the electronic equipment includes:
Luminance acquisition module, the brightness for obtaining current video frame;
Adjustment parameter acquisition module, for being joined according to the brightness of the current video frame and the brightness regulation of preceding video frame
Number, obtains the brightness regulation parameter of current video frame;
Luminance acquisition module is adjusted, for public according to mapping corresponding with the brightness regulation parameter of the current video frame
Formula generates the brightness after the adjusting of each pixel of the current video frame.
In conjunction with second aspect, in the first possible implementation, the luminance acquisition module is specifically used for:
If the color space of the current video frame is YUV, the data of the current video frame are obtained, are obtained current
The mean value of the brightness of video frame all pixels point is the brightness of the current video frame;
If the color space of the current video frame is RGB, the color space of the current video frame is converted to
YUV, and the data of the current video frame are obtained, the mean value for obtaining the brightness of current video frame all pixels point is described current
The brightness of video frame.
In conjunction with the possible realization method of the first of second aspect or second aspect, in second of possible realization method
In, the equipment further includes:
Setup module, for transition parameter and brightness regulation range [the first brightness, the second brightness] to be arranged;
In conjunction with second of second aspect to second aspect any one possible realization method, in the third possible reality
In existing mode, the adjustment parameter acquisition module is specifically used for:
According to the brightness of the current video frame, the brightness regulation parameter of the preceding video frame, first brightness, institute
The second brightness and the transition parameter are stated, the brightness regulation parameter of the current video frame is generated.
In conjunction with the third possible realization method of second aspect, in the 4th kind of possible realization method, the adjusting
Parameter acquisition module is specifically used for:
Determine the minimum value between the brightness of the current video frame and the second brightness, and determine the minimum value with it is described
Maximum value between first brightness;
If the maximum value is less than or equal to the brightness regulation parameter of the preceding video frame, the first parameter, which is arranged, is
Default value;
If the brightness regulation parameter that the maximum value is more than the preceding video frame passes through according to the transition parameter
First preset formula calculates first parameter;
According to the brightness regulation parameter of the preceding video frame and first parameter, the bright of the current video frame is generated
Spend adjustment parameter.
In conjunction with second to the 4th kind of second aspect any one possible realization method, in the 5th kind of possible realization
In mode, the adjusting luminance acquisition module is specifically used for:
According to the brightness regulation parameter and the second brightness, the mapping equation is generated;
According to the mapping equation, the brightness after the adjusting of each pixel of the current video frame is generated.
In conjunction with the 5th kind of possible realization method of second aspect, in the 6th kind of possible realization method, the adjusting
Luminance acquisition module is specifically used for:
Mapping equation is generated according to the secondary Lagrange's interpolation formula of preset three points, wherein described preset three
A point includes the first preset, the second preset and using the brightness regulation parameter and second brightness as the point of coordinate.
In conjunction with the 6th kind of second aspect to second aspect any one possible realization method, in the 7th kind of possible reality
In existing mode, the equipment further includes:
Display and/or coding module, for according to the brightness after the adjusting of each pixel of the current video frame
The current video frame is shown and/or encoded.
The third aspect, provides a kind of electronic equipment, and the electronic equipment includes memory and connects with the memory
The processor connect, for the memory for storing batch processing code, the processor calls the journey that the memory is stored
Sequence code is for performing the following operations:
Obtain the brightness of current video frame;
According to the brightness regulation parameter of the brightness of the current video frame and preceding video frame, the bright of current video frame is obtained
Spend adjustment parameter;
According to mapping equation corresponding with the brightness regulation parameter of the current video frame, the current video frame is generated
Brightness after the adjusting of each pixel.
In conjunction with the third aspect, in the first possible implementation, the processor calls the memory to be stored
Program code be specifically used for executing following operation:
If the color space of the current video frame is YUV, the data of the current video frame are obtained, are obtained current
The mean value of the brightness of video frame all pixels point is the brightness of the current video frame;
If the color space of the current video frame is RGB, the color space of the current video frame is converted to
YUV, and the data of the current video frame are obtained, the mean value for obtaining the brightness of current video frame all pixels point is described current
The brightness of video frame.
In conjunction with the possible realization method of the first of the third aspect or the third aspect, in second of possible realization method
In, the program code that the processor calls the memory to be stored is additionally operable to execute following operation:
Transition parameter and brightness regulation range [the first brightness, the second brightness] are set;
In conjunction with second of the third aspect to first aspect any one possible realization method, in the third possible reality
In existing mode, the program code that the processor calls the memory to be stored is specifically used for executing following operation:
According to the brightness of the current video frame, the brightness regulation parameter of the preceding video frame, first brightness, institute
The second brightness and the transition parameter are stated, the brightness regulation parameter of the current video frame is generated.
In conjunction with the third possible realization method of the third aspect, in the 4th kind of possible realization method, the processing
The program code that device calls the memory to be stored is specifically used for executing following operation:
Determine the minimum value between the brightness of the current video frame and the second brightness, and determine the minimum value with it is described
Maximum value between first brightness;
If the maximum value is less than or equal to the brightness regulation parameter of the preceding video frame, the first parameter, which is arranged, is
Default value;
If the brightness regulation parameter that the maximum value is more than the preceding video frame passes through according to the transition parameter
First preset formula calculates first parameter;
According to the brightness regulation parameter of the preceding video frame and first parameter, the bright of the current video frame is generated
Spend adjustment parameter.
In conjunction with second to the 4th kind of the third aspect any one possible realization method, in the 5th kind of possible realization
In mode, the program code that the processor calls the memory to be stored is specifically used for executing following operation:
According to the brightness regulation parameter and the second brightness, the mapping equation is generated;
According to the mapping equation, the brightness after the adjusting of each pixel of the current video frame is generated.
In conjunction with the 5th kind of possible realization method of the third aspect, in the 6th kind of possible realization method, the processing
The program code that device calls the memory to be stored is specifically used for executing following operation:
Mapping equation is generated according to the secondary Lagrange's interpolation formula of preset three points, wherein described preset three
A point includes the first preset, the second preset and using the brightness regulation parameter and second brightness as the point of coordinate.
In conjunction with the 6th kind of the third aspect to the third aspect any one possible realization method, in the 7th kind of possible reality
In existing mode, the program code that the processor calls the memory to be stored is additionally operable to execute following operation:
The current video frame is shown according to the brightness after the adjusting of each pixel of the current video frame
Show and/or encodes.
An embodiment of the present invention provides a kind of luminance video adjusting method and electronic equipments, including:Obtain current video frame
Brightness;According to the brightness regulation parameter of the brightness of current video frame and preceding video frame, the brightness tune of current video frame is obtained
Save parameter;According to mapping equation corresponding with the brightness regulation parameter of current video frame, each pixel of current video frame is generated
Adjusting after brightness.By according to mapping equation corresponding with the brightness regulation parameter of current video frame, generating current video
Brightness after the adjusting of each pixel of frame, realizes and the brightness of current video frame is adjusted so that in the video frame
When partly or entirely region is dimmed or fuzzy weaker and fuzzy due to the intensity of light source, the clarity of video can be still kept, from
And improve user experience of user during instant video.In addition, since the brightness between adjacent video frame is related
, by the brightness of current video frame and the brightness regulation parameter of preceding video frame, the brightness of current video frame is adjusted,
Improve the accuracy of luminance video adjusting so that the luminance video after adjusting is truer, to further improve user
User experience during instant video.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for
For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings
Attached drawing.
Fig. 1 is a kind of luminance video adjusting method flow chart provided in an embodiment of the present invention;
Fig. 2 is a kind of luminance video adjusting method flow chart provided in an embodiment of the present invention;
Fig. 3 is a kind of electronic equipment structural schematic diagram provided in an embodiment of the present invention;
Fig. 4 is a kind of electronic equipment structural schematic diagram provided in an embodiment of the present invention.
Specific implementation mode
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached in the embodiment of the present invention
Figure, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only this
Invention a part of the embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art exist
The every other embodiment obtained under the premise of creative work is not made, shall fall within the protection scope of the present invention.
Embodiment one is a kind of luminance video adjusting method provided in an embodiment of the present invention, shown referring to Fig.1, the method
Including:
101, the brightness of current video frame is obtained.
Specifically, if the color space of current video frame is YUV (also referred to as YCrCb, wherein " Y " represents brightness
(Luminance or Luma), that is, grayscale value;And that " U " and " V " is indicated is then coloration (Chrominance or Chroma),
Effect is description colors of image and saturation degree, is used for the color of specified pixel), then the data of current video frame are obtained, acquisition is worked as
The mean value of the brightness of preceding video frame all pixels point is the brightness of current video frame;
If the color space of current video frame be RGB (R, Red indicate red, G, Green, indicate green, B, Blue,
Indicate blue), then the color space of current video frame is converted into YUV, and obtain the data of current video frame, forward sight is worked as in acquisition
The mean value of the brightness of frequency frame all pixels point is the brightness of current video frame.
102, according to the brightness regulation parameter of the brightness of current video frame and preceding video frame, the bright of current video frame is obtained
Spend adjustment parameter.
Specifically, according to the brightness of current video frame, the brightness regulation parameter of preceding video frame, the first brightness, second bright
Degree and transition parameter, generate the brightness regulation parameter of current video frame, which can be:
Determine the minimum value between the brightness of current video frame and the second brightness, and determine the minimum value and the first brightness it
Between maximum value;
If the maximum value is less than or equal to the brightness regulation parameter of preceding video frame, it is present count that the first parameter, which is arranged,
Value;
If the maximum value is more than the brightness regulation parameter of preceding video frame, according to transition parameter, pass through the first default public affairs
Formula calculates the first parameter;
According to the brightness regulation parameter and the first parameter of preceding video frame, the brightness regulation parameter of current video frame is generated.
Optionally, before step 102, the method further includes:
Transition parameter and brightness regulation range [the first brightness, the second brightness] are set;
103, according to mapping equation corresponding with the brightness regulation parameter of current video frame, each of current video frame is generated
Brightness after the adjusting of pixel.
Specifically, according to brightness regulation parameter and the second brightness, mapping equation is generated;
According to mapping equation, the brightness after the adjusting of each pixel of current video frame is generated.
Wherein, according to brightness regulation parameter and the second brightness, generating the process of mapping equation can be:
Mapping equation is generated according to the secondary Lagrange's interpolation formula of preset three points, wherein preset three points
Including the first preset, the second preset and using brightness regulation parameter and the second brightness as the point of coordinate.
Optionally, after step 103, the method further includes:
Current video frame is shown and/or encoded according to the brightness after the adjusting of each pixel of current video frame.
An embodiment of the present invention provides a kind of luminance video adjusting methods, by according to the brightness regulation with current video frame
The corresponding mapping equation of parameter generates the brightness after the adjusting of each pixel of current video frame, realizes to current video frame
Brightness be adjusted so that region is dimmed or fuzzy since the intensity of light source is weaker and mould some or all of in the video frame
When paste, the clarity of video can be still kept, to improve user experience of user during instant video.In addition, by
Brightness between adjacent video frame is relevant, is joined by the brightness of current video frame and the brightness regulation of preceding video frame
Number, is adjusted the brightness of current video frame, improves the accuracy of luminance video adjusting so that the luminance video after adjusting
It is more true, to further improve user experience of user during instant video.
Embodiment two is a kind of luminance video adjusting method provided in an embodiment of the present invention, with reference to shown in Fig. 2, the method
Including:
201, judge that the color space of current video frame is YUV or RGB, if the color space of current video frame is
YUV thens follow the steps 202, if the color space of current video frame is RGB, thens follow the steps 203.
Specifically, from the video format information of current video frame, the color space information of current video frame is obtained, the color
Color space information can be the color space description field included by the description field of current video frame, and the embodiment of the present invention is to tool
The acquisition modes of body are not limited;
According to the color space information of current video frame, judge that the color space of current video frame is YUV or RGB, it should
It is to be carried out matching realization, the embodiment of the present invention pair with the description field to prestore according to color space description field in deterministic process
Specific judgment mode is not limited.
202, the data of current video frame are obtained, the mean value for obtaining the brightness of current video frame all pixels point is to work as forward sight
The brightness of frequency frame.After step 202, step 204 is executed.
Specifically, the mean value of the brightness of current video frame all pixels point is obtained, and with the mean value for the current video frame
Brightness, in yuv space, the brightness of pixel can be the Y-component in yuv data, and the process can be by default
Mean value formula realize, which can be:
Wherein, YavgFor the mean value of the brightness of all pixels point, yiFor the brightness value of ith pixel point in current video frame,
N is the number of pixel in current video frame.
203, the color space of current video frame is converted into YUV, and obtains the data of current video frame, forward sight is worked as in acquisition
The mean value of the brightness of frequency frame all pixels point is the brightness of current video frame.After step 203, step 204 is executed.
Specifically, the color space of current video frame is converted to YUV by RGB, which can be according to default
Conversion formula realize, which can be:
Y=(B*1868+G*9617+R*4899+8192)/16384;
U=((B-Y) * 9241+8192)/16384+128;
V=((R-Y) * 11682+8192)/16384+128;
The mean value of the brightness of current video frame all pixels point is obtained, and is the brightness of the current video frame with the mean value,
In yuv space, the brightness of pixel can be the Y-component in yuv data, the process and the process phase described in step 202
Together, it is not repeated here herein.
It is worth noting that, step 201 to step 203 is to realize the process for the brightness for obtaining current video frame, in addition to institute
State except the mode described in process, can also realize the process by other means, the embodiment of the present invention to specific mode not
It is limited.
204, it determines the minimum value between the brightness of current video frame and the second brightness, and determines minimum value and the first brightness
Between maximum value.
Specifically, the minimum value between the brightness and the second brightness of the determining current video frame, and determine minimum value with
The process of maximum value between first brightness can realize that the comparison formula can be by preset relatively formula:
Yavg=MAX (MIN (Yavg,T1),T0)
Wherein, YavgFor the brightness of current video frame, T0For the first brightness, T1For the second brightness, respectively current video frame
Brightness regulation range two endpoints, wherein T1More than T0, brightness regulation range can be expressed as [T0, T1]
If 205, maximum value is less than or equal to the brightness regulation parameter of preceding video frame, it is default that the first parameter, which is arranged,
Numerical value.After step 205, step 207 is executed.
Specifically, the brightness regulation parameter can be expressed as D0;
If YavgLess than or equal to D0, then it is preset value that the first parameter, which is arranged, and in practical applications, which can be with
It is 0.
It is default by first according to transition parameter if 206, maximum value is more than the brightness regulation parameter of preceding video frame
Formula calculates the first parameter.After step 206, step 207 is executed.
If specifically, YavgMore than D0, then according to transition parameter, by the first preset formula, the first parameter is calculated, this
One preset formula can be:
DeltaD=(Yavg-D0)×(100-G0)/100
Wherein, deltaD is the first parameter, G0For transition parameter, YavgFor the brightness of current video frame, D0For brightness regulation
Parameter.
207, according to the brightness regulation parameter of preceding video frame and the first parameter, the brightness regulation ginseng of current video frame is generated
Number.
Specifically, the process can be realized by the second preset formula, which can be:
D1=D0+deltaD
Wherein, D1For the brightness regulation parameter of current video frame, deltaD is the first parameter, D0For brightness regulation parameter.
It is worth noting that, step 204 to step 207 is brightness and the preceding video frame realized according to current video frame
Brightness regulation parameter, obtains the process of the brightness regulation parameter of current video frame, and the step is by according to current video frame
Brightness, preceding video frame brightness regulation parameter, the first brightness, the second brightness and transition parameter, generate current video frame
Brightness regulation parameter realize according to the brightness of current video frame and the brightness regulation parameter of preceding video frame, obtain current video
The process of the brightness regulation parameter of frame can also realize the process by other means other than the mode, the present invention
Embodiment is not limited specific mode.
Since the brightness between adjacent video frame is relevant, pass through the brightness of current video frame and preceding video frame
The brightness of current video frame is adjusted in brightness regulation parameter, improves the accuracy of luminance video adjusting so that after adjusting
Luminance video it is truer, to further improve user experience of user during instant video.
Optionally, before the step 204, step can also be performed:
Transition parameter and brightness regulation range [the first brightness, the second brightness] are set.
Specifically, the embodiment of the present invention is not limited specific setting up procedure.
It should be noted that in practical applications, the transition parameter and brightness regulation range that can be set before use,
Without before executing step 204 every time, be carried out the setting transition parameter and brightness regulation range [the first brightness,
Second brightness] the step of.
Moreover, it is noted that if current video frame is the first frame of video, the brightness of current video frame is as current
The brightness regulation parameter of video frame;If current video frame is not the first frame of video, according to step 204 to step 207
Process obtains the brightness regulation parameter of current video frame.
208, mapping equation is generated according to the secondary Lagrange's interpolation formula of preset three points, wherein preset three
A point includes the first preset, the second preset and using brightness regulation parameter and the second brightness as the point of coordinate.
Specifically, in practical applications, the coordinate of the first preset can be (0,0), and the coordinate of the second preset can be with
For (255,255), (D should can be expressed as the point of coordinate using brightness regulation parameter and the second brightness1, T1), corresponding, this is reflected
Penetrating formula can be:
Y=ax2+bx
Wherein, if the value of Y is less than 0, it is 0 that Y, which is arranged, if the value of Y is more than 255, it is 255 that Y, which is arranged,.
According to the first preset, the second preset and using brightness regulation parameter and the second brightness a is determined as the point of coordinate
Value with b is respectively:
A=(D1-T1)/[D1×(255-D1)]
B=(255 × T1-D1 2)/[D1×(255-D1)]
209, according to mapping equation, the brightness after the adjusting of each pixel of current video frame is generated.
Specifically, the brightness value of all pixels point in current video frame is brought into mapping equation, generation and current video
Brightness after the adjusting of each pixel of frame;
It is worth noting that, step 208 to step 209 is realized according to corresponding with the brightness regulation parameter of current video frame
Mapping equation, the process of the brightness after the adjusting of each pixel of current video frame is generated, in addition to the side described in the step
Except formula, it can also realize that the process, the embodiment of the present invention are not limited specific mode by other means.
Optionally, after step 209, the method further includes:
210, current video frame is shown and/or is compiled according to the brightness after the adjusting of each pixel of current video frame
Code.
Specifically, according to preset idsplay order, control display device according to the brightness after adjusting to current video frame into
Row display;And/or
According to preset coded command, control display device encodes current video frame according to the brightness after adjusting.
The embodiment of the present invention is not limited specific display mode and coding mode.
An embodiment of the present invention provides a kind of luminance video adjusting methods, by according to the brightness regulation with current video frame
The corresponding mapping equation of parameter generates the brightness after the adjusting of each pixel of current video frame, realizes to current video frame
Brightness be adjusted so that region is dimmed or fuzzy since the intensity of light source is weaker and mould some or all of in the video frame
When paste, the clarity of video can be still kept, to improve user experience of user during instant video.In addition, by
Brightness between adjacent video frame is relevant, is joined by the brightness of current video frame and the brightness regulation of preceding video frame
Number, is adjusted the brightness of current video frame, improves the accuracy of luminance video adjusting so that the luminance video after adjusting
It is more true, to further improve user experience of user during instant video.
Embodiment three is a kind of electronic equipment provided in an embodiment of the present invention, with reference to shown in Fig. 3, the electronic equipment packet
It includes:
Luminance acquisition module 301, the brightness for obtaining current video frame;
Adjustment parameter acquisition module 302, for being joined according to the brightness of current video frame and the brightness regulation of preceding video frame
Number, obtains the brightness regulation parameter of current video frame;
Luminance acquisition module 303 is adjusted, is used for according to mapping equation corresponding with the brightness regulation parameter of current video frame,
Generate the brightness after the adjusting of each pixel of current video frame.
Optionally, luminance acquisition module 301 is specifically used for:
If the color space of current video frame is YUV, the data of current video frame are obtained, obtain current video frame institute
It is the brightness of current video frame to have the mean value of the brightness of pixel;
If the color space of current video frame is RGB, the color space of current video frame is converted into YUV, and obtain
The data of current video frame are taken, the mean value for obtaining the brightness of current video frame all pixels point is the brightness of current video frame.
Optionally, equipment further includes:
Setup module 304, for transition parameter and brightness regulation range [the first brightness, the second brightness] to be arranged;
Optionally, adjustment parameter acquisition module 302 is specifically used for:
According to the brightness of current video frame, the brightness regulation parameter of preceding video frame, the first brightness, the second brightness and mistake
Parameter is crossed, the brightness regulation parameter of current video frame is generated.
Optionally, adjustment parameter acquisition module 302 is specifically used for:
It determines the minimum value between the brightness of current video frame and the second brightness, and determines between minimum value and the first brightness
Maximum value;
If maximum value is less than or equal to the brightness regulation parameter of preceding video frame, it is present count that the first parameter, which is arranged,
Value;
If maximum value is more than the brightness regulation parameter of preceding video frame, according to transition parameter, by the first preset formula,
Calculate the first parameter;
According to the brightness regulation parameter and the first parameter of preceding video frame, the brightness regulation parameter of current video frame is generated.
Optionally, luminance acquisition module 303 is adjusted to be specifically used for:
According to brightness regulation parameter and the second brightness, mapping equation is generated;
According to mapping equation, the brightness after the adjusting of each pixel of current video frame is generated.
Optionally, adjustment parameter acquisition module 303 is specifically used for:
Mapping equation is generated according to the secondary Lagrange's interpolation formula of preset three points, wherein preset three points
Including the first preset, the second preset and using brightness regulation parameter and the second brightness as the point of coordinate.
Optionally, equipment further includes:
Display and/or coding module 305 are used for according to the brightness after the adjusting of each pixel of current video frame to current
Video frame is shown and/or is encoded.
An embodiment of the present invention provides a kind of electronic equipment, which passes through according to the brightness tune with current video frame
The corresponding mapping equation of parameter is saved, the brightness after the adjusting of each pixel of current video frame is generated, realizes to current video
The brightness of frame is adjusted so that some or all of in the video frame region it is dimmed or it is fuzzy since the intensity of light source is weaker and
When fuzzy, the clarity of video can be still kept, to improve user experience of user during instant video.In addition,
Since the brightness between adjacent video frame is relevant, pass through the brightness of current video frame and the brightness regulation of preceding video frame
The brightness of current video frame is adjusted in parameter, improves the accuracy of luminance video adjusting so that the video after adjusting is bright
Degree is truer, to further improve user experience of user during instant video.
Example IV is a kind of electronic equipment provided in an embodiment of the present invention, and with reference to shown in Fig. 4, the electronic equipment includes
Memory 401 and the processor 402 being connect with memory, memory 401 is for storing batch processing code, processor 402
Call the program code that memory 401 is stored for performing the following operations:
Obtain the brightness of current video frame;
According to the brightness regulation parameter of the brightness of current video frame and preceding video frame, the brightness tune of current video frame is obtained
Save parameter;
According to mapping equation corresponding with the brightness regulation parameter of current video frame, each pixel of current video frame is generated
Adjusting after brightness.
Optionally, the program code that processor 402 calls memory 401 to be stored is specifically used for executing following operation:
If the color space of current video frame is YUV, the data of current video frame are obtained, obtain current video frame institute
It is the brightness of current video frame to have the mean value of the brightness of pixel;
If the color space of current video frame is RGB, the color space of current video frame is converted into YUV, and obtain
The data of current video frame are taken, the mean value for obtaining the brightness of current video frame all pixels point is the brightness of current video frame.
Optionally, the program code that processor 402 calls memory 401 to be stored is additionally operable to execute following operation:
Transition parameter and brightness regulation range [the first brightness, the second brightness] are set;
Optionally, the program code that processor 402 calls memory 401 to be stored is specifically used for executing following operation:
According to the brightness of current video frame, the brightness regulation parameter of preceding video frame, the first brightness, the second brightness and mistake
Parameter is crossed, the brightness regulation parameter of current video frame is generated.
Optionally, the program code that processor 402 calls memory 401 to be stored is specifically used for executing following operation:
It determines the minimum value between the brightness of current video frame and the second brightness, and determines between minimum value and the first brightness
Maximum value;
If maximum value is less than or equal to the brightness regulation parameter of preceding video frame, it is present count that the first parameter, which is arranged,
Value;
If maximum value is more than the brightness regulation parameter of preceding video frame, according to transition parameter, by the first preset formula,
Calculate the first parameter;
According to the brightness regulation parameter and the first parameter of preceding video frame, the brightness regulation parameter of current video frame is generated.
Optionally, the program code that processor 402 calls memory 401 to be stored is specifically used for executing following operation:
According to brightness regulation parameter and the second brightness, mapping equation is generated;
According to mapping equation, the brightness after the adjusting of each pixel of current video frame is generated.
Optionally, the program code that processor 402 calls memory 401 to be stored is specifically used for executing following operation:
Mapping equation is generated according to the secondary Lagrange's interpolation formula of preset three points, wherein preset three points
Including the first preset, the second preset and using brightness regulation parameter and the second brightness as the point of coordinate.
Optionally, equipment further includes display module 403 and coding module 404, and processor 402 calls memory 401 to be deposited
The program code of storage is additionally operable to execute following operation:
Coding module 404 is controlled to carry out current video frame according to the brightness after the adjusting of each pixel of current video frame
Coding;And/or
Display module 403 is controlled to carry out current video frame according to the brightness after the adjusting of each pixel of current video frame
Display.
An embodiment of the present invention provides a kind of electronic equipment, which passes through according to the brightness tune with current video frame
The corresponding mapping equation of parameter is saved, the brightness after the adjusting of each pixel of current video frame is generated, realizes to current video
The brightness of frame is adjusted so that some or all of in the video frame region it is dimmed or it is fuzzy since the intensity of light source is weaker and
When fuzzy, the clarity of video can be still kept, to improve user experience of user during instant video.In addition,
Since the brightness between adjacent video frame is relevant, pass through the brightness of current video frame and the brightness regulation of preceding video frame
The brightness of current video frame is adjusted in parameter, improves the accuracy of luminance video adjusting so that the video after adjusting is bright
Degree is truer, to further improve user experience of user during instant video.
The alternative embodiment that any combination forms the present invention may be used, herein no longer in above-mentioned all optional technical solutions
It repeats one by one.
It should be noted that:Above-described embodiment provide electronic equipment when executing luminance video adjusting method, only more than
The division progress of each function module is stated for example, in practical application, it can be as needed and by above-mentioned function distribution by difference
Function module complete, i.e., the internal structure of equipment is divided into different function modules, with complete it is described above whole or
Person's partial function.In addition, the luminance video adjusting method that above-described embodiment provides belongs to same design with electronic equipment embodiment,
Its specific implementation process refers to embodiment of the method, and which is not described herein again.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can pass through hardware
It completes, relevant hardware can also be instructed to complete by program, the program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent replacement, improvement and so on should all be included in the protection scope of the present invention.