Optical sensing module, optical sensing device and method

By introducing an imaging processing unit and a material recognition unit into the optical sensing device, adjusting the exposure time and comparing the spot characteristics, material recognition and distance measurement of the object to be measured is solved, and the existing optical sensing devices are unable to identify materials and lack distance measurement functions are improved, and user experience and sensing accuracy are improved.

CN119780960APending Publication Date: 2025-04-08FITIPOWER INTEGRATED TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411993508.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

Existing optical sensing devices cannot perform material recognition in some scenarios, resulting in a decline in user experience and lack of ranging function, affecting the sensing accuracy.

Method used

An optical sensing module is designed, including a sensor, an imaging processing unit and a material recognition unit. By adjusting the exposure time of the sensor, the spot characteristics represented by the imaging signal and the preset spot characteristics are compared to the material recognition of the object to be measured, and the distance measurement function is integrated.

Benefits of technology

The material recognition function of the optical sensing device is realized, which improves the user experience, and improves the sensing accuracy by integrating the ranging function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119780960A_ABST
    Figure CN119780960A_ABST
Patent Text Reader

Abstract

The present application provides an optical sensing module, an optical sensing device and a method, wherein the optical sensing device includes a sensor, an imaging processing unit and a material recognition unit. The sensor senses reflected light reflected from the object to be tested and generates an imaging signal, wherein the reflected light is formed by the detection light emitted by a light source emitter and reflected on the object to be tested. The imaging processing unit compares the light spot characteristics represented by the imaging signal with the preset light spot characteristics, and adjusts the exposure time of the sensor to output a target exposure time to the material recognition unit. The material recognition unit can perform material recognition on the object to be tested according to the target exposure time and a preset exposure time schedule. The optical sensing device of the present application can perform material recognition on the object to be tested and enhance the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of optical detection technology, and in particular to an optical sensing module, an optical sensing device and a method. Background Art

[0002] Optical ranging is a technology that measures the distance between a target object and a ranging device based on optics. The optical sensing device can emit light to the target object, receive the reflected light from the target object through the photosensitive element, and calculate the distance between the target object and the optical sensing device based on the imaging result of the reflected light.

[0003] However, in some application scenarios where the material of an object needs to be identified, traditional optical sensing devices only have the function of distance measurement, but not the function of object material identification, which will undoubtedly reduce the user experience. Therefore, how to realize the material identification function of the optical sensing device and further integrate the distance measurement function has become an urgent problem to be solved. Summary of the invention

[0004] The present application provides an optical sensing module, an optical sensing device and a method, which can solve the problem in the prior art that the optical sensing device cannot perform material recognition in some scenarios, resulting in a decrease in user experience, and can integrate a distance measurement function to improve the accuracy of sensing.

[0005] In a first aspect, an embodiment of the present application provides an optical sensing device, which includes a sensor, an imaging processing unit, and a material identification unit. The sensor can sense reflected light reflected from the object to be tested and generate an imaging signal, wherein the reflected light is formed by the detection light emitted by a light source emitter and reflected on the object to be tested. The imaging processing unit can be coupled to the light source emitter and the sensor, and the imaging processing unit can compare the light spot characteristics represented by the imaging signal with the preset light spot characteristics, and adjust the exposure time of the sensor according to the comparison result to output a target exposure time to the material identification unit. The material identification unit is coupled to the imaging processing unit, and the material identification unit is configured to perform material identification on the object to be tested according to the target exposure time and a preset exposure schedule. Wherein, the preset exposure schedule includes multiple objects to be tested of different materials and multiple preset exposure times corresponding to the multiple objects to be tested of different materials.

[0006] In an optional implementation, the optical sensing device further includes a memory, which is coupled to the imaging processing unit and the material recognition unit, and is used to pre-store a preset light spot feature table and a preset exposure schedule.

[0007] In an optional implementation, the imaging processing unit includes an exposure control unit; the exposure control unit is coupled to the sensor and the light source emitter, and the exposure control unit is configured to control the light source emitter to be turned on or off; the sensor is configured to sense a first image when the light source emitter is turned on, and to sense a second image when the light source emitter is turned off; the sensor is also configured to subtract the first image from the second image to obtain the imaging signal.

[0008] In an optional implementation, the imaging processing unit also includes an imaging calculation unit; the imaging calculation unit is coupled to the sensor and the exposure control unit, and the imaging calculation unit is configured to calculate the spot characteristics represented by the imaging signal, compare the spot characteristics represented by the imaging signal with the preset spot characteristics, and output a control signal to the exposure control unit; the exposure control unit is also configured to adjust the exposure time of the sensor according to the control signal.

[0009] In an optional implementation, the imaging processing unit also includes an imaging and distance calculation unit; the imaging and distance calculation unit is coupled to the sensor and the exposure control unit, and the imaging and distance calculation unit is configured to calculate the spot characteristics represented by the imaging signal, and compare the spot characteristics represented by the imaging signal with the preset spot characteristics to output a control signal to the exposure control unit; the exposure control unit is configured to adjust the exposure time of the sensor according to the control signal; the imaging and distance calculation unit is also configured to calculate the distance value between the object to be measured and the optical sensing device according to the imaging signal.

[0010] In a second aspect, the present application further provides an optical sensing module, comprising a light source emitter and the optical sensing device as described above.

[0011] In a third aspect, the present application further provides an optical sensing method, which is applied to an optical sensing device. The optical sensing method comprises the following steps:

[0012] Sensing reflected light from the object to be tested to generate an imaging signal, wherein the reflected light is formed by the detection light emitted by a light source emitter and reflected on the object to be tested;

[0013] Comparing the light spot feature represented by the imaging signal with the preset light spot feature, and adjusting the exposure time of the sensor according to the comparison result to output a target exposure time to the material recognition unit;

[0014] The material identification unit identifies the material of the object to be tested according to the target exposure time and a preset exposure schedule;

[0015] The preset exposure schedule includes a plurality of objects to be tested of different materials and a plurality of preset exposure times corresponding to the plurality of objects to be tested of different materials.

[0016] In an optional implementation, the optical sensing method further includes: pre-storing a preset light spot feature table and a preset exposure time schedule in a memory.

[0017] In an optional implementation, the optical sensing method further includes:

[0018] A first image is sensed when the light source emitter is turned on, and a second image is sensed when the light source emitter is turned off; the first image and the second image are subtracted to obtain an imaging signal.

[0019] In an optional implementation, the optical sensing method further includes:

[0020] Projecting detection light onto the calibration object;

[0021] sensing reflected light from the calibration object to generate an imaging signal;

[0022] Comparing the light spot characteristics represented by the imaging signal with the preset light spot characteristics, adjusting the exposure time of the sensor according to the comparison result, and outputting the preset exposure time of the calibration object when the ratio between the light spot characteristics represented by the imaging signal and the light spot characteristics represented by the imaging signal of a reflective object is stable;

[0023] The preset exposure schedule is obtained by recording the preset exposure times of a plurality of calibration objects of different materials.

[0024] As an optional implementation, the optical sensing method further includes: calculating the distance value between the object to be detected and the optical sensing device according to the imaging signal.

[0025] The optical sensing module, optical sensing device and method provided by the present application gradually adjust the exposure time through the exposure control unit until the ratio of the imaging spot characteristics of the object to be measured to the spot characteristics of the specified reflector is stable, and then the material of the object to be measured is recognized according to the exposure time. The embodiments of the present application can solve the problem that the optical sensing device in the prior art cannot perform material recognition in some scenarios, resulting in a decrease in user experience, and can integrate the distance measurement function to improve the accuracy of sensing. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A schematic diagram of an application scenario of an optical sensing device provided in one embodiment of the present application.

[0027] Figure 2 A schematic diagram of another application scenario of an optical sensing device provided by an embodiment of the present application.

[0028] Figure 3A and Figure 3B A schematic diagram of another application scenario of an optical sensing device provided by an embodiment of the present application.

[0029] Figure 4 A schematic diagram of another application scenario of an optical sensing device provided by an embodiment of the present application.

