CN107566695B - A kind of light compensation method and mobile terminal - Google Patents
A kind of light compensation method and mobile terminal Download PDFInfo
- Publication number
- CN107566695B CN107566695B CN201710693895.5A CN201710693895A CN107566695B CN 107566695 B CN107566695 B CN 107566695B CN 201710693895 A CN201710693895 A CN 201710693895A CN 107566695 B CN107566695 B CN 107566695B
- Authority
- CN
- China
- Prior art keywords
- light filling
- target area
- intensity
- brightness
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Studio Devices (AREA)
Abstract
The invention discloses a kind of light compensation methods, execute in the terminal, comprising: mobile terminal screen are divided into imaging region and light filling region, imaging region is located at the center of screen, and light filling region is located at the boundary of screen, and including at least two light filling units;Target area in recognition imaging region, target area are human face region or portrait area;Calculate target area brightness and background area brightness, wherein background area is the region in imaging region other than target area;When the difference of target area brightness and background area brightness is greater than first threshold, the attribute value of each pixel in light filling unit is adjusted to realize light filling.The present invention discloses corresponding mobile terminal together.According to the technique and scheme of the present invention, balanced light filling may be implemented, make the brightness of entire picture more uniform while improving brightness of image, improve image quality.
Description
Technical field
It takes pictures ancillary technique field more particularly to a kind of light compensation method and mobile terminal the present invention relates to mobile terminal.
Background technique
In actual life, people carry out self-timer commonly using mobile terminal.Self-timer generate photo tone usually with
Ambient light when taking pictures is consistent, seriously affects self-timer effect sometimes.For example, the cloudy day or the insufficient lights such as night the case where
Under, the photo taken is often more gloomy, and image quality is lower.
It exists in the prior art some light compensation methods, such as opens flash lamp, opens light compensating lamp, by mobile terminal screen
Brightness is adjusted to highest, is superimposed solid background, etc. on the screen.But flash lighting is only applicable to image after using
Head the case where taking pictures, the case where self-timer can not be suitable for (self-timer uses front camera);Light compensating lamp, the side that screen intensity is turned up
Case can generate strong light, cause human eye uncomfortable, and pupil is shunk rapidly, and eyes be closed or frown with conditioned reflex, shoot
Portrait is unnatural, and tablet quality declines out;And it is superimposed the scheme of solid background, the light of screen middle position transmitting can be than screen side
Light along transmitting is strong, so that the light for causing shooting to supplement is uneven, image quality is bad.
Summary of the invention
For this purpose, the present invention provides a kind of light compensation method and mobile terminal, exist above to solve the problems, such as or at least alleviate.
According to an aspect of the present invention, a kind of light compensation method is provided, is executed in the terminal, comprising: will be mobile whole
End screen is divided into imaging region and light filling region, and imaging region is located at the center of screen, and light filling region is located at the side of screen
At boundary, and including at least two light filling units;Target area in recognition imaging region, target area are human face region or portrait
Region;Target area brightness and background area brightness are calculated, target area brightness is the flat of the brightness of each pixel in target area
Mean value, background area brightness are the average value of the brightness of each pixel in background area, wherein background area is to remove in imaging region
Region except target area;When the difference of target area brightness and background area brightness is greater than first threshold, adjustment is mended
The attribute value of each pixel is in light unit to realize light filling.
Optionally, in light compensation method according to the present invention, above-mentioned at least two light filling unit is arranged to relative to shifting
The central axes of dynamic terminal screen are symmetrical.
Optionally, in light compensation method according to the present invention, the brightness of above-mentioned pixel is to be calculated according to the rgb value of pixel
Gray value out.
Optionally, it in light compensation method according to the present invention, adjusts the attribute value of each pixel in light filling unit and is mended with realizing
The step of light includes: to determine that maximum light filling intensity and minimum light filling are strong according to the difference of target area brightness and background area brightness
Degree, wherein each light filling intensity corresponds to one group of attribute value;Calculate separately each light filling unit to target area away from
From;Attribute value corresponding to maximum light filling intensity, farthest light filling list are set by the attribute value of pixel each in farthest light filling unit
Member is the farthest light filling unit in distance objective region;It is strong that minimum light filling is set by the attribute value of pixel each in nearest light filling unit
The corresponding attribute value of degree, nearest light filling unit are the nearest light filling unit in distance objective region;It will be each in other light filling units
The attribute value of pixel is set as between attribute value corresponding to attribute value corresponding to minimum light filling intensity to maximum light filling intensity
Numerical value, other light filling units are light filling unit other than farthest light filling unit and nearest light filling unit in light filling region.
Optionally, in light compensation method according to the present invention, maximum light filling intensity is 1, and minimum light filling intensity is according to formula
Min (max (0, (G1-G2)/M), 1) is determined, wherein G1 is target area brightness, and G2 is background area brightness, and M is target
The maximum difference of regional luminance and background area brightness, max () expression are maximized, and min () expression is minimized.
Optionally, in light compensation method according to the present invention, attribute includes transparency and rgb value;One light filling intensity institute
Corresponding one group of attribute value are as follows: transparency=light filling intensity * 100%;R value=R default value * light filling intensity;G value=G default value *
Light filling intensity;B value=B default value * light filling intensity;Wherein, R default value, G default value, B default value are preset constant.
Optionally, in light compensation method according to the present invention, the distance of light filling unit to target area is light filling unit
Central point to target area central point distance.
Optionally, in light compensation method according to the present invention, the distance of light filling unit to target area is light filling unit
The minimum value of the distance at any point on central point to target area boundaries.
Optionally, it in light compensation method according to the present invention, sets the attribute value of pixel each in other light filling units to
The step of numerical value between attribute value corresponding to attribute value corresponding to minimum light filling intensity to maximum light filling intensity includes: pair
In any one other light filling unit: determining other light filling units according to the distance of other light filling units to the target area
Light filling intensity;Attribute value corresponding to above-mentioned light filling intensity is set by the attribute value of each pixel in other light filling units.
Optionally, in light compensation method according to the present invention, the light filling intensity of other light filling units is true according to following formula
It is fixed:
Wherein, bg indicates the light filling intensity of other light filling units, and bgmax is maximum light filling intensity, and bgmin is minimum light filling
Intensity, dmax are distance of the farthest light filling unit to target area, and dmin is distance of the nearest light filling unit to target area, d
For the distance of other light filling units to target area.
According to an aspect of the present invention, a kind of mobile terminal is provided, comprising: at least one processor;Be stored with journey
The memory of sequence instruction, wherein program instruction is configured as being suitable for being executed by least one above-mentioned processor, and program instruction includes
For executing the instruction of light compensation method as described above.
According to an aspect of the present invention, a kind of readable storage medium storing program for executing for being stored with program instruction is provided, when the program refers to
When order is read by the mobile terminal and executes, so that mobile terminal execution light compensation method as described above.
According to the technique and scheme of the present invention, when user opens front camera, screen is divided into imaging region and benefit
Light region two parts.Imaging region is located at the center of screen, is used for live preview self-timer image;Light filling region is located at screen
Boundary includes at least two light filling units in light filling region, for realizing light filling, increases brightness of image.In user's self-timer,
Face in automatic identification imaging region adjusts light filling list by calculating and comparing target area brightness and background area brightness
The attribute value of each pixel is in member to realize light filling.The present invention separates light filling region and imaging region, and light filling region is only arranged at
The boundary of screen, and light filling intensity adjusts in real time according to the imaging contexts of preview, can avoid causing not eyes of user
Brightness of image is improved under the premise of suitable, and the image of preview is consistent with next image is finally shot in imaging region, finding is
Gained, so that user be facilitated to take satisfied photo.
Specifically, light filling unit of the invention is preferably set to symmetrical relative to the central axes of mobile terminal screen,
For example, being symmetrically arranged a certain number of light filling units at left and right sides of screen, or one is symmetrically arranged in the surrounding of screen
The light filling unit, etc. of fixed number amount, so as to realize balanced light filling, avoid occurring after light filling image side is too bright, side too
Dark situation, improves image quality.
In addition, technical solution of the present invention is greater than first threshold in the difference of target area brightness and background area brightness
When, light filling is carried out, difference is bigger, and light filling intensity is bigger.Meanwhile the light filling intensity of different light filling units is also not quite similar, away from
The light filling intensity of the light filling unit remoter from target area is bigger, and the light filling intensity of the closer light filling unit in distance objective region is more
It is small.In this way, the light filling of varying strength can be carried out adaptively to target area and background area, the same of brightness of image is being improved
When make the brightness of entire picture more uniform, improve image quality.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention,
And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can
It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
To the accomplishment of the foregoing and related purposes, certain illustrative sides are described herein in conjunction with following description and drawings
Face, these aspects indicate the various modes that can practice principles disclosed herein, and all aspects and its equivalent aspect
It is intended to fall in the range of theme claimed.Read following detailed description in conjunction with the accompanying drawings, the disclosure it is above-mentioned
And other purposes, feature and advantage will be apparent.Throughout the disclosure, identical appended drawing reference generally refers to identical
Component or element.
Fig. 1 shows the schematic diagram of mobile terminal 100 according to an embodiment of the invention;
Fig. 2 shows the flow charts of light compensation method 200 according to an embodiment of the invention;And
Fig. 3 shows the schematic diagram of the region division of mobile terminal screen 300 according to an embodiment of the invention.
Specific embodiment
Exemplary embodiments of the present disclosure are described in more detail below with reference to accompanying drawings.Although showing the disclosure in attached drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here
It is limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure
It is fully disclosed to those skilled in the art.
Fig. 1 shows the structure chart of mobile terminal 100 according to an embodiment of the invention.Mobile terminal 100 can be
Mobile phone, tablet computer, laptop, multimedia player, wearable device configured with front camera and display screen
Deng, but not limited to this.As shown in Figure 1, mobile terminal 100 may include memory interface 102, multi-core processor 104, and outer
Enclose interface 106.
Memory interface 102, multi-core processor 104 and/or peripheral interface 106 can also collect either discrete component
At in one or more integrated circuits.In the mobile terminal 100, various elements can by one or more communication bus or
Signal wire couples.Sensor, equipment and subsystem may be coupled to peripheral interface 106, to help to realize multiple functions.
For example, acceleration transducer 110, magnetic field sensor 112 and gravity sensor 114 may be coupled to peripheral interface
106, acceleration transducer 110 can acquire the acceleration information on three change in coordinate axis direction of fuselage coordinates system, and magnetic field passes
Sensor 112 can acquire the magnetic field data (magnetic induction intensity) on three change in coordinate axis direction of fuselage coordinates system, gravity sensitive
Device 114 can acquire the gravimetric data in three reference axis of fuselage coordinates system, the above sensor can be convenient realize step counting,
The functions such as orientation, horizontal/vertical screen intelligence switching.Other sensors 116 can equally be connected with peripheral interface 106, such as positioning system
(such as GPS receiver), temperature sensor, biometric sensor or other sensor devices, it is possible thereby to help to implement correlation
Function.
Camera sub-system 120 and optical sensor 122 can be used for the camera of convenient such as record photos and video clips
The realization of function, wherein the camera sub-system and optical sensor for example can be charge-coupled device (CCD) or complementary gold
Belong to oxide semiconductor (CMOS) optical sensor.It can help to realize by one or more radio communication subsystems 124
Communication function, wherein radio communication subsystem may include radio-frequency transmitter and transmitter and/or light (such as infrared) receiver
And transmitter.The particular design and embodiment of radio communication subsystem 124 can depend on mobile terminal 100 is supported one
A or multiple communication networks.For example, mobile terminal 100 may include be designed to support LTE, 3G, GSM network, GPRS network,
The communication subsystem 124 of EDGE network, Wi-Fi or WiMax network and BlueboothTM network.
Audio subsystem 126 can be coupled with loudspeaker 128 and microphone 130, to help to implement to enable voice
Function, such as speech recognition, speech reproduction, digital record and telephony feature.I/O subsystem 140 may include touch screen control
Device 142 processed and/or other one or more input controllers 144.Touch screen controller 142 may be coupled to touch screen 146.It lifts
For example, any one of a variety of touch-sensing technologies are can be used to detect in the touch screen 146 and touch screen controller 142
The contact and movement or pause carried out therewith, wherein detection technology includes but is not limited to capacitive character, resistive, infrared and table
Face technology of acoustic wave.Other one or more input controllers 144 may be coupled to other input/control devicess 148, such as one
Or the pointer device of multiple buttons, rocker switch, thumb wheel, infrared port, USB port, and/or stylus etc.It is described
One or more button (not shown)s may include the up/down for controlling 130 volume of loudspeaker 128 and/or microphone
Button.
Memory interface 102 can be coupled with memory 150.The memory 150 may include internal storage and outer
Portion's memory, internal storage for example can be static random access memory (SRAM), nonvolatile memory (NVRAM)
Deng, but not limited to this;External memory for example can be hard disk, mobile hard disk, USB flash disk etc., but not limited to this.Memory 150
It can store program instruction, program instruction for example may include operating system 152 and using 154.Operating system 152 for example can be with
It is Android, iOS, Windows Phone etc. comprising for handling basic system services and executing dependent on hardware
The program instruction of task.Memory 150 can also be stored using 154, and application 154 may include for realizing various users expectation
Function program instruction.It can be using 154 independently of operating system offer, be also possible to what operating system carried.Separately
Outside, when application 154 is mounted in mobile terminal 100, drive module can also be added to operating system.It is run in mobile device
When, meeting load operating system 152 from memory 150, and executed by processor 104.It at runtime using 154, also can be from
It loads in memory 150, and is executed by processor 104.Operated on operating system using 154, using operating system and
The interface that bottom hardware provides realizes the various desired functions of user, such as hardware management, instant messaging, web page browsing.
In above-mentioned various applications 154, one such application is light compensating apparatus 160 according to the present invention, can be
When user opens front camera, screen is divided into imaging region and light filling region two parts.Imaging region is located at screen
At center, it to be used for live preview self-timer image;Light filling region is located at the boundary of screen, includes at least two benefits in light filling region
Light unit increases brightness of image for realizing light filling.In user's self-timer, face in automatic identification imaging region passes through meter
It calculates and compares target area brightness and background area brightness, adjust the attribute value of each pixel in light filling unit to realize light filling, from
And improve image quality.
Fig. 2 shows the flow charts of light compensation method 200 according to an embodiment of the invention.Method 200 is suitable in movement
It is executed in terminal (such as mobile terminal 100).As shown in Fig. 2, method 200 starts from step S210.
In step S210, mobile terminal screen is divided into imaging region and light filling region, imaging region is located at screen
Center at, light filling region is located at the boundary of screen, and including at least two light filling units.It is above-mentioned according to a kind of embodiment
At least two light filling units are arranged to symmetrical relative to the central axes of mobile terminal screen, so as to realize balanced light filling,
There is the situation that image side is too bright, side is too dark after avoiding light filling, improves image quality.
For example, Fig. 3 shows the signal of the region division of mobile terminal screen 300 according to an embodiment of the invention
Figure.Screen 300 shown in Fig. 3 is divided into imaging region 320 and light filling region 340.Imaging region 320 is located at the center of screen
Position is used for live preview self-timer image;Light filling region 340 is located at the left and right sides boundary of screen 300, for realizing benefit
Light increases brightness of image.Light filling region 340 includes multiple light filling units 342, and this multiple light filling unit 342 is about screen
Central axes 360 are symmetrical.
Although should be pointed out that light filling unit 342 shown in Fig. 3 is circle, in other embodiments, light filling unit can
To be arranged to the arbitrary shape such as ellipse, rectangle, heart, star, the present invention to the shape of light filling unit with no restrictions.
Then, in step S220, target area in recognition imaging region, target area is human face region or portrait area
Domain.It should be pointed out that the region in human face region, that is, image where face, the area in portrait area, that is, image where people's face and body
Domain.For example, as shown in figure 3, the human face region where rectangle frame 322 is target area.It should be pointed out that the present invention is to recognition of face
Or specific algorithm used by Identification of Images is with no restrictions, those skilled in the art can select any people according to actual needs
Face, human Facial Image Recognition Algorithm.
After identifying target area, imaging region can be divided into two parts: target area and background area, back
Scene area is the region in imaging region other than target area.For example, as shown in figure 3, imaging region 320 further by
It is divided into target area 322 and background area 324.
Then, in step S230, target area brightness and background area brightness are calculated, target area brightness is target area
The average value of the brightness of each pixel in domain, background area brightness are the average value of the brightness of each pixel in background area, wherein back
Scene area is the region in imaging region other than target area.
According to a kind of embodiment, the brightness of pixel is the gray value being calculated according to the rgb value of pixel.According to a kind of reality
Apply example, the brightness of pixel can be the rgb value weighted sum of pixel as a result, for example, brightness=λ of pixel1* R value+λ2* G value+
λ3* B value, λ1、λ2、λ3The respectively gray processing weight of R value, G value, B value, λ1、λ2、λ3Such as can be separately arranged as 0.3,
0.59 and 0.11, certainly, λ1、λ2、λ3It may be also configured to other numerical value, there is no restriction for specific value of the present invention to three
Limitation.Further, it is noted that being only the present invention using the gray value being calculated according to the rgb value of pixel as the brightness of pixel
A kind of possible embodiment, in other examples, the brightness of pixel can also be pixel in the V in hsv color space
The value in channel, the value, etc. in the channel Y of the value or YUV color space in the channel L of Lab color space, this
Invention to the specific representation method of the brightness of pixel with no restrictions.
Then, it in step S240, when the difference of target area brightness and background area brightness is greater than first threshold, adjusts
The attribute value of each pixel in light unit is reorganized and brought up to full strength to realize light filling.The value of first threshold can voluntarily be set by those skilled in the art
It sets, the present invention is without limitation, for example, can set 0 for first threshold.
According to a kind of embodiment, step S240 can be implemented further according to following steps S241~S245:
In step S241, according to the determining maximum light filling intensity of the difference of target area brightness and background area brightness and most
Small light filling intensity, wherein each light filling intensity corresponds to one group of attribute value.
According to a kind of embodiment, attribute includes transparency and rgb value, one group of attribute value corresponding to a light filling intensity
Are as follows:
Transparency=light filling intensity * 100% (1)
R value=R default value * light filling intensity (2)
G value=G default value * light filling intensity (3)
B value=B default value * light filling intensity (4)
Wherein, R default value, G default value, B default value are preset constant.It should be pointed out that the R in formula (2)~(4)
Value, G value, B value, R default value, G default value, B default value are the numerical value after normalization, that is, and its value range is [0,1], and
It is not [0,255].It should be pointed out that the specific value of R default value, G default value, B default value can be by those skilled in the art certainly
Row setting, the present invention to the specific value of three with no restrictions.For example, three can be disposed as 1.0.In another example can be with
The value of adjustment three is allowed to be combined into bloom pink, to be most suitable for skin light filling.It should be pointed out that in addition to transparency and
Except rgb value, attribute can also include contrast, saturation degree etc., and correspondingly, light filling intensity also corresponds to contrast, saturation degree
Equal attribute values.The present invention does not do specific limit to the corresponding relationship of particular content included by attribute and light filling intensity and attribute value
System.
According to a kind of embodiment, 1 is set by maximum light filling intensity, minimum light filling intensity determines according to the following formula:
Minimum light filling intensity=min (max (0, (G1-G2)/M), 1) (5)
Wherein, G1 is target area brightness, and G2 is background area brightness, and M is target area brightness and background area brightness
Maximum difference, max () expression be maximized, min () expression be minimized.It should be pointed out that M is a preset constant,
Value can be by those skilled in the art according to the actual situation and experience is arranged.It should be pointed out that above-mentioned maximum light filling intensity and
The setting method of minimum light filling intensity is only an example, and those skilled in the art can according to need designed, designed maximum light filling
The calculation method of intensity and minimum light filling intensity, the present invention do not do the determination method of maximum light filling intensity and minimum light filling intensity
Limitation.
Then, in step S242, calculate separately each light filling unit to target area distance.
Light filling unit to target area distance there are many calculation method.According to a kind of embodiment, light filling unit to target
The distance in region be light filling unit central point to target area central point distance.Under this calculation, in Fig. 3
In, to target area apart from farthest light filling unit be light filling unit 342_1, be apart from nearest light filling unit to target area
Light filling unit 342_3.
According to another embodiment, the distance of light filling unit to target area is the central point of light filling unit to target area
The minimum value of the distance at any point on boundary.Under this calculation, in Fig. 3, to target area apart from farthest benefit
Light unit is light filling unit 342_1, have to target area apart from nearest light filling unit it is multiple, including light filling unit 342_2,
342_3,342_4 etc..
Then, in step S243, maximum light filling intensity institute is set by the attribute value of pixel each in farthest light filling unit
Corresponding attribute value, farthest light filling unit are the farthest light filling unit in distance objective region.For example, if by the center of light filling unit
Point arrives distance of the distance of the central point of target area as light filling unit to target area, and maximum light filling intensity is 1, then step
S243, which is equivalent to, sets 100% for the transparency of light filling unit 342_1, and rgb value is disposed as 255.
Then, in step S244, minimum light filling intensity institute is set by the attribute value of pixel each in nearest light filling unit
Corresponding attribute value, nearest light filling unit are the nearest light filling unit in distance objective region.For example, if by the center of light filling unit
Point arrives distance of the distance of the central point of target area as light filling unit to target area, and minimum light filling intensity is min (max
(0, (G1-G2)/M), 1), then step S244, which is equivalent to, sets min (max (0, (G1- for the transparency of light filling unit 342_3
G2)/M), 1) * 100%, rgb value is disposed as min (max (0, (G1-G2)/M), 1) * 255.
Then, in step S245, minimum light filling intensity institute is set by the attribute value of pixel each in other light filling units
Numerical value between attribute value corresponding to corresponding attribute value to maximum light filling intensity, other light filling units are to remove in light filling region
Light filling unit except farthest light filling unit and nearest light filling unit.
According to a kind of embodiment, step S245 can be implemented further according to following methods: for any one, other are mended
Light unit: the light filling intensity of other light filling units is determined according to the distance of other light filling units to the target area;By this its
The attribute value of each pixel is set as attribute value corresponding to the light filling intensity in his light filling unit.According to a kind of embodiment, other
The light filling intensity of light filling unit can be determined according to following formula:
Wherein, bg indicates the light filling intensity of other light filling units, and bgmax is maximum light filling intensity, and bgmin is minimum light filling
Intensity, dmax are distance of the farthest light filling unit to target area, and dmin is distance of the nearest light filling unit to target area, d
For the distance of other light filling units to target area.It should be pointed out that above-mentioned formula (6) are only the light filling of other light filling units
A kind of calculation of intensity, the light filling that those skilled in the art can also calculate other light filling units using other methods are strong
Degree, the present invention to the circular of the light filling intensity of other light filling units with no restrictions.
By step S240, the attribute of the pixel of each light filling unit is assigned, so that each light filling unit can be real
Now to the luminance compensation of image.The setting of step S240, which considers, carries out the actual conditions of self-timer in the region of dark.
In the region self-timer of dark, since face off screen curtain is closer, screen light can illuminate face and body;And at background
Farther out apart from screen, screen light can not illuminate background, so that background tends to appear as black in the picture.Therefore, background area
Domain needs the light filling compared with great dynamics, and target area can carry out the light filling of low-force degree, in this embodiment it is not even necessary to light filling.Based on step
S240, technical solution of the present invention carry out light filling according to the difference of target area brightness and background area brightness, and difference is bigger, mends
Luminous intensity is bigger (to set maximum light filling intensity to the implementation that 1, minimum light filling intensity is configured by formula (5) based on aforementioned
Example, it is bigger that " light filling intensity is bigger " actually refers to minimum light filling intensity).Meanwhile the light filling intensity of different light filling units
Also it is not quite similar, the light filling intensity of the remoter light filling unit in distance objective region is bigger, the closer light filling list in distance objective region
The light filling intensity of member is smaller.In this way, the light filling of varying strength can be carried out adaptively to target area and background area, mentioning
Make the brightness of entire picture more uniform while hi-vision brightness, improves image quality.
Method described in any one of A9:A4-8, wherein set the attribute value of pixel each in other light filling units to most
The step of numerical value between attribute value corresponding to attribute value corresponding to small light filling intensity to maximum light filling intensity includes:
For any one other light filling unit:
The light filling intensity of other light filling units is determined according to the distance of other light filling units to the target area;
Attribute value corresponding to the light filling intensity is set by the attribute value of each pixel in other light filling units.
Method described in A10:A9, wherein the light filling intensity of other light filling units is determined according to following formula:
Wherein, bg indicates the light filling intensity of other light filling units, and bgmax is maximum light filling intensity, and bgmin is minimum light filling
Intensity, dmax are distance of the farthest light filling unit to target area, and dmin is distance of the nearest light filling unit to target area, d
For the distance of other light filling units to target area.
Various technologies described herein are realized together in combination with hardware or software or their combination.To the present invention
Method and apparatus or the process and apparatus of the present invention some aspects or part can take insertion tangible media, such as can
Program code (instructing) in mobile hard disk, USB flash disk, floppy disk, CD-ROM or other any machine readable storage mediums
Form, wherein when program is loaded into the machine of such as computer etc, and when being executed by the machine, the machine becomes to practice
Equipment of the invention.
In the case where program code executes on programmable computers, mobile terminal generally comprises processor, processor
Readable storage medium (including volatile and non-volatile memory and or memory element), at least one input unit, and extremely
A few output device.Wherein, memory is configured for storage program code;Processor is configured for according to the memory
Instruction in the said program code of middle storage executes light compensation method of the invention.
By way of example and not limitation, readable medium includes readable storage medium storing program for executing and communication media.Readable storage medium storing program for executing
Store the information such as computer readable instructions, data structure, program module or other data.Communication media is generally such as to carry
The modulated message signals such as wave or other transmission mechanisms embody computer readable instructions, data structure, program module or other
Data, and including any information transmitting medium.Above any combination is also included within the scope of readable medium.
In the instructions provided here, algorithm and display not with any certain computer, virtual system or other
Equipment is inherently related.Various general-purpose systems can also be used together with example of the invention.As described above, it constructs this kind of
Structure required by system is obvious.In addition, the present invention is also not directed to any particular programming language.It should be understood that can
With using various programming languages realize summary of the invention described herein, and the description that language-specific is done above be for
Disclosure preferred forms of the invention.
In the instructions provided here, numerous specific details are set forth.It is to be appreciated, however, that implementation of the invention
Example can be practiced without these specific details.In some instances, well known method, knot is not been shown in detail
Structure and technology, so as not to obscure the understanding of this specification.
Similarly, it should be understood that in order to simplify the disclosure and help to understand one or more of the various inventive aspects,
Above in the description of exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes
In example, figure or descriptions thereof.However, the disclosed method should not be interpreted as reflecting the following intention: i.e. required to protect
Shield the present invention claims than feature more features expressly recited in each claim.More precisely, as following
As claims reflect, inventive aspect is all features less than single embodiment disclosed above.Therefore, it abides by
Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself
As a separate embodiment of the present invention.
Those skilled in the art should understand that the module of the equipment in example disclosed herein or unit or groups
Part can be arranged in equipment as depicted in this embodiment, or alternatively can be positioned at and the equipment in the example
In different one or more equipment.Module in aforementioned exemplary can be combined into a module or furthermore be segmented into multiple
Submodule.
Those skilled in the art will understand that can be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more devices different from this embodiment.It can be the module or list in embodiment
Member or component are combined into a module or unit or component, and furthermore they can be divided into multiple submodule or subelement or
Sub-component.Other than such feature and/or at least some of process or unit exclude each other, it can use any
Combination is to all features disclosed in this specification (including adjoint claim, abstract and attached drawing) and so disclosed
All process or units of what method or apparatus are combined.Unless expressly stated otherwise, this specification is (including adjoint power
Benefit require, abstract and attached drawing) disclosed in each feature can carry out generation with an alternative feature that provides the same, equivalent, or similar purpose
It replaces.
In addition, it will be appreciated by those of skill in the art that although some embodiments described herein include other embodiments
In included certain features rather than other feature, but the combination of the feature of different embodiments mean it is of the invention
Within the scope of and form different embodiments.For example, in the following claims, embodiment claimed is appointed
Meaning one of can in any combination mode come using.
In addition, be described as herein can be by the processor of computer system or by executing by some in the embodiment
The combination of method or method element that other devices of the function are implemented.Therefore, have for implementing the method or method
The processor of the necessary instruction of element forms the device for implementing this method or method element.In addition, Installation practice
Element described in this is the example of following device: the device be used for implement as in order to implement the purpose of the invention element performed by
Function.
As used in this, unless specifically stated, come using ordinal number " first ", " second ", " third " etc.
Description plain objects, which are merely representative of, is related to the different instances of similar object, and is not intended to imply that the object being described in this way must
Must have the time it is upper, spatially, sequence aspect or given sequence in any other manner.
Although the embodiment according to limited quantity describes the present invention, above description, the art are benefited from
It is interior it is clear for the skilled person that in the scope of the present invention thus described, it can be envisaged that other embodiments.Additionally, it should be noted that
Language used in this specification primarily to readable and introduction purpose and select, rather than in order to explain or limit
Determine subject of the present invention and selects.Therefore, without departing from the scope and spirit of the appended claims, for this
Many modifications and changes are obvious for the those of ordinary skill of technical field.For the scope of the present invention, to this
It invents done disclosure to be illustrative and be not restrictive, it is intended that the scope of the present invention be defined by the claims appended hereto.
Claims (11)
1. a kind of light compensation method, executes in the terminal, comprising:
Mobile terminal screen is divided into imaging region and light filling region, the imaging region is located at the center of screen, described
Light filling region is located at the boundary of screen, and including at least two light filling units;
Target area in recognition imaging region, the target area are human face region or portrait area;
Target area brightness and background area brightness are calculated, the target area brightness is the brightness of each pixel in target area
Average value, the background area brightness be background area in each pixel brightness average value, wherein the background area be at
As the region in region other than target area;
When the difference of the target area brightness and the background area brightness is greater than first threshold, adjust each in light filling unit
The attribute value of pixel is to realize light filling:
Determine that maximum light filling intensity and minimum light filling are strong according to the difference of the target area brightness and the background area brightness
Degree, wherein each light filling intensity corresponds to one group of attribute value;
Calculate separately each light filling unit to target area distance;
Set attribute value corresponding to the maximum light filling intensity for the attribute value of pixel each in farthest light filling unit, it is described most
Remote light filling unit is the farthest light filling unit in distance objective region;
Set attribute value corresponding to the minimum light filling intensity for the attribute value of pixel each in nearest light filling unit, it is described most
Nearly light filling unit is the nearest light filling unit in distance objective region;
Attribute value corresponding to minimum light filling intensity is set to maximum light filling by the attribute value of pixel each in other light filling units
Numerical value between attribute value corresponding to intensity, other described light filling units be in light filling region in addition to farthest light filling unit and most
Light filling unit except nearly light filling unit.
2. light compensation method as described in claim 1, wherein at least two light filling unit is arranged to relative to mobile whole
Hold the central axes of screen symmetrical.
3. the method for claim 1, wherein the brightness of the pixel is the ash being calculated according to the rgb value of pixel
Angle value.
4. the method for claim 1, wherein the maximum light filling intensity is 1, minimum light filling intensity is according to formula min
(max (0, (G1-G2)/M), 1) is determined, wherein G1 is target area brightness, and G2 is background area brightness, and M is target area
The maximum difference of brightness and background area brightness, max () expression are maximized, and min () expression is minimized.
5. method as described in claim 1 or 4, wherein the attribute value includes transparency and rgb value;One light filling intensity
One group of corresponding attribute value are as follows:
Transparency=light filling intensity * 100%;
R value=R default value * light filling intensity;
G value=G default value * light filling intensity;B value=B default value * light filling intensity;
Wherein, R default value, G default value, B default value are preset constant.
6. the method for claim 1, wherein the distance of the light filling unit to target area is the center of light filling unit
Point arrives the distance of the central point of target area.
7. the method for claim 1, wherein the distance of the light filling unit to target area is the center of light filling unit
Minimum value of the point to the distance at any point on target area boundaries.
8. the method for claim 1, wherein setting minimum light filling for the attribute value of pixel each in other light filling units
The step of numerical value between attribute value corresponding to attribute value corresponding to intensity to maximum light filling intensity includes:
For any one other light filling unit:
The light filling intensity of other light filling units is determined according to the distance of other light filling units to the target area;
Attribute value corresponding to the light filling intensity is set by the attribute value of each pixel in other light filling units.
9. method according to claim 8, wherein the light filling intensity of other light filling units is determined according to following formula:
Wherein, bg indicates the light filling intensity of other light filling units, and bgmax is maximum light filling intensity, and bgmin is that minimum light filling is strong
Degree, dmax are distance of the farthest light filling unit to target area, and dmin is distance of the nearest light filling unit to target area, and d is
Distance of other light filling units to target area.
10. a kind of mobile terminal, comprising:
At least one processor;With
It is stored with the memory of program instruction, wherein described program instruction is configured as being suitable for by least one described processor
It executes, described program instruction includes the instruction for executing light compensation method as claimed in any one of claims 1-9 wherein.
11. a kind of readable storage medium storing program for executing for being stored with program instruction, when described program instruction is read by the mobile terminal and executes,
So that the mobile terminal execution light compensation method as claimed in any one of claims 1-9 wherein.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710693895.5A CN107566695B (en) | 2017-08-14 | 2017-08-14 | A kind of light compensation method and mobile terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710693895.5A CN107566695B (en) | 2017-08-14 | 2017-08-14 | A kind of light compensation method and mobile terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107566695A CN107566695A (en) | 2018-01-09 |
CN107566695B true CN107566695B (en) | 2019-07-02 |
Family
ID=60975505
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710693895.5A Active CN107566695B (en) | 2017-08-14 | 2017-08-14 | A kind of light compensation method and mobile terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107566695B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108280431B (en) * | 2018-01-25 | 2021-04-30 | Oppo广东移动通信有限公司 | Face recognition processing method, face recognition processing device and intelligent terminal |
CN108449549B (en) * | 2018-03-19 | 2021-02-12 | 浙江国自机器人技术股份有限公司 | Method and device for adjusting brightness of LED fill light lamp panel and storage medium |
US11250813B2 (en) | 2018-04-04 | 2022-02-15 | Huawei Technologies Co., Ltd. | Ambient light detection method and terminal |
CN108900780A (en) * | 2018-06-28 | 2018-11-27 | 努比亚技术有限公司 | A kind of screen light compensation method, mobile terminal and storage medium |
CN112312030A (en) * | 2019-08-01 | 2021-02-02 | 深圳怡化电脑股份有限公司 | Photographing light supplement method and device, computer equipment and storage medium |
CN111083388B (en) * | 2019-12-26 | 2021-04-16 | 浙江大华技术股份有限公司 | Light supplement lamp control method and device, electronic equipment and storage medium |
CN112702531B (en) * | 2020-12-29 | 2022-06-17 | 维沃移动通信有限公司 | Shooting method and device and electronic equipment |
CN114900617B (en) * | 2022-03-28 | 2023-08-08 | 北京京东乾石科技有限公司 | Light supplementing method, device, equipment, storage medium and light supplementing brightness adjusting device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1499823A (en) * | 2002-11-05 | 2004-05-26 | 奥林巴斯株式会社 | Camera |
CN103428568A (en) * | 2012-05-23 | 2013-12-04 | 索尼公司 | Electronic mirror device, electronic mirror display method, and electronic mirror program |
CN104301598A (en) * | 2013-07-18 | 2015-01-21 | 国龙信息技术(上海)有限公司 | Method of setting lighting effect of front camera by mobile terminal |
CN104320578A (en) * | 2014-10-22 | 2015-01-28 | 厦门美图之家科技有限公司 | Method for performing self-shot soft light compensation on basis of screen luminance |
CN105554411A (en) * | 2016-02-15 | 2016-05-04 | 广东欧珀移动通信有限公司 | Photographing method and device based on screen light compensation and mobile terminal |
CN106534707A (en) * | 2015-09-14 | 2017-03-22 | 中兴通讯股份有限公司 | Photographing method and device |
-
2017
- 2017-08-14 CN CN201710693895.5A patent/CN107566695B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1499823A (en) * | 2002-11-05 | 2004-05-26 | 奥林巴斯株式会社 | Camera |
CN103428568A (en) * | 2012-05-23 | 2013-12-04 | 索尼公司 | Electronic mirror device, electronic mirror display method, and electronic mirror program |
CN104301598A (en) * | 2013-07-18 | 2015-01-21 | 国龙信息技术(上海)有限公司 | Method of setting lighting effect of front camera by mobile terminal |
CN104320578A (en) * | 2014-10-22 | 2015-01-28 | 厦门美图之家科技有限公司 | Method for performing self-shot soft light compensation on basis of screen luminance |
CN106534707A (en) * | 2015-09-14 | 2017-03-22 | 中兴通讯股份有限公司 | Photographing method and device |
CN105554411A (en) * | 2016-02-15 | 2016-05-04 | 广东欧珀移动通信有限公司 | Photographing method and device based on screen light compensation and mobile terminal |
Also Published As
Publication number | Publication date |
---|---|
CN107566695A (en) | 2018-01-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107566695B (en) | A kind of light compensation method and mobile terminal | |
KR102598109B1 (en) | Electronic device and method for providing notification relative to image displayed via display and image stored in memory based on image analysis | |
JP5136669B2 (en) | Image processing apparatus, image processing method, and program | |
US9843716B2 (en) | Method and apparatus for adjusting photography parameters | |
KR101977638B1 (en) | Method for correcting user’s gaze direction in image, machine-readable storage medium and communication terminal | |
US11158027B2 (en) | Image capturing method and apparatus, and terminal | |
US9185300B2 (en) | Photographing apparatus for scene catergory determination and method for controlling thereof | |
US20220329729A1 (en) | Photographing method, storage medium and electronic device | |
KR102400998B1 (en) | Method and photographing device for controlling a function based on a gesture of a user | |
KR20180044200A (en) | Electronic device with display-based image compensation and corresponding systems and methods | |
CN112950499B (en) | Image processing method, device, electronic equipment and storage medium | |
KR20210053096A (en) | Method for providing preview and electronic device using the same | |
CN105469357B (en) | Image processing method, device and terminal | |
KR102273059B1 (en) | Method, apparatus and electronic device for enhancing face image | |
KR20160149842A (en) | Method for processing an image and electronic device thereof | |
JP5370555B2 (en) | Imaging apparatus, imaging method, and program | |
KR102351496B1 (en) | Image processing apparatus and method for operating thereof | |
CN108462831B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
CN105472228B (en) | Image processing method and device and terminal | |
US20170163852A1 (en) | Method and electronic device for dynamically adjusting gamma parameter | |
JP2018195938A (en) | Imaging apparatus, control method of imaging apparatus, and program | |
CN115484383A (en) | Shooting method and related device | |
CN114519891A (en) | Backlight adjusting method and device and storage medium | |
CN111050026B (en) | Image noise reduction control method, terminal and computer readable storage medium | |
CN116055855B (en) | Image processing method and related 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |