CN108874128B - Proximity detection method and apparatus, electronic apparatus, storage medium, and device - Google Patents

Proximity detection method and apparatus, electronic apparatus, storage medium, and device Download PDF

Info

Publication number
CN108874128B
CN108874128B CN201810554883.9A CN201810554883A CN108874128B CN 108874128 B CN108874128 B CN 108874128B CN 201810554883 A CN201810554883 A CN 201810554883A CN 108874128 B CN108874128 B CN 108874128B
Authority
CN
China
Prior art keywords
electronic device
intensity value
infrared light
value
detecting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810554883.9A
Other languages
Chinese (zh)
Other versions
CN108874128A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201810554883.9A priority Critical patent/CN108874128B/en
Publication of CN108874128A publication Critical patent/CN108874128A/en
Application granted granted Critical
Publication of CN108874128B publication Critical patent/CN108874128B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/011Arrangements for interaction with the human body, e.g. for user immersion in virtual reality

Abstract

The invention discloses a proximity detection method for an electronic device. The electronic device includes a proximity sensor for emitting infrared light and receiving infrared light reflected by an object, and the control method includes the steps of: acquiring a first intensity value of infrared light in current ambient light; acquiring a second intensity value of the infrared light received by the proximity sensor; and detecting the distance from the object to the electronic device according to the first intensity value and the second intensity value to judge whether the object is close to or far away from the electronic device. The invention also discloses a proximity detection device, an electronic device, a computer readable storage medium and computer equipment. According to the proximity detection method, the proximity detection device, the electronic device, the computer-readable storage medium and the computer equipment, the distance between the object and the electronic device is judged by detecting the intensity of infrared light received by the proximity sensor and the intensity of infrared light in ambient light, and interference caused by the ambient light on detection of the proximity sensor can be reduced.

Description