[0030] Figure 5 A schematic diagram of an optical sensing module provided by one embodiment of the present application.

[0031] Figure 6 A schematic diagram of an optical sensing module provided by another embodiment of the present application.

[0032] Figure 7 A schematic diagram of a scenario in which an optical sensing device provided in one embodiment of the present application is applied to an automatic faucet.

[0033] Figure 8 A schematic diagram of another scenario in which an optical sensing device provided by an embodiment of the present application is applied to an automatic faucet.

[0034] Fig. 9 A schematic diagram of another scenario in which an optical sensing device provided by an embodiment of the present application is applied to an automatic faucet.

[0035] Fig.10 A schematic diagram of another scenario in which an optical sensing device provided by an embodiment of the present application is applied to an automatic faucet.

[0036] Fig.11 Schematic diagram of the exposure time of different test objects under continuous sampling time.

[0037] Fig.12 The figure is a working flow diagram of an optical sensing device applied to an automatic faucet.

[0038] Fig.13 A flowchart of an optical sensing method is provided for one embodiment of the present application.

[0039] Fig.14 A flowchart of an optical sensing method is provided for another embodiment of the present application.

[0040] Fig.15 A flowchart of an optical sensing method is provided for another embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, 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.

[0042] It should be noted that when an element is considered to be "connected" to another element, it may be directly connected to the other element or there may be a centrally disposed element at the same time. When an element is considered to be "disposed on" another element, it may be directly disposed on the other element or there may be a centrally disposed element at the same time.

[0043] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0044] See also Figure 1 , which is a schematic diagram of an application scenario of an optical sensing device 100 provided by an embodiment of the present application. It can be understood that the technical solution of the embodiment of the present application can be applied to any scenario related to the optical sensing technology. For example, the optical sensing device can be applied to various devices with optical sensing functions, such as automatic water supply devices, water valve switch devices, automatic faucet devices, or sweeping robot devices.

[0045] like Figure 1 As shown, in one scenario, the optical sensing device 100 is applied to a sweeping robot 200, and the sweeping robot 200 can be used to clean the floor indoors or outdoors. In different areas that the sweeping robot 200 cleans, the floor material may also be different. If the sweeping robot 200 can automatically adjust its moving speed, suction force, brush head speed, etc. according to different floor materials and conditions, the sweeping robot 200 can achieve a better cleaning effect, which will greatly improve the user experience. Therefore, in Figure 1 In the scenario shown, the optical sensing device 100 of the embodiment of the present application needs to identify the ground material of the area where the cleaning robot 200 is currently located. The ground material can generally be tiles, floor mats, wooden floors, etc. Figure 1As shown, when the sweeping robot 200 identifies that the ground material of the current area is the first material (such as ceramic tile) through the optical sensing device 100, the sweeping robot 200 will move at a first moving speed, and use the first brush head speed and the first suction force to clean the ground. When the sweeping robot 200 moves to another area along the direction of travel, and the sweeping robot 200 identifies that the ground material of the current area is the second material (such as wooden floor) through the optical sensing device 100, the sweeping robot 200 will move at a second moving speed, and use the second brush head speed and the second suction force to clean the ground. In other words, if the sweeping robot 200 is cleaning on a hard material such as ceramic tile, it will move at a faster moving speed, and use a higher brush head speed and a stronger suction force to clean. On the other hand, if the sweeping robot 200 is cleaning on a soft material such as a floor mat and a wooden floor, it will move at a slower moving speed, and use a lower brush head speed and a weaker suction force to clean. It can be understood that the cleaning robot 200 can also adjust the cleaning mode according to actual needs. For example, the cleaning robot 200 can adjust the cleaning mode according to the different smoothness and flatness of the ground.

[0046] See also Figure 2 , is a schematic diagram of another application scenario of the optical sensing device 100 provided in one embodiment of the present application.

[0047] exist Figure 2 In the scenario shown, the optical sensing device 100 is applied to a sweeping robot 200, and the sweeping robot 200 can clean the floor. In some cases, when there are stains or liquids on the floor, if the sweeping robot 200 detects the stains through the optical sensing device 100, the sweeping robot 200 will automatically switch to the enhanced cleaning mode. In the enhanced cleaning mode, the sweeping robot 200 can, for example, ensure that there are no stains remaining on the floor, thereby achieving a better cleaning effect by using the following means and combinations thereof: increasing the frequency of cleaning the area where the stains are present, performing multiple reciprocating cleaning of the area where the stains are present, reducing the moving speed, and increasing the suction force. Therefore, in the enhanced cleaning mode, the sweeping robot 200 can ensure that there are no stains remaining on the floor, thereby achieving a better cleaning effect. Figure 2 In the scenario shown, the optical sensing device 100 needs to be able to detect stains or liquids on the ground, and be able to determine the existence and range of these stains based on material recognition.

[0048] See also Figure 3A and Figure 3B , is a schematic diagram of another application scenario of the optical sensing device 100 provided in one embodiment of the present application.

[0049] exist Figure 3AIn the scenario shown, the optical sensing device 100 is applied to a cleaning robot 200, and the cleaning robot 200 moves along the travel direction and can clean the floor. Figure 3B As shown in FIG. 1 , when there is an obstacle in the direction of travel of the cleaning robot 200, if the optical sensing device 100 can identify that there is a transparent obstacle in front (for example, the obstacle may be a glass door), the cleaning robot 200 can slow down the moving speed or change the direction of travel to avoid collision. Figure 3A and Figure 3B In the scenario shown, the cleaning robot 200 can use the material recognition function of the optical sensing device 100 to adjust the obstacle avoidance strategy.

[0050] It can be understood that the application of the technical solution of the present application is not limited to the ground, but can also be applied to various other working surfaces, such as solar panels and various building structure surfaces.

[0051] See also Figure 4 , is a schematic diagram of another application scenario of the optical sensing device 100 provided in one embodiment of the present application.

[0052] like Figure 4 As shown, in one scenario, the optical sensing device 100 is applied to an automatic faucet 300 ( Figure 4 1 shows a side view of the automatic faucet 300). The automatic faucet 300 includes a column 301 and a water outlet section 302 connected to the column 301. A water outlet 303 is provided at one end of the water outlet section 302 away from the column 301, and the optical sensing device 100 can be set on the column 301. When the user is not in front of the automatic faucet 300 and no water column is sprayed from the water outlet 303, the optical sensing device 100 is facing the background object 304, and the object to be detected by the optical sensing device 100 is the background object 304. When the user is in front of the automatic faucet 300 and no water column is sprayed from the water outlet 303, the optical sensing device 100 is facing the user, and the object to be detected by the optical sensing device 100 is the user's hand. When a user washes his hands using the water outlet 303 of the automatic faucet 300 , that is, a water column is sprayed out from the water outlet 303 , the optical sensing device 100 is facing the water column and the hand. At this time, the objects to be detected by the optical sensing device 100 are the water column and the hand.

[0053] It is understood that when the background object 304 is too far from the optical sensing device 100 or there is no background object 304, the optical sensing device 100 can be regarded as infinitely far away and cannot form an image. At this time, the scene can be regarded as having no object to be detected. It is understood that in another possible implementation, the optical sensing device 100 can also be arranged in the water outlet section 302. Optionally, the optical sensing device 100 is arranged in the water outlet section 302 near the water outlet 303.

[0054] The specific contents of the optical sensing device and the optical sensing method of the present application will be described in detail below with reference to the drawings.

[0055] See also Figure 5 , Figure 5 A schematic diagram of an optical sensing module 400 provided according to an embodiment of the present application.

[0056] In this embodiment, the optical sensing module 400 may include a light source emitter 10 and an optical sensing device 100. The optical sensing device 100 may include a sensor 20, an imaging processing unit 60, a material recognition unit 50 and a memory 80. The imaging processing unit 60 includes an imaging calculation unit 30 and an exposure control unit 40.

