CN112525340A - Method and device for acquiring light intensity value, storage medium and electronic equipment - Google Patents

Method and device for acquiring light intensity value, storage medium and electronic equipment Download PDF

Info

Publication number
CN112525340A
CN112525340A CN202011388599.2A CN202011388599A CN112525340A CN 112525340 A CN112525340 A CN 112525340A CN 202011388599 A CN202011388599 A CN 202011388599A CN 112525340 A CN112525340 A CN 112525340A
Authority
CN
China
Prior art keywords
value
light
target terminal
light sensation
light intensity
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
CN202011388599.2A
Other languages
Chinese (zh)
Other versions
CN112525340B (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.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202011388599.2A priority Critical patent/CN112525340B/en
Publication of CN112525340A publication Critical patent/CN112525340A/en
Application granted granted Critical
Publication of CN112525340B publication Critical patent/CN112525340B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a method and a device for acquiring a light intensity value, a storage medium and electronic equipment, and belongs to the field of photoelectricity. Wherein, the method comprises the following steps: determining the placement direction of a target terminal; if the placement direction meets a preset condition, respectively acquiring a first light sensitivity value of the light sensor and a second light sensitivity value of the rear camera; and calculating the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value. According to the invention, the technical problem that the light intensity value obtained by the related technology is inaccurate is solved, the accuracy of the target terminal in backlight modulation based on the light intensity value is improved, the comfort of the user using the target terminal is further improved, and the visual fatigue is delayed.

Description

Method and device for acquiring light intensity value, storage medium and electronic equipment
Technical Field
The invention relates to the field of photoelectricity, in particular to a method and a device for acquiring a light intensity value, a storage medium and electronic equipment.
Background
In the related art, the light sensitivity of the display terminals such as the mobile phone is a light sensing sensor/light sense, which is an important means for the mobile phone to detect the ambient light and is the only basis for automatically adjusting the backlight.
In the related art, the light sensation position is generally located at the top of the mobile phone, and the direction of the user is opposite to the direction of the user, so that a certain deep well effect can exist no matter the structure is raised on a main board or the structure is attached to a support so that the device is closer to a screen. The deep well effect causes strong directivity of light detection, and light intensity in only one direction can be detected. When the mobile phone is horizontally or vertically arranged on the bracket, the front-mounted light sensor (also called light sense) cannot reflect the light intensity in the visual field range in all directions. Under the condition that a mobile phone is not used on the support temporarily, backlight is automatically adjusted through comprehensive parameters of a camera and light induction, all the mobile phone backlight adjustment only uses front light induction, and the collected light intensity value of actual environment light is inaccurate due to the deep well effect of the light induction sensor.
In view of the above problems in the related art, no effective solution has been found at present.
Disclosure of Invention
The embodiment of the invention provides a method and a device for acquiring a light intensity value, a storage medium and electronic equipment, and aims to solve the technical problem that the light intensity value acquired by a related technology is inaccurate.
According to an aspect of an embodiment of the present application, there is provided a method for obtaining a light intensity value, including: determining the placement direction of a target terminal; if the placement direction meets a preset condition, respectively acquiring a first light sensitivity value of the light sensor and a second light sensitivity value of the rear camera; and calculating the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value.
Further, after calculating the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value, the method further includes: adjusting a backlight intensity of a display screen of the target terminal based on the light intensity value, wherein the backlight intensity is in positive correlation with the light intensity value.
Further, determining the placement position of the target terminal includes: reading a gravity sensing value of a three-axis sensor, wherein the three-axis sensor is built in the target terminal; judging whether the placing position of the target terminal forms a preset included angle with the horizontal direction or not according to the gravity sensing value; if the placing position of the target terminal forms a preset included angle with the horizontal direction, determining that the placing direction of the target terminal meets a preset condition; and if the placing position of the target terminal does not form a preset included angle with the horizontal direction, determining that the placing direction of the target terminal does not meet the preset condition.
Further, reading the gravity sensing value of the three-axis sensor comprises: newly building an event monitor aiming at the three-axis sensor; sending a request message to a system database of a Hardware Abstraction Layer (HAL) of an operating system of the target terminal; and establishing a communication link between a CPU and the system database based on the request message, and polling the gravity sensing value of the three-axis sensor in the system database based on the communication link.
Further, calculating the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value includes: reading a first weight and a second weight of the first light sensation value and the second light sensation value respectively; and weighting and summing the first light sensation value and the second light sensation value based on the first weight and the second weight to obtain the light intensity value of the environment where the target terminal is located.
Further, before the first light sensation value of the light sensor and the second light sensation value of the rear camera are respectively obtained, the method further comprises the following steps: triggering a focusing button of the rear camera; and if the rear camera is successfully focused, determining to respectively acquire a first light sensitivity value of the light sensor and a second light sensitivity value of the rear camera.
Further, before calculating the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value, the method further includes: calculating a light sensation difference value obtained by subtracting the first light sensation value from the second light sensation value; judging whether the light sensation difference value is smaller than a preset value or not; and if the light sensation difference value is smaller than a preset value, determining to calculate the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value.
According to another aspect of the embodiments of the present application, there is also provided an apparatus for obtaining a light intensity value, including: the first determining module is used for determining the placement direction of the target terminal; the acquisition module is used for respectively acquiring a first light sensation value of the light sensor and a second light sensation value of the rear camera if the placement direction meets a preset condition; and the first calculating module is used for calculating the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value.
Further, the apparatus further comprises: and the adjusting module is used for adjusting the backlight intensity of the display screen of the target terminal based on the light intensity value after the first calculating module calculates the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value, wherein the backlight intensity is in positive correlation with the light intensity value.
Further, the first determining module comprises: the reading unit is used for reading a gravity sensing value of a three-axis sensor, wherein the three-axis sensor is arranged in the target terminal; the judging unit is used for judging whether the placing position of the target terminal forms a preset included angle with the horizontal direction according to the gravity sensing value; the determining unit is used for determining that the placing direction of the target terminal meets a preset condition if the placing position of the target terminal forms a preset included angle with the horizontal direction; and if the placing position of the target terminal does not form a preset included angle with the horizontal direction, determining that the placing direction of the target terminal does not meet the preset condition.
Further, the reading unit includes: a newly-built subunit, configured to newly build an event monitor for the three-axis sensor; a sending subunit, configured to send a request message to a system database of a hardware abstraction layer HAL of an operating system of the target terminal; and the polling subunit is used for establishing a communication link between the CPU and the system database based on the request message, and polling the gravity sensing value of the three-axis sensor in the system database based on the communication link.
Further, the first calculation module includes: a reading unit configured to read a first weight and a second weight of the first light sensitivity value and the second light sensitivity value, respectively; and the calculating unit is used for weighting and summing the first light sensation value and the second light sensation value based on the first weight and the second weight to obtain the light intensity value of the environment where the target terminal is located.
Further, the apparatus further comprises: the trigger module is used for triggering a focusing button of the rear camera before the acquisition module respectively acquires a first light sensation value of the light sensor and a second light sensation value of the rear camera; and the second determining module is used for determining to respectively acquire the first light sensation value of the light sensor and the second light sensation value of the rear camera if the rear camera is successfully focused.
Further, the apparatus further comprises: the second calculation module is used for calculating a light sensation difference value obtained by subtracting the first light sensation value from the second light sensation value before the first calculation module calculates the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value; the judging module is used for judging whether the light sensation difference value is smaller than a preset value or not; and the third determining module is used for determining to calculate the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value if the light sensation difference value is smaller than a preset value.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program that executes the above steps when the program is executed.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein: a memory for storing a computer program; a processor for executing the steps of the method by running the program stored in the memory.
Embodiments of the present application also provide a computer program product containing instructions, which when run on a computer, cause the computer to perform the steps of the above method.
According to the invention, the placing direction of the target terminal is determined, if the placing direction meets the preset condition, the first light sensation value of the light sensor and the second light sensation value of the rear camera are respectively obtained, the light intensity value of the environment where the target terminal is located is calculated according to the first light sensation value and the second light sensation value, the placing position of the target terminal is identified through the placing direction, the light intensity value of the environment where the target terminal is located is calculated by simultaneously adopting the light sensation values collected by the light sensor and the rear camera at the placing position of the target terminal, the light intensity of the target terminal in multiple environmental directions can be collected, the technical problem that the light intensity value obtained by the related technology is inaccurate is solved, the accuracy of the target terminal in backlight regulation based on the light intensity value is improved, the comfort of a user using the target terminal is further improved, and the visual fatigue is delayed.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a block diagram of a hardware configuration of a computer according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for obtaining a light intensity value according to an embodiment of the present invention;
FIG. 3 is a flow chart of an embodiment of the present invention;
fig. 4 is a block diagram of an apparatus for obtaining a light intensity value according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
The method provided by the first embodiment of the present application may be executed in a computer, a mobile phone, a tablet or a similar display device. Taking the operation on a mobile phone as an example, fig. 1 is a block diagram of a hardware structure of a mobile phone according to an embodiment of the present invention. As shown in fig. 1, the handset 10 may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting to the structure of the mobile phone. For example, the handset 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a mobile phone program, for example, a software program and a module of an application software, such as a mobile phone program corresponding to a method for acquiring a light intensity value according to an embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the mobile phone program stored in the memory 104, so as to implement the method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the handset 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of such networks may include wireless networks provided by the communications provider of the handset 10. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In the present embodiment, a method for obtaining a light intensity value is provided, and fig. 2 is a flowchart of a method for obtaining a light intensity value according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, determining the placement direction of the target terminal;
optionally, the target terminal is any terminal configured with a display screen, such as a mobile phone, a tablet, a television, and the like. The placement azimuth is used for representing the placement angle and the inclination state of the target terminal, such as the angle with the horizontal line of the earth surface, the angle with the vertical line and the like.
Step S204, if the placement direction meets the preset condition, respectively acquiring a first light sensation value of the light sensor and a second light sensation value of the rear camera;
the light sensor and the rear camera of the embodiment are respectively configured at the front end and the rear end of the target terminal, and are used for collecting light sensitivity values in the front direction and the rear direction of the environmental space. In some examples, the rear camera may be replaced by a side camera of the target terminal for collecting light sensation values in two other directions of the environmental space, and the second light sensation value may be obtained analytically from a picture taken by the rear camera. Besides imaging, the camera can also accurately detect the intensity of the ambient light.
In step S206, a light intensity value of the environment where the target terminal is located is calculated according to the first light sensation value and the second light sensation value.
Optionally, after the light intensity value is obtained, backlight adjustment may be performed on the display screen of the target terminal based on the light intensity value, or the light intensity value may be output, or the internet of things device in the current environment may be adjusted based on the light intensity value, such as adjusting the indoor illumination brightness, the opening and closing degree of the curtain, and the like.
Through the steps, the placement direction of the target terminal is determined, if the placement direction meets the preset conditions, a first light sensation value of the light sensor and a second light sensation value of the rear camera are respectively obtained, the light intensity value of the environment where the target terminal is located is calculated according to the first light sensation value and the second light sensation value, the placement position of the target terminal is identified through the placement direction, the light intensity value of the environment where the target terminal is located is calculated by simultaneously adopting the light sensation values collected by the light sensor and the rear camera at the placement position of the target terminal, the light intensity of the target terminal in multiple environmental directions can be collected, the technical problem that the light intensity value is inaccurate in related technology acquisition is solved, the accuracy of the target terminal in backlight adjustment based on the light intensity value is improved, the comfort of a user using the target terminal is further improved, and visual fatigue is delayed.
Optionally, after calculating the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value, the method further includes: adjusting a backlight intensity of a display screen of the target terminal based on the light intensity value, wherein the backlight intensity is in positive correlation with the light intensity value. The backlight module is used for enabling a display screen of the target terminal to be clearer, and when the light intensity value is larger, the ambient light of the current environment is stronger, and the backlight intensity of the display screen of the target terminal needs to be increased.
In one implementation of this embodiment, determining the placement position of the target terminal includes:
s11, reading a gravity sensing value of a three-axis sensor, wherein the three-axis sensor is built in the target terminal;
in one example based on the present embodiment, reading the gravity sensing value of the three-axis sensor includes: newly building an event monitor aiming at the three-axis sensor; sending a request message to a system database of a HardWare Abstraction Layer (HAL) of an operating system of the target terminal; and establishing a communication link between a CPU and the system database based on the request message, and polling the gravity sensing value of the three-axis sensor in the system database based on the communication link.
In one example, the following process is included: starting a thread; acquiring a sensor management object; acquiring a sensor object; newly building an event listener to an entity sensor with sensortype being ACC sensor; sending a request to each so library of the hal layer of the android through a client; and finally, the value (gravity sensing value) for driving to poll the gravity sensor is realized in a QMI or shared memory mode.
S12, judging whether the placing position of the target terminal forms a preset included angle with the horizontal direction according to the gravity sensing value;
optionally, the preset included angle is 45 ° to 90 °, wherein the gravity sensing value includes an angle value of three axes of XYZ and XYZ, and the angle value of the X axis or the Y axis is the preset included angle with the horizontal direction, if the angle value of the X axis or the Y axis is the preset included angle with the horizontal direction, the placing position is the preset included angle with the horizontal direction, and if the angle value of the X axis or the Y axis is not the preset included angle with the horizontal direction, the placing position is not the preset included angle with the horizontal direction.
In some embodiments, the holding time of the preset included angle formed between the placement position of the target terminal and the horizontal direction can be further monitored, if the holding time exceeds a certain length of time, it is determined that the placement direction of the target terminal meets the preset condition, and after the gravity sensing value is obtained, whether the value of the gravity sensor meets the condition that the value of the gravity sensor is 45-90 degrees between the Y-axis direction of the mobile phone or the value of the gravity sensor is 45-90 degrees between the X-axis direction and the horizontal direction and is held for 30 seconds is judged through calculation.
S13, if the placing position of the target terminal forms a preset included angle with the horizontal direction, determining that the placing direction of the target terminal meets a preset condition; and if the placing position of the target terminal does not form a preset included angle with the horizontal direction, determining that the placing direction of the target terminal does not meet the preset condition.
In an implementation manner of this embodiment, calculating the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value includes: reading a first weight and a second weight of the first light sensation value and the second light sensation value respectively; and weighting and summing the first light sensation value and the second light sensation value based on the first weight and the second weight to obtain the light intensity value of the environment where the target terminal is located.
In one example, the first light sensation value is L1, the second light sensation value of the ambient light is obtained through post-shooting, and is set as L2, and the first weight and the second weight are both 0.5, and L1 × 0.5+ L2 × 0.5 is taken as a light intensity value, and the light intensity value at this time integrates the light sensation values of the forward direction of the mobile phone screen and the forward direction of the user view range, so that the ambient light intensity can be more effectively reflected, the backlight intensity is adjusted, the comfort of the user can be improved, and the visual fatigue is delayed.
In an embodiment of this embodiment, before obtaining the first light sensation value of the light sensor and the second light sensation value of the rear camera respectively, the method further includes: triggering a focusing button of the rear camera; and if the rear camera is successfully focused, determining to respectively acquire a first light sensitivity value of the light sensor and a second light sensitivity value of the rear camera.
And if the rear camera fails to focus, triggering prompt information to prompt a user to move the rear camera.
In an implementation manner of this embodiment, before calculating the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value, the method further includes: calculating a light sensation difference value obtained by subtracting the first light sensation value from the second light sensation value; judging whether the light sensation difference value is smaller than a preset value or not; and if the light sensation difference value is smaller than a preset value, determining to calculate the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value.
Optionally, the preset value is 50%, by determining whether a difference range between the second light sensation value of the post-shot and the first light sensation value of the light sensation exceeds 50% of the light sensation, the target terminal is in a light anomaly environment or is abnormal in hardware, and the light sensor or the rear camera needs to be recalibrated or taught again, and optionally, if the light sensation difference value is greater than or equal to the preset value, a prompt message is output to prompt a user to calibrate or teach the light sensor or the rear camera.
In a specific application scenario of this embodiment, the method is applied to a mobile phone including a light sensor and a rear camera, and fig. 3 is a flowchart of the embodiment of the present invention, where the flowchart includes:
s31, turning on automatic backlight adjustment;
s32, monitoring whether the three-axis data of the Gsense is 45-85 degrees in the Y-axis direction or the X-axis direction of the mobile phone and the horizontal direction, and keeping for more than 30 seconds;
s33, monitoring a gyroscope to see whether the mobile phone has no rotating accelerator;
s34, shooting after starting, and starting light sensation;
s35, judging whether the aftershoot can be focused or not, and whether the difference between the ambient light and the light sensation is not more than 50% or not;
s36, if the light sensation value is L1 and the light intensity value of the rear-view is L2, the backlight intensity is automatically set by taking L1 × 0.5+ L2 × 0.5 as the ambient light value.
After the thread starts to run, acquiring a sensor object by acquiring a sensor management object, newly building an event monitor to an entity sensor of which sensorrtype is ACC sensor, sending a request to each so library of an HAL layer of android through a CPU, and finally implementing the value to drive to poll the gravity sensor in a QMI (Qualcomm MSM Interface) or shared memory mode. After the values are obtained, whether the value of the gravity sensor meets the requirement that the value of the gravity sensor is 45-90 degrees between the Y-axis direction or the X-axis direction of the mobile phone and the horizontal direction is judged through calculation, and the value is kept for 30 seconds. Therefore, whether the user is in activities such as reading or watching videos by fixing the mobile phone in a direction and an angle is judged.
If the mobile phone keeps the value of 45-90 degrees for more than 30 seconds, the gyroscope is started to judge whether the value is 0 +/-0.1 rad/s or not, and whether the mobile phone is held by hand or not and whether micro-swing exists or not is judged. The determination is to eliminate the holding, because the holding may be accompanied by the movement of the user or the change of the scene, and the power consumption is increased by frequently starting the post shooting to acquire the light sensing value after the scene is changed. If not, the light induction and the back shooting are started.
And the back shooting opens the focusing function to see whether the mobile phone can be focused or not, so as to judge whether the mobile phone is in the situation of leaning against the obstacle or not, and if the mobile phone is leaning against the obstacle, the ambient light value obtained by the camera does not have reference meaning.
If the camera can be focused, the camera is determined not to be shielded, the value of the obtained ambient light has a reference meaning, the value of the light sensation at the time is set to be L1, and the value of the ambient light is obtained through back shooting and is set to be L2. The backlight intensity is automatically set with L-L1 × 0.5+ L2 × 0.5 as the ambient light value. The value of the ambient light at this moment integrates the positive photosensitive value of the mobile phone screen and the positive photosensitive value of the user visual field range, and the ambient light intensity can be effectively reflected, so that the backlight intensity can be adjusted, the comfort of the user can be improved, and the visual fatigue can be delayed.
By adopting the scheme of the embodiment, whether the mobile phone is stably placed at a fixed position, such as a mobile phone support, is judged by judging the triaxial data of the Gsense and the angular velocity of the gyroscope. And opening the back shot, and detecting whether the back shot can be focused or not so as to exclude the scene that the mobile phone leans on a certain fixed object. Ambient light intensity is obtained through back-shooting. The light intensity after the back photographing is obtained is compared with the light intensity of the light sensation, and when the difference value exceeds 50% of the light sensation, the abnormal light intensity can be regarded as the abnormal light intensity, and the abnormal light intensity is not used.
And determining whether the mobile phone is watched or used at a fixed position (such as on a mobile phone support) by judging the three-axis data of the Gsense and the gyroscope. Whether focusing can be carried out or not is judged by opening the back shot so as to eliminate the situation of leaning on the shielding object, and whether the difference range of the light intensity of the back shot and the light intensity of the light sensation exceeds 50% of the light sensation or not is judged, and the data is eliminated if the difference range exceeds the data. When the conditions are satisfied, the light sensation value is L1, and the light intensity value of the rear-view is L2, and L1 × 0.5+ L2 × 0.5 is taken as the ambient light intensity, and the backlight intensity is automatically set in consideration of this light intensity. When the device is placed on a support or a scene fixedly leaned against, the light sensation and the back shot are used for acquiring the intensity of the ambient light, so that the intensity of the ambient light can be acquired more accurately.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
In this embodiment, a device for obtaining a light intensity value is further provided, which is used to implement the foregoing embodiments and preferred embodiments, and the description of the device is omitted for brevity. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 4 is a block diagram of an apparatus for obtaining a light intensity value according to an embodiment of the present invention, as shown in fig. 4, the apparatus includes: a first determination module 40, an acquisition module 42, a first calculation module 44, wherein,
a first determining module 40, configured to determine a placement position of the target terminal;
an obtaining module 42, configured to obtain a first light sensitivity value of the light sensor and a second light sensitivity value of the rear camera if the placement direction meets a preset condition;
the first calculating module 44 is configured to calculate a light intensity value of an environment where the target terminal is located according to the first light sensation value and the second light sensation value.
Optionally, the apparatus further comprises: and the adjusting module is used for adjusting the backlight intensity of the display screen of the target terminal based on the light intensity value after the first calculating module calculates the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value, wherein the backlight intensity is in positive correlation with the light intensity value.
Optionally, the first determining module includes: the reading unit is used for reading a gravity sensing value of a three-axis sensor, wherein the three-axis sensor is arranged in the target terminal; the judging unit is used for judging whether the placing position of the target terminal forms a preset included angle with the horizontal direction according to the gravity sensing value; the determining unit is used for determining that the placing direction of the target terminal meets a preset condition if the placing position of the target terminal forms a preset included angle with the horizontal direction; and if the placing position of the target terminal does not form a preset included angle with the horizontal direction, determining that the placing direction of the target terminal does not meet the preset condition.
Optionally, the reading unit includes: a newly-built subunit, configured to newly build an event monitor for the three-axis sensor; a sending subunit, configured to send a request message to a system database of a hardware abstraction layer HAL of an operating system of the target terminal; and the polling subunit is used for establishing a communication link between the CPU and the system database based on the request message, and polling the gravity sensing value of the three-axis sensor in the system database based on the communication link.
Optionally, the first computing module includes: a reading unit configured to read a first weight and a second weight of the first light sensitivity value and the second light sensitivity value, respectively; and the calculating unit is used for weighting and summing the first light sensation value and the second light sensation value based on the first weight and the second weight to obtain the light intensity value of the environment where the target terminal is located.
Optionally, the apparatus further comprises: the trigger module is used for triggering a focusing button of the rear camera before the acquisition module respectively acquires a first light sensation value of the light sensor and a second light sensation value of the rear camera; and the second determining module is used for determining to respectively acquire the first light sensation value of the light sensor and the second light sensation value of the rear camera if the rear camera is successfully focused.
Optionally, the apparatus further comprises: the second calculation module is used for calculating a light sensation difference value obtained by subtracting the first light sensation value from the second light sensation value before the first calculation module calculates the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value; the judging module is used for judging whether the light sensation difference value is smaller than a preset value or not; and the third determining module is used for determining to calculate the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value if the light sensation difference value is smaller than a preset value.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 3
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, determining the placement direction of the target terminal;
s2, if the placement direction meets the preset condition, respectively acquiring a first light sensitivity value of the light sensor and a second light sensitivity value of the rear camera;
and S3, calculating the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, determining the placement direction of the target terminal;
s2, if the placement direction meets the preset condition, respectively acquiring a first light sensitivity value of the light sensor and a second light sensitivity value of the rear camera;
and S3, calculating the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for obtaining a light intensity value includes:
determining the placement direction of a target terminal;
if the placement direction meets a preset condition, respectively acquiring a first light sensitivity value of the light sensor and a second light sensitivity value of the rear camera;
and calculating the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value.
2. The method of claim 1, wherein after calculating the light intensity value of the environment in which the target terminal is located based on the first and second light sensation values, the method further comprises:
adjusting a backlight intensity of a display screen of the target terminal based on the light intensity value, wherein the backlight intensity is in positive correlation with the light intensity value.
3. The method of claim 1, wherein determining the placement location of the target terminal comprises:
reading a gravity sensing value of a three-axis sensor, wherein the three-axis sensor is built in the target terminal;
judging whether the placing position of the target terminal forms a preset included angle with the horizontal direction or not according to the gravity sensing value;
if the placing position of the target terminal forms a preset included angle with the horizontal direction, determining that the placing direction of the target terminal meets a preset condition; and if the placing position of the target terminal does not form a preset included angle with the horizontal direction, determining that the placing direction of the target terminal does not meet the preset condition.
4. The method of claim 3, wherein reading the gravity sensing values of the three-axis sensor comprises:
newly building an event monitor aiming at the three-axis sensor;
sending a request message to a system database of a Hardware Abstraction Layer (HAL) of an operating system of the target terminal;
and establishing a communication link between a CPU and the system database based on the request message, and polling the gravity sensing value of the three-axis sensor in the system database based on the communication link.
5. The method of claim 1, wherein calculating the light intensity value of the environment in which the target terminal is located according to the first light sensation value and the second light sensation value comprises:
reading a first weight and a second weight of the first light sensation value and the second light sensation value respectively;
and weighting and summing the first light sensation value and the second light sensation value based on the first weight and the second weight to obtain the light intensity value of the environment where the target terminal is located.
6. The method of claim 1, wherein before the obtaining the first light sensation value of the light sensor and the second light sensation value of the rear camera respectively, the method further comprises:
triggering a focusing button of the rear camera;
and if the rear camera is successfully focused, determining to respectively acquire a first light sensitivity value of the light sensor and a second light sensitivity value of the rear camera.
7. The method of claim 1, wherein prior to calculating the light intensity value of the environment in which the target terminal is located based on the first and second light sensation values, the method further comprises:
calculating a light sensation difference value obtained by subtracting the first light sensation value from the second light sensation value;
judging whether the light sensation difference value is smaller than a preset value or not;
and if the light sensation difference value is smaller than a preset value, determining to calculate the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value.
8. An apparatus for obtaining a light intensity value, comprising:
the first determining module is used for determining the placement direction of the target terminal;
the acquisition module is used for respectively acquiring a first light sensation value of the light sensor and a second light sensation value of the rear camera if the placement direction meets a preset condition;
and the first calculating module is used for calculating the light intensity value of the environment where the target terminal is located according to the first light sensation value and the second light sensation value.
9. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program is operative to perform the method steps of any of the preceding claims 1 to 7.
10. An electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus; wherein:
a memory for storing a computer program;
a processor for performing the method steps of any of claims 1 to 7 by executing a program stored on a memory.
CN202011388599.2A 2020-12-01 2020-12-01 Method and device for acquiring light intensity value, storage medium and electronic equipment Active CN112525340B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011388599.2A CN112525340B (en) 2020-12-01 2020-12-01 Method and device for acquiring light intensity value, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011388599.2A CN112525340B (en) 2020-12-01 2020-12-01 Method and device for acquiring light intensity value, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN112525340A true CN112525340A (en) 2021-03-19
CN112525340B CN112525340B (en) 2021-12-14

Family

ID=74996147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011388599.2A Active CN112525340B (en) 2020-12-01 2020-12-01 Method and device for acquiring light intensity value, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112525340B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113108904A (en) * 2021-04-20 2021-07-13 武汉华星光电技术有限公司 Ambient light monitoring method and device, storage medium and mobile terminal
CN113781969A (en) * 2021-09-27 2021-12-10 联想(北京)有限公司 Backlight adjusting method and device and electronic equipment
CN114495862A (en) * 2022-01-24 2022-05-13 上海闻泰信息技术有限公司 Method for acquiring ambient light sensitivity value, electronic device and computer readable storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105611132A (en) * 2015-12-28 2016-05-25 广东欧珀移动通信有限公司 Exposure control method and device
CN106303273A (en) * 2016-07-29 2017-01-04 努比亚技术有限公司 A kind of mobile terminal and camera control method thereof
CN106453842A (en) * 2016-09-13 2017-02-22 北京松果电子有限公司 Method and apparatus for adjusting brightness of screen
US20180164409A1 (en) * 2016-05-04 2018-06-14 Dapa Inc. Optical proximity sensor and manufacturing method thereof
CN109523977A (en) * 2018-12-10 2019-03-26 惠州Tcl移动通信有限公司 Backlight adjusting method, device, mobile terminal and storage medium
CN109819168A (en) * 2019-01-31 2019-05-28 维沃移动通信有限公司 A kind of the starting method and mobile terminal of camera
CN111614805A (en) * 2019-02-25 2020-09-01 三星电子株式会社 Electronic device
CN111726449A (en) * 2019-03-18 2020-09-29 青岛海信移动通信技术股份有限公司 Method and equipment for determining ambient brightness of terminal

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105611132A (en) * 2015-12-28 2016-05-25 广东欧珀移动通信有限公司 Exposure control method and device
US20180164409A1 (en) * 2016-05-04 2018-06-14 Dapa Inc. Optical proximity sensor and manufacturing method thereof
CN106303273A (en) * 2016-07-29 2017-01-04 努比亚技术有限公司 A kind of mobile terminal and camera control method thereof
CN106453842A (en) * 2016-09-13 2017-02-22 北京松果电子有限公司 Method and apparatus for adjusting brightness of screen
CN109523977A (en) * 2018-12-10 2019-03-26 惠州Tcl移动通信有限公司 Backlight adjusting method, device, mobile terminal and storage medium
CN109819168A (en) * 2019-01-31 2019-05-28 维沃移动通信有限公司 A kind of the starting method and mobile terminal of camera
CN111614805A (en) * 2019-02-25 2020-09-01 三星电子株式会社 Electronic device
CN111726449A (en) * 2019-03-18 2020-09-29 青岛海信移动通信技术股份有限公司 Method and equipment for determining ambient brightness of terminal

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113108904A (en) * 2021-04-20 2021-07-13 武汉华星光电技术有限公司 Ambient light monitoring method and device, storage medium and mobile terminal
CN113781969A (en) * 2021-09-27 2021-12-10 联想(北京)有限公司 Backlight adjusting method and device and electronic equipment
CN113781969B (en) * 2021-09-27 2024-04-23 联想(北京)有限公司 Backlight adjusting method and device and electronic equipment
CN114495862A (en) * 2022-01-24 2022-05-13 上海闻泰信息技术有限公司 Method for acquiring ambient light sensitivity value, electronic device and computer readable storage medium
WO2023137957A1 (en) * 2022-01-24 2023-07-27 上海闻泰信息技术有限公司 Method for acquiring ambient light sensation value, and electronic device and computer-readable storage medium

Also Published As

Publication number Publication date
CN112525340B (en) 2021-12-14

Similar Documents

Publication Publication Date Title
CN112525340B (en) Method and device for acquiring light intensity value, storage medium and electronic equipment
CN110177221B (en) Shooting method and device for high dynamic range image
CN109891874B (en) Panoramic shooting method and device
EP3410694B1 (en) Image processing method and related products
CN108288044B (en) Electronic device, face recognition method and related product
EP3163498A2 (en) Alarming method and device
EP3627823B1 (en) Image selection method and related product
CN110491060B (en) Robot, safety monitoring method and device thereof, and storage medium
US20140049667A1 (en) System and Method of Modifying an Image
CN109068116B (en) Image processing method and device based on supplementary lighting, mobile terminal and storage medium
CN108012026B (en) Eyesight protection method and mobile terminal
CN112672069B (en) Exposure method and apparatus
CN108040240B (en) White balance adjustment method and device and mobile terminal
CN108564915B (en) Brightness adjusting method and related product
CN112929860B (en) Bluetooth connection method and device and electronic equipment
CN110213484A (en) A kind of photographic method, terminal device and computer readable storage medium
CN112291473A (en) Focusing method and device and electronic equipment
CN110677580B (en) Shooting method, shooting device, storage medium and terminal
CN110602387B (en) Shooting method and electronic equipment
CN112748798A (en) Eyeball tracking calibration method and related equipment
CN113395438B (en) Image correction method and related device for eyeball tracking technology
CN106851050B (en) Motion detection method and device and mobile equipment
WO2023179440A1 (en) Shooting apparatus control method and apparatus, shooting apparatus and electronic device
CN111182199B (en) Electronic device and photographing method
CN108960097B (en) Method and device for obtaining face depth information

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