Distance detection method, distance detection device and electronic equipment

By receiving display screen signals and generating driving signals to drive distance sensors to transmit infrared signals, the screen spot problem caused by infrared signal irradiation is solved, and the dual improvement of distance detection and user experience is achieved.

CN119556295APending Publication Date: 2025-03-04GOODIX TECH (CHENGDU) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411793466.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

When the infrared signal emitted by the distance sensor passes through the screen, it will affect the color or brightness of the screen display, resulting in visual spots and affect the user experience.

Method used

By receiving the screen signal output from the display screen, a driving signal is generated, and the distance sensor is driven through the driving signal, causing it to transmit a first infrared signal. The brightness change value of the illumination area of ​​the infrared signal is smaller than the brightness change threshold, thereby avoiding speckles.

Benefits of technology

While detecting distance, it can prevent excessive brightness changes caused by infrared signal irradiation, avoid spots, and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119556295A_ABST
    Figure CN119556295A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a distance detection method, a distance detection device and electronic equipment, the distance detection method is applied to the distance detection device, and the distance detection method comprises the following steps: receiving a screen signal output by a display screen; generating a driving signal according to the screen signal; a distance sensor is driven through a driving signal, so that the distance sensor emits a first infrared signal, and the brightness change value of an area, irradiated by the first infrared signal, on the display screen is smaller than a brightness change threshold value; and determining the distance between a to-be-identified object and the display screen according to at least part of the first infrared signal reflected by the to-be-identified object. According to the distance detection method provided by the embodiment of the invention, the brightness change value of the area, irradiated by the first infrared signal, on the display screen can be smaller than the brightness change threshold value, so that spots are prevented from being generated in the area, irradiated by the first infrared signal, on the display screen during distance detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of sensor technology, and in particular to a distance detection method, a distance detection device, and an electronic device. Background Art

[0002] Proximity Sensor (P-Sensor) is a sensor widely used in smart terminals (such as smart phones, tablets, etc.). It is mainly composed of an infrared transmitter and an infrared receiver. The detection principle of the distance sensor is to transmit infrared signals through the infrared transmitter and receive the infrared signals reflected by the object to be identified through the infrared receiver to determine the distance between the object to be identified and the distance sensor, and judge whether the object to be identified is in a close state or a far state.

[0003] Currently, a driving signal is sent to the distance sensor to drive the distance sensor to emit an infrared signal.

[0004] However, when the infrared signal emitted by the distance sensor passes through the screen, the screen display drive circuit will be affected by the irradiated infrared light, causing the color or brightness of the screen display to be different from other positions, forming visual spots and affecting the user experience. Summary of the invention

[0005] In view of this, embodiments of the present application provide a distance detection method, a distance detection device, and an electronic device to at least partially solve the above problems.

[0006] According to a first aspect of an embodiment of the present application, a distance detection method is provided, which is applied to a distance detection device, including: receiving a screen signal output by a display screen; generating a drive signal according to the screen signal; driving a distance sensor by the drive signal so that the distance sensor emits a first infrared signal, wherein a brightness change value of an area on the display screen illuminated by the first infrared signal is less than a brightness change threshold; and determining the distance between the object to be identified and the display screen according to at least a portion of the first infrared signal reflected back by the object to be identified.

[0007] According to a second aspect of an embodiment of the present application, a distance detection device is provided, comprising: a receiving unit, configured to receive a screen signal output by a display screen; a generating unit, configured to generate a driving signal according to the screen signal; a driving unit, configured to drive a distance sensor through the driving signal, so that the distance sensor emits a first infrared signal, wherein a brightness change value of an area on the display screen illuminated by the first infrared signal is less than a brightness change threshold; and a determining unit, configured to determine the distance between the object to be identified and the display screen according to at least a portion of the first infrared signal reflected back by the object to be identified.

[0008] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising: a display screen, a distance sensor, and a distance detection device as described in the second aspect; the display screen is electrically connected to the distance sensor, and the distance detection device is used to execute the distance detection method as described in the first aspect.

[0009] According to the distance detection method provided in the embodiment of the present application, a screen signal sent by the display screen is received, a driving signal is generated according to the screen signal, and the distance sensor is driven by the driving signal, so that the distance sensor emits a first infrared signal, and receives at least a part of the first infrared signal reflected back by the object to be identified, thereby determining the distance between the object to be identified and the display screen according to the reflected first infrared signal. Since the driving signal is generated according to the screen signal, and the screen signal is related to the screen display or screen dimming, the screen dimming or screen display is taken into consideration when driving the distance sensor to emit the infrared signal, thereby making the brightness change value of the area on the display screen irradiated by the first infrared signal less than the brightness change threshold. Compared with the prior art, it can prevent the generation of spots on the display screen due to the large brightness change of the area on the display screen irradiated by the first infrared signal, thereby affecting the screen display effect. This method can improve the user experience while realizing distance detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0011] Figure 1 is a flow chart of a distance detection method provided in an embodiment of the present application;

