Detection method, electronic device, storage medium, and program product
By using a ToF sensor to detect contaminants on the cover plate and determining the cover plate status by the ratio or difference of light source signal intensity, the problem of insufficient accuracy of the RGB image method in different scenarios is solved, and efficient and accurate camera contaminant detection is achieved.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2025-07-31
- Publication Date
- 2026-05-07
AI Technical Summary
In existing technologies, methods for judging camera contaminants based on RGB image imaging quality have low accuracy in different scenarios and are prone to false detections or missed detections.
A Time-of-Flight (ToF) sensor is used to emit a light source signal. The strength of the first echo signal reflected by the cover plate is compared with a preset threshold to determine whether there is a contaminant on the cover plate. Combined with the second echo signal reflected by the target object, a single-point or multi-point dToF sensor is used to perform accurate distance measurement and contaminant detection.
It improves the accuracy and efficiency of camera contaminant detection, reduces power consumption, is not limited by shooting scenarios, and simplifies computation.
Smart Images

Figure CN2025111825_07052026_PF_FP_ABST
Abstract
Description
Testing methods and electronic devices, storage media, and software products
[0001] This application claims priority to Chinese Patent Application No. 202411548999.3, filed with the State Intellectual Property Office of China on October 31, 2024, entitled "Detection Method and Electronic Device, Storage Medium and Program Product", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This disclosure relates to the field of computer technology, and in particular to a detection method, electronic device, storage medium, and program product. Background Technology
[0003] When users take photos with mobile phones or other electronic devices, the camera area is easily dirty, which affects the image quality. For example, fingerprints, oil stains, dust, etc. In related technologies, the image quality can usually be judged based on the image quality of the captured RGB image. However, this method is more limited by the scene, has low accuracy, and is prone to false detection or false negative. Summary of the Invention
[0004] This disclosure provides a testing method, an electronic device, a storage medium, and a program product.
[0005] In a first aspect, embodiments of this disclosure provide a detection method, comprising: emitting a light source signal based on a ToF sensor, acquiring a first echo signal reflected back to the ToF sensor via a cover plate; determining a first signal intensity of the first echo signal; and determining a detection result of the cover plate based on the first signal intensity and a second signal intensity.
[0006] The second signal strength is the signal strength of the echo signal reflected back to the ToF sensor after the ToF sensor emits a light source signal and is reflected by the cover plate in the first state. When the cover plate is in the first state, the pollutant index is less than a preset threshold, which can also be understood as the first state being a clean state. The second signal strength in the first state can be pre-calibrated, and then, during actual detection, the ToF sensor can emit a light source signal, and the first signal strength and the second signal strength of the first echo signal reflected by the cover plate can be compared to determine the detection result of the cover plate. For example, it can be determined whether the cover plate is in the first state or in the second state with pollutants. When the cover plate is in the second state, the pollutant index is greater than or equal to the preset threshold. This method is simple and convenient to implement, requires less computation, and compared with the method based on the quality of the captured image, the detection method disclosed herein is not limited by the scene and improves the detection accuracy.
[0007] In one alternative implementation, a cover plate covers the ToF sensor and the camera. In this way, the detection results of the cover plate can be used to characterize the detection results of the camera. That is, the detection of the cover plate can be used to determine whether there are contaminants in the camera and whether the camera's shooting is affected by contaminants, thereby improving accuracy.
[0008] In one alternative implementation, the signal strength of the echo signal reflected by the cover plate is different under different conditions of contamination and no contamination. Therefore, the detection result of the cover plate can be determined according to the ratio or difference between the first signal strength and the second signal strength, which is simple to implement and improves the detection efficiency.
[0009] In one optional implementation, when determining the detection result of the cover plate based on the ratio of the first signal intensity to the second signal intensity, specifically, it can be determined whether the ratio of the first signal intensity to the second signal intensity is greater than or equal to a first intensity threshold; when the ratio of the first signal intensity to the second signal intensity is greater than or equal to the first intensity threshold, the cover plate is determined to be in a second state; when the ratio of the first signal intensity to the second signal intensity is less than the first intensity threshold, the cover plate is determined to be in a first state. This method improves efficiency by determining the detection result through comparison of the ratio of the first signal intensity to the second signal intensity.
[0010] In one optional implementation, when determining the detection result of the cover plate based on the difference between the first signal strength and the second signal strength, specifically, it is determined whether the difference between the first signal strength and the second signal strength is greater than or equal to a second strength threshold. When the difference between the first signal strength and the second signal strength is greater than or equal to the second strength threshold, the cover plate is determined to be in a second state; when the difference between the first signal strength and the second signal strength is less than the second strength threshold, the cover plate is determined to be in a first state. In this way, the presence of contaminants on the cover plate can be determined by comparing the difference in signal strength reflected by the cover plate. The calculation is simple and efficient, and it also reduces power consumption and improves accuracy.
[0011] In one optional implementation, in this embodiment of the present disclosure, after the ToF sensor emits a light source signal, it will receive not only a first echo signal reflected from the cover plate, but also a second echo signal reflected from the target object. Based on this, in this embodiment of the present disclosure, the cover plate can also be detected based on the second echo signal. The ToF sensor may include a single-point dToF sensor or a multi-point dToF sensor. Different implementation methods are provided based on different types of ToF sensors. When the ToF sensor is a single-point dToF sensor, for example: the second echo signal reflected back to the ToF sensor via the target object is acquired; a first distance value between the target object and the single-point dToF sensor is determined based on the reception time of the second echo signal and the emission time of the light source signal; when the first distance value is less than or equal to a first distance threshold, the cover plate is determined to be in a second state.
[0012] In the case of a single-point dToF sensor, the first distance value between the target object and the ToF sensor can be obtained. By judging the first distance value, it is possible to detect whether the target object is close to the ToF sensor. When the target object is close to the ToF sensor, it can be said that it is blocking the cover plate. At this time, the cover plate is determined to be in the second state. The method is simple to implement and improves efficiency.
[0013] In one optional implementation, when the ToF sensor is a multi-point dToF sensor, compared to a single-point ToF sensor, the multi-point ToF sensor emits multiple light source signals simultaneously. This allows the multi-point ToF sensor to obtain multiple third echo signals reflected from the target object, thus acquiring multiple second distance values between the target object and the multi-point ToF sensor. When the number of second distance values less than or equal to a second distance threshold is greater than or equal to a first quantity threshold, the cover is determined to be in a second state. This cover detection based on a multi-point dToF sensor offers a wider field of view, expands the applicable scene range, and further improves detection accuracy.
[0014] In one optional implementation, the first echo signal and the second echo signal received by the ToF sensor may overlap, causing the aforementioned detection based on the first echo signal or the second echo signal to fail. Therefore, in this embodiment, when the ToF sensor is a single-point dToF sensor, a third distance threshold can be preset. This third distance threshold is greater than or equal to the minimum distance at which the first echo signal and the second echo signal can be distinguished. After determining the first distance value between the target object and the single-point dToF sensor, when the first distance value is determined to be greater than or equal to the third distance threshold, the detection method based on the first signal strength of the first echo signal can take effect, thereby enabling the execution of the detection method based on the first echo signal and improving detection accuracy.
[0015] In one optional implementation, when the ToF sensor is a multi-point dToF sensor, a third distance threshold can be preset, and a fourth distance threshold can be set to be greater than or equal to the minimum distance at which the first echo signal and the third echo signal can be distinguished. Based on the multi-point dToF sensor, multiple second distance values between the target object and the multi-point dToF sensor are determined. When the number of the multiple first distance values that are greater than or equal to the fourth distance threshold is greater than or equal to the second number threshold, the detection method based on the first signal strength of the first echo signal can take effect. Thus, in this embodiment of the present disclosure, by judging the distance between the target object and the ToF sensor, it is possible to identify whether the first echo signal can be accurately distinguished, and then the cover plate can be accurately detected based on the first echo signal, thereby improving the detection accuracy.
[0016] In one alternative implementation, the detection method in this embodiment can be applied to a shooting scenario. In response to a shooting command, the ToF sensor is triggered to emit a light source signal, and the detection result of the cover plate is determined based on the above detection method. A first prompt message can be displayed on the shooting interface. The first prompt message is used to indicate the detection result of the cover plate, which can prompt the user whether there are contaminants in the camera. Thus, the user can know whether the cover plate needs to be cleaned, thereby improving the shooting quality.
[0017] In one optional implementation, the detection method in this embodiment can be applied to a functional detection scenario. In response to a user's operation, a first application is opened and a first interface is displayed. In response to an operation on the first interface, a ToF sensor is triggered to emit a light source signal, such as when the user clicks a detection function control on the first interface. Then, based on the aforementioned detection method, the detection result of the cover plate is determined, and a second interface is displayed. The second interface includes a second prompt message indicating the detection result of the cover plate. This achieves the detection function of the camera, is efficient and convenient, and enhances the functionality, thereby improving the user experience.
[0018] In a second aspect, this disclosure provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores one or more computer programs executable by the at least one processor, the one or more computer programs being executed by the at least one processor to enable the at least one processor to perform the detection method described above.
[0019] Thirdly, this disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-described detection method.
[0020] Fourthly, this disclosure provides a computer program product that includes computer-readable code or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the detection method described above.
[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0022] The accompanying drawings are provided to further illustrate the present disclosure and form part of the specification. They are used together with the embodiments of the present disclosure to explain the disclosure and do not constitute a limitation thereof. The above and other features and advantages will become more apparent to those skilled in the art from the detailed description of exemplary embodiments with reference to the accompanying drawings, in which:
[0023] Figure 1 is a schematic diagram of the camera and TOF sensor in the electronic device in an embodiment of this disclosure;
[0024] Figure 2 is a schematic diagram of the TOF sensor in an embodiment of this disclosure;
[0025] Figure 3 is a schematic diagram of the echo signals reflected by the cover plate under different states in the embodiments of this disclosure;
[0026] Figure 4 is a histogram of the echo signal received by the dToF sensor in an embodiment of this disclosure;
[0027] Figure 5 is a schematic diagram of a user interface in an embodiment of this disclosure;
[0028] Figure 6 is a schematic diagram of another user interface in an embodiment of this disclosure;
[0029] Figure 7 is a block diagram of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0030] To enable those skilled in the art to better understand the technical solutions of this disclosure, exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments of this disclosure to aid understanding. These should be considered merely exemplary. Therefore, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0031] Where there is no conflict, the various embodiments of this disclosure and the features thereof in the embodiments may be combined with each other.
[0032] As used herein, the term “and / or” includes any and all combinations of one or more related enumerated entries.
[0033] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. As used herein, the singular forms “a” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that when the terms “comprising” and / or “made of” are used in this specification, the presence of the stated feature, integral, step, operation, element, and / or component is specified, but the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof is not excluded. Words such as “connected” or “linked” are not limited to physical or mechanical connections but can include electrical connections, whether direct or indirect.
[0034] Unless otherwise specified, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined herein.
[0035] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0036] Electronic devices can be configured with various components to enrich their functions and provide users with a better user experience. For example, electronic devices may include microphones, speakers, cameras, and time-of-flight (TOF) sensors. For instance, referring to Figure 1, which is a schematic diagram of a camera and a TOF sensor in an electronic device according to an embodiment of this disclosure, taking a rear camera in an electronic device as an example, multiple rear cameras and TOF sensors can be set on the back of the electronic device. At least one rear camera and TOF sensor can have a common cover plate. The cover plate mainly serves a protective function, protecting against physical damage and preventing dust and moisture intrusion. Depending on the needs of different electronic devices, the cover plate can be made of different materials. For example, the cover plate can be made of glass, which has high transparency and less interference with light entry, ensuring the imaging quality of the rear camera. Alternatively, the cover plate can be made of metal, which not only provides better protection but also enhances the texture of the electronic device. Or, the cover plate can be made of plastic, which is lighter and easier to mold through processes such as injection molding, allowing for more flexible design.
[0037] As shown in Figure 1, taking three rear cameras as an example, the system includes camera 101, camera 102, camera 103, and TOF sensor 104. Cameras 101, 102, 103, and TOF sensor 104 are covered by a common cover plate. Different cameras can have different configurations. TOF sensor 104 can be used to assist the cameras in achieving more advanced photography functions, 3D TOF face recognition functions, improving focus accuracy, and other functions. TOF sensor 104 can be set adjacent to the three cameras. As shown in Figure 1, TOF sensor 104 can be set at position a or position b, etc., and this embodiment does not impose any restrictions.
[0038] Among them, the TOF sensor 104 can be an indirect time-of-flight (iToF) sensor or a direct time-of-flight (dToF) sensor. The iToF sensor mainly calculates the distance and depth of an object by measuring the phase difference between the emitted light signal and the received signal, while the dToF sensor mainly calculates the distance of an object by directly measuring the time it takes for the light signal to travel from emission to reflection back from the object.
[0039] For example, the electronic devices in this disclosure may be mobile phones, tablets, desktops, laptops, handheld computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cellular phones, personal digital assistants (PDAs), wearable electronic devices, augmented reality (AR) or virtual reality (VR) devices, robots, robot vacuum cleaners, laser rangefinders, night vision devices, infrared monitoring equipment, industrial TOF detection equipment, vehicle-mounted equipment, etc. This disclosure does not limit the electronic devices.
[0040] Taking mobile phones as an example, when users use mobile phones, it is easy for contaminants such as fingerprints, oil stains, and dust to be generated at the camera position, which will affect the image quality of the photos taken and affect the user experience.
[0041] Currently, the image quality of a lens can be assessed based on red / green / blue (RGB) to determine if it contains contaminants. However, this method is easily limited by the scene and has low accuracy in many scenarios, such as night scenes, moving scenes, out-of-focus scenes, cloudy or foggy days, and scenes where the subject is dusty. In these scenarios, the image itself may be blurry, unclear, or of low quality due to scene factors. Therefore, judging whether a lens contains contaminants based on image quality is prone to false positives or false negatives.
[0042] Referring to Figure 2, which is a schematic diagram of a TOF sensor in an embodiment of this disclosure, the TOF sensor includes a transmitting device 201 and a receiving device 202, wherein both the transmitting device 201 and the receiving device 202 are located below the cover plate. Taking the dToF sensor as an example, the transmitting device 201 of the dToF sensor emits a light source signal outward. The light source signal is emitted to the target object through the cover plate and reflected back by the target object. The second echo signal P2 generated by the reflection of the target object is received by the receiving device 202. By measuring the emission time of the light source signal and the reception time of the second echo signal P2, the distance to the target object can be calculated.
[0043] Furthermore, the light source signal will also generate a first echo signal P1 after being reflected by the cover plate. The first echo signal P1 reflected by the cover plate can also be received by the receiving device 202. However, the signal strength of the first echo signal P1 received is different when the cover plate is clean, contaminated, or blocked.
[0044] For example, referring to Figure 3, which is a schematic diagram of the echo signals reflected by the cover plate in different states in an embodiment of this disclosure, Figure 3 shows the echo signals reflected when the cover plate is in a clean state and in a state with contaminants. In the figure, the horizontal axis represents time and the vertical axis represents intensity. The dToF sensor can transmit and receive multiple signals within a single frame measurement time and perform statistics on the recorded flight time. The frequency of occurrence of different flight times can represent the signal strength. As shown in Figure 3, the signal strength of the echo signal 11 (solid line in Figure 3) reflected when the cover plate is in a state with contaminants is greater than the signal strength of the echo signal 22 (dashed line in Figure 3) reflected when the cover plate is in a clean state. That is, due to the influence of contaminants on the cover plate, the echo signal reflected by the cover plate will be enhanced.
[0045] When calculating the signal strength of the echo signal, it can be the highest value of the frequency, i.e., the peak value of the curve in Figure 3, or it can be the average value of the signal strength within a certain range including the peak value. As shown in Figure 3, the signal strength can be obtained by averaging the signal strength values within a certain range before and after the peak value of the curve. For example, one possible example is to average the values of the vertical axis corresponding to the time interval [4,8] of the horizontal axis of the curve of echo signal 11 in Figure 3 to obtain the signal strength of echo signal 11.
[0046] Therefore, this disclosure provides a detection method that can detect contaminants on a cover plate based on a TOF sensor in an electronic device as shown in Figure 1. The second signal intensity of the echo signal when the cover plate is clean can be pre-calibrated. Then, during the actual detection process, the first signal intensity of the first echo signal actually received by the cover plate is obtained. Based on the second signal intensity and the first signal intensity, it can be determined whether there are contaminants on the cover plate. This method is not limited by the shooting scene, reduces the possibility of missed detections or false detections, improves accuracy, and has a relatively simple calculation method, which reduces power consumption and improves detection efficiency.
[0047] Furthermore, in this embodiment, detection can be based on a dToF sensor. Because the counting accuracy of the time-to-digital converter (TDC) of a dToF sensor is typically on the order of picoseconds (ps), it has high time accuracy. Therefore, it can more accurately measure the round-trip time of the light source signal. Also, due to its high time accuracy, the dToF sensor can divide space into smaller slices; 1 ps corresponds to a very small spatial distance. Therefore, the dToF sensor can more accurately measure and distinguish objects at different distances. In other words, the dToF sensor can better distinguish whether the reflected echo signal comes from the cover plate or the target object in front, thus improving detection accuracy.
[0048] The detection method in the embodiments of this disclosure will be described in detail below.
[0049] For example, one detection method in this disclosure includes:
[0050] S410: In response to a detection request for the cover plate, acquire a first echo signal, which is a light source signal emitted by the ToF sensor and reflected back to the ToF sensor via the cover plate.
[0051] The camera can be a rear camera or a front camera in an electronic device, and this embodiment does not limit the scope of the invention. In one example, the ToF sensor and the camera share a common cover plate. The cover plate covers both the ToF sensor and the camera. The cleanliness of the cover plate affects the shooting quality of the camera. Therefore, by detecting whether there are contaminants on the cover plate, it can be determined whether the camera shooting is interfered with by external contaminants. That is, the detection result of the cover plate can be used to characterize the detection result of the camera.
[0052] S420: Determine the first signal strength of the first echo signal.
[0053] In some possible embodiments, in real-world scenarios, especially in outdoor scenarios, noise may interfere with the echo signal. The noise can come from multiple sources, such as ambient light noise and background noise in the natural environment, which will be superimposed on the first echo signal and affect the accuracy of the first signal strength of the first echo signal. Therefore, in order to further improve the accuracy, the true first signal strength can be restored based on the current noise level to eliminate the influence of actual noise on the first signal strength.
[0054] For example, in this embodiment of the present disclosure, when determining the first signal strength of the first echo signal, the noise strength of the noise signal can be obtained first, and the first echo signal can be noise-cancelled according to the noise strength and the noise interference mapping function, so as to determine the first signal strength according to the first echo signal after noise cancellation, wherein the noise interference mapping function represents the mapping relationship between the noise, interference signal strength and non-interference signal strength.
[0055] For example, in this embodiment of the present disclosure, the influence of noise on the first echo signal can also be reduced in other ways, such as by adjusting the relevant parameters of the ToF sensor in combination with the ambient light intensity monitored by the ambient light sensor, so as to reduce the influence of ambient light, etc. This embodiment of the present disclosure does not limit this.
[0056] Thus, in this embodiment of the present disclosure, the influence of noise on the first echo signal can be eliminated first, thereby improving the accuracy of the first signal strength of the first echo signal.
[0057] S430: Based on the first signal strength and the second signal strength, obtain the detection result of the cover plate. The second signal strength is the signal strength of the echo signal of the ToF sensor after the ToF sensor emits a light source signal and is reflected back to the ToF sensor by the cover plate in the first state.
[0058] The first state indicates that the pollutant index on the cover is less than the preset threshold. This can be understood as the first state indicating a high degree of cleanliness, with the cover basically in a clean state, and having little impact on the image quality captured by the camera.
[0059] For example, the detection result of the cover plate can be determined based on the ratio or difference between the first signal intensity and the second signal intensity.
[0060] For example, if the ratio of the first signal intensity to the second signal intensity is greater than or equal to the first intensity threshold, it is determined that there is a contaminant on the cover plate, and the cover plate is in the second state. The second state indicates that the contaminant index on the cover plate is greater than or equal to the preset threshold, which means that there may be contaminants such as fingerprints and dust particles on the cover plate. If the ratio between the first signal intensity and the second signal intensity is less than the first intensity threshold, it is determined that there is no contaminant on the cover plate, which means that the cover plate is in the first state at this time.
[0061] Another possible example is that if the difference between the first signal strength and the second signal strength is greater than or equal to the second strength threshold, the cover is determined to be in the second state, indicating that there is contaminant on the cover. If the difference between the first signal strength and the second signal strength is less than the second strength threshold, the cover is determined to be in the first state, indicating that the cover is basically clean and there is no contaminant.
[0062] Of course, in this embodiment of the present disclosure, other methods can be used for step S430 above to obtain the detection result by comparing the first signal intensity and the second signal intensity, and there is no limitation on this.
[0063] Thus, in this embodiment of the present disclosure, the detection result of the cover plate can be obtained by emitting a light source signal based on the ToF sensor and then comparing the first signal strength of the first echo signal reflected by the cover plate with the second signal strength in the first state. This method is relatively simple to implement, requires less computation, reduces power consumption and improves efficiency. Furthermore, this method is not limited by the scene and improves the detection accuracy of the camera.
[0064] For example, after the ToF sensor emits a light source signal, it will receive not only the first echo signal reflected from the cover plate, but also the second echo signal reflected from the target object. Based on this, this disclosure also provides a detection method.
[0065] Furthermore, in this embodiment of the disclosure, taking the ToF sensor as an example, the dToF sensor can include a single-point dToF sensor or a multi-point dToF sensor. A single-point dToF sensor can only measure the distance of one point, providing only distance information for a specific location at a time. It is typically suitable for applications that measure the distance of a single point, such as rangefinders and liquid level detection. Moreover, its structure is relatively simple and its cost is low. A multi-point dToF sensor, on the other hand, can measure the distance of multiple points simultaneously, thereby generating a depth map of the target area. Therefore, multi-point dToF sensors are typically suitable for applications such as building 3D models, 3D maps, environmental perception, and object recognition.
[0066] For example, when the dToF sensor is a single-point dToF sensor, one detection method in this disclosure embodiment includes:
[0067] S510: After the ToF sensor emits a light source signal, it acquires the second echo signal reflected back to the ToF sensor by the target object.
[0068] S520: Based on the reception time of the second echo signal and the emission time of the light source signal, obtain the first distance value between the target object and the ToF sensor.
[0069] S530: When the first distance value is less than or equal to the first distance threshold, the cover plate is determined to be in the second state, which means that there are contaminants on the cover plate.
[0070] The first distance threshold can be preset based on experience and actual conditions. This embodiment does not impose any restrictions. In this embodiment, the ToF sensor and the camera are covered by a common cover plate. When the first distance value between the target object and the ToF sensor is small, it indicates that the target object is also close to the camera. For example, it may be close to the cover plate on the camera, which will affect the normal shooting of the camera. Therefore, it can be considered that the cover plate is obstructing the view.
[0071] S540: When the first distance value is greater than the first distance threshold, it means that the target object is far away from the ToF sensor and will not block the cover plate on the camera. In this case, it can only be determined that the target object does not block the cover plate. However, there may still be fingerprints, dust and other dirt on the cover plate, which will affect the shooting quality. Therefore, in order to further detect contaminants on the cover plate, when the first distance value is greater than the first distance threshold, the detection method of steps S410-S430 above can be further combined to obtain the final detection result of the cover plate.
[0072] For example, when the dToF sensor is a multi-point dToF sensor, compared to a single-point ToF sensor, the multi-point ToF sensor can obtain the distances of multiple points. Therefore, based on the pollutant detection method of a single-point ToF sensor, an addition can be made to determine the number of distance values between the obtained target object and the ToF sensor. To illustrate this more clearly, let's take the case where the target object reflects multiple third echo signals in the case of a multi-point dToF sensor as an example.
[0073] One detection method in this disclosure includes:
[0074] S610: Acquire multiple third echo signals. These multiple third echo signals are emitted by the multi-point dToF sensor at one time from multiple light source signals and reflected back to the multi-point dToF sensor by the target object.
[0075] S620: Determine multiple second distance values between the target object and the multi-point ToF sensor.
[0076] Similarly, multiple second distance values between the target object and the multi-point ToF sensor can be determined based on the reception time of multiple third echo signals and the emission time of multiple light source signals.
[0077] S620: Determine whether the number of the second distance values that are less than or equal to the second distance threshold is greater than or equal to the first quantity threshold.
[0078] S630: When the determination is yes, it is determined that the cover is in the second state and there is a contaminant on the cover.
[0079] In this embodiment of the disclosure, the multi-point dToF sensor can emit a light source signal with a large field of view, and then receive multiple third echo signals returned by multiple pixels of the target object through its multiple receiving devices. If most of the first distance values of these pixels from the dToF sensor are less than the second distance threshold, it indicates that the target object is close to the ToF sensor, which will affect the normal shooting of the camera. Therefore, it can be determined that there is a contaminant blocking the cover.
[0080] S640: If the result is negative, similar to the case of a single-point ToF sensor, it means that the target object is far away from the ToF sensor and the target object is not obstructed by the cover plate. However, it is still necessary to further detect whether there are fingerprints, dust or other dirt on the cover plate. Therefore, if the result is negative, the contaminant detection method of steps S410-S430 above can be further combined to obtain the contaminant detection result of the cover plate.
[0081] Thus, in this embodiment of the present disclosure, contaminant detection based on a multi-point dToF sensor can combine multiple echo signals reflected from the cover plate and the target object for detection, which can further improve the accuracy of detection. Furthermore, the multi-point dToF sensor can also improve the applicable range of scenes. This is because the effective field of view of a single-point dToF laser is relatively small. For example, in scenes with multiple depths of field, if the foreground is close, effective contaminant detection may not be possible. However, the field of view of a multi-point dToF sensor is larger, and in scenes with multiple depths of field, some pixels that are not covered by the foreground can still be detected as contaminants.
[0082] Furthermore, taking a single-point ToF sensor as an example, after the ToF sensor emits a light source signal, it may simultaneously receive a first echo signal reflected from the cover plate and a second echo signal reflected from the target object. In some possible embodiments, as shown in Figure 2, if the time interval between the reflections of P1 and P2 back to the ToF sensor in Figure 2 is short, signal overlap will occur, making it impossible to accurately distinguish between the first echo signal reflected from the cover plate and the second echo signal reflected from the target object. This limits the detection of pollutants based on the first or second echo signal in the above embodiments. Referring to Figure 4, which is a histogram of the echo signals received by the dToF sensor in this embodiment, the dToF sensor will emit and receive multiple signals within a single frame measurement time and record them. Histograms were plotted for multiple flight times. The flight time with the highest frequency was used to calculate the depth of the target object or cover plate. Figure 4 shows the flight time histogram based on a single pixel. In Figure 4(a), the target object is relatively close, and the signals on the histogram overlap. In Figure 4(b), the target object is relatively far away, and there are clearly two histograms with a certain interval. The longer the time, the farther the distance. As shown in Figure 4(b), the histogram corresponding to the larger part of the horizontal axis time is the target object, and the histogram corresponding to the smaller part of the horizontal axis time is the cover plate. Therefore, it can be seen that P1 and P2 can only be distinguished when the target object is a certain distance away from the cover plate, so that the first signal strength of the first echo signal can be accurately determined.
[0083] Therefore, in this embodiment of the present disclosure, before step S420, a step can be added to identify whether the second echo signal reflected by the target object will overlap with the first echo signal reflected by the cover plate by judging the first distance value between the target object and the TOF sensor.
[0084] For example, when the dToF sensor is a single-point dToF sensor, step S440 may be included before step S420: determining whether the first distance value between the target object and the single-point TOF sensor is greater than or equal to a third distance threshold. When the first distance value is greater than or equal to the third distance threshold, step S420 can be executed. When the first distance value is less than the third distance threshold, the first echo signal and the second echo signal may overlap, and the first echo signal cannot be accurately identified. In this case, the pollutant detection result can be output as unidentified.
[0085] The third distance threshold can be determined based on the pulse width of the light source signal emitted by the dToF sensor. When the pulse width is narrower, the second echo signal reflected by the target object may arrive at the receiving device of the dToF sensor before the first echo signal reflected by the cover plate disappears. This will cause the two echo signals to overlap. By analyzing the minimum distance between P1 and P2 received under the pulse width of the light source signal that do not overlap or can be separated, the third distance threshold can be set to a value equal to or greater than the minimum distance. This embodiment does not impose any restrictions on this. For example, the pulse width can usually be expressed as the full width at half maximum (FWHM), which is the width corresponding to half of the maximum value of the light source signal energy. For example, the full width at half maximum is 2.35δ, and the full width is 6δ. Considering the complexity of the light path reflected by the cover plate and the target object, the second distance threshold can be set to be greater than or equal to 4δ.
[0086] For example, when the dToF sensor is a multi-point dToF sensor, step S450 may be included before step S420: determining whether the number of second distance values between the target object and the multi-point TOF sensor that are greater than or equal to the fourth distance threshold is greater than or equal to the second quantity threshold. If yes, step S420 can be executed. If no, the first echo signal and the third echo signal may overlap, and the first echo signal cannot be accurately identified. In this case, the pollutant detection result can be output as not identified.
[0087] Wherein, the fourth distance threshold is greater than or equal to the minimum distance at which the first echo signal and the third echo signal can be distinguished. Thus, in this embodiment of the present disclosure, when it is determined that the second distance value between the target object and the TOF sensor is greater than or equal to the fourth distance threshold, the method of detection based on the first signal intensity of the first echo signal can be effective. Of course, furthermore, when it is determined that the second distance value between the target object and the TOF sensor is less than the fourth distance threshold, the method of detection based on the first signal intensity of the first echo signal cannot be effective, and the pollutant detection result can be output as unrecognized.
[0088] Furthermore, in this embodiment of the present disclosure, when contaminant interference is detected on the cover plate, a prompt message can be displayed to alert the user that the cover plate is dirty or obstructed, so that the user can clean the cover plate or remove the obstruction to improve the shooting quality of the camera.
[0089] In this embodiment of the disclosure, the application scenarios of the cover plate detection method are not limited. For example, it can be applied to mobile phones, laser rangefinders, robot vacuum cleaners, vehicle-mounted LiDAR, vehicle-mounted computers, AR devices, VR devices, robots, industrial TOF detection equipment, night vision devices, infrared monitoring equipment, etc. Taking a mobile phone as an electronic device as an example, the embodiments of this disclosure are further described.
[0090] Figure 5 is a schematic diagram of a user interface in an embodiment of this disclosure.
[0091] Mobile phones can install various applications, such as camera, gallery, calendar, social media, and video apps. The phone's screen displays app icons; Figure 5(a) only shows the camera icon. When the phone detects a user tapping the camera icon, it can display the camera shooting interface as shown in Figure 5(b). As shown in Figure 5(b), the preview image can be displayed in the preview area of the camera shooting interface, and it can also include various functional controls, such as a shutter button and controls for selecting various shooting modes.
[0092] Furthermore, in this embodiment, upon entering the camera shooting interface, the detection method described in this embodiment can be triggered. Taking a single-point ToF sensor as an example, an image is captured by the rear camera of the mobile phone, and a ToF sensor located under the same cover plate as the rear camera emits a light source signal. Based on the first echo signal received by the ToF sensor from the cover plate of the rear camera and the second echo signal reflected by the target object, it can be determined whether there is contaminant on the cover plate of the rear camera. When contaminant is detected, a first prompt message can be displayed in the camera shooting interface. For example, as shown in Figure 5(b), the first prompt message is: "There is contaminant on the rear camera, please clean it!" The first prompt message can be displayed continuously until no contaminant is detected on the rear camera, or it can be displayed for a preset time and then automatically disappear. Additionally, during the display of the first prompt message, the user can also choose to manually turn it off; this is not limited in this embodiment.
[0093] Then, based on the first prompt, the user cleans the cover of the rear camera and detects no contaminants. At this time, a second prompt can be displayed on the camera shooting interface. For example, as shown in Figure 5(c), the second prompt is: "The rear camera is clean and can be used for shooting normally".
[0094] Thus, in this embodiment of the present disclosure, the camera can be detected during shooting to determine whether the camera is dirty or obstructed, which can promptly remind the user to clean it, improve the quality of the captured image, and enhance the user experience.
[0095] Figure 6 is a schematic diagram of another user interface in an embodiment of this disclosure.
[0096] The phone can also have an application installed to detect whether there are contaminants in the camera, or an application can integrate a mini-program or function to detect whether there are contaminants in the camera. In Figure 6(a), the user clicks the function icon on the phone. If the function icon is "Camera Detection", when the phone detects that the user has clicked the function icon, it can display the detection result interface as shown in Figure 6(b).
[0097] For example, in this embodiment of the present disclosure, when the detection function is enabled, detection can be performed simultaneously. Based on the ToF sensor of the rear camera, the detection result for the camera can be obtained through the detection method described in this embodiment of the present disclosure. The detection result can be displayed in the detection result interface. For example, as shown in Figure 6(b), the detection result is: "There are contaminants in the rear camera. Please clean it in time!".
[0098] In this embodiment of the disclosure, users can use the function of detecting whether there are contaminants on the cover plate in the electronic device according to their needs, which enriches the function of the electronic device, improves the user experience, and improves the detection accuracy and makes the implementation simpler by using the ToF sensor in the electronic device.
[0099] It should be noted that the interface diagrams in this embodiment are only one possible example, and the icons, layout, and other information in the interface should not limit the pollutant detection method in this embodiment.
[0100] It is understood that the various method embodiments mentioned above in this disclosure can be combined with each other to form combined embodiments without violating the principle and logic. Due to space limitations, this disclosure will not elaborate further. Those skilled in the art will understand that in the above methods of specific implementation, the specific execution order of each step should be determined by its function and possible internal logic.
[0101] Figure 7 is a structural block diagram of an electronic device provided in an embodiment of this disclosure.
[0102] As shown in Figure 7, the electronic device 700 may include: a processor 710, an external memory interface 720, an internal memory 721, a universal serial bus (USB) interface 730, a charging management module 740, a power management module 741, a battery 742, an antenna 1, an antenna 2, a mobile communication module 750, a wireless communication module 760, an audio module 770, a speaker 770A, a receiver 770B, a microphone 770C, a headphone jack 770D, a sensor module 780, buttons 790, a motor 791, an indicator 792, a camera 793, a display screen 794, and a subscriber identification module (SIM) card interface 795, etc. The sensor module 780 may include a pressure sensor 780A, a gyroscope sensor 780B, a barometric pressure sensor 780C, a magnetic sensor 780D, an accelerometer sensor 780E, a distance sensor 780F, a proximity sensor 780G, a fingerprint sensor 780H, a temperature sensor 780J, a touch sensor 780K, an ambient light sensor 780L, a ToF sensor 780M, etc.
[0103] It is understood that the structures illustrated in the embodiments of this disclosure do not constitute a specific limitation on the electronic device 700. In other embodiments of this application, the electronic device 700 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0104] The processor 710 may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors. The controller can generate operation control signals based on the instruction opcode and timing signals to control instruction fetching and execution.
[0105] The processor 710 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 710 is a cache memory. This memory can store instructions or data that the processor 710 has just used or that are being used repeatedly. If the processor 710 needs to use the instruction or data again, it can directly retrieve it from the memory. For example, the computer code instructions of the detection method in this embodiment can be stored in the memory, and then, when a detection request is triggered, the processor 710 can call the computer code instructions in the memory to execute the detection method described above.
[0106] Electronic device 700 can achieve shooting function through ISP, camera 793, video codec, GPU, display 794 and application processor.
[0107] The camera 793 may include a front-facing camera and a rear-facing camera. In the electronic device 700, the camera 793 is usually equipped with a cover for protection. During the shooting process, the camera 793 can use auxiliary information from other sensors to improve the shooting quality. For example, the ToF sensor 780M is located under the same cover of the camera 793. During the shooting process, the ToF sensor 780M can be used to detect the cover.
[0108] The USB port 730 is a USB standard compliant interface, which can be a Mini USB port, Micro USB port, USB Type-C port, etc. The USB port 730 can be used to connect a charger to charge electronic device 700, and can also be used for data transfer between electronic device 700 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.
[0109] The charging management module 740 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 740 receives charging input from the wired charger via a USB interface 730. In some wireless charging embodiments, the charging management module 740 receives wireless charging input via the wireless charging coil of the electronic device 700. While charging the battery 742, the charging management module 740 can also supply power to the electronic device via the power management module 741.
[0110] The power management module 741 connects the battery 742, the charging management module 740, and the processor 710. The power management module 741 receives input from the battery 742 and / or the charging management module 740, providing power to the processor 710, internal memory 721, display screen 794, camera 793, and wireless communication module 760, etc. The power management module 741 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 741 may also be located within the processor 710. In other embodiments, the power management module 741 and the charging management module 740 may be located in the same device.
[0111] The wireless communication function of electronic device 700 can be implemented through antenna 1, antenna 2, mobile communication module 750, wireless communication module 760, modem processor and baseband processor, etc.
[0112] Electronic device 700 implements display functions through a GPU, a display screen 794, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 794 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 710 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0113] The external memory interface 720 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 700. The external memory card communicates with the processor 710 through the external memory interface 720 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0114] Internal memory 721 can be used to store computer executable program code, which includes instructions. Internal memory 721 may include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as file transfer function, photo album function, etc.), etc. The data storage area may store data created during the use of electronic device 700 (such as files, photos, videos, etc.).
[0115] Electronic device 700 can implement audio functions such as music playback and recording through audio module 770, speaker 770A, receiver 770B, microphone 770C, headphone jack 770D, and application processor.
[0116] Buttons 790 include a power button, volume buttons, etc. Buttons 790 can be mechanical buttons or touch-sensitive buttons. Electronic device 700 can receive button input and generate key signal inputs related to user settings and function control of electronic device 700.
[0117] Motor 791 can generate vibration alerts. Motor 791 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can be corresponding to touch operations applied to different applications (such as taking photos, playing audio, etc.). Motor 791 can also provide different vibration feedback effects for touch operations applied to different areas of the display screen 794.
[0118] Indicator 792 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0119] The SIM card interface 795 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 795 to establish contact with the electronic device 700. The electronic device 700 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 795 supports Nano SIM cards, Micro SIM cards, and other SIM cards. Multiple cards can be inserted into the same SIM card interface 795 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 795 is also compatible with different types of SIM cards. The SIM card interface 795 is also compatible with external memory cards. The electronic device 700 interacts with the network through the SIM card to achieve functions such as voice calls and data communication.
[0120] It will be apparent to those skilled in the art that some of the specific details presented above regarding electronic device 700 may not be necessary for practicing the particular embodiment or its equivalent. Similarly, other electronic devices may include a greater number of modules, components, etc. Where appropriate, some modules may be implemented as software or hardware. Therefore, it should be understood that the above description is not intended to be exhaustive or to limit this application to the precise forms set forth herein. Rather, it will be apparent to those skilled in the art that many modifications and variations are possible in light of the above teachings.
[0121] This disclosure also provides a computer-readable storage medium storing a computer program thereon, wherein the computer program, when executed by a processor, implements the detection method described above. The computer-readable storage medium may be volatile or non-volatile.
[0122] This disclosure also provides a computer program product, including computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the detection method described above.
[0123] Those skilled in the art will understand that all or some of the steps, systems, and apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software can be distributed on a computer-readable storage medium, which may include computer storage media (or non-transitory media) and communication media (or transient media).
[0124] As is known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable program instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, it is known to those skilled in the art that communication media typically contain computer-readable program instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0125] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0126] Computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions to implement various aspects of this disclosure.
[0127] The computer program product described herein can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.
[0128] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0129] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0130] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0131] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0132] Example embodiments have been disclosed herein, and while specific terminology has been used, it is for illustrative purposes only and should be construed as such, and is not intended to be limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in connection with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in connection with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.
Claims
1. A detection method, characterized in that, include: Acquire the first echo signal, which is the light source signal emitted by the ToF sensor and reflected back to the ToF sensor by the cover plate; Determine the first signal strength of the first echo signal; The detection result of the cover plate is determined based on the first signal strength and the second signal strength. The second signal strength is the signal strength of the echo signal reflected back to the ToF sensor after the ToF sensor emits a light source signal and is reflected back to the ToF sensor through the cover plate in the first state. The pollutant index of the cover plate in the first state is less than a preset threshold.
2. The method according to claim 1, characterized in that, The cover plate covers the ToF sensor and the camera, and the detection result of the cover plate is used to characterize the detection result of the camera.
3. The method according to claim 1 or 2, characterized in that, Determining the detection result of the cover plate based on the first signal strength and the second signal strength includes: The detection result of the cover plate is determined based on the ratio or difference between the first signal strength and the second signal strength.
4. The method according to claim 1 or 2, characterized in that, Determining the detection result of the cover plate based on the first signal strength and the second signal strength includes: When the ratio of the first signal strength to the second signal strength is greater than or equal to the first strength threshold, the cover plate is determined to be in the second state, and the pollutant index of the cover plate in the second state is greater than or equal to the preset threshold. When the ratio between the first signal strength and the second signal strength is less than the first strength threshold, the cover plate is determined to be in the first state.
5. The method according to claim 1 or 2, characterized in that, Determining the detection result of the cover plate based on the first signal strength and the second signal strength includes: When the difference between the first signal strength and the second signal strength is greater than or equal to the second strength threshold, the cover plate is determined to be in the second state, and the pollutant index of the cover plate in the second state is greater than or equal to the preset threshold. When the difference between the first signal strength and the second signal strength is less than the second strength threshold, the cover plate is determined to be in the first state.
6. The method according to claim 1, characterized in that, The ToF sensor is a single-point dToF sensor. Before determining the first signal strength of the first echo signal, the method further includes: Acquire the second echo signal, which is the light source signal emitted by the single-point dToF sensor and reflected back to the single-point dToF sensor by the target object; Based on the reception time of the second echo signal and the emission time of the light source signal, a first distance value between the target object and the single-point dToF sensor is determined; The first distance value is determined to be greater than or equal to a third distance threshold, wherein the third distance threshold is greater than or equal to the minimum distance at which the first echo signal and the second echo signal can be distinguished.
7. The method according to claim 1, characterized in that, The ToF sensor is a multi-point dToF sensor, and before determining the first signal strength of the first echo signal, the method further includes: Multiple third echo signals are acquired, which are signals emitted by the multi-point dToF sensor at one time and reflected back to the multi-point dToF sensor by the target object; Based on the reception time of the plurality of third echo signals and the emission time of the plurality of light source signals, a plurality of second distance values between the target object and the multi-point dToF sensor are determined; The number of second distance values that are greater than or equal to the fourth distance threshold is greater than or equal to the second number threshold, wherein the fourth distance threshold is greater than or equal to the minimum distance at which the first echo signal and the third echo signal can be distinguished.
8. The method according to any one of claims 1-5, characterized in that, The ToF sensor is a single-point dToF sensor, and the method further includes: Acquire the second echo signal, which is the light source signal emitted by the single-point dToF sensor and reflected back to the single-point dToF sensor by the target object; Based on the reception time of the second echo signal and the emission time of the light source signal, a first distance value between the target object and the single-point dToF sensor is determined; When the first distance value is less than or equal to the first distance threshold, the cover plate is determined to be in the second state, and the pollutant index of the cover plate in the second state is greater than or equal to the preset threshold.
9. The method according to any one of claims 1-5, characterized in that, The ToF sensor is a multi-point dToF sensor, and the method further includes: Multiple third echo signals are acquired, which are signals emitted by the multi-point dToF sensor at one time and reflected back to the multi-point dToF sensor by the target object; Based on the reception time of the plurality of third echo signals and the emission time of the plurality of light source signals, a plurality of second distance values between the target object and the multi-point dToF sensor are determined; When the number of the plurality of second distance values less than or equal to the second distance threshold is greater than or equal to the first quantity threshold, the cover plate is determined to be in a second state, and the pollutant index of the cover plate in the second state is greater than or equal to the preset threshold.
10. The method according to any one of claims 2-9, characterized in that, The method further includes: In response to a shooting command, the ToF sensor is triggered to emit a light source signal; The first prompt message is displayed on the shooting interface, which is used to indicate the detection result of the cover plate.
11. The method according to any one of claims 2-9, characterized in that, The method further includes: In response to the user's action, open the first application and display the first interface; In response to an operation on the first interface, the ToF sensor is triggered to emit a light source signal; The second interface is displayed, which includes a second prompt message indicating the detection result of the cover plate.
12. An electronic device, characterized in that, include: A camera, a ToF sensor, and a cover plate, the cover plate covering the camera and the ToF sensor. At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores one or more computer programs that can be executed by the at least one processor, the one or more computer programs being executed by the at least one processor to enable the at least one processor to perform the detection method as described in any one of claims 1-11.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the detection method as described in any one of claims 1-11.
14. A computer program product, characterized in that, Includes computer-readable code, or a non-volatile computer-readable storage medium carrying computer-readable code, wherein when the computer-readable code is run in a processor of an electronic device, the processor in the electronic device performs the detection method as described in any one of claims 1-11.
Citation Information
Patent Citations
Screen control method and apparatus
CN107943267A
Test structural member, ToF device and lens dirt detection method
CN112702488A
Dirt detection method and device, vehicle and storage medium
CN114839161A
Detection method and device
CN115480254A
Lens dirt detection method and device, electronic equipment and readable storage medium
CN115980718A