Proximity detection method and apparatus, electronic apparatus, storage medium, and device
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a proximity detection method, a proximity detection apparatus, an electronic apparatus, a computer-readable storage medium, and a computer device.
Background
The proximity sensor detects a distance between an object and the mobile terminal by using the emitted infrared light to determine whether the object is far away from or close to the mobile terminal. In some usage scenarios, the proximity sensor will be interfered by infrared rays in sunlight, resulting in errors in determination.
Disclosure of Invention
To solve the above technical problem, the present invention provides a control method, a proximity detection device, an electronic device, a computer-readable storage medium, and a computer apparatus.
The invention provides a proximity detection method for an electronic device, which is characterized in that the electronic device comprises a proximity sensor, the proximity sensor is used for emitting infrared light and receiving the infrared light reflected by an object, and the control method comprises the following steps:
acquiring a first intensity value of infrared light in current ambient light;
acquiring a second intensity value of the infrared light received by the proximity sensor; and
and detecting the distance from the object to the electronic device according to the first intensity value and the second intensity value to judge whether the object is close to or far away from the electronic device.
In some embodiments, the proximity detection method comprises the steps of:
detecting the brightness value of the current environment light; and
when the brightness value is greater than or equal to a brightness preset threshold value, acquiring the first intensity value of the infrared light in the current environment light.
In some embodiments, the proximity detection method comprises the steps of:
if the brightness value is smaller than the preset brightness threshold value, detecting the distance from the object to the electronic device according to the second intensity value to judge whether the object is close to or far away from the electronic device.
In some embodiments, the step of detecting the brightness value of the current ambient light includes:
acquiring a multi-frame image of a current environment; and
and calculating the brightness value of the current environment according to the multi-frame image.
In some embodiments, the step of obtaining the first intensity value of infrared light in the current ambient light when the brightness value is greater than or equal to a brightness predetermined threshold comprises:
detecting the inclination angle of the electronic device; and
and when the inclination angle is smaller than a preset angle threshold, acquiring the first intensity value of the infrared light in the current ambient light.
In some embodiments, the proximity detection method comprises the steps of:
if the inclination angle is larger than or equal to a preset angle threshold, detecting the distance from the object to the electronic device according to the second intensity value to judge whether the object is close to or far away from the electronic device.
The present invention provides a proximity detection apparatus for an electronic apparatus, characterized in that the electronic apparatus includes a proximity sensor for emitting infrared light and receiving infrared light reflected by an object, the proximity detection apparatus including:
the system comprises an acquisition module, a processing module and a control module, wherein the acquisition module is used for acquiring a first intensity value of infrared light in current ambient light;
the acquisition module is further used for acquiring a second intensity value of the infrared light received by the proximity sensor; and
a judging module, configured to detect a distance from the object to the electronic device according to the first intensity value and the second intensity value to judge whether the object is close to or far from the electronic device.
The invention provides an electronic device, which is characterized by comprising:
the environment light sensor is used for acquiring infrared light in environment light;
a proximity sensor for emitting infrared light and receiving infrared light reflected by an object; and
a processor to:
acquiring a first intensity value of infrared light in current ambient light;
acquiring a second intensity value of the infrared light received by the proximity sensor; and
and detecting the distance from the object to the electronic device according to the first intensity value and the second intensity value to judge whether the object is close to or far away from the electronic device.
In some embodiments, the ambient light sensor is configured to detect a brightness value of the current ambient light, and the processor is configured to obtain the first intensity value of the infrared light in the current ambient light when the brightness value is greater than or equal to a brightness predetermined threshold.
In some embodiments, the processor is further configured to detect a distance from the object to the electronic device according to the second intensity value to determine whether the object is close to or far from the electronic device when the brightness value is smaller than the brightness predetermined threshold.
In some embodiments, the electronic device includes a camera configured to obtain a plurality of frames of images of a current environment, and the processor is configured to calculate the brightness value of the current environment according to the plurality of frames of images.
In some embodiments, the electronic device includes an acceleration sensor configured to detect a tilt angle of the electronic device, and the processor is configured to obtain the first intensity value of the infrared light in the current ambient light when the tilt angle is smaller than an angle predetermined threshold.
In some embodiments, the processor is configured to detect a distance from the object to the electronic device according to the second intensity value to determine whether the object is close to or far from the electronic device when the tilt angle is greater than or equal to a predetermined angle threshold.
One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the proximity detection method are provided.
The invention provides a computer device comprising a memory and a processor, wherein the memory stores computer readable instructions, and the instructions, when executed by the processor, cause the processor to execute the proximity detection method.
According to the proximity detection method, the proximity detection device, the electronic device, the computer-readable storage medium and the computer equipment, the distance between the object and the electronic device is judged by detecting the intensity of infrared light received by the proximity sensor and the intensity of infrared light in ambient light, and interference caused by the ambient light on detection of the proximity sensor can be reduced.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a block diagram of an electronic device according to an embodiment of the invention;
FIG. 2 is a schematic flow diagram of a proximity detection method in accordance with an embodiment of the present invention;
FIG. 3 is a block schematic diagram of a proximity detection device in accordance with an embodiment of the present invention;
FIG. 4 is a block schematic diagram of a computer device of an embodiment of the present invention;
FIG. 5 is a schematic diagram of an application scenario of an electronic device according to an embodiment of the invention;
FIG. 6 is a schematic view of another application scenario of the electronic device according to the embodiment of the present invention;
FIG. 7 is a schematic view of another application scenario of the electronic device according to the embodiment of the present invention;
FIG. 8 is a schematic view of another application scenario of the electronic device according to the embodiment of the present invention;
FIG. 9 is another schematic flow chart of a proximity detection method according to an embodiment of the present invention;
FIG. 10 is a schematic view of another application scenario of the electronic device according to the embodiment of the present invention;
FIG. 11 is a schematic flow chart of a proximity detection method according to an embodiment of the present invention;
FIG. 12 is a schematic flow chart of a proximity detection method according to an embodiment of the present invention;
FIG. 13 is a schematic view of another application scenario of the electronic device according to the embodiment of the present invention;
FIG. 14 is a schematic view of another application scenario of the electronic device according to the embodiment of the present invention; and
fig. 15 is a schematic view of another application scenario of the electronic device according to the embodiment of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
A proximity detection method, a proximity detection apparatus 200, an electronic apparatus 100, a computer-readable storage medium, and a computer device 300 according to embodiments of the present invention are described in detail below with reference to fig. 1 to 15.
Referring to fig. 1 to 4, an embodiment of the invention provides a proximity detection method for an electronic device 100. The electronic device 100 includes an ambient light sensor 161 and a proximity sensor 162, the ambient light sensor 161 for acquiring infrared light in ambient light, and the proximity sensor 162 for emitting infrared light and receiving infrared light reflected by an object. The approach detection method includes the steps of:
s10, a first intensity value of the infrared light in the current ambient light is obtained.
S20, a second intensity value of the infrared light received by the proximity sensor is obtained. And
and S30, detecting the distance from the object to the electronic device according to the first intensity value and the second intensity value to judge whether the object is close to or far away from the electronic device.
The embodiment of the invention also provides a proximity detection device 200 for the electronic device 100. The proximity detection method according to the embodiment of the present invention can be realized by the proximity detection device 200 according to the embodiment of the present invention. The proximity detection device 200 includes an acquisition module 21 and a determination module 22, and steps S10 and S20 may be implemented by the acquisition module 21, and step S30 may be implemented by the determination module 22. That is, the obtaining module 21 may be configured to obtain a first intensity value of the infrared light in the current ambient light and obtain a second intensity value of the infrared light received by the proximity sensor 162. The determining module 22 can be used for detecting a distance from the object to the electronic device 100 according to the first intensity value and the second intensity value to determine whether the object is close to or far away from the electronic device 100.
The embodiment of the invention also provides an electronic device 100. The electronic device 100 includes an ambient light sensor 161, a proximity sensor 162, and a processor 24. Step S10, step S20, and step S30 may be implemented by the processor 24. That is, the processor 24 is configured to obtain a first intensity value of the infrared light in the current ambient light received by the ambient light sensor 161 and obtain a second intensity value of the infrared light received by the proximity sensor 162, and detect a distance from the object to the electronic device 100 according to the first intensity value and the second intensity value to determine whether the object is close to or far from the electronic device 100.
The embodiment of the invention also provides computer equipment 300. In an embodiment of the present invention, the proximity detection apparatus 200 may be employed in a computer device 300. The computer device 300 may be a mobile phone, a tablet computer, a notebook computer, an intelligent bracelet, an intelligent watch, an intelligent helmet, an intelligent glasses, a game console, and the like, and the electronic apparatus 100 according to the embodiment of the present invention may also be one of the computer devices 300.
The embodiment of the present invention is described by taking the electronic device 100 as a mobile phone as an example. The ambient light sensor 161 and the proximity sensor 162 in the mobile phone respectively realize the adjustment of the screen brightness according to the intensity of the ambient light and the detection of the distance between the electronic device 100 and the user. Referring to fig. 5 and 6, when the ambient light detection is performed, for example, when the user is in an outdoor environment and the ambient light is strong, the ambient light sensor 161 feeds back the light intensity of the environment to the processor, the processor sends a corresponding instruction to the controller, and the controller increases the brightness of the display screen according to the instruction to adapt to the light intensity of the current environment, so that the content of the screen viewed by the user is clearer. When the user is in a dark environment, the ambient light is weak, the ambient light sensor 161 feeds back the light intensity of the environment to the processor, the processor sends a corresponding instruction to the controller, and the controller reduces the brightness of the display screen according to the instruction to adapt to the light intensity of the current environment, so that the user does not feel dazzling when watching the screen content, and the optimal visual effect is provided for the user.
Referring to fig. 7 and 8, when distance detection is performed, for example, when a user is receiving or making a call and brings a mobile phone close to the head, the proximity sensor 162 calculates intensity of infrared light emitted by the emitter and intensity of infrared light reflected by the receiver to generate distance detection information, the processor sends a corresponding instruction to the controller according to the distance detection information, and the controller closes the screen according to the instruction. When the mobile phone is far away from the head, the processor calculates and sends an instruction to the controller again according to the detection information fed back by the proximity sensor 162, and the controller reopens the screen according to the instruction.
However, in the practical application process of the proximity sensor, for example, in an outdoor use environment in which sunlight is directly emitted, since the sunlight contains infrared light, certain interference is caused to the infrared light emitted by the proximity sensor itself, and particularly, when the electronic device is at different receiving angles, the proximity sensor fluctuates due to the intensity of the received infrared light, so that the proximity sensor cannot accurately judge whether an object is blocked or approaches the electronic device.
The proximity detection method, the proximity detection apparatus 200, the electronic apparatus 100, the computer-readable storage medium, and the computer device 300 according to the embodiments of the present invention can reduce interference of the ambient light with detection of the proximity sensor 162 by detecting the intensity of the infrared light received by the proximity sensor 162 and the intensity of the infrared light in the ambient light to determine the distance between the object and the electronic apparatus 100.
It should be noted that, since the ambient light sensor 161 can also sense the infrared light emitted by the proximity sensor 162, after the ambient light sensor 161 obtains the first intensity value of the infrared light in the current ambient light, the proximity sensor 162 may be turned on to emit the infrared light for distance detection, so as to avoid interference of the infrared light emitted by the proximity sensor 162 on detection of the first intensity value. In addition, the installation position of the ambient light sensor 161 may be set to be distant from the installation position of the proximity sensor 162. It is to be understood that after the second intensity value of the infrared light received by the proximity sensor 162 is obtained, the ambient light sensor 161 may be turned on to obtain the first intensity value of the infrared light in the current ambient light, and the timing sequence is not limited specifically.
In addition, the distance from the object to the electronic device 100 may be calculated by subtracting the first intensity value from the second intensity value, so as to determine whether the object is close to or far from the electronic device 100 according to the obtained distance. For example, in a normal state, when the intensity of infrared light received by the proximity sensor 162 is below 50 lumens (Lumen, lm), it indicates that the distance between the object or the human face and the electronic device 100 is above 90mm, which indicates that the object or the human face is far away from the electronic device 100. When the intensity of the infrared light received by the proximity sensor 162 is above 200 lumens, it indicates that the distance between the object or the human face and the electronic device 100 is below 50mm, indicating that the object or the human face approaches the electronic device 100. When ambient light sensor 161 detects a first intensity value of 70 lumens for infrared light in the ambient light and proximity sensor 162 detects a second intensity value of 85 lumens for infrared light, subtracting the first intensity value of 70 lumens from the second intensity value of 85 lumens is 15 lumens (15 lumens is less than 50 lumens), indicating that the object or face is far from electronic device 100. When ambient light sensor 161 detects a first intensity value of 70 lumens for infrared light in the ambient light and proximity sensor 162 detects a second intensity value of 350 lumens for infrared light, the subtraction of the first intensity value of 70 lumens from the second intensity value of 350 lumens is 280 lumens (280 lumens is greater than 200 lumens), indicating that an object or a human face is in proximity to electronic device 100. It will be appreciated that these intensity values and distance values are exemplary only and are not limiting to the invention. The intensity value and the distance value can be set according to specific situations.
Referring to fig. 9, in some embodiments, a proximity detection method includes the steps of:
s101: detecting the brightness value of the current environment light; and
s102: when the brightness value is larger than or equal to a preset brightness threshold value, a first intensity value of infrared light in current environment light is acquired.
Referring to fig. 3, in some embodiments, step S101 and step S102 may be implemented by the obtaining module 21. That is, the obtaining module 21 may detect a brightness value of the current ambient light, and obtain the first intensity value of the infrared light in the current ambient light when the brightness value is greater than or equal to a predetermined brightness threshold.
Referring to fig. 1, in some embodiments, steps S101 and S102 may be implemented by the processor 24. That is, the processor 24 may acquire the brightness value of the current ambient light detected by the ambient light sensor 161 and acquire the first intensity value of the infrared light in the current ambient light when the brightness value is greater than or equal to the brightness predetermined threshold.
Specifically, referring to fig. 10, when the user is in an outdoor environment, such as exposed to the sun, the proximity sensor 162 is greatly affected by infrared rays in the ambient light during the distance detection process, and thus a detection error of the proximity sensor 162 is more likely to be caused. Therefore, when it is detected that the brightness value of the current ambient light is greater than or equal to the brightness predetermined threshold, acquiring the first intensity value of the infrared light in the ambient light is beneficial to reducing the interference caused by the ambient light on the detection of the proximity sensor 162. The predetermined brightness threshold may be set according to specific situations. Further, the luminance value of the ambient light may be calculated by the level of sensitivity of the image sensor in the electronic device 100.
Referring to fig. 11, in some embodiments, a proximity detection method includes the steps of:
s103: if the brightness value is smaller than the preset brightness threshold value, the distance from the object to the electronic device is detected according to the second intensity value to judge whether the object is close to or far away from the electronic device.
Referring to fig. 3, in some embodiments, step S103 may be implemented by the determining module 22. That is, the determining module 22 may detect the distance from the object to the electronic device 100 according to the second intensity value when the brightness value is smaller than the predetermined brightness threshold to determine whether the object is close to or far away from the electronic device 100.
Referring to fig. 1, in some embodiments, step S103 may be implemented by the processor 24. That is, the processor 24 may detect the distance from the object to the electronic device 100 according to the second intensity value when the brightness value is smaller than the predetermined brightness threshold to determine whether the object is close to or far from the electronic device 100.
Specifically, when the brightness value is less than the predetermined threshold value of brightness, the infrared light in the current light environment has less influence on the proximity sensor 162. For example, when the user is in a low-light environment such as indoors, since infrared light in ambient light is small and the influence on the proximity sensor 162 is negligible, the distance detection operation can be performed using the second intensity value detected by the proximity sensor 162 as it is.
Referring to fig. 11, in some embodiments, the step S101 of detecting the brightness value of the current ambient light includes:
s1011, acquiring a multi-frame image of the current environment; and
s1012, a luminance value of the current environment is calculated from the plurality of frames of images.
Referring to fig. 3, in some embodiments, the proximity detection apparatus 200 includes a calculation module 23. Step S1011 may be implemented by the obtaining module 21, and step S1012 may be implemented by the calculating module 23. That is, the obtaining module 21 may obtain a multi-frame image of the current environment, and the calculating module 23 may calculate the brightness value of the current environment according to the multi-frame image.
Referring to fig. 1, in some embodiments, the electronic device 100 includes the camera 163, and steps S1011 and S1012 can be implemented by the processor 24. That is, the processor 24 may acquire a plurality of frame images of the current environment by using the camera 163, and calculate the brightness value of the current environment from the plurality of frame images.
Specifically, the brightness value of the current environment may also be obtained by detecting the image captured by the camera 163. For example, the luminance value of the current environment may be calculated from the brightness of the captured image. It is understood that these ways of detecting the ambient light are only exemplary, and do not limit the present invention, and that the ways of detecting the ambient light may be other forms.
Referring to fig. 12, in some embodiments, the step S10 of acquiring the first intensity value of the infrared light in the current ambient light when the brightness value is greater than or equal to the predetermined brightness threshold includes:
s104, detecting the inclination angle of the electronic device; and
and S105, when the inclination angle is smaller than the preset angle threshold, acquiring a first intensity value of the infrared light in the current ambient light.
Referring to fig. 3, in some embodiments, step S104 and step S105 may be implemented by the obtaining module 21. That is, the obtaining module 21 may detect the tilt angle of the electronic device 100, and obtain the first intensity value of the infrared light in the current ambient light when the tilt angle is smaller than the predetermined angle threshold.
Referring to fig. 1, in some embodiments, the electronic device 100 includes an acceleration sensor 164, and step S104 and step S105 can be implemented by the processor 24. That is, the processor 24 may detect the tilt angle of the electronic device 100 by using the acceleration sensor 164, and obtain the first intensity value of the infrared light in the current ambient light when the tilt angle is smaller than the predetermined angle threshold.
Specifically, please refer to fig. 13, in which the tilt angle of the electronic device 100 is 0 degree (the electronic device 100 is parallel to the horizontal direction). Referring to fig. 14, the tilt angle of the electronic device 100 is 30 degrees (the included angle between the electronic device 100 and the horizontal direction is 30 degrees). The proximity sensor 162 can more easily receive the infrared light in the ambient light, and the influence on the proximity sensor 162 is large, so when the tilt angle of the electronic device 100 is smaller than the predetermined angle threshold, the distance between the object and the electronic device 100 can be determined by detecting the intensity of the infrared light received by the proximity sensor 162 and the intensity of the infrared light in the ambient light, and the interference caused by the detection of the proximity sensor 162 by the ambient light can be reduced. In addition, the tilt angle of the electronic device 100 may also include a tilt angle of the electronic device 100 from a vertical direction. The tilt angle of the electronic device 100 may be detected by a gravity sensor or a gyro sensor. It is understood that the specific data of the predetermined angle threshold can be set according to actual conditions.
Referring to fig. 12, in some embodiments, a proximity detection method includes the steps of:
and S106, if the inclination angle is larger than or equal to the preset angle threshold, detecting the distance from the object to the electronic device according to the second intensity value to judge whether the object is close to or far away from the electronic device.
Referring to fig. 3, in some embodiments, step S106 may be implemented by the determining module 22. That is, the determining module 22 may detect the distance from the object to the electronic device 100 according to the second intensity value when the tilt angle is greater than or equal to the predetermined angle threshold to determine whether the object is close to or far from the electronic device 100.
Referring to fig. 1, in some embodiments, step S106 may be implemented by the processor 24. That is, the processor 24 may detect the distance from the object to the electronic device 100 according to the second intensity value when the tilt angle is greater than or equal to the predetermined angle threshold to determine whether the object is close to or far from the electronic device 100.
Specifically, please refer to fig. 15, the tilt angle of the electronic device 100 is 120 degrees. The proximity sensor 162 receives less infrared light in the ambient light, and the influence on the proximity sensor 162 is negligible, so that the distance detection operation can be performed directly using the second intensity value detected by the proximity sensor 162.
The embodiment of the invention also provides a computer readable storage medium. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by the one or more processors 24, cause the processors 24 to perform the proximity detection method of any of the embodiments described above. For example, step S10 is executed to obtain a first intensity value of the infrared light in the current ambient light. In step S20, a second intensity value of the infrared light received by the proximity sensor is acquired. And step S30, detecting the distance from the object to the electronic device according to the first intensity value and the second intensity value to judge whether the object is close to or far away from the electronic device.
Referring to fig. 4, the embodiment of the invention further provides a computer device 300. The computer device includes a memory 32 and a processor 24, wherein the memory 32 stores computer readable instructions, and when the instructions are executed by the processor 24, the processor 24 executes the proximity detection method according to any of the embodiments. For example, step S10 is executed to obtain a first intensity value of the infrared light in the current ambient light. In step S20, a second intensity value of the infrared light received by the proximity sensor is acquired. And step S30, detecting the distance from the object to the electronic device according to the first intensity value and the second intensity value to judge whether the object is close to or far away from the electronic device.
FIG. 4 is a schematic diagram of internal modules of computer device 300, under an embodiment. The computer apparatus 300 includes a processor 24, a memory 32 (e.g., a nonvolatile storage medium), an internal memory 33, an input device 34, an ambient light sensor 161, a proximity sensor 162, a camera 163, and an acceleration sensor 164, which are connected by a system bus 31. The memory 32 of the computer device 300 has stored therein an operating system and computer readable instructions. The computer readable instructions are executable by the processor 24 to implement the proximity detection method of any of the above embodiments. Processor 24 may be used to provide computing and control capabilities that support the operation of the overall computer device 300. The internal memory 33 of the computer device 300 provides an environment for the execution of computer readable instructions in the memory 32. The input device 34 of the computer device 300 may be a touch panel on a display screen, a button, a track ball or a touch pad arranged on a housing of the computer device 300, or an external keyboard, a touch pad or a mouse. The computer device 300 may be a mobile phone, a tablet computer, a notebook computer, a personal digital assistant, or a wearable device (e.g., a smart bracelet, a smart watch, a smart helmet, smart glasses), etc. It will be appreciated by those skilled in the art that the configurations shown in the figures are merely schematic representations of portions of configurations relevant to the present inventive arrangements and are not intended to limit the computing device 300 to which the present inventive arrangements may be applied, and that a particular computing device 300 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
It will be understood by those skilled in the art that all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above embodiments of the methods. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
The above disclosure provides many different embodiments, or examples, for implementing different features of the invention. The components and arrangements of the specific examples are described above to simplify the present disclosure. Of course, they are merely examples and are not intended to limit the present invention. Furthermore, the present invention may repeat reference numerals and/or letters in the various examples, such repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed. In addition, the present invention provides examples of various specific processes and materials, but one of ordinary skill in the art may recognize applications of other processes and/or uses of other materials.
In the description of the present specification, reference to the description of the terms "one embodiment", "some embodiments", "an illustrative embodiment", "an example", "a specific example", or "some examples", etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