[0012] Figure 2 is a schematic diagram of spot brightness provided in an embodiment of the present application;

[0013] Figure 3 It is a schematic diagram of brightness change of an area illuminated by an infrared signal provided in an embodiment of the present application;

[0014] Figure 4 is a flow chart of a method for determining a first duration provided in an embodiment of the present application;

[0015] Figure 5 This is a flow chart of a method for determining a first duration, a first operating current, and a second duration provided in an embodiment of the present application;

[0016] Figure 6is a flow chart of adjustment based on a spot image provided by an embodiment of the present application;

[0017] Figure 7 is a schematic diagram of a distance detection device provided in an embodiment of the present application;

[0018] Figure 8 is a schematic diagram of an electronic device provided in an embodiment of the present application;

[0019] Fig. 9 It is a schematic diagram of another electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.

[0021] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0022] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0023] As mentioned above, the proximity sensor (P-Sensor) is a sensor widely used in smart terminals (such as smart phones, tablets, etc.), mainly composed of an infrared transmitter and an infrared receiver. The detection principle of the distance sensor is to transmit an infrared signal through an infrared transmitter, and receive the infrared signal reflected by the object to be identified through an infrared receiver, determine the distance between the object to be identified and the distance sensor, and judge whether the object to be identified is close or far away. At present, the distance sensor is driven to transmit an infrared signal by sending a driving signal to the distance sensor. However, when the infrared signal emitted by the distance sensor passes through the screen, the screen display drive circuit will be affected by the irradiated infrared light, causing the color or brightness of the screen display to be different from other positions, forming visual spots, affecting the user experience.

[0024] An embodiment of the present application provides a distance detection method, which receives a screen signal sent by a display screen, generates a driving signal according to the screen signal, drives a distance sensor through the driving signal, causes the distance sensor to emit a first infrared signal, and receives at least a portion of the first infrared signal reflected back by an object to be identified, thereby determining the distance between the object to be identified and the display screen according to the reflected first infrared signal. Since the driving signal is generated according to the screen signal, and the screen signal is related to the screen display or screen dimming, the screen dimming or screen display is taken into consideration when driving the distance sensor to emit the infrared signal, thereby making the brightness change value of the area on the display screen irradiated by the first infrared signal less than the brightness change threshold. Compared with the prior art, it can prevent spots from being generated on the display screen due to a large brightness change in the area on the display screen irradiated by the first infrared signal, thereby affecting the screen display effect. This method can improve the user experience while achieving distance detection.

[0025] The distance detection method provided by the present application is described below through examples.

[0026] Figure 1 is a flow chart of a distance detection method provided in an embodiment of the present application, and the distance detection method is applied to a distance detection device, such as Figure 1 As shown, the distance detection method includes the following steps 101 to 104:

[0027] Step 101: Receive a screen signal output by a display screen.

[0028] A screen signal output by a display screen is received, where the screen signal may be a vertical synchronization signal Vsync signal output by the display screen. In one example, a pulse frequency of the Vsync signal is consistent with a screen refresh frequency, that is, when a screen pixel changes from a light-emitting state to a non-light-emitting state, the display screen outputs the screen signal. Optionally, the screen signal may also be a TE signal output by a tearing effect (TE) pin.

[0029] Step 102: Generate a driving signal according to the screen signal.

[0030] Step 103: drive the distance sensor by a driving signal, so that the distance sensor emits a first infrared signal, wherein a brightness change value of an area on the display screen irradiated by the first infrared signal is less than a brightness change threshold.

[0031] The distance sensor is driven by a driving signal. In one example, the infrared emitting unit in the distance sensor can be driven by the driving signal to emit a first infrared signal. It should be noted that when the first infrared signal emitted by the distance sensor passes through the screen, the screen display driving circuit will be affected by the infrared light, causing the brightness of the screen display to change from other positions, and generating spots in the irradiated area of ​​the display screen, thereby affecting the display of the screen. However, since the driving signal is generated according to the screen signal, and the screen signal is related to the screen display or screen dimming, the screen dimming or screen display is taken into account when driving the distance sensor, so that the brightness change value of the area on the display screen irradiated by the first infrared signal can be made less than the brightness change threshold, that is, no spots visible to the human eye are generated.

[0032] Step 104: Determine the distance between the object to be identified and the display screen according to at least a portion of the first infrared signal reflected by the object to be identified.