[0057] The light source transmitter 10 can be used to transmit the detection light L1 to the object to be tested 101, and the detection light L1 will be reflected on the surface of the object to be tested 101 to form the reflected light L2. In some optional implementations, the light source transmitter 10 can be any one of a laser, a light-emitting diode (LED) or an infrared light source. It can be understood that in this embodiment, the sensor 20, the imaging processing unit 60, the material recognition unit 50 and the memory 80 can be integrated into an integrated circuit (IC), and the light source transmitter 10 and the IC (i.e., the optical sensing device 100) can be integrated into a module. In other words, the distance between the object to be tested 101 and the sensor 20 can represent the distance between the object to be tested 101 and the optical sensing device 100. The distance between the object to be tested 101 and the sensor 20 can also represent the distance between the object to be tested 101 and the optical sensing module 400.

[0058] It can be understood that in this embodiment, the imaging calculation unit 30 is connected between the sensor 20 and the material identification unit 50. The exposure control unit 40 is connected to the imaging calculation unit 30, the sensor 20, and the light source emitter 10. The exposure control unit 40 can be used to control the light source emitter 10 to be turned on or off. In some more specific implementations, the exposure control unit 40 can also adjust the light source emitter 10 on time or off time according to actual needs, so as to achieve the purpose of power saving.

[0059] The sensor 20 may be a photosensitive array composed of a plurality of photosensitive elements. In a specific implementation, the sensor 20 may be a CMOS image sensor (CIS). The reflected light L2 formed on the surface of the object to be measured 101 may be incident on the sensor 20. The sensor 20 is used to convert the received light signal into an electrical signal, that is, the sensor 20 may sense the reflected light L2 and may generate an imaging signal. It is understood that in a specific implementation process, the sensor 20 may sense a first image when the light source emitter 10 is turned on. The sensor 20 may also sense a second image when the light source emitter 10 is turned off. The influence of ambient light may be eliminated by subtracting the first image from the second image, and an imaging signal may be obtained by the difference between the first image and the second image.

[0060] In other words, the light source emitter 10 can emit the detection light L1 to the object to be tested 101, thereby forming a light spot on the object to be tested 101, and the sensor 20 can obtain the reflected light imaging distribution of the reflected light L2, thereby outputting an imaging signal to the imaging calculation unit 30. The reflected light imaging distribution corresponds to the light spot, and the imaging signal contains information on the characteristics of the light spot.

[0061] In this embodiment, the imaging calculation unit 30 can be used to receive the imaging signal (such as a digital signal) output by the sensor 20, and calculate the imaging signal to obtain the light spot characteristics represented by the imaging signal. The light spot characteristics represented by the imaging signal can be the width, area and centroid of the light spot.

[0062] The memory 80 is connected to the imaging calculation unit 30 and the material identification unit 50. The memory 80 stores a preset light spot feature table and a preset exposure time table. The preset light spot feature table may include a set of preset light spot features.

[0063] It can be understood that the preset light spot characteristics can be obtained by projecting the detection light onto a specified reflective object (such as a whiteboard) for measurement. The preset light spot characteristics may include the width of the light spot reflected by the detection light projected onto the specified reflective object, the area of ​​the light spot reflected by the detection light projected onto the specified reflective object, the centroid position of the light spot reflected by the detection light projected onto the specified reflective object, etc.

[0064] Among them, the preset exposure schedule may include multiple known materials and multiple preset exposure times corresponding to the multiple known materials. It can be understood that an object of a known material can be used as a calibration object to obtain the preset exposure time. Each object of a known material (i.e., a calibration object) corresponds to a preset exposure time, so the preset exposure time of the object of the known material can be measured by projecting the detection light onto an object of a known material, and when the ratio of the imaging spot characteristics of the object of the known material to the imaging spot characteristics of the specified reflector (such as a whiteboard) is stable. In other words, the present application obtains a preset exposure schedule by measuring multiple objects of known materials separately and recording the preset exposure times of multiple objects of known materials.

[0065] Before the optical sensing device 100 leaves the factory, the preset light spot feature table and the preset exposure schedule can be pre-stored in the memory 80, or the light spot feature table and the preset exposure schedule can be reset according to the user's needs or actual applications after the optical sensing device 100 leaves the factory. The imaging calculation unit 30 is used to receive the imaging signal output by the sensor 20, and calculate the light spot feature (such as width, area or centroid) represented by the imaging signal according to the intensity distribution. Then, the imaging calculation unit 30 can also compare the light spot feature represented by the imaging signal with the preset light spot feature in the preset light spot feature table to output a control signal to the exposure control unit 40, and the exposure control unit 40 adjusts the next exposure time of the sensor 20 according to the control signal.

[0066] For example, if the light spot feature (such as width or area) represented by the imaging signal is greater than a feature upper limit, the exposure control unit 40 outputs a control signal to reduce the next exposure time of the sensor 20. If the light spot feature (such as width or area) represented by the imaging signal is less than a feature lower limit, the exposure control unit 40 increases the next exposure time of the sensor 20 according to the control signal. It can be understood that the imaging calculation unit 30 of the present application can output a control signal to the exposure control unit 40 according to the proportional relationship between the imaging spot feature of the object to be measured 101 and the imaging spot feature of the specified reflector, and the exposure control unit 40 adjusts the next exposure time of the sensor 20 according to the control signal. In other words, since different materials have different reflection characteristics and scattering characteristics, the present application needs to use the exposure control unit 40 to gradually adjust the exposure time according to the proportional relationship between the imaging spot feature of the object to be measured and the imaging spot feature of the specified reflector, and use the exposure time to adjust the width or area of ​​the light spot represented by the imaging signal until the ratio of the imaging spot feature of the object to be measured to the imaging spot feature of the specified reflector is stable. For example, the ratio stability may refer to when the spot width of the object to be tested 101 is close to the spot width of the specified reflector, or the spot area of ​​the object to be tested 101 is close to the spot area of ​​the specified reflector. After the ratio of the imaging spot feature of the object to be tested and the imaging spot feature of the specified reflector is stable, the imaging calculation unit 30 may output a target exposure time to the material identification unit 50, so that the material identification unit 50 can accurately identify the material of the object to be tested 101 according to the received target exposure time.

[0067] In the specific implementation process, the material identification unit 50 obtains the target exposure time output by the imaging calculation unit 30, and performs material identification on the object to be tested 101 according to a preset exposure schedule, so that the material identification result can be output to identify the soft and hard materials of the ground where the sweeping robot 200 is located, whether there are transparent obstacles in front of the sweeping robot 200, whether there are stains or liquids in the area where the sweeping robot 200 is currently located, etc.

[0068] It can be understood that the material identification mentioned above may mean that the optical sensing device 100 may classify the object 101 by receiving the reflected light of the object 101 and analyzing the light spot characteristics and exposure time to determine the specific material of the object 101 .

[0069] by Figure 1Taking the application scenario shown as an example, the sweeping robot 200 sweeps the ground, and the sweeping robot 200 identifies the ground material of the current area through the optical sensing device 100, where the ground is the object to be detected 101. Specifically, the light source emitter 10 emits the detection light L1 to the ground of the current area, and the detection light L1 forms the reflected light L2 on the ground. The sensor 20 obtains the reflected light imaging distribution of the reflected light L2, thereby outputting the imaging signal to the imaging calculation unit 30. The imaging calculation unit 30 and the exposure control unit 40 can output a control signal to the sensor 20 according to the proportional relationship between the imaging spot characteristics of the ground in the current area and the imaging spot characteristics of the specified reflector, so as to adjust the next exposure time of the sensor 20 until the ratio of the imaging spot characteristics of the ground in the current area to the imaging spot characteristics of the specified reflector is stable. The material identification unit 50 receives the target exposure time output by the imaging calculation unit 30, and identifies the material of the ground in the current area of ​​the sweeping robot 200 according to the preset exposure schedule. In one example, the preset exposure schedule is shown in Table 1 below.

[0070] Table 1

[0071] Object to be tested White tiles Black tile (matte) Black tile (bright surface) Wooden floor Floor mat (grey) Preset exposure time 250(T) 600(T) 1350(T) 400(T) 320(T)