Claims (11)

1. A proximity detection method for an electronic device including a proximity sensor for emitting infrared light and receiving infrared light reflected by an object, the method comprising the steps of:
detecting the brightness value of the current environment light;
when the brightness value is larger than or equal to a preset brightness threshold value, detecting an inclination angle of the electronic device, and when the inclination angle is smaller than a preset angle threshold value, acquiring a first intensity value of infrared light in current ambient light;
acquiring a second intensity value of the infrared light received by the proximity sensor; and
and detecting the distance from the object to the electronic device according to the first intensity value and the second intensity value to judge whether the object is close to or far away from the electronic device.
2. The proximity detection method according to claim 1, wherein the proximity detection method comprises the steps of:
if the brightness value is smaller than the preset brightness threshold value, detecting the distance from the object to the electronic device according to the second intensity value to judge whether the object is close to or far away from the electronic device.
3. The proximity detection method according to claim 1, wherein the step of detecting the brightness value of the current ambient light includes:
acquiring a multi-frame image of a current environment; and
and calculating the brightness value of the current environment according to the multi-frame image.
4. The proximity detection method according to claim 1, wherein the proximity detection method comprises the steps of:
if the inclination angle is larger than or equal to a preset angle threshold, detecting the distance from the object to the electronic device according to the second intensity value to judge whether the object is close to or far away from the electronic device.
5. A proximity detection apparatus for an electronic apparatus, the electronic apparatus including a proximity sensor for emitting infrared light and receiving infrared light reflected by an object, the proximity detection apparatus comprising:
the acquisition module is used for detecting the brightness value of the current environment light, detecting the inclination angle of the electronic device when the brightness value is greater than or equal to a preset brightness threshold, and acquiring a first intensity value of infrared light in the current environment light when the inclination angle is smaller than a preset angle threshold;
the acquisition module is further used for acquiring a second intensity value of the infrared light received by the proximity sensor; and
a judging module, configured to detect a distance from the object to the electronic device according to the first intensity value and the second intensity value to judge whether the object is close to or far from the electronic device.
6. An electronic device, comprising:
an ambient light sensor for detecting a brightness value of current ambient light;
the acceleration sensor is used for detecting the inclination angle of the electronic device;
a proximity sensor for emitting infrared light and receiving infrared light reflected by an object; and
a processor to:
when the brightness value is larger than or equal to a preset brightness threshold value and the inclination angle is smaller than a preset angle threshold value, acquiring a first intensity value of infrared light in current environment light;
acquiring a second intensity value of the infrared light received by the proximity sensor; and
and detecting the distance from the object to the electronic device according to the first intensity value and the second intensity value to judge whether the object is close to or far away from the electronic device.
7. The electronic device of claim 6, wherein the processor is further configured to detect a distance from the object to the electronic device according to the second intensity value to determine whether the object is close to or far from the electronic device when the brightness value is smaller than the brightness predetermined threshold.
8. The electronic device of claim 6, wherein the electronic device comprises a camera configured to obtain a plurality of frame images of a current environment, and wherein the processor is configured to calculate the brightness value of the current environment from the plurality of frame images.
9. The electronic device of claim 6, wherein the processor is configured to detect a distance from the object to the electronic device according to the second intensity value to determine whether the object is close to or far from the electronic device when the tilt angle is greater than or equal to a predetermined angle threshold.
10. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the proximity detection method of any of claims 1 to 4.
11. A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions that, when executed by the processor, cause the processor to perform the proximity detection method of any of claims 1 to 4.
CN201810554883.9A 2018-06-01 2018-06-01 Proximity detection method and apparatus, electronic apparatus, storage medium, and device Active CN108874128B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810554883.9A CN108874128B (en) 2018-06-01 2018-06-01 Proximity detection method and apparatus, electronic apparatus, storage medium, and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810554883.9A CN108874128B (en) 2018-06-01 2018-06-01 Proximity detection method and apparatus, electronic apparatus, storage medium, and device