[0033] After the distance sensor transmits the first infrared signal, the first infrared signal passes through the display screen and is at least partially reflected by the object to be identified. At least a portion of the first infrared signal reflected back by the object to be identified is received. In one example, at least a portion of the reflected first infrared signal can be received by an infrared receiving unit in the distance sensor. After receiving at least a portion of the reflected first infrared signal, the distance between the object to be identified and the display screen can be determined based on the infrared signal. In one example, when the distance between the object to be identified and the display screen is less than a distance threshold, the object to be identified can be determined to be in a proximity state, and operations related to the proximity state can be performed, such as: turning off the display screen, etc. In another example, when the signal amount of at least a portion of the first infrared signal reflected back is higher than the signal amount threshold, the object to be identified can be determined to be in a proximity state.

[0034] In an embodiment of the present application, a screen signal sent by a display screen is received, a driving signal is generated according to the screen signal, and a distance sensor is driven by the driving signal, so that the distance sensor emits a first infrared signal, and at least a portion of the first infrared signal reflected back by the object to be identified is received, thereby determining the distance between the object to be identified and the display screen according to the reflected first infrared signal. Since the driving signal is generated according to the screen signal, and the screen signal is related to the screen display or screen dimming, the screen dimming or screen display is taken into consideration when driving the distance sensor to emit the infrared signal, thereby making the brightness change value of the area on the display screen irradiated by the first infrared signal less than the brightness change threshold. Compared with the prior art, it can prevent spots from being generated on the display screen due to a large brightness change in the area on the display screen irradiated by the first infrared signal, thereby affecting the screen display effect. This method can improve the user experience while achieving distance detection.

[0035] In a possible implementation, when generating a driving signal according to a screen signal, the screen signal may be delayed for a first time period, and the driving signal may be obtained according to the screen signal after being delayed for the first time period.

[0036] The screen signal is delayed for a first time period, that is, after the time when the screen signal is received reaches the first time period, the distance sensor is driven by a driving signal. In one example, the screen signal can be delayed for a first time period through a circuit structure to obtain a driving signal. In another example, the driving signal can be generated after the time when the screen signal is received reaches the first time period.