[0072] It is understood that T can be any unit of time, and T can vary with the operating frequency of the optical sensing device 100. As can be seen from Table 1, white tiles, black tiles (matte), black tiles (glossy), wooden floors, and floor mats (gray) have corresponding preset exposure times. Figure 1 In the application scenario shown, if the material recognition unit 50 obtains an exposure time of approximately 250T, the material recognition unit 50 can determine that the floor material of the area where the sweeping robot 200 is currently located is white tiles, so that the sweeping robot 200 can adjust the cleaning parameters corresponding to the white tiles to clean the floor. If the material recognition unit 50 obtains an exposure time of approximately 400T, the material recognition unit 50 can determine that the floor material of the area where the sweeping robot 200 is currently located is wooden floors, so that the sweeping robot 200 can adjust the cleaning parameters corresponding to wooden floors to clean the floor. Therefore, the sweeping robot 200 can accurately identify the floor material through the optical sensing device 100, thereby adjusting the cleaning parameters according to different floor materials, which can effectively improve the cleaning effect of the sweeping robot 200 and improve the user experience.

[0073] Then Figure 2Taking the application scenario shown as an example, the sweeping robot 200 sweeps the ground, and the sweeping robot 200 identifies the ground material of the current area through the optical sensing device 100, where the ground is the object to be detected 101. Specifically, the light source emitter 10 emits the detection light L1 to the ground of the current area. If the light source emitter 10 moves to the area where there is stain or liquid, the detection light L1 is projected onto the ground where there is stain to form the reflected light L2, and the sensor 20 obtains the reflected light imaging distribution of the reflected light L2, thereby outputting the imaging signal to the imaging calculation unit 30. The imaging calculation unit 30 and the exposure control unit 40 can output the control signal to the sensor 20 according to the proportional relationship between the imaging spot feature of the ground where there is stain and the imaging spot feature of the specified reflector, so as to adjust the next exposure time of the sensor 20 until the ratio of the imaging spot feature of the ground where there is stain and the imaging spot feature of the specified reflector is stable. The material recognition unit 50 receives the target exposure time output by the imaging calculation unit 30, and identifies the stain on the ground according to the preset exposure schedule. In one example, the preset exposure schedule is shown in Table 2 below.

[0074] Table 2

[0075] Object to be tested floor Floor + stains (such as coffee) Floor + Liquid (Water) Preset exposure time 180(T) 300(T) 240(T)

[0076] From Table 2 above, it can be seen that the presence or absence of stains or liquid on the floor has different preset exposure times. Figure 2 In the application scenario shown, if the material recognition unit 50 obtains an exposure time of about 180T, the material recognition unit 50 can determine that the floor material of the area where the sweeping robot 200 is currently located is a floor without stains or liquids, so that the sweeping robot 200 cleans and sweeps the floor in a normal working mode. If the material recognition unit 50 obtains an exposure time of about 300T, the material recognition unit 50 can determine that there are stains on the floor of the area where the sweeping robot 200 is currently located, so that the sweeping robot 200 can automatically switch to the enhanced cleaning mode. At this time, the sweeping robot 200 can increase the cleaning frequency of the area where the stains exist or perform multiple reciprocating cleaning of the area where the stains exist. Therefore, by judging in real time whether the target exposure time returns to 180T when cleaning stains or liquids, it is ensured that there are no stains remaining on the floor, thereby achieving a better cleaning effect and improving the user experience.

[0077] Then Figure 3A and Figure 3BTaking the application scenario shown as an example, the sweeping robot 200 sweeps the ground, and the sweeping robot 200 identifies the ground material of the current area through the optical sensing device 100, where the ground and obstacles are the objects to be detected 101. Specifically, the light source emitter 10 emits detection light L1 to the ground of the current area, and the detection light L1 is projected onto the transparent obstacle to form reflected light L2. The sensor 20 obtains the reflected light imaging distribution of the reflected light L2, thereby outputting an imaging signal to the imaging calculation unit 30. The imaging calculation unit 30 and the exposure control unit 40 can output a control signal to the sensor 20 according to the proportional relationship between the imaging spot characteristics of the transparent obstacle and the imaging spot characteristics of the specified reflector, so as to adjust the next exposure time of the sensor 20 until the ratio of the imaging spot characteristics of the transparent obstacle to the imaging spot characteristics of the specified reflector is stable. The material recognition unit 50 receives the target exposure time output by the imaging calculation unit 30, and identifies the transparent obstacle according to the preset exposure schedule. In one example, the preset exposure schedule is shown in Table 3 below.

[0078] Table 3

[0079] Object to be tested ground Ground + transparent obstacles Preset exposure time 400(T) 700(T)

[0080] It can be seen from Table 3 above that different preset exposure times are used depending on whether there is a transparent obstacle on the ground. Figure 3A In the application scenario shown, if the material recognition unit 50 obtains an exposure time of approximately 400T, the material recognition unit 50 can determine that there is no obstacle in front of the sweeping robot 200, so that the sweeping robot 200 can move normally along the predetermined path to clean the floor. If the material recognition unit 50 obtains an exposure time of approximately 700T, the material recognition unit 50 can determine that there is a transparent obstacle (such as a glass door, floor-to-ceiling window, transparent furniture, transparent decorations, etc.) in front of the sweeping robot 200. In this case, the sweeping robot 200 can slow down its speed and / or change its direction of travel to avoid a collision with the sweeping robot 200. Therefore, in Figure 3A and Figure 3B In the scenario shown, the cleaning robot 200 can use the optical sensing device 100 to identify the material of the obstacle, so as to adjust the obstacle avoidance strategy.

[0081] It is understandable that in order to avoid the influence of ambient light on the optical sensing device, the optical sensing device of the present application can also eliminate the ambient background by subtracting two frames of images through the exposure control unit 40, so that the sensor 20 can achieve a better imaging effect.

[0082] See also Figure 6 , Figure 6A schematic diagram of an optical sensing module 400 provided according to another embodiment of the present application.

[0083] and Figure 5 The difference between the optical sensing device 100 shown in the embodiment is that Figure 6 As shown, in this embodiment, the imaging processing unit 60 includes an exposure control unit 40 and an imaging and distance calculation unit 70 .

[0084] The imaging and distance calculation unit 70 may be connected between the sensor 20 and the material identification unit 50. The exposure control unit 40 may be connected to the imaging and distance calculation unit 70. The memory 80 may be connected to the imaging and distance calculation unit 70 and the material identification unit 50. The memory 80 may store a preset light spot feature table and a preset exposure time schedule.

[0085] In this embodiment, the light source emitter 10 can emit detection light L1 to the object to be measured 101, and the detection light L1 is reflected on the surface of the object to be measured 101 to form a reflected light L2. The sensor 20 can sense a first image when the light source emitter 10 is turned on. The sensor 20 can also sense a second image when the light source emitter 10 is turned off. The influence of ambient light can be eliminated by subtracting the first image from the second image, and an imaging signal can be obtained by the difference between the first image and the second image. The exposure control unit 40 can compare the light spot feature represented by the imaging signal with the preset light spot feature, thereby outputting a control signal to the sensor 20 to adjust the next exposure time of the sensor 20. When the ratio of the imaging light spot feature of the object to be measured 101 to the imaging light spot feature of the specified reflector is stable, the optical sensing device 100 can perform material recognition and distance measurement on the object to be measured 101 according to the exposure time and the preset exposure schedule, thereby outputting the recognition and distance measurement results.

[0086] In this embodiment, the imaging and distance calculation unit 70 receives the imaging signal output by the sensor 20, and calculates the light spot characteristics (such as width, area or centroid) represented by the imaging signal according to the intensity distribution. The imaging and distance calculation unit 70 can also calculate the distance value d1 between the object to be measured 101 and the optical sensing device 100. In some specific implementations, the imaging and distance calculation unit 70 can calculate the distance between the object to be measured 101 and the optical sensing device 100 according to the centroid position of the light spot represented by the imaging signal of the reflected light in the sensor 20 using the triangulation principle.

