CN109238460A - A kind of method and terminal device obtaining ambient light intensity - Google Patents

A kind of method and terminal device obtaining ambient light intensity Download PDF

Info

Publication number
CN109238460A
CN109238460A CN201810975136.2A CN201810975136A CN109238460A CN 109238460 A CN109238460 A CN 109238460A CN 201810975136 A CN201810975136 A CN 201810975136A CN 109238460 A CN109238460 A CN 109238460A
Authority
CN
China
Prior art keywords
value
difference
target
environment
terminal device
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.)
Granted
Application number
CN201810975136.2A
Other languages
Chinese (zh)
Other versions
CN109238460B (en
Inventor
雷乃策
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201810975136.2A priority Critical patent/CN109238460B/en
Publication of CN109238460A publication Critical patent/CN109238460A/en
Application granted granted Critical
Publication of CN109238460B publication Critical patent/CN109238460B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J1/00Photometry, e.g. photographic exposure meter
    • G01J1/10Photometry, e.g. photographic exposure meter by comparison with reference light or electric value provisionally void
    • G01J1/12Photometry, e.g. photographic exposure meter by comparison with reference light or electric value provisionally void using wholly visual means
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01JMEASUREMENT OF INTENSITY, VELOCITY, SPECTRAL CONTENT, POLARISATION, PHASE OR PULSE CHARACTERISTICS OF INFRARED, VISIBLE OR ULTRAVIOLET LIGHT; COLORIMETRY; RADIATION PYROMETRY
    • G01J1/00Photometry, e.g. photographic exposure meter
    • G01J1/42Photometry, e.g. photographic exposure meter using electric radiation detectors
    • G01J1/4204Photometry, e.g. photographic exposure meter using electric radiation detectors with determination of ambient light

Abstract

The embodiment of the invention discloses a kind of methods and terminal device for obtaining ambient light intensity, are related to field of communication technology, to solve the problems, such as the testing result inaccuracy of prior art environment light.This method comprises: obtaining the first difference, the first difference is the absolute value of the difference of first environment luminous intensity measurement value and second environment luminous intensity measurement value;Obtain the second difference, second difference is the absolute value of the difference of the first grayscale value and target gray scale value, first grayscale value is the grayscale value of first object image, target gray scale value is the second grayscale value or is to the first grayscale value through target treated grayscale value, and the second grayscale value is the grayscale value of the second target image;According to first environment luminous intensity measurement value, the first difference, the second difference and the first grayscale value, target environment light intensity value is calculated.The program is applied particularly in the scene of measurement ambient light intensity.

Description

A kind of method and terminal device obtaining ambient light intensity
Technical field
The present embodiments relate to fields of communication technology more particularly to a kind of method for obtaining ambient light intensity and terminal to set It is standby.
Background technique
With the continuous development of terminal technology, terminal device using more and more extensive.In order to make human eye in terminal device Light in local environment can preferably watch the content on screen when changing, there is terminal device screen intensity to adjust automatically Save function.
Currently, being usually that optical sensor is arranged in terminal device, terminal device local environment is detected by optical sensor In ambient light intensity determined then according to the mapping relations of the ambient light intensity and ambient light intensity and screen brightness value Screen brightness value corresponding with the ambient light intensity.And in order to not influence the screen accounting of terminal device, usually by optical sensor It is set to below screen.
However, being set to the optical sensor below screen, the environment light in terminal device local environment can not only be detected Intensity, can also detect screen exit rays by the intensity of the reflected reflected light of the glass cover-plate of terminal device, thus due to The influence of reflected light leads to the testing result inaccuracy of environment light.
Summary of the invention
The embodiment of the present invention provides a kind of method and terminal device for obtaining ambient light intensity, to solve prior art environment The problem of the testing result inaccuracy of light.
In order to solve the above-mentioned technical problem, the present invention is implemented as follows:
In a first aspect, the embodiment of the invention provides a kind of methods for obtaining ambient light intensity, this method comprises:
The first difference is obtained, which is first environment luminous intensity measurement value and second environment luminous intensity measurement value The absolute value of difference, the first environment luminous intensity measurement value be first time period in, terminal device show first object image when, Measurement the terminal device local environment environmental light intensity angle value, the second environment luminous intensity measurement value be second time period in, When terminal device shows the second target image, the environmental light intensity angle value of the terminal device local environment of measurement, second time Section is identical as the duration of the first time period;
The second difference is obtained, which is the absolute value of the difference of the first grayscale value and target gray scale value, this first Grayscale value is the grayscale value of the first object image, which is the second grayscale value or is to pass through to first grayscale value Target treated grayscale value, second grayscale value are the grayscale value of second target image, first grayscale value and the target Grayscale value is different;
According to the first environment luminous intensity measurement value, first difference, second difference and first grayscale value, calculate Target environment light intensity value.
Second aspect, the embodiment of the invention provides a kind of terminal device, which includes: to obtain module and calculating Module;
The acquisition module, for obtaining the first difference, which is first environment luminous intensity measurement value and the second ring The absolute value of the difference of border luminous intensity measurement value, the first environment luminous intensity measurement value are in first time period, and terminal device is aobvious When showing first object image, the environmental light intensity angle value of the terminal device local environment of measurement, the second environment luminous intensity measurement Value be second time period in, when terminal device shows the second target image, the environment light of the terminal device local environment of measurement Intensity value, the second time period are identical as the duration of the first time period;The second difference is obtained, which is the first grayscale The absolute value of value and the difference of target gray scale value, first grayscale value are the grayscale value of the first object image, the target gray scale Value is the second grayscale value or is to first grayscale value through target treated grayscale value, which is second mesh The grayscale value of logo image, first grayscale value are different from the target gray scale value;
The computing module, for according to the first environment luminous intensity measurement value, the acquisition module acquisition first difference, Second difference and first grayscale value that the acquisition module obtains, calculate target environment light intensity value.
The third aspect the embodiment of the invention provides a kind of terminal device, including processor, memory and is stored in this and deposits On reservoir and the computer program that can run on the processor, such as first is realized when which is executed by the processor The step of method of acquisition ambient light intensity in aspect.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage medium, the computer-readable storage mediums Computer program is stored in matter, is realized when which is executed by processor such as the acquisition ambient light intensity in first aspect Method the step of.
In embodiments of the present invention, by obtaining the first difference, first difference be first environment luminous intensity measurement value and The absolute value of the difference of second environment luminous intensity measurement value, the first environment luminous intensity measurement value are terminal in first time period When equipment shows first object image, the environmental light intensity angle value of the terminal device local environment of measurement, the second environment light intensity Spend measured value be second time period in, when terminal device shows the second target image, the terminal device local environment of measurement Environmental light intensity angle value, the second time period are identical as the duration of the first time period;The second difference is obtained, which is the The absolute value of the difference of one grayscale value and target gray scale value, first grayscale value are the grayscale value of the first object image, the mesh Mark grayscale value is second grayscale value or is to first grayscale value through target treated grayscale value, which is The grayscale value of second target image, first grayscale value are different from the target gray scale value;It is surveyed according to the first environment luminous intensity Magnitude, first difference, second difference and first grayscale value calculate target environment light intensity value.In the program, first Ambient light intensity measured value and second environment luminous intensity measurement value include at least actual environment light intensity value and corresponding screen respectively Curtain intensity of reflected light, since first time period is identical with the duration of second time period, if the duration is shorter, in first time period In interior and second time period, the actual environment light intensity value of environment locating for terminal device is constant, the change of the intensity value of screen light Change amount is the second difference, and the absolute value of the difference of first environment luminous intensity measurement value and second environment luminous intensity measurement value is first Difference, therefore, the first difference (difference of ambient light measurement value) be by caused by the second difference (variation of screen light intensity value), Then terminal device can be calculated according to the first grayscale value, the first difference, the second difference and first environment luminous intensity measurement value To target environment light intensity value, compared to first environment luminous intensity measurement value or second environment luminous intensity measurement value, target environment Light intensity value is closer to actual environment light intensity value, so as to improve the ambient light intensity to environment locating for terminal device The measurement accuracy of finger can solve the problem of the testing result inaccuracy of prior art environment light.
Detailed description of the invention
Fig. 1 is a kind of configuration diagram of Android operation system provided in an embodiment of the present invention;
Fig. 2 is one of the flow chart of method provided in an embodiment of the present invention for obtaining ambient light intensity;
Fig. 3 is one of the structural schematic diagram of terminal device provided in an embodiment of the present invention;
Fig. 4 is one of the ambient light measurement value schematic diagram of method provided in an embodiment of the present invention for obtaining ambient light intensity;
Fig. 5 is the two of the ambient light measurement value schematic diagram of the method provided in an embodiment of the present invention for obtaining ambient light intensity;
Fig. 6 is the two of the flow chart of the method provided in an embodiment of the present invention for obtaining ambient light intensity;
Fig. 7 is the three of the flow chart of the method provided in an embodiment of the present invention for obtaining ambient light intensity;
Fig. 8 is the second structural representation of terminal device provided in an embodiment of the present invention;
Fig. 9 is the third structural representation of terminal device provided in an embodiment of the present invention;
Figure 10 is the four of the structural schematic diagram of terminal device provided in an embodiment of the present invention;
Figure 11 is the hardware schematic of terminal device provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts Example, shall fall within the protection scope of the present invention.
Term " first ", " second ", " third " and " the 4th " in description and claims of this specification etc. are to use In the different object of difference, rather than it is used for the particular order of description object.For example, the first difference, the second difference, third difference It is rather than the particular order for describing difference for distinguishing different differences with the 4th difference etc..
In embodiments of the present invention, " illustrative " or " such as " etc. words for indicate make example, illustration or explanation.This Be described as in inventive embodiments " illustrative " or " such as " any embodiment or design scheme be not necessarily to be construed as comparing Other embodiments or design scheme more preferably or more advantage.Specifically, use " illustrative " or " such as " etc. words purport Related notion is being presented in specific ways.
In the description of the embodiment of the present invention, unless otherwise indicated, the meaning of " plurality " is refer to two or more, For example, multiple processing units refer to two or more processing unit;Multiple element refers to two or more Element etc..
The embodiment of the present invention provides a kind of method for obtaining ambient light intensity, in embodiments of the present invention, by obtaining the One difference, first difference are the absolute value of the difference of first environment luminous intensity measurement value and second environment luminous intensity measurement value, The first environment luminous intensity measurement value be first time period in, terminal device show first object image when, the terminal of measurement The environmental light intensity angle value of equipment local environment, the second environment luminous intensity measurement value are in second time period, and terminal device is shown When the second target image, the environmental light intensity angle value of the terminal device local environment of measurement, the second time period and this first when Between section duration it is identical;The second difference is obtained, which is the absolute value of the difference of the first grayscale value and target gray scale value, First grayscale value be the first object image grayscale value, the target gray scale value be second grayscale value or be to this first For grayscale value through target treated grayscale value, which is the grayscale value of second target image, first grayscale value It is different from the target gray scale value;According to the first environment luminous intensity measurement value, first difference, second difference and this first Grayscale value calculates target environment light intensity value.In the program, first environment luminous intensity measurement value and second environment luminous intensity measurement Value includes at least actual environment light intensity value and corresponding screen reflection luminous intensity respectively, due to first time period and the second time The duration of section is identical, if the duration is shorter, in first time period and in second time period, environment locating for terminal device Actual environment light intensity value is constant, and the variable quantity of the intensity value of screen light is the second difference, first environment luminous intensity measurement value and The absolute value of the difference of second environment luminous intensity measurement value is the first difference, therefore, the first difference (difference of ambient light measurement value Value) it is by caused by the second difference (variation of screen light intensity value), then terminal device can be according to the first grayscale value, first poor Target environment light intensity value is calculated in value, the second difference and first environment luminous intensity measurement value, compared to first environment light Intensity measurements or second environment luminous intensity measurement value, target environment light intensity value closer to actual environment light intensity value, from And can be improved the measurement accuracy referred to the ambient light intensity of environment locating for terminal device, it can solve prior art environment light Testing result inaccuracy problem.
Below by taking Android operation system as an example, the method provided in an embodiment of the present invention for obtaining ambient light intensity is introduced Applied software environment.
As shown in Figure 1, being a kind of configuration diagram of possible Android operation system provided in an embodiment of the present invention.Scheming In 1, the framework of Android operation system includes 4 layers, be respectively as follows: application layer, application framework layer, system Runtime Library layer and Inner nuclear layer (is specifically as follows Linux inner core).
Wherein, application layer includes each application program (including system application and in Android operation system Tripartite's application program).
Application framework layer is the frame of application program, and developer can be in the exploitation for the frame for abiding by application program In the case where principle, some application programs are developed based on application framework layer.
System Runtime Library layer includes library (also referred to as system library) and Android operation system running environment.Library is mainly Android behaviour As system it is provided needed for all kinds of resources.Android operation system running environment is used to provide software loop for Android operation system Border.
Inner nuclear layer is the operating system layer of Android operation system, belongs to the bottom of Android operation system software level.It is interior Stratum nucleare provides core system service and hardware-related driver based on linux kernel for Android operation system.
By taking Android operation system as an example, in the embodiment of the present invention, developer can be based on above-mentioned Android as shown in Figure 1 The software program of the method provided in an embodiment of the present invention for obtaining ambient light intensity is realized in the system architecture of operating system, exploitation, So that the method for the acquisition ambient light intensity can be run based on Android operation system as shown in Figure 1.I.e. processor or Person's terminal can realize acquisition environment light provided in an embodiment of the present invention by running the software program in Android operation system The method of intensity.
Terminal device in the embodiment of the present invention can be mobile terminal device, or immobile terminal equipment.It moves Dynamic terminal device can be mobile phone, tablet computer, laptop, palm PC, car-mounted terminal, wearable device, super shifting Dynamic personal computer (ultra-mobile personal computer, UMPC), net book or personal digital assistant (personal digital assistant, PDA) etc.;Immobile terminal equipment can be personal computer (personal Computer, PC), television set (television, TV), automatic teller machine or self-service machine etc.;The embodiment of the present invention does not limit specifically It is fixed.
The executing subject of the method provided in an embodiment of the present invention for obtaining ambient light intensity can be above-mentioned terminal device (including mobile terminal device and immobile terminal equipment), or can be realized the function mould of this method in the terminal device Block and/or functional entity can specifically determine that the embodiment of the present invention is not construed as limiting according to actual use demand.Below with end For end equipment, the method provided in an embodiment of the present invention for obtaining ambient light intensity is illustratively illustrated.
Refering to what is shown in Fig. 2, the embodiment of the invention provides a kind of method for obtaining ambient light intensity, this method may include Following step 201- steps 203.
Step 201, terminal device obtain the first difference, which is first environment luminous intensity measurement value and the second ring The absolute value of the difference of border luminous intensity measurement value.
The first environment luminous intensity measurement value is when terminal device shows first object image, to measure in first time period The terminal device local environment environmental light intensity angle value, the second environment luminous intensity measurement value be second time period in, terminal When equipment shows the second target image, the environmental light intensity angle value of the terminal device local environment of measurement, the second time period with The duration of the first time period is identical.
Before terminal device obtains the first difference, terminal device will first obtain first environment luminous intensity measurement value and second Ambient light intensity measured value.First environment luminous intensity measurement value and second environment luminous intensity measurement value include at least actual rings respectively (screen exit rays are by the reflected reflected light of the glass cover-plate of terminal device for border light intensity value and corresponding screen light intensity value Intensity, abbreviation screen reflection luminous intensity), it may further include other light intensity values.Terminal device can be surveyed by optical sensor etc. One ambient light intensity measured value of flow control and second environment luminous intensity measurement value can specifically refer to existing the relevant technologies, herein It will not go into details.First environment luminous intensity measurement value is measured by optical sensor with terminal device below and second environment luminous intensity is surveyed The method provided in an embodiment of the present invention for obtaining ambient light intensity is illustratively illustrated for magnitude.
Refering to what is shown in Fig. 3, optical sensor is located at below screen, wherein 1 is environment light, and 2 be screen reflection light, and 01 is glass Glass cover board, 02 is screen, and 03 is optical sensor.Therefore optical sensor is other than it can detect actual environment luminous intensity, moreover it is possible to The screen exit rays of target area are detected by the intensity of the reflected reflected light of the glass cover-plate of terminal device, for the ease of retouching It states, the latter's abbreviation screen reflection luminous intensity.Therefore first environment luminous intensity measurement value includes the actual environment in first time period Luminous intensity and screen reflection luminous intensity, second environment luminous intensity measurement value include actual environment luminous intensity in second time period and Screen reflection luminous intensity.
Terminal device calculates the absolute value of the difference of first environment luminous intensity measurement value and second environment luminous intensity measurement value It is denoted as the first difference.
First object image and the second target image can be a frame image, be also possible to multiple image, and the present invention is implemented Example is not construed as limiting.
The duration of the second time period and the duration of the first time period are identical, and are preset duration, the preset duration Can determine according to actual needs, the embodiment of the present invention is not construed as limiting.The first time period can be adjacent with the second time period Two periods, be also possible to non-conterminous two periods, the embodiment of the present invention is not construed as limiting.First time period and second Period does not have sequencing, can be first time period before second time period, is also possible to first time period second Behind period, illustratively illustrated so that first time period is before second time period as an example below.First time period The duration of duration (preset duration) and second time period is very short (preset duration), first time period and second time period it is adjacent or The duration at interval is also very short, and in shorter duration, it is believed that actual environment luminous intensity is constant or almost unchanged, and the screen Curtain brightness is also constant or almost unchanged, i.e., screen reflection luminous intensity is constant or almost unchanged.Terminal device in first time period The number of image frames of display is identical with the number of image frames that terminal device in second time period is shown, and usually integer frame.
Preferably, which includes continuous first image of N frame, which includes that N frame is continuous The second image, second image of N frame and first image of N frame are the image that the terminal device continuously displays, and N is positive integer. I.e. first time period and second time period are two adjacent periods, the acquisition environment provided according to embodiments of the present invention in this way The ambient light intensity that the method for luminous intensity obtains can be more acurrate.
First environment luminous intensity measurement value can be optical sensor and show the frame in first object image in terminal device It is measured when the first image;It is also possible to optical sensor when terminal device shows M the first image of frame in first object image Measurement, M is greater than 1 and is less than or equal to N;It is also possible to optical sensor and shows the M frame in first object image in terminal device The multiple average value measured when the first image;It can also be other, the embodiment of the present invention is not construed as limiting.Similarly second environment Luminous intensity measurement value can be what optical sensor was measured when terminal device shows second image of frame in the second target image; It is also possible to what optical sensor was measured when terminal device shows M the second image of frame in the second target image;It is also possible to light The multiple average value that sensor is measured when terminal device shows M the second image of frame in the second target image;It can also be Others, the embodiment of the present invention are not construed as limiting.
Step 202, terminal device obtain the second difference, which is the difference of the first grayscale value and target gray scale value Absolute value.
Color is usually described with three independent attributes, three independent variable comprehensive functions, just constitutes a sky naturally Between coordinate, here it is color spaces.But color object being described itself is that objectively, different colours space is only from different Angle goes to measure the same object.Color space can be divided into two major classes according to basic system: primary colours color space (also referred to as three Primary colors color space) and color, show the score from color space.Primary colours color space and color, show the score can be mutual between color space Conversion, specific conversion process can refer to the prior art, and it will not go into details herein.
Primary colours color space: what kind of color a pixel is presented, and is determined by three primary color components.For example, a pixel Point includes red (R), green (G), blue (B) three sub-pixels, then three primary color components are respectively R value, G value and B value at this time.In another example One pixel includes green (C), pinkish red (M), yellow (Y) three sub-pixels, then three primary color components can be C value, M value and Y at this time Value.In the present embodiment, it is preferred that component value is RGB component value or CMY component value, is also possible to other color component values.
It should be noted that a pixel in the embodiment of the present invention can be only made of three above-mentioned sub-pixels, It can certainly also include the 4th sub-pixel, such as white (W) sub-pixel.At this point, because white is not belonging to primary colors, therefore for this The three primary color components of pixel are referring still to foregoing description.
Color is showed the score from color space: the color space being made of brightness and coloration, wherein brightness is referred to as grayscale Or gray scale, coloration include tone and saturation degree.In embodiments of the present invention, color, show the score that it is empty to can be YUV color from color space Between, YCbCr color space, HSI color space, hsv color space etc..
In the following, simply introducing several common color spaces comprising brightness and coloration.
YUV: wherein Y indicates brightness (Luminance or Luma), that is, grayscale, and what U and V were then indicated is coloration (Chrominance or Chroma).In YUV, Y value is grayscale value.
YCbCr: being reprint of the YUV by scaling and offset.Wherein Y is consistent with the Y meaning in YUV, and Cb, Cr equally refer to Color, it is only different on representation method.In YUV family, YCbCr be in computer systems using it is most at Member, application field is very extensive, and JPEG, MPEG are all made of this format.The YUV that general people are said refers to YCbCr mostly.? In YCbCr, Y value is grayscale value.
HSI: the colored mode of the vision system perception of people is reflected, with three kinds of tone (H), saturation degree (S) and brightness (I) Essential characteristic amount perceives color.In HSI, I value is grayscale value.
HSV: being a kind of color space created according to the intuitive nature of color, parameter is respectively: tone (H), saturation degree (S), lightness (V).In HSV, V value is grayscale value.
In the examples below, illustratively illustrated by taking RGB primary colours color space as an example.
In the prior art, when recording the color of digital picture, the bit depth actually needed with each pixel is (simple Claim position, bit) come what is indicated, i.e., it is indicated to store digit used in each pixel with the depth of image, is also used for measurement image Color-resolution.Picture depth determines the presumable number of colours of each pixel of color image, or determines the every of gray level image A presumable grayscale series of pixel.It is determined in the MaxColors or gray level image that may occur in which in color image most Big greyscale level.Such as a width monochrome image, if each pixel has 8 (bit), maximum gray number of levels is 8 times of 2 Side, i.e., 256.The pixel digit of one 3 components of width color image R, G, B is respectively 4,4,2, then the 4+ that maximum color number is 2 4+2=10 power, i.e., 1024, that is the depth of pixel is 10bit, and each pixel can be one of 1024 kinds of colors.
First grayscale value is the grayscale value of the first object image, which is second grayscale value or is To first grayscale value through target treated grayscale value, which is the grayscale value of second target image, this One grayscale value is different from the target gray scale value.
Terminal device will first obtain the first grayscale value and target gray scale value before obtaining the second difference.
Since the duration of the duration (preset duration) and second time period of first time period is very short (preset duration), when first Between section and second time period is adjacent or the duration at interval is also very short, therefore, refering to what is shown in Fig. 4, wherein, L1~L3For actual environment Luminous intensity, G1~G6、G2'、G4'、G6' it is screen reflection luminous intensity.The corresponding grayscale value of first object image is (when first Δ t Between section, third Δ t period or the 5th Δ t period etc.) and the corresponding original gray-scale value of the second target image (second Δ t period, the 4th Δ t period or the 6th Δ t period etc.) (the corresponding grayscale value of third target image) usual phase Together, or there is faint variation, can not thus calculate the second difference, the second target image is third mesh in embodiments of the present invention For logo image through target treated image, the corresponding grayscale value of the second target image is not to be through target treated grayscale value The corresponding original gray-scale value of second image.Refering to what is shown in Fig. 5, the corresponding grayscale value of the second target image (the first Δ t time Section, third Δ t period or the 5th Δ t period etc.) corresponding with first object image grayscale value is (when second Δ t Between section, the 4th Δ t period or the 6th Δ t period etc.) have certain difference.
It should be understood that the process of the second target image is specifically obtained after target is handled to third target image, It can be before showing the second target image, which obtains the second target to third target image after target is handled The process of image;Be also possible to before showing the second target image, other terminal devices to third target image through target at The second target image is obtained after reason;The specific embodiment of the present invention is not construed as limiting.
Illustratively, if image is the image of primary colours color space, in order to guarantee that image color is undistorted, then target is handled Mode can be each component value of each pixel in third target image to grayscale value multiplied by the first preset value, To obtain the second target image, i.e. target processing increases for the grayscale value of each pixel of the predeterminable area to third target image Big or Q times of reduction, Q are greater than 0 and less than 1.For example, if third target image is RGB image, by (the first preset value of R*) (G* First preset value) (the first preset value of B*) be used as the second target image.
Illustratively, if image is color, the image showed the score from color space, the mode of target processing be can be third The intensity gray scale value of each pixel in target image adds the second preset value, or multiplied by third preset value, to obtain the second mesh The processing of the intensity gray scale value of each pixel in logo image, i.e. target is each picture to the predeterminable area of third target image The grayscale value of vegetarian refreshments increases or reduces T, or increases or reduces Q times, and T is positive integer, in order to guarantee that image color is undistorted, also Color compensation is carried out to the coloration in third target image, to obtain the second target image.Wherein, specific color compensation Method can refer to existing the relevant technologies, and the embodiment of the present invention is not construed as limiting.For example, if third target image is YCbCr image, (the second preset value of Y+ or Y* third preset value) (Cb after color compensation) (Cr after color compensation) is then used as the second target Image.
It should be understood that the first preset value, the second preset value and third preset value are set according to actual needs, the present invention Embodiment is not construed as limiting.When determining the first preset value, the second preset value and third preset value again, need to consider following two Point: one, consider optical sensor sensitivity, two, consider human eye sensitivity.Specifically, in conjunction with optical sensor sensitivity and The sensitivity of human eye, by the corresponding grayscale value control of the second target image in the rigid range of variation of human eye, even if photosensitive can examine Difference is measured, but people but perceives and jumping less than screen intensity.
First grayscale value is the corresponding grayscale value of first object image, and terminal device can read first from memory Then the grayscale value of the corresponding each pixel of target image calculates the corresponding total grayscale value of first object image, is denoted as first Grayscale value.
First grayscale value specifically can be the grayscale value of first image of frame;It is also possible to total grayscale of the first image of P frame Value, P are greater than 1 and are less than or equal to N;It is also possible to the average value of total grayscale value of the first image of P frame;It can also be other, The embodiment of the present invention is not construed as limiting.
Similarly, the second grayscale value is the corresponding grayscale value of the second target image, and terminal device can be read from memory Then the grayscale value for taking the corresponding each pixel of the second target image calculates the corresponding total grayscale value of the second target image, note Make the second grayscale value.
Second grayscale value specifically can be the grayscale value of second image of frame;It is also possible to total grayscale of the second image of P frame Value, P are greater than 1 and are less than or equal to N;It is also possible to the average value of total grayscale value of the second image of P frame;It can also be other, The embodiment of the present invention is not construed as limiting.
The target gray scale value is second grayscale value, then the first difference is the difference of the first grayscale value and the second grayscale value Absolute value
The target gray scale value is to first grayscale value through target treated grayscale value, since first object image is corresponding Grayscale value and the corresponding grayscale value of third target image it is usually identical, or have faint variation, therefore can be by the first grayscale value Through with to the identical target of third target image treated grayscale value as target gray scale value.
Illustratively, which is specially the grayscale value of the first area in the first object image, this second Grayscale value is specially the grayscale value in region identical with the first area in second target image.It is said by taking first area as an example Bright, first area is that can detect the corresponding region in the target area of screen reflection luminous intensity, i.e. first object with optical sensor Region corresponding with target area in image.Since the screen reflection luminous intensity in first environment luminous intensity measurement value is interference light Sensor can not accurately measure the factor of actual environment luminous intensity, and screen reflection luminous intensity is due in first object image The luminous generation of the pixel of first area.Therefore when first grayscale value is specially the first area in the first object image Grayscale value, which can when being specially the grayscale value in region identical with the first area in second target image Accurately to remove interference of the screen reflection luminous intensity to actual environment luminous intensity, make target environment luminous intensity closer to actual environment Luminous intensity keeps the measurement to environment light more acurrate, refers to so as to improve to the ambient light intensity of environment locating for terminal device Measurement accuracy.
Step 203, terminal device according to the first environment luminous intensity measurement value, first difference, second difference and First grayscale value calculates target environment light intensity value.
Compared to first environment luminous intensity measurement value or second environment luminous intensity measurement value, target environment light intensity value is more connect It is bordering on actual environment light intensity value.
Illustratively, which can specifically be realized by following step 203a.
Step 203a, terminal device according to the first environment luminous intensity measurement value, first difference, second difference and First grayscale value calculates target environment light intensity value using the first formula.
First formula are as follows:Wherein, L1For the target environment light intensity value, L1' it is the first environment Luminous intensity measurement value, Δ L are first difference, and Δ G is second difference, G1For first grayscale value.
Specifically, terminal device first calculates the ratio of the first difference Yu the second difference, the corresponding screen of as single grayscale value Curtain intensity of reflected light;The product of single grayscale value corresponding screen reflection luminous intensity and first grayscale value is calculated again, as Total screen reflection luminous intensity in one period;Finally calculate the first environment luminous intensity measurement value and total screen reflection luminous intensity Difference, as target environment light intensity value.
Illustratively, more acurrate in order to make to calculate in practical calculating process, it can be corresponded to single grayscale value is calculated Screen reflection luminous intensity after, add an offset for the corresponding screen reflection luminous intensity of single grayscale value, as final The corresponding screen reflection luminous intensity of single grayscale value.Offset can also be added after total screen reflection luminous intensity is calculated, Or add offset after target environment light intensity value is calculated, it is set with specific reference to actual conditions, the embodiment of the present invention It is not construed as limiting.
Illustratively, if the terminal device handles third target image through target before showing the second target image After obtain the second target image, then combine Fig. 2, it is provided in an embodiment of the present invention specific as shown in fig. 6, before step 201 The method for obtaining ambient light intensity can also include the steps that following 204.
Step 204, before showing second target image, terminal device is to the grayscale value of third target image through the mesh Mark handles to obtain second target image.
It specifically can be with reference to the associated description in above-mentioned steps 202.
Illustratively, the second target image shown in second time period and the first mesh shown in first time period Logo image is compared, it is possible to be changed, therefore is likely to occur to the calculating of the corresponding screen reflection luminous intensity of single grayscale value Deviation, especially when target gray scale value be to first grayscale value through target treated grayscale value when.In order to avoid in display Hold mutation obvious errors caused by target environment luminous intensity, after target environment luminous intensity is calculated, before being directed to The multiple groups target environment light intensity data being calculated afterwards carries out low-pass filtering treatment.
In conjunction with Fig. 3, as shown in fig. 7, after step 203, specific acquisition environmental light intensity provided in an embodiment of the present invention The method of degree can also include the steps that following 205.
Step 205, terminal device use low-pass filtering mode, are filtered to the target environment light intensity value.
In embodiments of the present invention, low-pass filtering mode can be is filtered by low-pass filter, is also possible to by low Pass filter algorithm filtering, the embodiment of the present invention are not construed as limiting.
Illustratively, according to the mode of low-pass filter filtering, then the cutoff frequency of low-pass filter is the 4th default Value.4th preset value is set according to actual needs, and the embodiment of the present invention is not construed as limiting, specifically can be with reference to existing related skill Art, it will not go into details herein.
Illustratively, according to the mode of low-pass filtering algorithm filtering, then low-pass filtering algorithm can be sliding average filter Wave algorithm can also be other low-pass filtering algorithms, can specifically refer to existing the relevant technologies, and the embodiment of the present invention is refused It repeats.
The embodiment of the invention provides a kind of methods for obtaining ambient light intensity to pass through acquisition in embodiments of the present invention First difference, first difference are the absolute of the difference of first environment luminous intensity measurement value and second environment luminous intensity measurement value Value, the first environment luminous intensity measurement value be first time period in, terminal device show first object image when, the end of measurement The environmental light intensity angle value of end equipment local environment, the second environment luminous intensity measurement value are in second time period, and terminal device is aobvious When showing the second target image, the environmental light intensity angle value of the terminal device local environment of measurement, the second time period and this first The duration of period is identical;The second difference is obtained, which is the absolute of the first grayscale value and the difference of target gray scale value Value, first grayscale value are the grayscale value of the first object image, which is second grayscale value or is to this For first grayscale value through target treated grayscale value, which is the grayscale value of second target image, first ash Rank value is different from the target gray scale value;According to the first environment luminous intensity measurement value, first difference, second difference and it is somebody's turn to do First grayscale value calculates target environment light intensity value.In the program, first environment luminous intensity measurement value and second environment luminous intensity Measured value includes at least actual environment light intensity value and corresponding screen reflection luminous intensity respectively, due to first time period and second The duration of period is identical, if the duration is shorter, in first time period and in second time period, and ring locating for terminal device The actual environment light intensity value in border is constant, and the variable quantity of the intensity value of screen light is the second difference, first environment luminous intensity measurement The absolute value of the difference of value and second environment luminous intensity measurement value is the first difference, and therefore, the first difference be (ambient light measurement value Difference) it is caused by the second difference (variation of screen light intensity value), then terminal device can be according to the first grayscale value, first Target environment light intensity value is calculated in difference, the second difference and first environment luminous intensity measurement value, compared to first environment Luminous intensity measurement value or second environment luminous intensity measurement value, target environment light intensity value closer to actual environment light intensity value, So as to improve the measurement accuracy referred to the ambient light intensity of environment locating for terminal device, prior art environment can solve The problem of the testing result inaccuracy of light.
As shown in figure 8, the embodiment of the present invention provides a kind of terminal device 120, which includes: acquisition module 121 and computing module 122;
The acquisition module 121, for obtaining the first difference, which is first environment luminous intensity measurement value and second The absolute value of the difference of ambient light intensity measured value, the first environment luminous intensity measurement value are terminal device in first time period When showing first object image, the environmental light intensity angle value of the terminal device local environment of measurement, the second environment luminous intensity is surveyed Magnitude be second time period in, when terminal device shows the second target image, the environment of the terminal device local environment of measurement Light intensity value, the second time period are identical as the duration of the first time period;The second difference is obtained, which is the first ash The absolute value of the difference of rank value and target gray scale value, first grayscale value are the grayscale value of the first object image, target ash Rank value is second grayscale value or is to first grayscale value through target treated grayscale value, second grayscale value be this The grayscale value of two target images, first grayscale value are different from the target gray scale value;
The computing module 122, for according to the first environment luminous intensity measurement value, the acquisition module 121 acquisition this Second difference and first grayscale value that one difference, the acquisition module 121 obtain, calculate target environment light intensity value.
Optionally, which includes continuous first image of N frame, which includes that N frame is continuous The second image, second image of N frame and first image of N frame are the image that the terminal device continuously displays, and N is positive integer.
Optionally, in conjunction with Fig. 8, as shown in figure 9, the terminal device 120 further include: processing module 123;The processing module 123, for before showing second target image, to the grayscale value of third target image through the target handle to obtain this second Target image.
Optionally, which is specially the grayscale value of the first area in the first object image, second ash Rank value is specially the grayscale value in region identical with the first area in second target image.
Optionally, the computing module 122 is specifically used for according to the first environment luminous intensity measurement value, first difference, is somebody's turn to do Second difference and first grayscale value calculate target environment light intensity value using the first formula;First formula are as follows:Wherein, L1For the target environment light intensity value, L1' it is the first environment luminous intensity measurement value, Δ L is should First difference, Δ G are second difference, G1For first grayscale value.
Optionally, in conjunction with Fig. 9, as shown in Figure 10, which goes back mass: filter module 124;The filter module 124, for this according to the first environment luminous intensity measurement value, first difference, second difference and first grayscale value, After calculating target environment light intensity value, using low-pass filtering mode, the target environment which is calculated Light intensity value is filtered.
Terminal device provided in an embodiment of the present invention can be realized in above method embodiment one of any institute of Fig. 2 to Fig. 7 The each process shown, to avoid repeating, details are not described herein again.
The embodiment of the invention provides one kind to obtain terminal device, in embodiments of the present invention, should by obtaining the first difference First difference is the absolute value of the difference of first environment luminous intensity measurement value and second environment luminous intensity measurement value, the first environment Luminous intensity measurement value is in first time period, when terminal device shows first object image, ring locating for the terminal device of measurement The environmental light intensity angle value in border, the second environment luminous intensity measurement value are in second time period, and terminal device shows the second target figure When picture, the environmental light intensity angle value of the terminal device local environment of measurement, the duration of the second time period and the first time period It is identical;The second difference is obtained, which is the absolute value of the difference of the first grayscale value and target gray scale value, first grayscale Value is the grayscale value of the first object image, which is second grayscale value or is to first grayscale value through mesh Mark treated grayscale value, second grayscale value are the grayscale value of second target image, first grayscale value and target ash Rank value is different;According to the first environment luminous intensity measurement value, first difference, second difference and first grayscale value, meter Calculate target environment light intensity value.In the program, first environment luminous intensity measurement value and second environment luminous intensity measurement value are respectively extremely It include less actual environment light intensity value and corresponding screen reflection luminous intensity, due to the duration of first time period and second time period It is identical, if the duration is shorter, in first time period and in second time period, the actual environment of environment locating for terminal device Light intensity value is constant, and the variable quantity of the intensity value of screen light is the second difference, first environment luminous intensity measurement value and second environment The absolute value of the difference of luminous intensity measurement value is the first difference, and therefore, the first difference (difference of ambient light measurement value) is by the Caused by two differences (variation of screen light intensity value), then terminal device can be according to the first grayscale value, the first difference, second poor Target environment light intensity value is calculated in value and first environment luminous intensity measurement value, compared to first environment luminous intensity measurement value Or second environment luminous intensity measurement value, target environment light intensity value is closer to actual environment light intensity value, so as to improve To the measurement accuracy that the ambient light intensity of environment locating for terminal device refers to, the testing result of prior art environment light can solve The problem of inaccuracy.
A kind of hardware structural diagram of Figure 11 terminal device of each embodiment to realize the present invention.As shown in figure 11, The terminal device 100 includes but is not limited to: radio frequency unit 101, network module 102, audio output unit 103, input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, with And the equal components of power supply 111.It will be understood by those skilled in the art that the not structure paired terminal of terminal device structure shown in Figure 11 The restriction of equipment, terminal device may include perhaps combining certain components or different than illustrating more or fewer components Component layout.In embodiments of the present invention, terminal device includes but is not limited to mobile phone, tablet computer, laptop, palm electricity Brain, vehicle-mounted terminal equipment, wearable device and pedometer etc..
Wherein, processor 110, for obtaining the first difference, which is first environment luminous intensity measurement value and the The absolute value of the difference of two ambient light intensity measured values, the first environment luminous intensity measurement value are in first time period, and terminal is set When standby display first object image, the environmental light intensity angle value of the terminal device local environment of measurement, the second environment luminous intensity Measured value be second time period in, when terminal device shows the second target image, the ring of the terminal device local environment of measurement Border light intensity value, the second time period are identical as the duration of the first time period;The second difference is obtained, which is first The absolute value of the difference of grayscale value and target gray scale value, first grayscale value are the grayscale value of the first object image, the target Grayscale value is second grayscale value or is to first grayscale value through target treated grayscale value, which is should The grayscale value of second target image, first grayscale value are different from the target gray scale value;According to the first environment luminous intensity measurement Value, first difference, second difference and first grayscale value calculate target environment light intensity value.
Terminal device provided in an embodiment of the present invention, in embodiments of the present invention, by obtaining the first difference, this is first poor Value is the absolute value of the difference of first environment luminous intensity measurement value and second environment luminous intensity measurement value, the first environment luminous intensity Measured value be first time period in, terminal device show first object image when, the ring of the terminal device local environment of measurement Border light intensity value, the second environment luminous intensity measurement value are when terminal device shows the second target image, to survey in second time period The environmental light intensity angle value of the terminal device local environment of amount, the second time period are identical as the duration of the first time period;It obtains The second difference is taken, which is the absolute value of the difference of the first grayscale value and target gray scale value, which is should The grayscale value of first object image, the target gray scale value are second grayscale value or are to be handled through target first grayscale value Grayscale value afterwards, second grayscale value are the grayscale value of second target image, and first grayscale value and the target gray scale value are not Together;According to the first environment luminous intensity measurement value, first difference, second difference and first grayscale value, target is calculated Environmental light intensity angle value.In the program, first environment luminous intensity measurement value and second environment luminous intensity measurement value include at least respectively Actual environment light intensity value and corresponding screen reflection luminous intensity, since first time period is identical with the duration of second time period, If the duration is shorter, in first time period and in second time period, the actual environment light intensity of environment locating for terminal device Angle value is constant, and the variable quantity of the intensity value of screen light is the second difference, first environment luminous intensity measurement value and second environment light intensity The absolute value for spending the difference of measured value is the first difference, and therefore, the first difference (difference of ambient light measurement value) is poor by second Be worth (variation of screen light intensity value) caused by, then terminal device can according to the first grayscale value, the first difference, the second difference with And target environment light intensity value is calculated in first environment luminous intensity measurement value, compared to first environment luminous intensity measurement value or Two ambient light intensity measured values, target environment light intensity value is closer to actual environment light intensity value, so as to improve to end The measurement accuracy that the ambient light intensity of environment locating for end equipment refers to, the testing result that can solve prior art environment light are inaccurate True problem.
It should be understood that the embodiment of the present invention in, radio frequency unit 101 can be used for receiving and sending messages or communication process in, signal Send and receive, specifically, by from base station downlink data receive after, to processor 110 handle;In addition, by uplink Data are sent to base station.In general, radio frequency unit 101 includes but is not limited to antenna, at least one amplifier, transceiver, coupling Device, low-noise amplifier, duplexer etc..In addition, radio frequency unit 101 can also by wireless communication system and network and other set Standby communication.
Terminal device provides wireless broadband internet by network module 102 for user and accesses, and such as user is helped to receive It sends e-mails, browse webpage and access streaming video etc..
Audio output unit 103 can be received by radio frequency unit 101 or network module 102 or in memory 109 The audio data of storage is converted into audio signal and exports to be sound.Moreover, audio output unit 103 can also provide and end The relevant audio output of specific function that end equipment 100 executes is (for example, call signal receives sound, message sink sound etc. Deng).Audio output unit 103 includes loudspeaker, buzzer and receiver etc..
Input unit 104 is for receiving audio or video signal.Input unit 104 may include graphics processor (Graphics Processing Unit, GPU) 1041 and microphone 1042, graphics processor 1041 is in video acquisition mode Or the image data of the static images or video obtained in image capture mode by image capture apparatus (such as camera) carries out Reason.Treated, and picture frame may be displayed on display unit 106.Through graphics processor 1041, treated that picture frame can be deposited Storage is sent in memory 109 (or other storage mediums) or via radio frequency unit 101 or network module 102.Mike Wind 1042 can receive sound, and can be audio data by such acoustic processing.Treated audio data can be The format output that mobile communication base station can be sent to via radio frequency unit 101 is converted in the case where telephone calling model.
Terminal device 100 further includes at least one sensor 105, such as optical sensor, motion sensor and other biographies Sensor.Specifically, optical sensor includes ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment The light and shade of light adjusts the brightness of display panel 1061, and proximity sensor can close when terminal device 100 is moved in one's ear Display panel 1061 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect in all directions (general For three axis) size of acceleration, it can detect that size and the direction of gravity when static, can be used to identify terminal device posture (ratio Such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap);It passes Sensor 105 can also include fingerprint sensor, pressure sensor, iris sensor, molecule sensor, gyroscope, barometer, wet Meter, thermometer, infrared sensor etc. are spent, details are not described herein.
Display unit 106 is for showing information input by user or being supplied to the information of user.Display unit 106 can wrap Display panel 1061 is included, liquid crystal display (Liquid Crystal Display, LCD), Organic Light Emitting Diode can be used Forms such as (Organic Light-Emitting Diode, OLED) configure display panel 1061.
User input unit 107 can be used for receiving the number or character information of input, and generate the use with terminal device Family setting and the related key signals input of function control.Specifically, user input unit 107 include touch panel 1071 and Other input equipments 1072.Touch panel 1071, also referred to as touch screen collect the touch operation of user on it or nearby (for example user uses any suitable objects or attachment such as finger, stylus on touch panel 1071 or in touch panel 1071 Neighbouring operation).Touch panel 1071 may include both touch detecting apparatus and touch controller.Wherein, touch detection Device detects the touch orientation of user, and detects touch operation bring signal, transmits a signal to touch controller;Touch control Device processed receives touch information from touch detecting apparatus, and is converted into contact coordinate, then gives processor 110, receiving area It manages the order that device 110 is sent and is executed.Furthermore, it is possible to more using resistance-type, condenser type, infrared ray and surface acoustic wave etc. Seed type realizes touch panel 1071.In addition to touch panel 1071, user input unit 107 can also include other input equipments 1072.Specifically, other input equipments 1072 can include but is not limited to physical keyboard, function key (such as volume control button, Switch key etc.), trace ball, mouse, operating stick, details are not described herein.
Further, touch panel 1071 can be covered on display panel 1061, when touch panel 1071 is detected at it On or near touch operation after, send processor 110 to determine the type of touch event, be followed by subsequent processing device 110 according to touching The type for touching event provides corresponding visual output on display panel 1061.Although in Figure 11, touch panel 1071 and aobvious Show that panel 1061 is the function that outputs and inputs of realizing terminal device as two independent components, but in some embodiments In, can be integrated by touch panel 1071 and display panel 1061 and realize the function that outputs and inputs of terminal device, it is specific this Place is without limitation.
Interface unit 108 is the interface that external device (ED) is connect with terminal device 100.For example, external device (ED) may include having Line or wireless head-band earphone port, external power supply (or battery charger) port, wired or wireless data port, storage card end Mouth, port, the port audio input/output (I/O), video i/o port, earphone end for connecting the device with identification module Mouthful etc..Interface unit 108 can be used for receiving the input (for example, data information, electric power etc.) from external device (ED) and By one or more elements that the input received is transferred in terminal device 100 or can be used in 100 He of terminal device Data are transmitted between external device (ED).
Memory 109 can be used for storing software program and various data.Memory 109 can mainly include storing program area The storage data area and, wherein storing program area can (such as the sound of application program needed for storage program area, at least one function Sound playing function, image player function etc.) etc.;Storage data area can store according to mobile phone use created data (such as Audio data, phone directory etc.) etc..In addition, memory 109 may include high-speed random access memory, it can also include non-easy The property lost memory, a for example, at least disk memory, flush memory device or other volatile solid-state parts.
Processor 110 is the control centre of terminal device, utilizes each of various interfaces and the entire terminal device of connection A part by running or execute the software program and/or module that are stored in memory 109, and calls and is stored in storage Data in device 109 execute the various functions and processing data of terminal device, to carry out integral monitoring to terminal device.Place Managing device 110 may include one or more processing units;Optionally, processor 110 can integrate application processor and modulatedemodulate is mediated Manage device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is main Processing wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 110.
Terminal device 100 can also include the power supply 111 (such as battery) powered to all parts, optionally, power supply 111 Can be logically contiguous by power-supply management system and processor 110, to realize management charging by power-supply management system, put The functions such as electricity and power managed.
In addition, terminal device 100 includes some unshowned functional modules, details are not described herein.
Optionally, the embodiment of the present invention also provides a kind of terminal device, may include above-mentioned processor as shown in figure 11 110, memory 109, and it is stored in the computer program that can be run on memory 109 and on the processor 110, the calculating Realize in above method embodiment that Fig. 2 to Fig. 7 obtains environmental light intensity shown in one of any when machine program is executed by processor 110 Each process of the method for degree, and identical technical effect can be reached, to avoid repeating, details are not described herein again.
The embodiment of the present invention also provides a kind of computer readable storage medium, and meter is stored on computer readable storage medium Calculation machine program, realized when which is executed by processor in above method embodiment Fig. 2 to Fig. 7 it is one of any shown in The each process of method of ambient light intensity is obtained, and identical technical effect can be reached, to avoid repeating, details are not described herein again. Wherein, the computer readable storage medium, such as read-only memory (Read-Only Memory, ROM), random access memory Device (Random Access Memory, RAM), magnetic or disk etc..
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do There is also other identical elements in the process, method of element, article or device.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art The part contributed out can be embodied in the form of software products, which is stored in a storage medium In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes Business device, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited to above-mentioned specific Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much Form belongs within protection of the invention.

Claims (12)

1. a kind of method for obtaining ambient light intensity, which is characterized in that the described method includes:
The first difference is obtained, first difference is the difference of first environment luminous intensity measurement value and second environment luminous intensity measurement value The absolute value of value, the first environment luminous intensity measurement value be first time period in, terminal device show first object image when, The environmental light intensity angle value of the terminal device local environment of measurement, the second environment luminous intensity measurement value are second time period It is interior, when terminal device shows the second target image, the environmental light intensity angle value of the terminal device local environment of measurement, described Two periods are identical as the duration of the first time period;
Obtaining the second difference, second difference is the absolute value of the difference of the first grayscale value and target gray scale value, described first Grayscale value is the grayscale value of the first object image, and the target gray scale value is the second grayscale value or is to first ash For rank value through target treated grayscale value, second grayscale value is the grayscale value of second target image, first ash Rank value is different from the target gray scale value;
According to the first environment luminous intensity measurement value, first difference, second difference and first grayscale value, Calculate target environment light intensity value.
2. the method according to claim 1, wherein the first object image includes continuous first figure of N frame Picture, second target image include continuous second image of N frame, and second image of N frame and first image of N frame are institute The image that terminal device continuously displays is stated, N is positive integer.
3. the method according to claim 1, wherein the method also includes:
Before showing second target image, handle to obtain described the through the target to the grayscale value of third target image Two target images.
4. the method according to claim 1, wherein first grayscale value is specially the first object image In first area grayscale value, second grayscale value is specially identical as the first area in second target image Region grayscale value.
5. the method according to claim 1, wherein described according to the first environment luminous intensity measurement value, institute The first difference, second difference and first grayscale value are stated, target environment light intensity value is calculated, comprising:
According to the first environment luminous intensity measurement value, first difference, second difference and first grayscale value, Using the first formula, target environment light intensity value is calculated;
First formula are as follows:Wherein, L1For the target environment light intensity value, L1' it is first ring Border luminous intensity measurement value, Δ L are first difference, and Δ G is second difference, G1For first grayscale value.
6. method according to claim 1-5, which is characterized in that described to be surveyed according to the first environment luminous intensity Magnitude, first difference, second difference and first grayscale value, after calculating target environment light intensity value, also Include:
Using low-pass filtering mode, the target environment light intensity value is filtered.
7. a kind of terminal device, which is characterized in that the terminal device includes: to obtain module and computing module;
The acquisition module, for obtaining the first difference, first difference is first environment luminous intensity measurement value and the second ring The absolute value of the difference of border luminous intensity measurement value, the first environment luminous intensity measurement value are terminal device in first time period When showing first object image, the environmental light intensity angle value of the terminal device local environment of measurement, the second environment light intensity Spend measured value be second time period in, when terminal device shows the second target image, the terminal device local environment of measurement Environmental light intensity angle value, the second time period is identical as the duration of the first time period;Obtain the second difference, described second Difference is the absolute value of the difference of the first grayscale value and target gray scale value, and first grayscale value is the first object image Grayscale value, the target gray scale value be the second grayscale value or be to first grayscale value through target treated grayscale value, Second grayscale value is the grayscale value of second target image, and first grayscale value is different from the target gray scale value;
The computing module, for according to the first environment luminous intensity measurement value, described first for obtaining module and obtaining Difference, second difference for obtaining module acquisition and first grayscale value, calculate target environment light intensity value.
8. terminal device according to claim 7, which is characterized in that the first object image includes N frame continuous One image, second target image include continuous second image of N frame, second image of N frame and first image of N frame For the image that the terminal device continuously displays, N is positive integer.
9. terminal device according to claim 7, which is characterized in that the terminal device further include: processing module;
The processing module is used for before showing second target image, described in the grayscale value warp to third target image Target handles to obtain second target image.
10. terminal device according to claim 7, which is characterized in that first grayscale value is specially first mesh The grayscale value of first area in logo image, second grayscale value be specially in second target image with firstth area The grayscale value in the identical region in domain.
11. terminal device according to claim 7, which is characterized in that
The computing module is specifically used for according to the first environment luminous intensity measurement value, first difference, described second poor Value and first grayscale value calculate target environment light intensity value using the first formula;
First formula are as follows:Wherein, L1For the target environment light intensity value, L1' it is first ring Border luminous intensity measurement value, Δ L are first difference, and Δ G is second difference, G1For first grayscale value.
12. according to the described in any item terminal devices of claim 7-11, which is characterized in that the terminal device also mass: filter Wave module;
The filter module is used for described according to the first environment luminous intensity measurement value, first difference, described second Difference and first grayscale value, after calculating target environment light intensity value, using low-pass filtering mode, to the calculating mould The target environment light intensity value that block is calculated is filtered.
CN201810975136.2A 2018-08-24 2018-08-24 Method for obtaining ambient light intensity and terminal equipment Active CN109238460B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810975136.2A CN109238460B (en) 2018-08-24 2018-08-24 Method for obtaining ambient light intensity and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810975136.2A CN109238460B (en) 2018-08-24 2018-08-24 Method for obtaining ambient light intensity and terminal equipment

Publications (2)

Publication Number Publication Date
CN109238460A true CN109238460A (en) 2019-01-18
CN109238460B CN109238460B (en) 2020-11-06

Family

ID=65067971

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810975136.2A Active CN109238460B (en) 2018-08-24 2018-08-24 Method for obtaining ambient light intensity and terminal equipment

Country Status (1)

Country Link
CN (1) CN109238460B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111754932A (en) * 2019-09-11 2020-10-09 义明科技股份有限公司 Electronic device and method for detecting ambient light
CN112229507A (en) * 2020-10-15 2021-01-15 Tcl通讯(宁波)有限公司 Ambient light detection method and device, storage medium and mobile terminal
WO2021035897A1 (en) * 2019-08-30 2021-03-04 北京小米移动软件有限公司 Mobile terminal
CN112992060A (en) * 2021-03-02 2021-06-18 维沃移动通信有限公司 Display method and device of display screen of electronic equipment and electronic equipment
EP3845878A1 (en) * 2020-01-03 2021-07-07 Beijing Xiaomi Mobile Software Co., Ltd. Method and device for detecting ambient light, and storage medium
CN113551768A (en) * 2021-07-14 2021-10-26 北京小米移动软件有限公司 Method and device for determining ambient brightness
CN114743514A (en) * 2022-06-09 2022-07-12 南京惠华电子技术有限公司 Method for high-brightness multicolor display of liquid crystal display module
CN116033142A (en) * 2023-03-30 2023-04-28 北京城建智控科技股份有限公司 Ambient light measurement method and system based on camera device
CN113551768B (en) * 2021-07-14 2024-04-23 北京小米移动软件有限公司 Method and device for determining ambient brightness

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150116377A1 (en) * 2011-04-20 2015-04-30 Wistron Corporation Display device for adjusting gray-level of image frame depending on environment illumination
CN105788566A (en) * 2016-05-06 2016-07-20 南京巨鲨显示科技有限公司 Gray-scale brightness curve correction system and method
CN106462339A (en) * 2015-09-28 2017-02-22 华为技术有限公司 Terminal and method for detecting ambient brightness
CN106453888A (en) * 2016-10-08 2017-02-22 珠海格力电器股份有限公司 Photographing method and device
KR20180024618A (en) * 2016-08-30 2018-03-08 삼성전자주식회사 Display controlling method and electronic device supporting the same
CN107957294A (en) * 2017-11-22 2018-04-24 广东欧珀移动通信有限公司 Ambient light intensity detection method, device, storage medium and electronic equipment
CN108257581A (en) * 2017-12-22 2018-07-06 维沃移动通信有限公司 A kind of method of adjustment of light intensity sensing device, mobile terminal and brightness of display screen

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150116377A1 (en) * 2011-04-20 2015-04-30 Wistron Corporation Display device for adjusting gray-level of image frame depending on environment illumination
CN106462339A (en) * 2015-09-28 2017-02-22 华为技术有限公司 Terminal and method for detecting ambient brightness
CN105788566A (en) * 2016-05-06 2016-07-20 南京巨鲨显示科技有限公司 Gray-scale brightness curve correction system and method
KR20180024618A (en) * 2016-08-30 2018-03-08 삼성전자주식회사 Display controlling method and electronic device supporting the same
CN106453888A (en) * 2016-10-08 2017-02-22 珠海格力电器股份有限公司 Photographing method and device
CN107957294A (en) * 2017-11-22 2018-04-24 广东欧珀移动通信有限公司 Ambient light intensity detection method, device, storage medium and electronic equipment
CN108257581A (en) * 2017-12-22 2018-07-06 维沃移动通信有限公司 A kind of method of adjustment of light intensity sensing device, mobile terminal and brightness of display screen

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021035897A1 (en) * 2019-08-30 2021-03-04 北京小米移动软件有限公司 Mobile terminal
CN111754932A (en) * 2019-09-11 2020-10-09 义明科技股份有限公司 Electronic device and method for detecting ambient light
US11087677B2 (en) 2019-09-11 2021-08-10 Eminent Electronic Technology Corp. Ltd. Electronic device and ambient light sensing method thereof
US11250791B2 (en) 2020-01-03 2022-02-15 Beijing Xiaomi Mobile Software Co., Ltd. Method and device for detecting ambient light, and storage medium
EP3845878A1 (en) * 2020-01-03 2021-07-07 Beijing Xiaomi Mobile Software Co., Ltd. Method and device for detecting ambient light, and storage medium
CN112229507A (en) * 2020-10-15 2021-01-15 Tcl通讯(宁波)有限公司 Ambient light detection method and device, storage medium and mobile terminal
CN112992060B (en) * 2021-03-02 2022-08-02 维沃移动通信有限公司 Display method and device of display screen of electronic equipment and electronic equipment
CN112992060A (en) * 2021-03-02 2021-06-18 维沃移动通信有限公司 Display method and device of display screen of electronic equipment and electronic equipment
CN113551768A (en) * 2021-07-14 2021-10-26 北京小米移动软件有限公司 Method and device for determining ambient brightness
CN113551768B (en) * 2021-07-14 2024-04-23 北京小米移动软件有限公司 Method and device for determining ambient brightness
CN114743514A (en) * 2022-06-09 2022-07-12 南京惠华电子技术有限公司 Method for high-brightness multicolor display of liquid crystal display module
CN116033142A (en) * 2023-03-30 2023-04-28 北京城建智控科技股份有限公司 Ambient light measurement method and system based on camera device
CN116033142B (en) * 2023-03-30 2023-06-23 北京城建智控科技股份有限公司 Ambient light measurement method and system based on camera device

Also Published As

Publication number Publication date
CN109238460B (en) 2020-11-06

Similar Documents

Publication Publication Date Title
CN109238460A (en) A kind of method and terminal device obtaining ambient light intensity
CN107580184B (en) A kind of image pickup method and mobile terminal
CN107665697B (en) A kind of adjusting method and mobile terminal of screen intensity
CN108184037B (en) A kind of image display method and mobile terminal
CN108021161A (en) Ambient light intensity detection method, device, storage medium and electronic equipment
CN109272968A (en) A kind of screen nonuniformity calibration method and terminal device
CN107846537B (en) A kind of CCD camera assembly, image acquiring method and mobile terminal
CN109002243A (en) A kind of image parameter adjusting method and terminal device
CN107682616A (en) Control method, shooting epicranial plate and mobile terminal
CN108492246A (en) A kind of image processing method, device and mobile terminal
CN107895352A (en) A kind of image processing method and mobile terminal
CN108960179A (en) A kind of image processing method and mobile terminal
CN110213485A (en) A kind of image processing method and terminal
CN107846583A (en) A kind of image shadow compensating method and mobile terminal
CN109544486A (en) A kind of image processing method and terminal device
CN109614182A (en) A kind of display methods and terminal device
CN107845074A (en) A kind of image rendering method and mobile terminal
CN109005314A (en) A kind of image processing method and terminal
CN108845785A (en) A kind of display methods and terminal
CN108200352A (en) A kind of method, terminal and storage medium for reconciling picture luminance
CN107835402A (en) A kind of image processing method, device and mobile terminal
CN109639981A (en) A kind of image capturing method and mobile terminal
CN109068063A (en) A kind of processing of 3 d image data, display methods, device and mobile terminal
CN107995425B (en) A kind of image processing method and mobile terminal
CN109729280A (en) A kind of image processing method and mobile terminal

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