[0037] It should be noted that the brightness of the screen area illuminated by the first infrared signal may become brighter or darker. The greater the brightness change of the screen area illuminated by the first infrared signal, the more obvious the spots are. Figure 2 is a schematic diagram of spot brightness provided in an embodiment of the present application, such as Figure 2 As shown, when the distance sensor is driven by the driving signal to emit the first infrared signal at different times, the brightness of the display spot of the screen area irradiated by the first infrared signal is different. It should be noted that Figure 2 This is only an example to illustrate the principle. Specifically, the period of the screen signal can be consistent with the screen dimming signal ( Figure 2 The period of the screen brightness change in the display is different. For example, the period of the screen signal can be 60Hz, and the period of the screen dimming signal can be above 250Hz.

[0038] The principle is explained below. Figure 3 is a schematic diagram of a brightness change of an area illuminated by an infrared signal provided in an embodiment of the present application, such as Figure 3As shown, curve 301 represents the display brightness of the screen when it is not irradiated by the infrared signal, curve 302 represents the screen brightness change after the distance sensor is driven to emit the infrared signal by the driving signal 305 at the first moment, curve 303 represents the screen brightness change after the distance sensor is driven to emit the infrared signal by the driving signal 306 at the second moment, and curve 304 represents the screen brightness change after the distance sensor is driven to emit the infrared signal by the driving signal 307 at the third moment. Figure 3 It can be seen that after being irradiated by the infrared signal, the display brightness of the area irradiated by the infrared signal changes to a fixed value, and the earlier the distance sensor is driven to emit the first infrared signal in a dimming cycle, the longer the time for the display brightness of the area irradiated by the infrared signal to change to a fixed brightness, the greater the brightness change value, and the longer the change time, the more obvious the display spots on the screen, and the shorter the change time, the less obvious the display spots on the screen. It should be noted that Figure 3 This is only an example to illustrate the principle, and the changing rules of dimming signals of different display screens may not be the same.

[0039] In an embodiment of the present application, the screen signal is delayed for a first time period, and a driving signal is obtained based on the screen signal after the first time period is delayed. Thus, the screen display or screen dimming can be considered when driving the distance sensor to emit the first infrared signal. Thus, according to the screen display or screen dimming rule, the brightness change value of the area on the display screen illuminated by the first infrared signal can be made less than the brightness change threshold value. The display effect of the screen can be improved while performing distance detection, and visible spots on the display screen due to infrared signal illumination can be prevented, thereby improving the user experience.

[0040] Figure 4 is a flow chart of a method for determining a first duration provided in an embodiment of the present application. Figure 4 As shown, when determining the first duration, the following steps 401 to 404 may be performed:

[0041] Step 401: drive a distance sensor with a first test signal to cause the distance sensor to emit a second infrared signal.

[0042] A first test signal is sent to the distance sensor, where the first test signal is a test signal generated after a first delay is performed on the screen signal, and the distance sensor is driven to emit a second infrared signal by the first test signal.

[0043] Step 402 , determine whether the brightness change value of the area on the display screen illuminated by the second infrared signal is less than the brightness change threshold, if so, execute step 403 , otherwise execute step 404 .

[0044] After the distance sensor transmits the second infrared signal, the second infrared signal penetrates the display screen, and the brightness of the area on the display screen illuminated by the second infrared signal changes. It is determined whether the brightness change value of the area on the display screen illuminated by the second infrared signal is less than the brightness change threshold. In one example, it can be manually observed that if spots visible to the human eye are generated in the area on the display screen illuminated by the second infrared signal, then the brightness change value of the area on the display screen illuminated by the second infrared signal is greater than or equal to the brightness change threshold. If no spots visible to the human eye are generated in the area on the display screen illuminated by the second infrared signal, then the brightness change value of the area on the display screen illuminated by the second infrared signal is less than the brightness change threshold. In another example, the screen images before and after the distance sensor transmits the second infrared signal can be taken by a camera to determine whether the brightness change value of the area on the display screen illuminated by the second infrared signal is less than the brightness change threshold. The specific determination method is not limited.

[0045] Step 403: determine a first delay of the first test signal relative to the screen signal as a first duration.

[0046] When the brightness change value of the area on the display screen illuminated by the second infrared signal is less than the brightness change threshold, for example: when the area on the display screen illuminated by the second infrared signal does not produce spots visible to the human eye, the first delay of the first test signal relative to the screen signal is determined. In one example, the first delay can be determined by calculating the time difference between the rising edge of the screen signal and the rising edge of the second test signal, and the first delay is determined as the first duration, so that the screen signal can be delayed by the first duration to obtain a driving signal.

[0047] Step 404 , adjust the first delay of the first test signal relative to the screen signal, and execute step 401 .

[0048] When the brightness change value of the area on the display screen illuminated by the second infrared signal is greater than the brightness change threshold, for example: when the area on the display screen illuminated by the second infrared signal does not produce spots visible to the human eye, the first delay of the first test signal relative to the screen signal is determined. In one example, the first delay can be determined by calculating the time difference between the rising edge of the screen signal and the rising edge of the second test signal, the size of the first delay is changed, and step 402 is re-executed, that is, it is determined whether the brightness change value of the area on the display screen illuminated by the second infrared signal after adjusting the first delay is less than the brightness change threshold. If the brightness change value is still less than the brightness change threshold, the size of the first delay continues to be changed until the brightness change value of the area on the display screen illuminated by the second infrared signal is less than the brightness change threshold.

[0049] In an embodiment of the present application, a distance sensor is driven by a first test signal to emit a second infrared signal, and a first delay of the first test signal relative to a screen signal is adjusted until a brightness change value of an area on the display screen illuminated by the second infrared signal is less than a brightness change threshold, and the first delay is determined as a first duration, thereby enabling the determination of the first duration to be achieved. Since the first delay is adjusted until the requirement is met, when the distance sensor is driven to emit a first infrared signal by a driving signal obtained by delaying the screen signal for the first duration, the brightness change value of the area illuminated by the first infrared signal can be made less than the brightness change threshold, thereby preventing visible spots on the display screen due to illumination of the first infrared signal, thereby improving the screen display effect and thus improving the user experience.

[0050] In a possible implementation, when the distance sensor is driven by a driving signal so that the distance sensor emits a first infrared signal, a first operating current can be output to the distance sensor when the driving signal is received so that the distance sensor emits a first infrared signal having a second duration.

[0051] In an embodiment of the present application, when a driving signal is received, a first operating current is output to the distance sensor, causing the distance sensor to emit a first infrared signal with a duration of a second duration. Thus, after receiving the driving signal, the distance sensor can emit an infrared signal with a duration of a preset duration, thereby driving the distance sensor to obtain the distance between the object to be identified and the display screen.

[0052] Figure 5 is a flow chart of a method for determining a first duration, a first operating current, and a second duration provided by an embodiment of the present application, such as Figure 5 As shown, when determining the first duration, the first operating current and the second duration, the following steps 501 to 504 may be performed:

[0053] Step 501: When receiving a second test signal, output a second operating current to the distance sensor, so that the distance sensor emits a third infrared signal with a third duration.

[0054] A second test signal is received, where the second test signal is a signal generated after a second delay is performed on the screen signal. Optionally, the second test signal is a pulse signal. When a high level pulse of the second test signal is received, a second operating current with a third duration is output to the distance sensor, so that the distance sensor emits a third infrared signal with a third duration.

[0055] Step 502: Determine a spot image of the area on the display screen that is illuminated by the third infrared signal.

[0056] When the distance sensor emits the third infrared signal, the third infrared signal penetrates the display screen, and the brightness of the area on the display screen illuminated by the third infrared signal changes, producing visual spots. The spot image of the area on the display screen illuminated by the third infrared signal is determined. In one example, the spot image can be captured by a camera.

[0057] Step 503 , determining whether the brightness change value of the area on the display screen illuminated by the third infrared signal is less than a brightness change threshold, if so, executing step 504 , otherwise executing step 505 .

[0058] Determine whether the brightness change value of the area on the display screen illuminated by the third infrared signal is less than the brightness change threshold. In one example, it can be determined through manual observation that if spots visible to the human eye are generated in the area on the display screen illuminated by the third infrared signal, then the brightness change value of the area on the display screen illuminated by the third infrared signal is greater than the brightness change threshold; if spots visible to the human eye are not generated in the area on the display screen illuminated by the third infrared signal, then the brightness change value of the area on the display screen illuminated by the third infrared signal is less than the brightness change threshold. In another example, it can be determined through a spot image whether the brightness change value of the area on the display screen illuminated by the third infrared signal is less than the brightness change threshold. The specific determination method is not limited.

[0059] Step 504: determine the second delay of the second test signal relative to the screen signal as the first duration, determine the third duration as the second duration, and determine the second operating current as the first operating current.

[0060] If the brightness change value of the area on the display screen illuminated by the third infrared signal is less than the brightness change threshold, it can be determined that the human eye cannot observe the excitation spot in the area on the display screen illuminated by the third infrared signal, and the second delay of the second test signal relative to the screen signal is determined as the first duration, and the third duration is determined as the second duration, and the second working current is determined as the first working current. In one example, the second delay can be determined by calculating the time difference between the rising edge of the screen signal and the rising edge of the third test signal, and the second delay is determined as the first duration, so that the screen signal can be delayed by the first duration to obtain a driving signal.

[0061] Step 505 , adjusting at least one of the second delay, the third duration, and the second operating current of the second test signal relative to the screen signal according to the speckle image, and executing step 501 .

[0062] If the brightness change value of the area on the display screen illuminated by the third infrared signal is greater than or equal to the brightness change threshold, at least one of the second delay, the third duration and the second working current is adjusted. It should be understood that, similar to the first test signal, the second delay will affect the brightness change value of the area on the display screen illuminated by the third infrared signal, the third duration will affect the duration of the distance sensor transmitting the third infrared signal, and the second working current will affect the signal strength of the third infrared signal emitted by the distance sensor. Third infrared signals with different signal strengths and different working durations will produce different brightness changes in the area illuminated on the display screen. During the adjustment, after adjusting at least one of the second delay, the third duration and the second working current, the distance sensor is re-controlled to transmit the third infrared signal until the brightness change value of the area on the display screen illuminated by the third infrared signal is less than the brightness change threshold.

[0063] In an embodiment of the present application, a spot image generated on the display screen when the distance sensor emits a third infrared signal is obtained, and at least one of the second delay, the third duration, and the second operating current of the second test signal relative to the screen signal is adjusted according to the spot image until the brightness change value of the area on the display screen irradiated by the third infrared signal is less than the brightness change threshold, thereby determining the first duration, the second duration, and the first operating current, and by adjusting the delay, the duration of the distance sensor emitting the infrared signal, and the signal strength of the distance sensor emitting the infrared signal, when the driving signal drives the distance sensor to emit the first infrared signal, the brightness change value of the area on the display screen irradiated by the first infrared signal is less than the brightness change threshold, thereby preventing the generation of visible spots on the display screen due to the irradiation of the infrared signal, and improving the screen display effect, thereby improving the user experience.

[0064] In one possible implementation, when determining the spot image of the area on the display screen illuminated by the third infrared signal, a first image of the display screen can be acquired when the distance sensor does not emit the third infrared signal, and a second image of the display screen can be acquired when the distance sensor emits the third infrared signal, and a subtraction operation is performed on the second image and the first image to determine the spot image.

[0065] When the distance sensor is not working, the first image of the display screen is captured and used as the background image. In one example, the display screen can be set to display a fixed image, such as a pure white image, etc., so that the captured first image of the display screen can be used as the background image.

[0066] When the distance sensor is working, a second image of the display screen is collected, and the second image at least includes an image of the area of ​​the display screen illuminated by the third infrared signal emitted by the distance sensor. The second image is used as a working image, and a subtraction operation is performed on the second image and the first image, that is, the result of subtracting the second image from the first image is calculated. It should be understood that since the second image is the working image and the first image is the background image, subtracting the second image from the first image means removing the background in the second image to obtain a spot image.

[0067] In an embodiment of the present application, a first image of the display screen can be captured when the distance sensor does not emit a third infrared signal, and a second image of the display screen can be captured when the distance sensor emits a third infrared signal, and a subtraction operation is performed on the second image and the first image to determine a spot image, thereby achieving acquisition of the spot image. Since the subtraction operation is performed with the first image, the background image of the non-spot area in the second image can be removed, and the image of the non-spot area in the second image can be prevented from affecting the subsequent adjustment of at least one of the second delay, the third duration, and the second operating current.

[0068] Figure 6 is a flow chart of adjusting based on a spot image provided by an embodiment of the present application, such as Figure 6 As shown, when at least one of the second delay, the third duration and the second working current of the second test signal relative to the screen signal is adjusted according to the spot image, the following steps 601 to 606 may be performed:

[0069] Step 601: Filter the spot image to obtain a third image.

[0070] The speckle image is filtered to make it smooth and denoised. One or more of a variety of filtering methods can be used to filter the speckle image. For example, at least one of Gaussian filtering, median filtering, and mean filtering can be used to filter the speckle image.

[0071] Step 602: Binarize the third image to obtain a fourth image.

[0072] The third image is binarized. Specifically, the relationship between the grayscale value of each pixel in the third image and the preset grayscale threshold is determined, the grayscale value of the pixel whose grayscale value is greater than the preset grayscale threshold is adjusted to 255, and the grayscale value of the pixel whose grayscale value is less than the preset grayscale threshold is adjusted to 0, so as to obtain a fourth image, which is a grayscale image.

[0073] Step 603 , determine whether the grayscale value of the pixel in the fourth image is unique, if so, execute step 604 , otherwise, execute step 605 .

[0074] It is determined whether the grayscale value in the fourth image is unique, that is, whether the grayscale values ​​corresponding to the pixels are equal, for example, whether they are all 0, or whether they are all 255.

[0075] Step 604: Do not adjust the second delay, the third duration, and the second operating current.

[0076] When the grayscale value of the pixel in the fourth image is unique, it proves that no obvious spots are generated on the display screen at this time, that is, the brightness change value of the area on the display screen illuminated by the third infrared signal is less than the brightness change threshold, and the second delay, the third duration and the second working current will not be adjusted.

[0077] Step 605: adjust at least one of the second delay, the third duration, and the second operating current according to the fourth image.

[0078] When the grayscale value of the pixel in the fourth image is not unique, it is proved that obvious spots are generated on the display screen, that is, the brightness change value of the area on the display screen illuminated by the third infrared signal is greater than or equal to the brightness change threshold, then at least one of the second delay, the third duration and the second operating current is adjusted according to the fourth image.

[0079] In an embodiment of the present application, the spot image is filtered to obtain a third image, and the third image is binarized to obtain a fourth image. If the grayscale values ​​of each pixel in the fourth image are not unique, at least one of the second delay, the third duration, and the second operating current is adjusted according to the fourth image. Thus, by adjusting the second delay, the third duration, and the second operating current according to the spot image, the brightness change value of the area on the display screen illuminated by the third infrared signal is made less than the brightness change threshold.

[0080] In one possible implementation, when adjusting at least one of the second delay, the third duration, and the second working current according to the fourth image, the spot type of the spot image can be determined according to the grayscale value of each pixel in the fourth image, the fourth image can be processed by image opening operation to obtain the fifth image, the area of ​​the connected area in the fifth image is calculated, the connected area with the largest area is determined as the spot area, the number of pixels in the spot area is determined as the spot area, the spot area is multiplied by the third image, the values ​​in the multiplication result are sorted in order from large to small, and the average of the first n values ​​​​in the sorting is determined as the spot depth, where n is an integer greater than or equal to 2, and at least one of the second delay, the third duration, and the second working current is adjusted according to the spot type, spot area, and spot depth.

[0081] According to the grayscale value in the fourth image, the spot type of the spot image is determined, for example: if the grayscale value is 255, the spot is a white spot, and if the grayscale value is 0, the spot is a black spot. The fourth image is opened to obtain the fifth image. Specifically, the fourth image can be corroded first, and then the fourth image after the corrosion operation is expanded to realize the opening operation of the fourth image to obtain the fifth image. The opening operation can smooth the image, remove small noise points, and maintain the shape of larger objects.

[0082] The largest connected area in the fifth image is determined as the spot area, and the number of pixels in the spot area is determined as the spot area. The spot area can indicate the number of pixels that have brightness changes in the area illuminated by the infrared signal. The spot area is multiplied with the third image, that is, the largest connected area in the fifth image and the third image are matrix multiplied. The values ​​in the multiplication result are sorted in descending order, and the average of the first n values ​​in the sorting is determined as the spot depth, where n is an integer greater than or equal to 2. For example, the average of the 20 largest numbers in the multiplication result can be determined as the spot depth.

[0083] At least one of the second delay, the third duration and the second operating current is adjusted according to the spot type, the spot area and the spot depth.

[0084] In an embodiment of the present application, the spot type is determined according to the fourth image, the fourth image is opened to obtain the fifth image, the spot area is determined according to the fifth image, and the spot depth is determined according to the fifth image and the third image. Thus, the quantitative characteristics of the spot, that is, the quantitative characteristics of the brightness change value of the area on the display screen illuminated by the third infrared signal, can be determined according to the fourth image. Since at least one of the second delay, the third duration and the second operating current can be adjusted based on the quantitative characteristics of the brightness change value of the area on the display screen illuminated by the third infrared signal, the brightness change value of the area on the display screen illuminated by the third infrared signal after adjustment can meet the requirements.

[0085] Figure 7 is a schematic diagram of a distance detection device provided in an embodiment of the present application, such as Figure 7 As shown, the distance detection device 700 includes: a receiving unit 701, which is used to receive a screen signal output by a display screen, a generating unit 702, which is used to generate a driving signal according to the screen signal, a driving unit 703, which is used to drive the distance sensor through the driving signal, so that the distance sensor emits a first infrared signal, wherein the brightness change value of the area on the display screen irradiated by the first infrared signal is less than a brightness change threshold, and a determining unit 704, which is used to determine the distance between the object to be identified and the display screen according to at least a part of the first infrared signal reflected back by the object to be identified.

[0086] In an embodiment of the present application, the receiving unit 701 can be used to execute step 101 in the above method embodiment, the generating unit 702 can be used to execute step 102 in the above method embodiment, the driving unit 703 can be used to execute step 103 in the above method embodiment, and the determining unit 704 can be used to execute step 104 in the above method embodiment.

[0087] In a possible implementation, the generating unit 702 may also be configured to delay the screen signal for a first time period; and obtain the driving signal according to the screen signal after the delay for the first time period.

[0088] In one possible implementation, the generation unit 702 can also be used to drive the distance sensor through the first test signal, so that the distance sensor emits a second infrared signal, and adjust the first delay of the first test signal relative to the screen signal according to the brightness change value of the area on the display screen illuminated by the second infrared signal, until the brightness change value of the area on the display screen illuminated by the second infrared signal is less than the brightness change threshold, and the first delay is determined as the first duration.

[0089] In a possible implementation, the driving unit 703 may also be configured to output a first operating current to the distance sensor when receiving a driving signal, so that the distance sensor emits a first infrared signal having a second duration.

[0090] In one possible implementation, the generation unit 702 can also be used to output a second working current to the distance sensor when receiving a second test signal, so that the distance sensor emits a third infrared signal with a duration of a third duration, determines a spot image of the area on the display screen illuminated by the third infrared signal, and adjusts at least one of the second delay, the third duration, and the second working current of the second test signal relative to the screen signal according to the spot image until the brightness change value of the area on the display screen illuminated by the third infrared signal is less than the brightness change threshold, determines the second delay as the first duration, determines the third duration as the second duration, and determines the second working current as the first working current.

[0091] In one possible implementation, the generation unit 702 can also be used to obtain a first image of the display screen when the distance sensor does not emit a third infrared signal, and to obtain a second image of the display screen when the distance sensor emits a third infrared signal, and to perform a subtraction operation on the second image and the first image to determine a spot image.

[0092] In one possible implementation, the generation unit 702 can also be used to filter the spot image to obtain a third image, binarize the third image to obtain a fourth image, and if the grayscale values ​​of the pixels in the fourth image are not unique, adjust at least one of the second delay, the third duration, and the second operating current according to the fourth image.

[0093] In one possible implementation, the generation unit 702 can also be used to determine the spot type of the spot image based on the grayscale value of each pixel in the fourth image, perform an image opening operation on the fourth image to obtain a fifth image, calculate the area of ​​the connected area in the fifth image, determine the connected area with the largest area as the spot area, determine the number of pixels in the spot area as the spot area, multiply the spot area with the third image, sort the values ​​in the multiplication result from large to small, and determine the average of the first n values ​​in the sorting as the spot depth, where n is an integer greater than or equal to 2, and adjust at least one of the second delay, the third duration, and the second working current based on the spot type, spot area, and spot depth.

[0094] Figure 8 is a schematic diagram of an electronic device provided in an embodiment of the present application, Fig. 9 is a schematic diagram of another electronic device provided in an embodiment of the present application, such as Figure 8 and Fig. 9 As shown, the electronic device 800 includes: a display screen 801, a distance sensor 802 and the distance detection device 700 in the above embodiments, the display screen 801 is electrically connected to the distance sensor 802, the display screen 801 can output a screen signal to the distance sensor 802, and the distance detection device 700 is used to execute the distance detection method in any of the above embodiments.

[0095] In one example, if Figure 8 and Fig. 9 As shown, the distance sensor 802 includes an infrared transmitting unit 8021 and an infrared receiving unit 8022. The infrared transmitting unit 8021 can transmit infrared signals, and the infrared receiving unit 8022 can receive infrared signals. Figure 8 FIG. 8 shows that the display screen 801 is electrically connected to the distance sensor 802. Fig. 9 It is shown that the display screen 801 is electrically connected to the infrared emitting unit 8021 of the distance sensor 802, and the specific electrical connection position is not limited in the embodiment of the present application.

[0096] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.

[0097] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor or programmable or dedicated hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the distance detection method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the distance detection method shown here, the execution of the code converts the general-purpose computer into a dedicated computer for executing the distance detection method shown here.

[0098] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.

[0099] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.

Claims

1. A distance detection method, applied to a distance detection device, characterized in that: include: Receiving a screen signal output by a display screen; Generate a driving signal according to the screen signal; The distance sensor is driven by the driving signal to cause the distance sensor to emit a first infrared signal, wherein a brightness change value of an area on the display screen irradiated by the first infrared signal is less than a brightness change threshold; The distance between the object to be identified and the display screen is determined according to at least a portion of the first infrared signal reflected by the object to be identified.

2. The method according to claim 1, characterized in that: The step of generating a driving signal according to the screen signal comprises: Delaying the screen signal for a first time period; The driving signal is obtained according to the screen signal after being delayed for the first time period.

3. The method according to claim 2, characterized in that The first duration is determined by: Driving the distance sensor by a first test signal so that the distance sensor emits a second infrared signal; According to the brightness change value of the area on the display screen illuminated by the second infrared signal, adjust the first delay of the first test signal relative to the screen signal until the brightness change value of the area on the display screen illuminated by the second infrared signal is less than the brightness change threshold, and determine the first delay as the first duration.

4. The method according to claim 2, characterized in that: The step of driving the distance sensor by a driving signal so that the distance sensor emits a first infrared signal includes: When the driving signal is received, a first operating current is output to the distance sensor, so that the distance sensor emits the first infrared signal with a duration of a second duration.

5. The method according to claim 4, characterized in that The first duration, the first operating current and the second duration are determined in the following manner: When receiving the second test signal, outputting a second operating current to the distance sensor, so that the distance sensor emits a third infrared signal having a third duration; determining a spot image of an area on the display screen illuminated by the third infrared signal; Adjust at least one of the second delay, the third duration and the second operating current of the second test signal relative to the screen signal according to the spot image until the brightness change value of the area on the display screen illuminated by the third infrared signal is less than the brightness change threshold, determine the second delay as the first duration, determine the third duration as the second duration, and determine the second operating current as the first operating current.

6. The method according to claim 5, characterized in that The determining of the spot image of the area on the display screen illuminated by the third infrared signal comprises: When the distance sensor does not emit the third infrared signal, acquiring a first image of the display screen; When the distance sensor transmits the third infrared signal, acquiring a second image of the display screen; A subtraction operation is performed on the second image and the first image to determine the spot image.

7. The method according to claim 5, characterized in that The step of adjusting at least one of a second delay of the second test signal relative to the screen signal, the third duration, and the second operating current according to the spot image comprises: Performing filtering processing on the spot image to obtain a third image; Performing binarization processing on the third image to obtain a fourth image; If the grayscale values ​​of the pixels in the fourth image are not unique, at least one of the second delay, the third duration and the second operating current is adjusted according to the fourth image.

8. The method according to claim 7, characterized in that The adjusting at least one of the second delay, the third duration, and the second operating current according to the fourth image comprises: determining a spot type of the spot image according to a grayscale value of each pixel in the fourth image; Performing an image opening operation on the fourth image to obtain a fifth image; Calculating the area of ​​the connected regions in the fifth image, and determining the connected region with the largest area as a spot region; Determine the number of pixels in the spot region as the spot area; Performing a multiplication operation on the spot area and the third image, sorting the values ​​in the multiplication result from large to small, and determining the average value of the first n values ​​in the sorting as the spot depth, where n is an integer greater than or equal to 2; At least one of the second delay, the third duration and the second operating current is adjusted according to the spot type, the spot area and the spot depth.

9. A distance detection device, characterized in that: include: A receiving unit, used for receiving a screen signal output by a display screen; A generating unit, configured to generate a driving signal according to the screen signal; a driving unit, configured to drive the distance sensor through a driving signal, so that the distance sensor emits a first infrared signal, wherein a brightness change value of an area on the display screen irradiated by the first infrared signal is less than a brightness change threshold; A determination unit is used to determine the distance between the object to be identified and the display screen according to at least a portion of the first infrared signal reflected by the object to be identified.

10. An electronic device, characterized in that: include: A display screen, a distance sensor, and a distance detection device as claimed in claim 9; The display screen is electrically connected to the distance sensor, and the distance detection device is used to execute the distance detection method as described in any one of claims 1-8.