[0087] by Figure 4Taking the application scenario shown as an example, the optical sensing device 100 is applied to an automatic faucet 300. The optical sensing device 100 can sense the water column and the user's hand. Specifically, the light source emitter 10 emits a detection light L1 to the object to be tested, and the detection light L1 is projected onto the object to be tested to form a reflected light L2. The sensor 20 obtains the reflected light imaging distribution of the reflected light L2, thereby outputting an imaging signal to the imaging and distance calculation unit 70. The imaging and distance calculation unit 70 can output a control signal to the exposure control unit 40 based on the proportional relationship between the imaging spot characteristics of the object to be tested and the imaging spot characteristics of the specified reflector. The exposure control unit 40 adjusts the next exposure time of the sensor 20 according to the control signal until the ratio of the imaging spot characteristics of the object to be tested to the imaging spot characteristics of the specified reflector is stable. The material recognition unit 50 identifies the object to be tested according to a preset exposure schedule. In one example, the preset exposure schedule is shown in Table 4 below.

[0088] Table 4

[0089]

[0090] It is understood that T can be any unit of time, and T can vary with the operating frequency of the optical sensing device 100. When no user is located in the sensing direction of the optical sensing device 100 or the automatic faucet 300 is not supplying water, the sensor 20 can obtain the light spot characteristics of the background object 304, thereby identifying the background object 304. The background object 304 can be a white target material, a gray target material, a black target material, or a target material of other colors, all depending on actual application requirements.

[0091] It can be seen from Table 4 above that different objects to be tested may have different preset exposure times. In different application scenarios, the object to be tested 101 may be one of a water column, a hand, a water column and a hand (i.e., the state of a user washing hands in a water column), a white target material, a gray target material, and a black target material. Among them, when the object to be tested 101 is a white target material, a gray target material, or a black target material, that is, no user is using the automatic faucet 300. It can be understood that when the optical sensing device 100 cannot form an image, the exposure time will reach the maximum value of the sensor 20 (e.g., 65535T), at which time it can be determined that there is no object to be tested.

[0092] The process of a user using an automatic faucet is usually divided into five stages: (1) The user stands in front of the faucet, but the user does not use the faucet to wash his hands; (2) The user places his hand on the water outlet of the faucet, that is, the sensing area of ​​the optical sensing device 100; (3) The optical sensing device 100 senses the user's hand, controls the faucet to start supplying water, and the pure water column sprayed from the faucet will gradually increase; (4) The user puts his hand into the water column to wash his hands; (5) The user finishes washing his hands and uses water. Therefore, when the optical sensing device 100 is applied to the automatic faucet 300, the optical sensing device 100 can have four sensing scenarios. Such as Figure 7 As shown, the first sensing scenario of the optical sensing device 100 is sensing that a user is standing in front of a faucet and the user is not washing hands. In this scenario, the user himself is the background object of the optical sensing device 100. Figure 8 As shown, the second sensing scenario of the optical sensing device 100 is sensing "pure hand". In this scenario, the object to be detected by the optical sensing device 100 is pure hand, that is, the water outlet 303 has not yet supplied water and the optical sensing device 100 only senses the presence of the hand. Fig. 9 As shown, the third sensing scenario of the optical sensing device 100 is sensing "the user is washing hands". In this scenario, the objects to be detected by the optical sensing device 100 are water columns and hands, that is, the optical sensing device 100 senses that the user is washing hands and the optical sensing device 100 senses the mixed behavior of water columns and hands. Fig.10 As shown, the fourth sensing scenario of the optical sensing device 100 is sensing a "pure water column". In this scenario, the user has just washed his hands, and the user's hands have left the faucet, but the water column has not stopped. The object to be detected by the optical sensing device 100 is a pure water column, that is, the optical sensing device 100 only senses the water column sprayed from the water outlet 303.

[0093] Fig.11 , which is a schematic diagram of the exposure time of different objects to be tested under continuous sampling time. Curve C1 is the exposure time when the optical sensing device 100 senses the scene of "pure water column", curve C2 is the exposure time when the optical sensing device 100 senses the scene of "pure hands", and curve C3 is the exposure time when the optical sensing device 100 senses the scene of "user washing hands".

[0094] It can be seen from curve C1 that the exposure time corresponding to the "pure water column" gradually increases from the water-free state to the gradual formation of a continuous water column. The exposure time of curves C2 and C3 is significantly lower than that of curve C1.

[0095] As can be seen from the above, when the optical sensing device 100 detects a "pure water column", its exposure time increases significantly. When the optical sensing device 100 detects "pure hands" and "users are washing their hands", its exposure time decreases significantly. In other words, the exposure time in the "pure water column" scenario is significantly different from the exposure time in the two scenarios of "pure hands" and "users are washing their hands". Therefore, the automatic faucet 300 of the present application can determine whether the user has finished using the water through the optical sensing device 100, thereby determining whether continuous water supply is required. In other words, the optical sensing device 100 of the present application can distinguish the difference between the water column and the hand through the characteristics of the exposure time, thereby avoiding the problem that the optical sensing device 100 misjudges the water column as an object to be washed and continues to inject water when the user has run out of water and there is no object to be tested. This can ensure the reliability of the automatic faucet and improve the user experience.

[0096] The following will be combined Fig.12 The working principle of the automatic faucet 300 is introduced.

[0097] In stage 0, that is, when the user has not used the automatic faucet 300 to wash his hands, the optical sensing device 100 detects the distance change of the object to be detected in real time. When the optical sensing device 100 detects that the current distance of the object to be detected is less than or equal to the starting distance, Figure 8 Taking the illustrated scenario as an example, the user's hand has been placed under the hand faucet 303 and the distance between the user's hand and the optical sensing device 100 is less than or equal to the start distance, that is, entering stage 1. It can be understood that the current distance of the object to be detected refers to the current distance between the object to be detected and the optical sensing device 100.

[0098] In stage 1, the automatic faucet 300 starts supplying water and continues to supply water within a first time period T1.

[0099] In phase 2, the optical sensing device 100 starts detection and identification, and continues for a second period of time T2 to collect exposure time and distance measurement information.

[0100] The minimum distance D between the object to be tested and the optical sensing device 100 is min (t) satisfies the following relationship:

[0101] D min (t) = min{D min (t-1),D(t)}.

[0102] Among them, min{D min (t-1),D(t)} is to take D min The minimum value between (t-1) and D(t). min(t-1) is the minimum distance between the object to be tested and the optical sensing device 100 in the previous period of time, and D(t) is the distance between the object to be tested and the optical sensing device 100 at the current time. min (-1) = D(0).

[0103] Among them, the average exposure time of the object to be tested is W avg (t) satisfies the following relationship:

[0104] W avg (t) = [W(t) + W avg (t-1)] / 2.

[0105] Among them, [W(t)+W avg (t-1)] / 2 is to take W(t) and W avg (t-1) is the average of the two. W(t) is the exposure time of the object to be tested at the current time, W avg (t-1) is the average exposure time of the object to be tested in the previous period of time. avg (-1) = W(0).

[0106] In stage 3, the minimum distance D can be calculated min (t) and the average exposure time W avg (t) to determine whether to continue water supply.

[0107] If the average exposure time W avg If (t) is greater than the time threshold TH1, the water supply is shut down and the process returns to phase 0.

[0108] If the minimum distance D min (t) Distance to target D target If the difference between the minimum distance D and the minimum distance D is greater than or equal to the distance threshold TH2, that is, the user's hand leaves the faucet, the water supply is turned off and the process returns to stage 0. min (t) Distance to target D target If the difference is less than the distance threshold TH2, that is, the user is washing hands, water is continuously supplied and the process returns to stage 1. min (t)-D target .

[0109] Among them, the minimum distance D min (t) Distance to target D target The difference can be a positive number, 0 or a negative number, and the distance threshold TH2 is a positive number.

