CN-121995396-A - Detection method, electronic device, storage medium, and program product
Abstract
The disclosure provides a detection method, electronic equipment, storage media and a program product, wherein the method comprises the steps of obtaining a first echo signal, determining first signal intensity of the first echo signal, determining detection results of a cover plate according to the first signal intensity and second signal intensity, wherein the first echo signal is reflected back to a ToF sensor through the cover plate after a ToF sensor transmits a light source signal, and the second signal intensity is the signal intensity of the echo signal reflected back to the ToF sensor through the cover plate in a first state after the ToF sensor transmits the light source signal, and the pollutant index of the cover plate in the first state is smaller than a preset threshold value. According to the embodiment of the disclosure, the ToF sensor can be utilized to emit the light source signal, the detection of the cover plate is realized through the first echo signal reflected by the cover plate, the efficiency is improved, the scene is not limited, and the detection accuracy is improved.
Inventors
- Chang Zhongcan
- WU RUNHAO
- FENG XIAOGANG
Assignees
- 荣耀终端股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241031
Claims (14)
- 1. A method of detection comprising: acquiring a first echo signal, wherein the first echo signal is reflected back to a ToF sensor through a cover plate after a light source signal is emitted by the ToF sensor; Determining a first signal strength of the first echo signal; And determining a detection result of the cover plate according to the first signal intensity and the second signal intensity, wherein the second signal intensity is the signal intensity of an echo signal which is reflected back to the ToF sensor through the cover plate in a first state after the ToF sensor transmits a light source signal, and the pollutant index of the cover plate in the first state is smaller than a preset threshold value.
- 2. The method of claim 1, wherein the cover plate covers the ToF sensor, wherein the cover plate covers a camera, and wherein the detection results of the cover plate are used to characterize the detection results of the camera.
- 3. The method according to claim 1 or 2, wherein determining the detection result of the cover plate according to the first signal strength and the second signal strength comprises: and determining the detection result of the cover plate according to the ratio or the difference value of the first signal intensity and the second signal intensity.
- 4. The method according to claim 1 or 2, wherein determining the detection result of the cover plate according to the first signal strength and the second signal strength comprises: When the ratio of the first signal intensity to the second signal intensity is greater than or equal to a first intensity threshold, determining that the cover plate is in a second state, wherein the pollutant index of the cover plate in the second state is greater than or equal to the preset threshold; and determining that the cover plate is in the first state when the ratio between the first signal intensity and the second signal intensity is smaller than a first intensity threshold value.
- 5. The method according to claim 1 or 2, wherein determining the detection result of the cover plate according to the first signal strength and the second signal strength comprises: When the difference value between the first signal intensity and the second signal intensity is larger than or equal to a second intensity threshold value, determining that the cover plate is in a second state, wherein the pollutant index of the cover plate in the second state is larger than or equal to the preset threshold value; And when the difference value between the first signal intensity and the second signal intensity is smaller than a second intensity threshold value, determining that the cover plate is in the first state.
- 6. The method of claim 1, wherein the ToF sensor is a single point dToF sensor, the method further comprising, prior to said determining the first signal strength of the first echo signal: Acquiring a second echo signal, wherein the second echo signal is reflected back to the single point dToF sensor through a target object after the single point dToF sensor transmits a light source signal; Determining a first distance value between the target object and the single-point dToF sensor according to the receiving time of the second echo signal and the transmitting time of the light source signal; Determining that the first distance value is greater than or equal to a third distance threshold, wherein the third distance threshold is greater than or equal to a minimum distance at which the first echo signal and the second echo signal can be distinguished.
- 7. The method of claim 1, wherein the ToF sensor is a multi-point dToF sensor, the method further comprising, prior to said determining the first signal strength of the first echo signal: acquiring a plurality of third echo signals, wherein the plurality of third echo signals are reflected back to the multipoint dToF sensor through a target object after the multipoint dToF sensor transmits a plurality of light source signals at one time; Determining a plurality of second distance values between the target object and the multi-point dToF sensor according to the receiving time of the plurality of third echo signals and the transmitting time of the plurality of light source signals; And when the number of the second distance values is larger than or equal to a fourth distance threshold and is larger than or equal to a second number threshold, the fourth distance threshold is larger than or equal to the minimum distance capable of distinguishing the first echo signal from the third echo signal.
- 8. The method of any one of claims 1-5, wherein the ToF sensor is a single point dToF sensor, the method further comprising: Acquiring a second echo signal, wherein the second echo signal is reflected back to the single point dToF sensor through a target object after the single point dToF sensor transmits a light source signal; Determining a first distance value between the target object and the single-point dToF sensor according to the receiving time of the second echo signal and the transmitting time of the light source signal; And when the first distance value is smaller than or equal to a first distance threshold value, determining that the cover plate is in a second state, wherein the pollutant index of the cover plate in the second state is larger than or equal to the preset threshold value.
- 9. The method of any one of claims 1-5, wherein the ToF sensor is a multipoint dToF sensor, the method further comprising: acquiring a plurality of third echo signals, wherein the plurality of third echo signals are reflected back to the multipoint dToF sensor through a target object after the multipoint dToF sensor transmits a plurality of light source signals at one time; Determining a plurality of second distance values between the target object and the multi-point dToF sensor according to the receiving time of the plurality of third echo signals and the transmitting time of the plurality of light source signals; And when the number of the second distance values is smaller than or equal to a second distance threshold and is larger than or equal to a first distance threshold, determining that the cover plate is in a second state, wherein the pollutant index of the cover plate in the second state is larger than or equal to the preset threshold.
- 10. The method according to any one of claims 2-9, wherein the method further comprises: triggering the ToF sensor to emit a light source signal in response to a shooting instruction; and displaying first prompt information in the shooting interface, wherein the first prompt information is used for indicating the detection result of the cover plate.
- 11. The method according to any one of claims 2-9, wherein the method further comprises: responding to the operation of a user, opening a first application, and displaying a first interface; Triggering the ToF sensor to emit a light source signal in response to an operation on the first interface; And displaying a second interface, wherein the second interface comprises second prompt information, and the second prompt information is used for indicating the detection result of the cover plate.
- 12. An electronic device, comprising: The camera, the TOF sensor and the cover plate, wherein the cover plate covers the camera, the cover plate covers the TOF sensor, At least one processor, and A memory communicatively coupled 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 executable by the at least one processor, such that the at least one processor is capable of performing the detection method according to any one of claims 1-11.
- 13. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the detection method according to any of claims 1-11.
- 14. A computer program product comprising computer readable code, or a non-transitory computer readable storage medium carrying computer readable code, which when run in a processor of an electronic device, performs the detection method according to any one of claims 1-11.
Description
Detection method, electronic device, storage medium, and program product Technical Field The disclosure relates to the field of computer technology, and in particular, to a detection method, an electronic device, a storage medium, and a program product. Background When a user shoots by using an electronic device such as a mobile phone, the position of the camera is easy to be stained to influence the imaging quality, such as fingerprints, oil stains, dust and the like, in the related art, judgment can be generally performed based on the imaging quality of the shot RGB image, but the method is limited by scenes, has low accuracy and is easy to cause false detection or omission. Disclosure of Invention The present disclosure provides a detection method, an electronic device, a storage medium, and a program product. In a first aspect, an embodiment of the present disclosure provides a detection method, including acquiring a first echo signal reflected back to a ToF sensor via a cover plate based on a light source signal emitted by the ToF sensor, determining a first signal strength of the first echo signal, and determining a detection result of the cover plate according to the first signal strength and the second signal strength. Wherein the second signal intensity is the signal intensity of the echo signal reflected back to the ToF sensor by the cover plate in the first state after the ToF sensor transmits the light source signal, the contaminant index of the cover plate in the first state is smaller than the preset threshold, the first state can be understood to be a clean state, the second signal intensity in the first state can be pre-calibrated, and further the ToF sensor can be utilized to transmit the light source signal during actual detection, the detection result of the cover plate is determined by comparing the first signal intensity and the second signal intensity of the first echo signal reflected by the cover plate, for example, whether the cover plate is in the first state or in the second state with pollutants is determined, and the pollutant index of the cover plate in the second state is larger than or equal to the preset threshold value. In an alternative implementation manner, the cover plate covers the ToF sensor, and the cover plate covers the camera, so that the detection result of the cover plate can be used for representing the detection result of the camera, that is, whether the camera has pollutants or not can be judged through detection of the cover plate, whether the shooting of the camera has the influence of the pollutants or not is judged, and accuracy is improved. In an alternative implementation manner, the signal intensity of the reflected echo signal is different in different states of the pollutant and the pollutant-free state of the cover plate, so that the detection result of the cover plate can be determined according to the ratio or the difference value of the first signal intensity and the second signal intensity, the implementation is simple and convenient, and the detection efficiency is improved. In an alternative implementation manner, when determining the detection result of the cover plate according to the ratio of the first signal strength to the second signal strength, specifically, whether the ratio between the first signal strength and the second signal strength is greater than or equal to a first strength threshold value may be determined, when the ratio between the first signal strength and the second signal strength is greater than or equal to the first strength threshold value, the cover plate is determined to be in the second state, and when the ratio between the first signal strength and the second signal strength is less than the first strength threshold value, the cover plate is determined to be in the first state. The detection result can be determined by comparing the ratio of the first signal intensity to the second signal intensity, and the efficiency is improved. In an alternative implementation manner, when the detection result of the cover plate is determined according to the difference value between the first signal intensity and the second signal intensity, specifically, whether the difference value between the first signal intensity and the second signal intensity is greater than or equal to a second intensity threshold value is judged, when the difference value between the first signal intensity and the second signal intensity is greater than or equal to the second intensity threshold value, the cover plate is determined to be in a second state, and when the difference value between the first signal intensity and the second signal intensity is less than the second intensity threshold value, the cover plate is determined to be in a first state. Therefore, whether pollutants exist on the cover plate can be judged by comparing the difference value of the signal intensities reflected by the cover plate, the calculation is simple and efficient,