Publications (2)

Publication Number Publication Date
CN108874128A CN108874128A (en) 2018-11-23
CN108874128B true CN108874128B (en) 2021-07-23

Family

ID=64336035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810554883.9A Active CN108874128B (en) 2018-06-01 2018-06-01 Proximity detection method and apparatus, electronic apparatus, storage medium, and device

Country Status (1)

Country Link
CN (1) CN108874128B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110531438B (en) * 2019-09-01 2021-07-13 福州优朋电子有限公司 Infrared induction detection method for self-adaptive moving object and induction sanitary appliance thereof
CN111123385B (en) * 2019-11-11 2021-03-19 广州安协科技股份有限公司 Diffuse reflection type object detection method and device with self-learning function
CN112865862B (en) * 2019-11-12 2022-05-13 Oppo广东移动通信有限公司 Ambient light detection method and apparatus for optical communication between electronic devices
CN113421358B (en) * 2020-03-03 2023-05-09 比亚迪股份有限公司 Lock control system, lock control method and vehicle
JP2021150671A (en) * 2020-03-16 2021-09-27 ローム株式会社 Light receiving ic, proximity sensor, and electronic apparatus
CN112399012B (en) * 2020-11-17 2022-03-25 惠州Tcl移动通信有限公司 Proximity sensor setting method, device and storage medium
CN113119128A (en) * 2021-04-25 2021-07-16 广州科语机器人有限公司 Robot, operation control method thereof, electronic device, and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102883061A (en) * 2012-09-26 2013-01-16 广东欧珀移动通信有限公司 Method and system for controlling working state of touch screen of mobile terminal
CN103037088A (en) * 2012-12-11 2013-04-10 惠州Tcl移动通信有限公司 Method and mobile terminal for screen backlight adjusting
CN103309572A (en) * 2012-03-16 2013-09-18 联想(北京)有限公司 Method and device for state switching
CN104541231A (en) * 2014-08-29 2015-04-22 华为技术有限公司 Method and device for preventing mistaken touch of touch screen
CN105959492A (en) * 2016-07-06 2016-09-21 广东欧珀移动通信有限公司 Control method and device for infrared proximity sensor and mobile terminal
CN105957499A (en) * 2016-06-28 2016-09-21 广东欧珀移动通信有限公司 Control method, control device and electronic device
CN105988559A (en) * 2015-02-03 2016-10-05 联想(北京)有限公司 Information processing method and electronic device
CN106060285A (en) * 2016-08-15 2016-10-26 广东欧珀移动通信有限公司 Backlight control method and device, and mobile terminal
CN106357922A (en) * 2016-10-12 2017-01-25 广东欧珀移动通信有限公司 State monitoring method and device for terminal equipment and terminal equipment
CN107450817A (en) * 2017-07-31 2017-12-08 广东欧珀移动通信有限公司 Proximity test method, apparatus, storage medium and electronic equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2458823A1 (en) * 1979-06-08 1981-01-02 Mulleman Michel Proximity detector using light sources - produces intersecting beams which form spots on target with separation dependent on distance between source and target
TWI451160B (en) * 2012-03-05 2014-09-01 原相科技股份有限公司 Automatic detection method and portable electronic device using the same
US9223353B2 (en) * 2013-09-30 2015-12-29 Sonos, Inc. Ambient light proximity sensing configuration
CN106131345B (en) * 2016-08-29 2020-01-10 Oppo广东移动通信有限公司 Control method and device of proximity sensor and mobile terminal
CN106506831B (en) * 2016-10-26 2019-09-27 Oppo广东移动通信有限公司 Control method and control device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309572A (en) * 2012-03-16 2013-09-18 联想(北京)有限公司 Method and device for state switching
CN102883061A (en) * 2012-09-26 2013-01-16 广东欧珀移动通信有限公司 Method and system for controlling working state of touch screen of mobile terminal
CN103037088A (en) * 2012-12-11 2013-04-10 惠州Tcl移动通信有限公司 Method and mobile terminal for screen backlight adjusting
CN104541231A (en) * 2014-08-29 2015-04-22 华为技术有限公司 Method and device for preventing mistaken touch of touch screen
CN105988559A (en) * 2015-02-03 2016-10-05 联想(北京)有限公司 Information processing method and electronic device
CN105957499A (en) * 2016-06-28 2016-09-21 广东欧珀移动通信有限公司 Control method, control device and electronic device
CN105959492A (en) * 2016-07-06 2016-09-21 广东欧珀移动通信有限公司 Control method and device for infrared proximity sensor and mobile terminal
CN106060285A (en) * 2016-08-15 2016-10-26 广东欧珀移动通信有限公司 Backlight control method and device, and mobile terminal
CN106357922A (en) * 2016-10-12 2017-01-25 广东欧珀移动通信有限公司 State monitoring method and device for terminal equipment and terminal equipment
CN107450817A (en) * 2017-07-31 2017-12-08 广东欧珀移动通信有限公司 Proximity test method, apparatus, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN108874128A (en) 2018-11-23