[0110] It can be understood that the above target distance D targetIt may refer to that when the automatic faucet 300 is not supplying water, the optical sensing device 100 measures the distance between the optical sensing device 100 and the target object directly below the water outlet 303 .

[0111] It is understandable that the object to be tested of the automatic faucet 300 is not limited to the user's hand, but can also be a bucket, a cup or other objects to be washed, and this application does not make specific limitations on this.

[0112] Based on such a design, the optical sensing device 100 of the present application can be applied to automatic faucets. By performing distance judgment and material recognition by optical sensing, the accuracy of the control mechanism of the automatic faucet can be increased. The optical sensing device 100 of the present application can distinguish the difference between the water column and the hand through the characteristics of the exposure time, thereby avoiding the problem that the optical sensing device 100 misjudges the water column as the target object to be washed and continues to inject water when the user runs out of water and there is no object to be tested. This can ensure the reliability of the automatic faucet and improve the user experience.

[0113] See also Fig.13 , is a flow chart of an optical sensing method provided by an embodiment of the present application. The optical sensing method can be applied to Figure 5 In the optical sensing device 100 shown in the embodiment, the optical sensing method in this embodiment may include the following steps:

[0114] Step S131: emitting a detection light to the object to be detected, and the detection light is reflected on the object to be detected to form a reflected light.

[0115] by Figure 5 Taking the optical sensing device 100 as an example, the light source emitter 10 can emit a detection light L1 to the object to be detected 101. The detection light L1 will form a light spot on the surface of the object to be detected 101 and will be reflected to form a reflected light L2.

[0116] Step S132: sensing the reflected light from the object to be tested to generate an imaging signal.

[0117] The sensor 20 may be a photosensitive array composed of a plurality of photosensitive elements. In a specific implementation, the sensor 20 may be a CMOS image sensor (CIS). The sensor 20 may sense the reflected light L2 and may generate an imaging signal. In a specific implementation, the sensor 20 may sense a first image when the light source emitter 10 is turned on. The sensor 20 may also sense a second image when the light source emitter 10 is turned off. The influence of ambient light may be eliminated by subtracting the first image from the second image, and an imaging signal may be obtained by the difference between the first image and the second image. The imaging distribution of the reflected light corresponds to the light spot, so the imaging signal contains information on the characteristics of the light spot.

[0118] Step S133: Calculate the light spot characteristics represented by the imaging signal.

[0119] The imaging calculation unit 30 receives the imaging signal output by the sensor 20 and calculates it to obtain the light spot characteristics represented by the imaging signal. The light spot characteristics represented by the imaging signal may be the width, area and centroid of the light spot.

[0120] Step S134: Compare the light spot characteristics with the preset light spot characteristics and output a control signal, wherein the control signal is used to adjust the exposure time of the sensor.

[0121] The imaging calculation unit 30 is further used to compare the light spot feature represented by the imaging signal with a preset light spot feature, and output a control signal to the sensor 20 .

[0122] In a specific implementation process, the imaging calculation unit 30 receives the imaging signal output by the sensor 20, and calculates the spot feature (such as width, area or centroid) represented by the imaging signal according to the intensity distribution. The memory 80 stores a preset spot feature table and a preset exposure time table. Among them, the preset spot feature table may include a set of preset spot features. Therefore, the imaging calculation unit 30 can also compare the spot feature represented by the imaging signal with the preset spot feature to output a control signal to the exposure control unit 40, and the exposure control unit 40 adjusts the next exposure time of the sensor 20 according to the control signal.

[0123] For example, if the light spot feature (such as width or area) represented by the imaging signal is greater than a feature upper limit, the exposure control unit 40 outputs a control signal to reduce the next exposure time of the sensor 20. If the light spot feature (such as width or area) represented by the imaging signal is less than a feature lower limit, the exposure control unit 40 increases the next exposure time of the sensor 20 according to the control signal. It can be understood that the imaging calculation unit 30 of the present application can output a control signal to the exposure control unit 40 according to the proportional relationship between the imaging light spot feature of the object to be measured 101 and the imaging light spot feature of the specified reflector, and the exposure control unit 40 adjusts the next exposure time of the sensor 20 according to the control signal.

[0124] Step S135: when the ratio of the imaging spot feature of the object to be tested to the imaging spot feature of the designated reflector is stable, material identification is performed on the object to be tested according to a preset exposure schedule.

[0125] The present application uses the exposure control unit 40 to gradually adjust the exposure time according to the ratio between the imaging spot characteristics of the object to be tested and the imaging spot characteristics of the designated reflector, and uses the exposure time to adjust the width or area of ​​the imaging spot S1 until the ratio between the imaging spot characteristics of the object to be tested and the imaging spot characteristics of the designated reflector is stable. For example, the ratio is stable, which means that when the spot width of the object to be tested 101 is similar to the spot width of the designated reflector, or the spot area of ​​the object to be tested 101 is similar to the spot area of ​​the designated reflector, the optical sensing device 100 can accurately identify the material of the object to be tested 101 according to the exposure time.

[0126] In a specific implementation process, the material identification unit 50 obtains the target exposure time output by the imaging calculation unit 30, and performs material identification on the object to be tested 101 according to a preset exposure schedule, and outputs a material identification result to identify the soft or hard material of the ground where the cleaning robot 200 is located, whether there is a transparent obstacle in front of the cleaning robot 200, whether there is stain or liquid in the area where the cleaning robot 200 is currently located, etc. The preset exposure schedule may include multiple known materials and multiple preset exposure times corresponding to the multiple known materials.

[0127] It is understandable that the following steps may be included before step S131:

[0128] Before the optical sensing device 100 leaves the factory, the preset light spot characteristic table and the preset exposure schedule are pre-stored in the memory 80. Alternatively, the light spot characteristic table and the preset exposure schedule may be reset according to user needs or actual applications after the optical sensing device 100 leaves the factory.

[0129] It can be understood that the preset spot feature table may include a set of preset spot features, and the preset spot features can be measured by projecting the detection light onto a specified reflector (such as a whiteboard). Among them, the preset spot features may include the spot width reflected by the detection light projected onto the specified reflector, the spot area reflected by the detection light projected onto the specified reflector, the centroid position of the spot reflected by the detection light projected onto the specified reflector, etc. The preset exposure schedule may include multiple known materials and multiple preset exposure times corresponding to the multiple known materials. It can be understood that an object of a known material can be used as a calibration object for obtaining a preset exposure time. Each object of a known material (i.e., a calibration object) corresponds to a preset exposure time, so the preset exposure time of the object of the known material can be measured by projecting the detection light onto an object of a known material, and when the ratio of the imaging spot feature of the object of the known material to the imaging spot feature of the specified reflector (such as a whiteboard) is stable. In other words, the present application obtains a preset exposure schedule by measuring multiple objects of known materials respectively and recording the preset exposure times of multiple objects of known materials.

[0130] It can be understood that after executing step S135 , the optical sensing method in this embodiment will return to step S131 , thereby repeatedly executing the above steps.

[0131] See also Fig.14 , is a flow chart of an optical sensing method provided by another embodiment of the present application. The optical sensing method can be applied to Figure 6 In the optical sensing device 100 shown in the embodiment, the optical sensing method in this embodiment may include the following steps:

[0132] Step S141: emitting a detection light to the object to be detected, and the detection light is reflected on the object to be detected to form a reflected light.

[0133] by Figure 6 Taking the optical sensing device 100 as an example, the light source emitter 10 can emit a detection light L1 to the object to be detected 101. The detection light L1 will form a light spot on the surface of the object to be detected 101 and will be reflected to form a reflected light L2.

[0134] Step S142: sensing the reflected light from the object to be measured to generate an imaging signal.

[0135] In a specific implementation process, the sensor 20 can sense a first image when the light source emitter 10 is turned on. The sensor 20 can also sense a second image when the light source emitter 10 is turned off. The influence of ambient light can be eliminated by subtracting the first image from the second image, and an imaging signal can be obtained by the difference between the first image and the second image. The imaging distribution of the reflected light corresponds to the light spot, so the imaging signal contains information about the characteristics of the light spot.

[0136] Step S143: Calculate the light spot characteristics represented by the imaging signal.

[0137] The imaging calculation unit 30 receives the imaging signal output by the sensor 20 and calculates it to obtain the light spot characteristics represented by the imaging signal. The light spot characteristics represented by the imaging signal may be the width, area and centroid of the light spot.

[0138] Step S144 : calculating the distance between the object to be detected and the optical sensing device 100 .

[0139] like Figure 6 As shown, the imaging and distance calculation unit 70 can receive the imaging signal output by the sensor 20, and calculate the light spot characteristics (such as width, area or centroid) represented by the imaging signal according to the intensity distribution. The imaging and distance calculation unit 70 can also calculate the distance between the object to be measured 101 and the optical sensing device 100 according to the centroid position of the light spot represented by the imaging signal using the triangulation principle.

[0140] Step S145: Compare the light spot characteristics with the preset light spot characteristics and output a control signal, wherein the control signal is used to adjust the exposure time of the sensor.

[0141] The imaging calculation unit 30 is further used to compare the light spot feature represented by the imaging signal with a preset light spot feature, and output a control signal to the sensor 20 .

[0142] In the specific implementation process, the imaging calculation unit 30 receives the imaging signal output by the sensor 20, and calculates the spot feature (such as width, area or centroid) represented by the imaging signal according to the intensity distribution. The memory 80 stores a preset spot feature table and a preset exposure schedule. Among them, the preset spot feature table may include a set of preset spot features. Therefore, the imaging calculation unit 30 can also compare the spot feature represented by the imaging signal with the preset spot feature to output a control signal to the exposure control unit 40, and the exposure control unit 40 adjusts the next exposure time of the sensor 20 according to the control signal. Among them, it can be measured by projecting the detection light onto a specified reflector (such as a whiteboard). Among them, the preset spot feature may include the spot width reflected by the detection light projected onto the specified reflector, the spot area reflected by the detection light projected onto the specified reflector, the centroid position of the spot reflected by the detection light projected onto the specified reflector, etc. Before the optical sensing device 100 leaves the factory, the preset spot feature table and the preset exposure schedule will be pre-stored in the memory 80.

[0143] For example, if the light spot feature (such as width or area) represented by the imaging signal is greater than a feature upper limit, the exposure control unit 40 outputs a control signal to reduce the next exposure time of the sensor 20. If the light spot feature (such as width or area) represented by the imaging signal is less than a feature lower limit, the exposure control unit 40 increases the next exposure time of the sensor 20 according to the control signal. It can be understood that the imaging calculation unit 30 of the present application can output a control signal to the exposure control unit 40 according to the proportional relationship between the imaging light spot feature of the object to be measured 101 and the imaging light spot feature of the specified reflector, and the exposure control unit 40 adjusts the next exposure time of the sensor 20 according to the control signal.

[0144] Step S146: when the ratio of the imaging spot feature of the object to be tested to the imaging spot feature of the designated reflector is stable, material identification is performed on the object to be tested according to a preset exposure schedule.

[0145] The present application uses the exposure control unit 40 to gradually adjust the exposure time according to the ratio between the imaging spot characteristics of the object to be tested and the imaging spot characteristics of the designated reflector, and uses the exposure time to adjust the width or area of ​​the imaging spot S1 until the ratio between the imaging spot characteristics of the object to be tested and the imaging spot characteristics of the designated reflector is stable. For example, the ratio is stable, which means that when the spot width of the object to be tested 101 is similar to the spot width of the designated reflector, or the spot area of ​​the object to be tested 101 is similar to the spot area of ​​the designated reflector, the optical sensing device 100 can accurately identify the material of the object to be tested 101 according to the exposure time.

[0146] In a specific implementation process, the material identification unit 50 obtains the target exposure time output by the imaging calculation unit 30, and performs material identification on the object to be tested 101 according to a preset exposure schedule, and outputs a material identification result to identify the soft or hard material of the ground where the cleaning robot 200 is located, whether there is a transparent obstacle in front of the cleaning robot 200, whether there is stain or liquid in the area where the cleaning robot 200 is currently located, etc. The preset exposure schedule may include multiple known materials and multiple preset exposure times corresponding to the multiple known materials.

[0147] It is understandable that the following steps may be included before step S141:

[0148] Before the optical sensing device 100 leaves the factory, the preset spot feature table and the preset exposure schedule are pre-stored in the memory 80. Alternatively, the spot feature table and the preset exposure schedule may be reset according to user requirements or actual applications after the optical sensing device 100 leaves the factory.

[0149] It can be understood that the preset spot feature table may include a set of preset spot features, and the preset spot features can be measured by projecting the detection light onto a specified reflector (such as a whiteboard). Among them, the preset spot features may include the spot width reflected by the detection light projected onto the specified reflector, the spot area reflected by the detection light projected onto the specified reflector, the centroid position of the spot reflected by the detection light projected onto the specified reflector, etc. The preset exposure schedule may include multiple known materials and multiple preset exposure times corresponding to the multiple known materials. It can be understood that an object of a known material can be used as a calibration object for obtaining a preset exposure time. Each object of a known material (i.e., a calibration object) corresponds to a preset exposure time, so the preset exposure time of the object of the known material can be measured by projecting the detection light onto an object of a known material, and when the ratio of the imaging spot feature of the object of the known material to the imaging spot feature of the specified reflector (such as a whiteboard) is stable. In other words, the present application obtains a preset exposure schedule by measuring multiple objects of known materials respectively and recording the preset exposure times of multiple objects of known materials.

[0150] It can be understood that after executing step S146 , the optical sensing method in this embodiment will return to step S141 to repeatedly execute the above steps.

[0151] See also Fig.15 , is a flow chart of an optical sensing method provided by another embodiment of the present application. The optical sensing method can be applied to Figure 6 In the optical sensing device 100 shown in the embodiment, the optical sensing method in this embodiment may include the following steps:

[0152] Step S151: Detect the distance change of the object.

[0153] by Figure 6 Taking the optical sensing device 100 as an example, the optical sensing device 100 can be applied to the automatic faucet 300. Before the user washes his hands with the automatic faucet 300, the optical sensing device 100 will detect the distance change of the object to be detected in real time.

[0154] Step S152: Determine whether the current distance of the object to be measured is less than or equal to the starting distance. If the current distance of the object is less than or equal to the starting distance, proceed to step S153, otherwise return to step S151.

[0155] It can be understood that in this embodiment, the sensor 20, the imaging processing unit 60, the material identification unit 50 and the memory 80 can be integrated into an integrated circuit, and the light source emitter 10 and the IC (i.e., the optical sensing device 100) can be integrated into a module. That is, the distance between the object to be tested 101 and the sensor 20 can represent the distance between the object to be tested 101 and the optical sensing device 100. The distance between the object to be tested 101 and the sensor 20 can also represent the distance between the object to be tested 101 and the optical sensing module 400.

[0156] It can be understood that the optical sensing device 100 determines whether the user washes his hands by comparing the current distance of the object to be detected with a preset distance.

[0157] Step S153: Start water supply and continue for a first period of time.

[0158] When the current distance of the object to be measured is less than or equal to the starting distance, such as Figure 8 In the scenario shown, the user's hand is under the water outlet 303 and the distance between the user's hand and the optical sensing device 100 is less than or equal to a preset distance, which means that the user needs to wash his hands, and the automatic faucet will start supplying water, opening the faucet to supply water to the user within the first time period T1.

[0159] Step S154: Execute detection and identification for a second period of time to collect exposure time and distance measurement information.

[0160] In the second time period T2 , the optical sensing device 100 detects and identifies the object to be detected, and collects exposure time and distance measurement information of the object to be detected.

[0161] Step S155: Calculate the minimum distance and average exposure time.

[0162] The minimum distance D between the object to be tested and the optical sensing device 100 is min (t) satisfies the following relationship:

[0163] D min (t) = min{D min (t-1),D(t)}.