Similar Documents

Publication Publication Date Title
CN108874128B (en) Proximity detection method and apparatus, electronic apparatus, storage medium, and device
CN108873005B (en) Proximity detection method and apparatus, electronic apparatus, storage medium, and device
US10250820B2 (en) Electronic device and method for controlling the electronic device
US11770619B2 (en) Generating static images with an event camera
US20160005362A1 (en) Determination Of Optical Condition And Adjustment Of Display
CN107450817B (en) Proximity detection method, proximity detection device, storage medium, and electronic apparatus
CN108983250B (en) Proximity detection method and apparatus, electronic apparatus, storage medium, and device
JP2019537285A (en) Method and apparatus for preventing terminal erroneous contact
KR20180056732A (en) Terminal and method for detecting luminance of ambient light
US11698297B2 (en) Methods and devices for detecting ambient light based on different states of flexible screen, and storage medium
US10708512B2 (en) Method and device for capturing image and storage medium
CN109040524B (en) Artifact eliminating method and device, storage medium and terminal
CN105915803B (en) Photographing method and system based on sensor
CN108881875B (en) Image white balance processing method and device, storage medium and terminal
US20160335940A1 (en) Method for processing display data and electronic device for supporting the same
CN104780320B (en) Ambient light detection method and electronic device
KR20160038460A (en) Electronic device and control method of the same
KR20180102331A (en) Electronic device including camera module and method for controlling thereof
CN113140194B (en) Brightness adjusting method, device and storage medium
US20200202813A1 (en) Method for adjusting brightness of display screen and electronic device employing the method
KR20190033462A (en) Power control method, distance measurement module and electronic device
KR20200089593A (en) Method to obtain outside luminance using camera sensor and electronic device applying the method
CN111083386B (en) Image processing method and electronic device
US10348983B2 (en) Non-transitory storage medium encoded with computer readable image processing program, information processing system, information processing apparatus, and image processing method for determining a position of a subject in an obtained infrared image
US20130006578A1 (en) Device and Method for Detecting Light Reflection and Electronic Device Using the Same

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