[0164] Among them, min{D min (t-1),D(t)} is to take D min The minimum value between (t-1) and D(t). min (t-1) is the minimum distance between the object to be measured and the optical sensing device 100 in the previous period of time, and D(t) is the distance between the object to be measured and the optical sensing device 100 at the current time.

[0165] Among them, the average exposure time of the object to be tested is W avg (t) satisfies the following relationship:

[0166] W avg (t) = [W(t) + W avg (t-1)] / 2.

[0167] Among them, [W(t)+W avg (t-1)] / 2 is to take W(t) and W avg (t-1) is the average of the two. W(t) is the exposure time of the object to be tested at the current time, W avg (t-1) is the average exposure time of the object to be tested in the previous period of time.

[0168] Step S156: Determine whether the average exposure time is greater than the time threshold. If the average exposure time is greater than the time threshold, proceed to step S158, otherwise proceed to step S157.

[0169] It can be understood that when the optical sensing device 100 detects a "pure water column", its exposure time increases significantly. When the optical sensing device 100 detects "pure hands" and "users washing hands", its exposure time decreases significantly. In other words, the exposure time in the "pure water column" scenario is significantly different from the exposure time in the "pure hands" and "users washing hands" scenarios. Therefore, the present application can determine the average exposure time W of the object to be tested. avg Whether (t) is greater than the time threshold TH1 can determine whether continuous water supply is required.

[0170] If the average exposure time of the object to be tested is W avg (t) is greater than the time threshold TH1, it means that the object to be tested is a "pure water column" and the water supply can be turned off. avg (t) is less than the time threshold TH1, then the minimum distance D between the object to be tested and the optical sensing device 100 needs to be min (t) Distance D from a target target Make a comparison.

[0171] Step S157: Determine whether the difference between the minimum distance and the target distance is greater than or equal to the distance threshold. If the difference between the minimum distance and the target distance is greater than or equal to the distance threshold, proceed to step S158, otherwise return to step S153.

[0172] If the minimum distance D min (t) Distance to target D target If the difference between the minimum distance D and the minimum distance D is greater than or equal to the distance threshold TH2, that is, the user's hand leaves the faucet, the water supply is turned off and the process returns to stage 0. min (t) Distance to target D target If the difference between D and TH2 is less than the distance threshold TH2, that is, the user is washing hands, water is continuously supplied and the process returns to step S153. min (t)-D target .

[0173] Among them, the minimum distance D min (t) Distance to target D target The difference can be a positive number, 0 or a negative number, and the distance threshold TH2 is a positive number.

[0174] It can be understood that the above target distance D target It may refer to that when the automatic faucet 300 is not supplying water, the optical sensing device 100 measures the distance between the optical sensing device 100 and the target object directly below the water outlet 303 .

[0175] It is understandable that the object to be tested of the automatic faucet 300 is not limited to the user's hand, but can also be a bucket, a cup or other objects to be washed, and this application does not make specific limitations on this.

[0176] Step S158: Turn off the water supply.

[0177] The optical sensing module, optical sensing device and method of the present application can gradually adjust the exposure time through the exposure control unit according to the ratio of the imaging spot characteristics of the object to be measured, until the spot characteristic ratio is stable, and then can identify the material and state of the object to be measured and measure the distance of the object to be measured according to the exposure time. The embodiments of the present application can solve the problem that the optical sensing device in the prior art cannot identify the material in some scenarios, resulting in a decrease in user experience.

[0178] Those skilled in the art should recognize that the above embodiments are only used to illustrate the present application and are not intended to be limiting of the present application. As long as they are within the spirit and scope of the present application, appropriate changes and modifications to the above embodiments are within the scope of protection claimed in the present application.

Claims

1. An optical sensing device, characterized in that: The optical sensing device includes a sensor, an imaging processing unit and a material recognition unit; The sensor is configured to sense reflected light from the object to be tested and generate an imaging signal; wherein the reflected light is formed by the detection light emitted by a light source emitter and reflected on the object to be tested; The imaging processing unit is coupled to the light source emitter and the sensor, and is configured to compare the light spot feature represented by the imaging signal with a preset light spot feature in a preset light spot feature table, and adjust the exposure time of the sensor according to the comparison result to output a target exposure time to the material recognition unit; The material identification unit is coupled to the imaging processing unit, and the material identification unit is configured to perform material identification on the object to be tested according to the target exposure time and a preset exposure schedule; The preset exposure time table includes a plurality of objects to be tested of different materials and a plurality of preset exposure times corresponding to the plurality of objects to be tested of different materials.

2. The optical sensing device according to claim 1, wherein: The optical sensing device further includes a memory, which is coupled to the imaging processing unit and the material recognition unit, and is used to pre-store the preset light spot feature table and the preset exposure time schedule.

3. The optical sensing device according to claim 1, wherein: The imaging processing unit includes an exposure control unit; The exposure control unit is coupled to the sensor and the light source emitter, and the exposure control unit is configured to control the light source emitter to be turned on or off; The sensor is configured to sense a first image when the light source emitter is turned on, and to sense a second image when the light source emitter is turned off; the sensor is also configured to subtract the first image from the second image to obtain the imaging signal.

4. The optical sensing device according to claim 3, wherein: The imaging processing unit also includes an imaging calculation unit; The imaging calculation unit is coupled to the sensor and the exposure control unit, and is configured to calculate the light spot feature represented by the imaging signal, compare the light spot feature represented by the imaging signal with the preset light spot feature, and output the control signal to the exposure control unit; The exposure control unit is further configured to adjust an exposure time of the sensor according to the control signal.

5. The optical sensing device according to claim 3, wherein: The imaging processing unit also includes an imaging and distance calculation unit; The imaging and distance calculation unit is coupled to the sensor and the exposure control unit, and is configured to calculate the light spot feature represented by the imaging signal, compare the light spot feature represented by the imaging signal with the preset light spot feature, and output the control signal to the exposure control unit; The exposure control unit is configured to adjust the exposure time of the sensor according to the control signal; The imaging and distance calculation unit is further configured to calculate a distance value between the object to be detected and the optical sensing device according to the imaging signal.

6. An optical sensing module, characterized in that: The optical sensing module comprises a light source emitter and the optical sensing device as claimed in any one of claims 1 to 5.

7. An optical sensing method, applied to an optical sensing device, characterized in that: The optical sensing method comprises: Sensing reflected light from the object to be tested to generate an imaging signal; wherein the reflected light is formed by the detection light emitted by a light source emitter and reflected on the object to be tested; Comparing the light spot feature represented by the imaging signal with a preset light spot feature in a preset light spot feature table, and adjusting the exposure time of the sensor according to the comparison result to output a target exposure time; Performing material identification on the object to be tested according to the target exposure time and a preset exposure schedule; The preset exposure time table includes a plurality of objects to be tested of different materials and a plurality of preset exposure times corresponding to the plurality of objects to be tested of different materials.

8. The optical sensing method according to claim 7, characterized in that: The optical sensing method further comprises: The preset light spot characteristic table and the preset exposure time schedule are stored in the memory in advance.

9. The optical sensing method according to claim 7, characterized in that: The optical sensing method further comprises: sensing a first image when the light source emitter is turned on, and sensing a second image when the light source emitter is turned off; The imaging signal is obtained by subtracting the first image from the second image.

10. The optical sensing method according to claim 7, characterized in that: The optical sensing method further comprises: Projecting detection light onto the calibration object; sensing reflected light from the calibration object to generate an imaging signal; Comparing the light spot feature represented by the imaging signal with the preset light spot feature, adjusting the exposure time of the sensor according to the comparison result, and outputting the preset exposure time of the calibration object when the ratio between the light spot feature represented by the imaging signal and the light spot feature represented by the imaging signal of a reflective object is stable; The preset exposure schedule is obtained by recording the preset exposure times of a plurality of calibration objects of different materials.

11. The optical sensing method according to claim 7, characterized in that: The optical sensing method further comprises: The distance value between the object to be detected and the optical sensing device is calculated according to the imaging signal.