Optical sensor, electronic device, distance calculation method, and recording medium for program
The optical sensor corrects for skewness in ToF sensor histograms to accurately calculate distances to objects despite non-objects, improving measurement precision.
Patent Information
- Application Number
- JP2021072082
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-04-21
- Publication Date
- 2025-07-28
- Estimated Expiration
- 2041-04-21
AI Technical Summary
Existing distance calculation methods using ToF sensors are inaccurate when reflected light components from multiple objects are mixed, leading to incorrect distance measurements due to the presence of non-objects in the sensing range.
An optical sensor that calculates skewness from a histogram of light reflection times and intensities to correct for distortion caused by non-objects, using a skewness-based correction method to improve distance calculation accuracy.
Enables precise distance calculation to a target object even when non-objects are present, by correcting for histogram skewness and distortion, thereby enhancing measurement accuracy.
Smart Images

Figure 0007713797000005 
Figure 0007713797000006 
Figure 0007713797000007
Abstract
Description
Technical Field
[0001] The present invention relates to an optical sensor, an electronic device, a distance calculation method, and a program recording medium.
Background Art
[0002] In distance calculation of an object by a ToF (Time of Flight) sensor, as an example, by a TDC (Time to Digital Convertor) circuit, for each time (flight time of light) from when light is irradiated until reflected light from the object is received, the reflected light is counted and histogrammed. Then, among this flight time of light, the distance from the sensor to the object is calculated using the time with the maximum count.
[0003] For example, Patent Document 1 discloses a method of subtracting a crosstalk component and an ambient light component caused by a sensor cover from a reflected light component of an object. Specifically, for improving the measurement time accompanying an improvement in the resolution of a camera, reflected light in which pulsed light irradiated from a light emitting element is reflected by an object and incident on a first light receiving unit and reference light (crosstalk inside the sensor) in which pulsed light irradiated from the light emitting element is directly incident on a second light receiving unit are calculated, and the distance from the sensor to the object is calculated. In this way, by subtracting the reference light component from the reflected light component, the accuracy of the reflected light component is improved.
Prior Art Documents
Patent Documents
[0004]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0005] However, in the prior art, there is a problem that the distance calculation accuracy of one object cannot be improved when the reflected light components from a plurality of objects are mixed in the histogram. Even if the operation between the reflected light and the reference light is performed, when there are objects other than the object (hereinafter referred to as non-objects) around the object, the reflected light from the non-objects is mixed into the reflected light from the object, so that the distance to the object cannot be accurately calculated.
[0006] One aspect of the present invention aims to accurately calculate the distance to an object even when there are non-objects around the object.
Means for Solving the Problems
[0007] In order to solve the above problems, an optical sensor according to one aspect of the present invention is an optical sensor, comprising: a light emitting element that irradiates light to a region where an object exists; a light receiving element that receives the reflected light from the object; a generation unit that generates a histogram showing the relationship between the time from when the light emitting element irradiates the light until the light receiving element receives the reflected light, and the intensity of the reflected light received by the light receiving element; a first calculation unit that calculates the skewness of the histogram; and a second calculation unit that calculates the distance between the optical sensor and the object with reference to the histogram and the skewness.
[0008] Also, a distance calculation method according to one aspect of the present invention is a distance calculation method for an optical sensor that measures the distance to an object, the optical sensor comprising: a light emitting element that irradiates light to a region where the object exists; and a light receiving element that receives the reflected light from the object, the method comprising: a generation step of generating a histogram showing the relationship between the time from when the light emitting element irradiates the light until the light receiving element receives the reflected light, and the intensity of the reflected light received by the light receiving element; a first calculation step of calculating the skewness indicating the degree of distortion from the normal distribution of the histogram generated in the generation step; and a second calculation step of correcting the histogram generated in the generation step using the skewness calculated in the first calculation step, and calculating the distance between the optical sensor and the object from the corrected histogram.
Effect of the Invention
[0009] According to one aspect of the present invention, the distance to an object can be calculated with high precision.
Brief Description of the Drawings
[0010]
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9
Figure 10
Figure 11
Figure 12
Modes for Carrying Out the Invention
[0011] 〔Embodiment 1〕 Hereinafter, Embodiment 1 of the present invention will be described in detail.
[0012] (Configuration of Optical Sensor 1) FIG. 1 is a block diagram showing the configuration of the optical sensor 1 according to the present embodiment. The optical sensor 1 is a ToF sensor, and measures the distance to an object based on the time from when light is irradiated until the reflected light from the object is received.
[0013] As shown in FIG. 1, the optical sensor 1 includes a reference pulse generation unit 11, a driver 12, a light emitting element 13, a signal light receiving unit (light receiving element) 21, a first TDC 22, a reference light receiving unit (light receiving element) 23, a second TDC 24, a histogram generation unit (generation unit) 25, and an arithmetic unit (first arithmetic unit, second arithmetic unit) 26.
[0014] The reference pulse generation unit 11 gives a reference pulse of a waveform to the driver 12. Further, the reference pulse generation unit 11 gives a reference clock signal to the first TDC 22 and the second TDC 24.
[0015] The driver 12 irradiates the light emitting element 13 with pulsed light based on the reference pulse from the reference pulse generation unit 11. The light emitting element 13 irradiates light to the region where the target object (object) 2 exists. The pulsed light irradiated from the light emitting element 13 is reflected by the target object 2 and the non-target object 3 respectively and enters the signal light receiving unit 21. Further, the pulsed light irradiated from the light emitting element 13 directly enters the reference light receiving unit 23. Hereinafter, the light directly entering the reference light receiving unit 23 is referred to as "reference light".
[0016] The signal light receiving unit 21 is a light receiving element that receives the reflected light from the target object 2 and the non-target object 3, and outputs a pulse synchronized with the reflected light from the target object 2 and the non-target object 3 to the first TDC 22. The first TDC 22 outputs a time stamp indicating the pulse output time of the pulse output from the signal light receiving unit 21 to the histogram generation unit 25.
[0017] The reference light receiving unit 23 outputs a pulse synchronized with the reference light from the light emitting element 13 to the second TDC 24. The second TDC 24 outputs a timestamp indicating the pulse output time of the pulse output by the reference light receiving unit 23 to the histogram generation unit 25.
[0018] The histogram generation unit 25 generates a histogram showing the relationship between the time from when the light emitting element 13 irradiates light until the signal light receiving unit 21 receives the reflected light, and the intensity of the reflected light received by the signal light receiving unit 21. Specifically, the histogram generation unit 25 receives a timestamp from the first TDC 22 and increments the count value in the bin which is the measurement interval corresponding to the timestamp. Then, the histogram generation unit 25 counts the timestamps at a predetermined period and generates a histogram based on the count. The histogram generation unit 25 also receives a timestamp from the second TDC 24 and performs the same processing as above to generate a histogram. Note that the intensity of the reflected light is proportional to the count value in the bin.
[0019] The arithmetic unit 26 calculates the detection distance from the difference between the centroid position of the histogram based on the timestamp from the first TDC 22 and the centroid position of the histogram based on the timestamp from the second TDC 24, with the centroid position of the histogram from the second TDC 24 as the origin, among the histograms generated by the histogram generation unit 25.
[0020] Next, the arithmetic unit (first arithmetic unit) 26 calculates the skewness indicating the degree of distortion from the normal distribution of the histogram with the above origin set. Then, the arithmetic unit (second arithmetic unit) 26 calculates the distance between the optical sensor 1 and the object 2 with reference to the histogram generated by the histogram generation unit 25 and the calculated skewness.
[0021] Note that the optical sensor 1 may output the calculated distance data to another device at a short distance (for example, a memory on the same substrate) by I2C (Inter-Integrated Circuit) communication.
[0022] Figure 2 is a diagram showing an image of a histogram according to the present embodiment. Since the optical sensor 1 has the above-described distance detection mechanism, when non-target objects 3 other than the target object 2 are mixed within the sensing range of the histogram, as shown in Figure 2, the signal acquired by the signal light receiving unit 21 of the optical sensor 1 includes reflected light components from the target object 2 and the non-target objects 3. Therefore, the histogram showing the result of counting the signals for each bin takes a distorted shape.
[0023] That is, in Figure 2, since the position of the center of gravity of the histogram is shifted, the class where the frequency peaks is shifted. In this histogram, since the time from when light is irradiated until the reflected light is received, which corresponds to the class, cannot be accurately specified, high-precision distance calculation cannot be performed.
[0024] In the present embodiment, in order to cope with this shift in the center of gravity position, the degree of distortion of the histogram in which a plurality of objects obtained by the optical sensor 1 are mixed is obtained as skewness, and correction is applied according to the skewness during distance calculation to improve the accuracy of distance calculation.
[0025] (Explanation of skewness) "Skewness" is a value indicating how much a distribution diagram (histogram) is distorted from a normal distribution as a statistical method. As shown in Figure 2, in a histogram with a trailing tail and a forward dip, the skewness becomes a positive value (for example, 0.76). Also, in a histogram with a leading tail and a backward dip, the skewness becomes a negative value (for example, -0.76). It is an index such that the absolute value increases as each tendency strengthens.
[0026] The degree of collapse of the histogram shape is quantified by skewness β1 1 / 2 and the distance value to the object is corrected using β1 1 / 2 to detect the target object. β1 1 / 2 is calculated by Equation (1). b is the interval number of the bin interval (measurement interval) of the histogram. n bis the signal amount in each bin (the count value of timestamps per unit time shorter than the measurement interval). μ is the average value of the interval number b. That is, μ is the interval number at which the signal generation frequency is maximized. σ is the positive square root of the variance of the interval number b (i.e., the standard deviation).
[0027] [Number]
[0028] Skewness β1 1 / 2 is used to correct the distance value in the direction of the object 2, enabling more accurate distance calculation. Also, skewness β1 1 / 2 is used to determine the threshold related to the determination of object detection, enabling object detection that is less affected by non-target objects.
[0029] (Processing of the optical sensor 1) FIG. 3 is a flowchart showing the processing of the optical sensor 1 according to the present embodiment. The processing of the optical sensor 1 will be described according to FIG. 3.
[0030] (Step S11: Generation step) In the optical sensor 1, the histogram generation unit 25 generates a histogram based on the signal from the signal light receiving unit 21 that receives the signal light outside the optical sensor 1. Also, the histogram generation unit 25 generates a histogram based on the signal from the reference light receiving unit 23 that receives the reference light inside the optical sensor 1.
[0031] (Step S12) The arithmetic unit 26 subtracts the centroid position of the histogram based on the reference light from the centroid position of the histogram based on the signal light generated in step S11. Thereby, the origin position can be set in the histogram. In the present embodiment, this histogram is used in steps S13 and S14.
[0032] (Step S13: First arithmetic step) The calculation unit 26 calculates the skewness from the histogram of the result in which the origin position is set in step S12 using Expression (1).
[0033] (Step S14: Second calculation step) The calculation unit 26 calculates the distance between the optical sensor 1 and the object 2 with reference to the histogram of the result in which the origin position is set in step S12, the skewness calculated in step S13, and a predetermined distortion coefficient. Specifically, the calculation unit 26 calculates the distance from the histogram and corrects the distance using the skewness and the distortion coefficient. For example, as shown in Expression (2), the calculation unit 26 calculates a distance value Range obtained by multiplying the barycentric position G of the histogram by the histogram width W, and corrects the distance value Range by a value obtained by multiplying the skewness β1 hist by the distortion coefficient K. 1 / 2
[0034]
Equation
[0035] The distortion coefficient K may be, for example, a numerically value obtained experimentally, and may be appropriately set according to the measurement range of the optical sensor 1 or the like.
[0036] As described above, the optical sensor 1 can calculate the distance to the object 2 with high accuracy.
[0037] In the above description, the case where the reference light is used as the origin information has been described. However, the present embodiment is not limited to this. For example, as a modification, members related to the reference light from the light emitting element 13 (for example, the reference light receiving unit 23, the second TDC 24, etc.) and processes (for example, generation of a histogram based on the reference light (the latter half of step S11), origin setting (step S12), etc.) are omitted, and the histogram based on the signal light generated in the first half of step S11 may be used in steps S13 and S14.
[0038] <Example 1> FIG. 4 is a diagram for explaining a specific example according to the present embodiment. In the example shown in FIG. 4, the object 2 is transparent and is placed on the non-object 3 which is the floor.
[0039] In the example shown in FIG. 4, the optical sensor 1 according to the present embodiment obtains the distortion of the histogram in which the reflected light of the object 2 and the reflected light of the non-object 3 are mixed, and corrects the distance value Range to the object 2 using Equation (3).
[0040]
Equation
[0041] Here, G hist is the centroid position of the histogram. 7.5 is the histogram width. 13.9 is the distortion coefficient.
[0042] Note that the distance calculation by the conventional method is shown in Equation (4).
[0043]
Equation
[0044] The calculation unit 26 (second calculation unit) of the optical sensor 1 calculates the distance between the optical sensor 1 and the object 2 using the centroid of the histogram and the value obtained by multiplying the skewness by the distortion coefficient. Specifically, as shown in Equation (3), the calculation unit 26 adds the product of the skewness and the distortion coefficient to the distance Range in Equation (4).
[0045] The skewness β1 in the mixed state of FIG. 4 1 / 2 is -1.06, and it can be determined that not only the signal of the object 2 but also the signal of the non-object 3 is mixed, and the histogram in which the signal of the non-object 3 trailing behind is dominant.
[0046] The calculated distance value obtained by correcting the center of gravity position of the hem trailing portion according to Equation (3) is the position indicated by A'1. Even in the case of a transparent object 2 where the influence of reflection within the object 2 and reflection by the non-object 3 is strong and distance detection itself is difficult, compared with the position of the calculated distance value A1 in the mixed state before correction according to Equation (4), it has become possible to calculate a distance closer to the theoretical distance value P1 between the optical sensor 1 and the object 2.
[0047] 〔Embodiment 2〕 Embodiment 2 of the present invention will be described below. For the sake of convenience of explanation, members having the same functions as those described in Embodiment 1 are denoted by the same reference numerals, and their descriptions will not be repeated.
[0048] When the optical sensor 1 detects the object 2, when the optical sensor 1 approaches the object 2, regarding the light reception at the optical sensor 1, the signal amount from the object 2 changes greatly, while the signal amount from the non-object 3 does not change so much. In the present embodiment, the histogram generation unit 25 generates a first histogram corresponding to the object 2 and the non-object 3 before the optical sensor 1 moves, and a second histogram corresponding to the object 2 and the non-object 3 after the optical sensor 1 moves, respectively. The calculation unit (second calculation unit) 26 calculates the distance between the optical sensor 1 and the object 2 with reference to the difference between the first histogram and the second histogram. Since the signal component of the object 2 remains in the difference, the distance can be calculated with high accuracy.
[0049] FIG. 5 is a diagram showing a histogram of the distances among the optical sensor 1, the object 2, and the non-object 3 according to the present embodiment. The horizontal axis represents the section number of the bin interval (measurement interval), and the vertical axis represents the amount of signal received from the object and / or the non-object. As shown in FIG. 5, the histogram 1 (Hist1) is a histogram in a state where the object and the non-object before movement are mixed, and is shown by a solid line without plot marks. The histogram 2 (Hist2) is a histogram in a state where the object and the non-object after movement are mixed, and is shown by a dotted line without plot marks. The histogram 3 (Hist3) is a histogram generated by subtracting the histogram 1 from the histogram 2, and is shown by a dashed-dotted line with square plot marks.
[0050] In FIG. 5, when comparing the histogram 1 and the histogram 2, when the distance between the optical sensor 1 and the object 2 becomes shorter due to the movement of the optical sensor 1 or the object 2, the histogram 2 when the distance was long before the movement has a larger signal amount of the object 2 than the histogram 1. As shown in the triangular graph of FIG. 5, it can be seen that there is a large difference in the amount of signal received by the optical sensor 1 from the object 2 before and after the movement. This is because the intensity of light is inversely proportional to the square of the distance from the light source, and the shorter the distance, the larger the amount of signal indicating the intensity of light. On the other hand, as shown in the circular graph of FIG. 5, the amount of signal received by the optical sensor 1 from the non-object 3 hardly changes before and after the movement. Also, since the signal amounts are different for each of the object 2, the non-object 3, and the mixed state of the object 2 and the non-object 3, as shown in FIG. 5, the histogram of the mixed state tends to take a distorted shape.
[0051] Therefore, by subtracting the histogram 1 from the histogram 2 shown in FIG. 5, the histogram 3 is generated. Thereby, the distance between the optical sensor 1 and the object 2 can be calculated with high accuracy.
[0052] When the optical sensor 1 approaches the object 2, before and after the optical sensor 1 moves, as shown in the triangular graph of FIG. 5, the signal amount of the object 2 close to the optical sensor 1 increases significantly, while as shown in the circular graph of FIG. 5, the signal amount of the non-object 3 away from the optical sensor 1 changes little.
[0053] Therefore, by the above subtraction, the signal component of the non-object 3 is almost canceled out, and for the signal component of the object 2, since the large signal amount is subtracted from the small signal amount, the main signal component of the object 2 remains. Thus, the distance can be calculated accurately. Note that the arithmetic unit 26 does not necessarily subtract the histogram before movement from the histogram after movement, but may subtract the histogram with a smaller signal amount from the histogram with a larger signal amount among the histogram before movement and the histogram after movement.
[0054] (Processing of the optical sensor 1) FIG. 6 is a flowchart showing the processing of the optical sensor 1 according to the present embodiment. According to FIG. 6, the processing of the optical sensor 1 will be described.
[0055] (Step S21) Before the object 2 moves, in the optical sensor 1, the histogram generation unit 25 generates a histogram based on the signal from the signal light receiving unit 21 that receives the signal light outside the optical sensor 1. Also, the histogram generation unit 25 generates a histogram based on the signal from the reference light receiving unit 23 that receives the reference light inside the optical sensor 1. Then, the arithmetic unit 26 subtracts the centroid position of the histogram based on the reference light from the centroid position of the histogram based on the generated signal light. Thereby, in the histogram 1 before movement (Hist1: solid line of the mixed state before movement in FIG. 5), the origin position can be set.
[0056] (Step S22) After the object 2 has moved, in the optical sensor 1, the histogram generation unit 25 generates a histogram based on the signal from the signal light receiving unit 21 that receives the signal light outside the optical sensor 1. Also, the histogram generation unit 25 generates a histogram based on the signal from the reference light receiving unit 23 that receives the reference light inside the optical sensor 1. Then, the arithmetic unit 26 subtracts the centroid position of the histogram based on the reference light from the centroid position of the histogram based on the generated signal light. Thereby, in the histogram 2 after movement (Hist2: the broken line of the mixed state after movement in FIG. 5), the origin position can be set.
[0057] (Step S23) The arithmetic unit 26 calculates the skewness from the histogram 1 obtained in step S21 using the formula (1) of Embodiment 1.
[0058] (Step S24) The arithmetic unit 26 subtracts the histogram 1 obtained in step S21 from the histogram 2 obtained in step S22, and generates a histogram 3 for signal extraction (Hist3: the dashed-dotted line of the signal difference of the target detection object in FIG. 5).
[0059] In this case, assuming that the non-target object 3 exists behind the target object 2, as shown in the graphs of the non-target object before and after movement in FIG. 5, the position of the non-target object 3 is regarded as substantially constant, and the signal amount is also substantially constant. Also, the signal amount, which is the intensity of light, is inversely proportional to the square of the distance. Therefore, by subtracting the histogram 1 before movement in the mixed state from the histogram 2 after movement in the mixed state, a histogram 3 after movement of only the target object 2, which is for signal extraction, is generated schematically.
[0060] (Step S25) The arithmetic unit 26 calculates the distance value between the optical sensor 1 and the target object 2 from the histogram 3 for signal extraction generated in step S24, and corrects the distance value using the skewness calculated in step S23 and a predetermined distortion coefficient.
[0061] <Example 2> FIG. 7 is a diagram showing a specific example according to the present embodiment. As a specific example of the present embodiment, in a histogram in which the object 2 and the non-object 3 are mixed, a case where signals before and after movement are subtracted will be described.
[0062] As shown in FIG. 7, compared with before subtraction, after subtraction, the trailing component is excluded, so that it takes a shape closer to the histogram of only the object 2, and the object component is dominant.
[0063] When calculating the centroid based on the conventional histogram, it was at the 7.3 bin position, but when calculating the centroid based on the histogram after subtraction, it was at the 5.7 bin position, which is close to the ideal value of 3.7 bin in this example.
[0064] When calculating by the conventional method based on the conventional histogram, the distance shown by A2 was obtained. In Example 1 where correction was given due to skewness, when calculating Expressions (1) and (2) based on the histogram after difference, compared with the distance shown by A'1 shown in FIG. 4, the distance shown by A'2 shown in FIG. 7 was obtained, which was effective in improving the accuracy (see FIG. 7).
[0065] Here, b is the section number of the bin interval (measurement interval) of the histogram, and n b is the signal amount in 1 bin. μ is the average value in the section b. σ is the positive square root of the variance in the section b. G hist is the centroid position of the histogram. 7.5 is the histogram width. 13.9 is the distortion coefficient.
[0066] 〔Embodiment 3〕 Embodiment 3 of the present invention will be described below. For convenience of explanation, members having the same functions as those described in Embodiments 1 and 2 are denoted by the same reference numerals, and the description thereof will not be repeated.
[0067] FIG. 8 is a block diagram showing the configuration of the optical sensor 1a according to the present embodiment. The optical sensor 1a further includes an information acquisition unit (acquisition unit) 30 that acquires range-related information regarding a range in which the object (target object) 2 can exist. The calculation unit 26 calculates the distortion degree with reference to the range-related information. Specifically, the calculation unit 26 sets the element range of the histogram (the range of Σ in the above-described formula (1)) used for calculating the distortion degree so as to correspond to the range in which the object 2 can exist. Thereby, the accuracy of the calculated distance is improved.
[0068] In one aspect, the information acquisition unit 30 may be configured to receive an input of range-related information from a user or another device. Examples of the range-related information include, for example, an assumed initial positional relationship between the optical sensor 1a and the object 2, a moving distance of the optical sensor 1a or the object 2, a measurement range required for the optical sensor 1, and the like. The measurement range is an arbitrarily determined range according to the use of the optical sensor 1a and is a range overlapping with the detection range defined by the performance of the optical sensor 1a.
[0069] Also, in one aspect, the information acquisition unit 30 may detect the position of the non-target object 3 that defines the position of the object 2 and acquire range-related information based on the position of the non-target object 3. For example, when the object 2 is disposed on the non-target object 3 or when the object 2 is disposed inside the non-target object 3, the information acquisition unit 30 can acquire range-related information regarding a range in which the object 2 can exist based on the position of the non-target object 3. For example, at the time of calibration of the optical sensor 1a, the optical sensor 1a measures the distance to the non-target object 3 instead of the object 2, and the information acquisition unit 30 may acquire range-related information based on the result.
[0070] According to the above configuration, the calculation unit 26 sets the element range of the histogram (the range of Σ in the above-described formula (1)) used for calculating the distortion degree so as to correspond to the range in which the object 2 can exist, thereby minimizing the influence of reflected light from the non-target object 3 existing outside the range in which the object 2 can exist during the calculation of the distortion degree. Thereby, the accuracy of the calculated distance is improved.
[0071] 〔Embodiment 4〕 Embodiment 4 of the present invention will be described below. For convenience of explanation, members having the same functions as those described in Embodiments 1 to 3 are denoted by the same reference numerals, and their descriptions will not be repeated.
[0072] In this embodiment, similar to Embodiment 3, the optical sensor 1a further includes an information acquisition unit (acquisition unit) 30 that acquires range-related information regarding a range in which the object (body) 2 can exist. Then, the calculation unit 26 of the optical sensor 1a calculates the distance using a distortion coefficient corresponding to the information regarding the range in which the object 2 can exist. Thereby, the accuracy of the calculated distance is improved.
[0073] The optical sensor 1a usually has a detection range including a central axis extending from the optical sensor 1a. This detection range may be represented by a substantially conical shape, or may be represented by a substantially three-dimensional shape depending on the shape of the window provided on the optical sensor 1. When the optical sensor 1a is brought close to the object 2 and the non-object 3, the detection range of the optical sensor 1a is limited compared to before the approach, and the ratio of the space occupied by the mixed object of the non-object 3 and the object 2 within the detection range increases. Thus, when the optical sensor 1a and the object 2 are in an approaching state, by setting the distortion coefficient so that the amount of distortion correction increases when the calculation unit 26 calculates the distance, a solution close to the actual distance can be obtained.
[0074] As an example, when the object 2 is disposed on the non-object 3, the information acquisition unit 30 acquires, as range-related information, the distance between the optical sensor 1a and the non-object 3. When the distance between the optical sensor 1 and the non-object 3 is less than the threshold value, the calculation unit 26 may set K in the above-described formula (2) to K1, and when the distance between the optical sensor 1a and the non-object 3 is equal to or greater than the threshold value, the calculation unit 26 may set K in the above-described formula (2) to K2 (K1 > K2). That is, the calculation unit 26 can set the distortion coefficient so that the distortion coefficient increases as the range in which the object 2 may exist approaches the optical sensor 1a. The calculation unit 26 may change the distortion coefficient in two or more steps or gradually increase the distortion coefficient as the range in which the object 2 may exist approaches the optical sensor 1a. The value of the distortion coefficient set by the calculation unit 26 may be obtained experimentally, for example.
[0075] 〔Embodiment 5〕 Embodiment 5 of the present invention will be described below. For convenience of explanation, members having the same functions as those described in Embodiments 1 to 4 are denoted by the same reference numerals, and the description thereof will not be repeated.
[0076] In the present embodiment, the optical sensor 1 includes a plurality of light receiving elements having different detection angles as the signal light receiving unit 21. Accordingly, the plurality of light receiving elements detect the signal light from the object 2 and the non-object 3 for each different detection angle.
[0077] According to the above configuration, by detecting the signal light from the object 2 and the non-object 3 for each different detection angle, the distance between the optical sensor 1 and the object 2 can be calculated with high accuracy. Further, since the light emitting element 13 or the signal light receiving unit 21 has different incident angles or detection angles, it is possible to selectively improve the accuracy of the detected distance.
[0078] Taking the edge detection of the object 2 using this embodiment as an example. In a state where the positional relationship of the object 2 is not fixed and the position of the object 2 with respect to the optical sensor 1 is not restricted, by providing the optical sensor 1 with a signal light receiving unit 21 having different detection angles, it becomes possible to calculate the distance by utilizing the signal of the light receiving element that appropriately captures the object 2. As a result, it is possible to improve the tolerance to position fluctuations of the object 2. In other words, since the optical sensor 1 includes a plurality of light receiving elements having different detection angles, even if the position of the object 2 fluctuates, any one of the light receiving elements receives light at an appropriate angle, and the signal of that light receiving element is used, so that high-precision distance calculation can be maintained. In addition, the configuration of this embodiment is very effective because the range of the object 2 for which the distance can be calculated with higher precision is wider than the configuration including a light receiving element with a single angle.
[0079] 〔Embodiment 6〕 Embodiment 6 of the present invention will be described below. For the sake of convenience of explanation, members having the same functions as the members described in Embodiments 1 to 5 are denoted by the same reference numerals, and the description thereof will not be repeated.
[0080] This embodiment is applied to, for example, an electronic device including an optical sensor 1b. Examples of the electronic device include, but are not limited to, a water purifier or a surveying instrument that performs a specific operation when an object is within a predetermined distance.
[0081] FIG. 9 is a block diagram showing the configuration of the optical sensor 1b according to this embodiment. As can be seen by comparing FIG. 1 and FIG. 9, the optical sensor 1b further includes a determination unit 27 with respect to the optical sensor 1. The determination unit 27 compares the distance between the optical sensor 1b and the object 2 calculated by the arithmetic unit (second arithmetic unit) 26 with the threshold value of the distance, and determines whether or not the object 2 has been detected. Specifically, the determination unit 27 detects the object 2 when the distance between the optical sensor 1b and the object 2 is equal to or less than the threshold value.
[0082] FIG. 10 is a diagram showing a change in the amount of signal detected by the optical sensor 1b due to a difference in the distance between the optical sensor 1b and the object 2 according to the present embodiment. As shown in FIG. 10, as the optical sensor 1b and the object 2 approach each other, the amount of signal increases. On the other hand, as the optical sensor 1b and the object 2 move away from each other, the amount of signal decreases. When the amount of signal decreases, the difference between the signal light and the surrounding noise light becomes small, so that the noise light cannot be ignored. The amount of signal detected by the optical sensor 1b can also vary depending on the reflectivities of the object 2 and the non-object 3.
[0083] Due to such characteristics, the arithmetic unit (first arithmetic unit) 26 may adjust the distance threshold according to the intensity of the reflected light from the object 2. For example, when the detected signal amount is large (the reflected light is strong), the SN ratio is good, so the arithmetic unit 26 sets a threshold close to the ideal distance suitable for performing a predetermined operation. On the other hand, when the detected signal amount is small (the reflected light is weak), there is a possibility that the distance is calculated to be longer by the distance to the light source of the noise light due to the influence of the noise light. Therefore, the arithmetic unit 26 sets the threshold to be larger than the above-described ideal distance. Thereby, it is possible to improve the resistance to noise light.
[0084] (Processing of the optical sensor 1b) FIG. 11 is a flowchart showing the processing of the optical sensor 1b according to the present embodiment. The processing of the optical sensor 1b will be described according to FIG. 11.
[0085] (Step S61) Before the object 2 moves, in the optical sensor 1b, the histogram generation unit 25 generates a histogram based on the signal from the signal light receiving unit 21 that receives the signal light outside the optical sensor 1b. Further, the histogram generation unit 25 generates a histogram based on the signal from the reference light receiving unit 23 that receives the reference light inside the optical sensor 1b. Then, the arithmetic unit 26 subtracts the centroid position of the histogram based on the reference light from the centroid position of the histogram based on the generated signal light. Thereby, the origin position can be set in the histogram 1 before the movement.
[0086] (Step S62) After the object 2 has moved, in the optical sensor 1b, the histogram generation unit 25 generates a histogram based on the signal from the signal light receiving unit 21 that receives the signal light outside the optical sensor 1b. Further, the histogram generation unit 25 generates a histogram based on the signal from the reference light receiving unit 23 that receives the reference light inside the optical sensor 1b. Then, the calculation unit 26 subtracts the centroid position of the histogram based on the reference light from the centroid position of the histogram based on the signal light that has been generated. Thereby, in the histogram 2 after movement, the origin position can be set.
[0087] (Step S63) The calculation unit 26 adjusts a threshold value, which is a distance value for detection determination, according to the signal amounts of the histogram 1 obtained in Step S61 and the histogram 2 of the result obtained in Step S62. Note that the calculation unit 26 may adjust the threshold value according not only to the signal amount but also to the height (or the amount of movement) of the optical sensor 1b. In this case, the optical sensor 1b further includes an information acquisition unit 30. Then, the calculation unit 26 acquires the height (or the amount of movement of the optical sensor 1b) of the optical sensor 1b from the information acquisition unit 30. Then, the calculation unit 26 adjusts the threshold value so that it becomes larger as the position of the optical sensor 1b is farther from the light source of the noise light whose position is assumed (for example, the floor surface that becomes the light source of the reflected light).
[0088] (Step S64) The calculation unit 26 calculates the skewness from the histogram 1 obtained in Step S61 and the histogram 2 of the result obtained in Step S62, respectively, using the formula (1) of Embodiment 1.
[0089] (Step S65) The calculation unit 26 subtracts the histogram 1 obtained in Step S61 from the histogram 2 obtained in Step S62, and generates a histogram 3 for signal extraction.
[0090] (Step S66) The calculation unit 26 corrects the distortion of the histogram 3 for signal extraction generated in step S65 using the skewness calculated in step S64 and a predetermined distortion coefficient, and calculates the distance value between the optical sensor 1b and the object 2 from the histogram 3.
[0091] (Step S67) The determination unit 27 compares the distance value calculated in step S66 with the threshold value adjusted in step S63 to determine whether the object 2 is detected or not.
[0092] Specifically, the determination unit 27 determines whether the distance value calculated in step S66 is less than or equal to the threshold value adjusted in step S63. When the distance value is less than or equal to the threshold value, the determination unit 27 determines that the object 2 has been detected. When the distance value is greater than the threshold value, the determination unit 27 determines that the object 2 has not been detected. Even when the distance value is less than or equal to the threshold value, if the distance to the object 2 is small, although the signal should increase according to the inverse square law of light, if the signal amount of the histogram 2 < the signal amount of the histogram 1, the determination unit 27 may invalidate the detection of the object 2.
[0093] <Example 3> To more specifically explain the effects of the present embodiment, a case where the tip of the object 2 made of a different material is detected in an environment where the object 2 and the non-object 3 are mixed will be described.
[0094] FIG. 12 is a diagram showing the change in the signal amount and the change in the calculated distance value when the optical sensor 1b moves with respect to the object 2 made of different materials. In FIG. 12, it is ideal that the distance indicated by the dashed-dotted line is calculated. Also, the material 2 is a substance with a higher reflectivity than the material 1. In addition to the material of the object 2, the reflectivity of the object 2 also changes depending on the color and shape.
[0095] When the optical sensor 1b and the object 2 are approaching, the influence of noise is small, and the optical sensor 1b can easily calculate a more accurate distance value of the object 2. As shown in the dashed-line graph of FIG. 12, as the optical sensor 1b and the object 2 approach (the distance on the horizontal axis decreases), the signal amount increases in a shape close to a square, so it can be seen that the influence of noise and the like is small and the reflected light from the object 2 is captured.
[0096] On the contrary, when the optical sensor 1b and the object 2 are moving away from each other or when the material of the object 2 is different, the influence of noise is large, and the optical sensor 1b can easily calculate a distance value with a large influence of the non-object 3. As shown in the graph with the white-circle plot marks in FIG. 12, in the material 1 with a low reflectivity, compared with the material 2 with a high reflectivity, the signal amount does not start to rise until the position where the distance is short, so it can be seen that the influence of noise is large. Also, as shown in the graph with the white-triangle plot marks in FIG. 12, even in the material 2 with a high reflectivity, since the change in the signal amount at a long distance position is not in the form of a square, it can be seen that the influence of noise is large.
[0097] Therefore, by adjusting the threshold value of the detection distance according to the signal amount received by the optical sensor 1b, it functions as a switching of the detection distance between the case where the object 2 is detected more appropriately and the case where it is not detected, and it is possible to detect an object at an appropriate position that is resistant to noise and not affected by the difference in material.
[0098] As shown in FIG. 12, the change in the calculated distance in the material 1 with a low reflectivity (the solid line with circles in the figure) is a non-linear transition compared to the change in the calculated distance in the material 2 with a high reflectivity (the solid line with triangles in the figure). And even when the actual distances are the same, different calculated distances are shown for the material 1 and the material 2.
[0099] Therefore, since there is a difference in the signal amount according to the object 2, the calculation unit 26 may switch the threshold according to the magnitude of the signal amount. In one aspect, the calculation unit 26 may use a shorter threshold as the threshold for the calculated distance value when the signal amount is equal to or greater than a predetermined amount than when the signal amount is less than the predetermined amount.
[0100] For example, in the example shown in FIG. 12, when the calculation unit 26 sets the threshold for the calculated distance value to 72 mm when (i) the signal amount is less than 300, and sets the threshold for the calculated distance value to 55 mm when (ii) the signal amount is 300 or more, the determination unit 27 determines that (i) for the object 2 of the material 1 with low reflectivity, the calculated distance exceeds the threshold when the actual distance is 55 mm, and (ii) for the object 2 of the material 2 with high reflectivity, the calculated distance exceeds the threshold when the actual distance is 60 mm. As a result, the difference in the actual distance when the determination unit 27 determines that the calculated distance exceeds the threshold can be made smaller than when a fixed threshold is used. Therefore, the optical sensor 1b can determine that the calculated distance exceeds the threshold at a close distance even for objects 2 made of different materials.
[0101] 〔Example of Realization by Software〕 The functions of the optical sensors 1, 1a, and 1b (hereinafter referred to as "optical sensors") can be realized by a program for causing a computer to function as the optical sensor, and a program for causing a computer to function as each control block of the optical sensor (particularly, the histogram generation unit 25, the calculation unit 26, and the determination unit 27).
[0102] In this case, the optical sensor includes a computer having at least one control device (for example, a processor) and at least one storage device (for example, a memory) as hardware for executing the program. By executing the program with this control device and storage device, each function described in each of the above embodiments is realized.
[0103] The above program may be recorded on one or more computer-readable recording media, rather than temporarily. This recording medium may or may not be provided in the above device. In the latter case, the above program may be supplied to the above device via any wired or wireless transmission medium.
[0104] In addition, part or all of the functions of each of the above control blocks can also be realized by a logic circuit. For example, an integrated circuit in which a logic circuit functioning as each of the above control blocks is formed is also included in the scope of the present invention. In addition to this, for example, it is also possible to realize the functions of each of the above control blocks by a quantum computer.
[0105] 〔Summary〕 The optical sensor according to Embodiment 1 of the present invention is an optical sensor, comprising: a light emitting element that irradiates light to a region where an object exists; a light receiving element that receives reflected light from the object; a generation unit that generates a histogram showing the relationship between the time from when the light emitting element irradiates the light until the light receiving element receives the reflected light, and the intensity of the reflected light received by the light receiving element; a first calculation unit that calculates the skewness of the histogram; and a second calculation unit that calculates the distance between the optical sensor and the object with reference to the histogram and the skewness.
[0106] According to the above configuration, since the histogram and the skewness are referred to, even when a plurality of objects exist, the distance to the object can be calculated with high accuracy.
[0107] The optical sensor according to Embodiment 2 of the present invention may be such that, in the above Embodiment 1, the second calculation unit calculates the distance using the center of gravity of the histogram and a value obtained by multiplying the skewness by a skewness coefficient.
[0108] According to the above configuration, since the center of gravity of the histogram and a value obtained by multiplying the skewness by a skewness coefficient are used, the distance to the object can be calculated with even higher accuracy.
[0109] In the optical sensor according to Aspect 3 of the present invention, in the above Aspect 1 or 2, the generation unit generates a first histogram corresponding to the object before movement and a second histogram corresponding to the object after movement, respectively, and the second calculation unit may calculate the distance with reference to the difference between the first histogram and the second histogram.
[0110] According to the above configuration, when the optical sensor moves, by referring to the difference between the histograms before and after the movement, most of the components of the object close to the optical sensor among the reflected light components of the object are left, and the components of the object far from the optical sensor can be almost canceled out. Therefore, the distance to the object to be measured close to the optical sensor can be calculated with high accuracy.
[0111] The optical sensor according to Aspect 4 of the present invention includes an acquisition unit that acquires information on a range in which the object may exist, in any one of the above Aspects 1 to 3, and the first calculation unit may calculate the skewness with reference to the information on the range in which the object may exist.
[0112] According to the above configuration, since the skewness is calculated with reference to the range in which the object may exist, the skewness is appropriately obtained, and the accuracy of the distance corrected using the skewness is improved.
[0113] The optical sensor according to Aspect 5 of the present invention includes an acquisition unit that acquires information on a range in which the object may exist, in the above Aspect 2, and the second calculation unit may use the distortion coefficient corresponding to the information on the range in which the object may exist.
[0114] According to the above configuration, since the distance is calculated using the distortion coefficient corresponding to the range in which the object may exist, the accuracy of the distance is improved.
[0115] The optical sensor according to Aspect 6 of the present invention may be composed of a plurality of light receiving elements having different detection angles, in any one of the above Aspects 1 to 3.
[0116] According to the above configuration, since the plurality of light receiving elements have different detection angles, the accuracy of the detection distance can be selectively improved.
[0117] The optical sensor according to aspect 7 of the present invention may include, in any one of aspects 1 to 3 above, a determination unit that compares the distance calculated by the second calculation unit with a threshold value of the distance to determine whether the object has been detected.
[0118] According to the above configuration, for example, when the distance is equal to or less than the threshold value, it is possible to determine that the object has been detected.
[0119] The optical sensor according to aspect 8 of the present invention may be such that, in aspect 7 above, the first calculation unit adjusts the threshold value according to the intensity of the reflected light.
[0120] According to the above configuration, since the threshold value of the distance is adjusted according to the intensity of the reflected light, it is possible to improve the resistance to noise light.
[0121] The electronic device according to aspect 9 of the present invention includes the optical sensor according to any one of aspects 1 to 8 above.
[0122] According to the above configuration, since the histogram and skewness are referred to, even when a plurality of objects exist, the distance to the object can be calculated with high accuracy.
[0123] The distance calculation method according to aspect 10 of the present invention is a distance calculation method for an optical sensor including a light emitting element that irradiates light on a region where an object exists and a light receiving element that receives reflected light from the object, the method including: a generation step of generating a histogram showing the relationship between the time from when the light emitting element irradiates the light until the light receiving element receives the reflected light and the intensity of the reflected light received by the light receiving element; a first calculation step of calculating the skewness of the histogram; and a second calculation step of calculating the distance between the optical sensor and the object with reference to the histogram and the skewness.
[0124] According to the above configuration, since the histogram and skewness are referred to, even when there are a plurality of objects, the distance to the object can be calculated with high accuracy.
[0125] The optical sensor according to each aspect of the present invention may be realized by a computer. In this case, a control program for realizing the optical sensor by operating the computer as each part (software element) provided in the optical sensor, and a computer-readable recording medium on which the program is recorded also fall within the scope of the present invention.
[0126] The present invention is not limited to the above-described embodiments, and various modifications are possible within the scope shown in the claims. Embodiments obtained by appropriately combining the technical means disclosed in different embodiments are also included in the technical scope of the present invention. Furthermore, by combining the technical means disclosed in each embodiment, new technical features can be formed.
Explanation of Reference Numerals
[0127] 1, 1a, 1b Optical sensors 13 Light emitting element 2 Object 3 Non-object 21 Signal light receiving unit (light receiving element) 23 Reference light receiving unit (light receiving element) 25 Histogram generation unit (generation unit) 26 Arithmetic unit (first arithmetic unit, second arithmetic unit) 27 Determination unit 30 Information acquisition unit (acquisition unit)
Claims
1. An optical sensor, comprising: a light emitting element that irradiates light onto an area where an object exists; a light receiving element that receives reflected light from the object; a generation unit that generates a histogram showing the relationship between the time from when the light emitting element irradiates the light until the light receiving element receives the reflected light, and the intensity of the reflected light received by the light receiving element; a first calculation unit that calculates a skewness indicating the distortion from the normal distribution of the histogram; a second calculation unit that calculates the distance between the optical sensor and the object with reference to the histogram and the skewness; wherein the second calculation unit calculates the distance using the centroid of the histogram and the skewness. An optical sensor characterized by the above.
2. An optical sensor, comprising: a light emitting element that irradiates light onto an area where an object exists; a light receiving element that receives reflected light from the object; a generation unit that generates a histogram showing the relationship between the time from when the light emitting element irradiates the light until the light receiving element receives the reflected light, and the intensity of the reflected light received by the light receiving element; a first calculation unit that calculates a skewness indicating the distortion from the normal distribution of the histogram; a second calculation unit that calculates the distance between the optical sensor and the object with reference to the histogram and the skewness; wherein the generation unit generates a first histogram corresponding to the object before the optical sensor and the object approach each other, and a second histogram corresponding to the object after the optical sensor and the object approach each other; the second calculation unit calculates the distance with reference to the difference between the first histogram and the second histogram. An optical sensor characterized by the above.
3. comprising an acquisition unit that acquires information regarding the range in which the object may exist; The optical sensor according to claim 1 or 2, wherein the first calculation unit calculates the skewness with reference to the information regarding the range in which the object may exist.
4. comprising an acquisition unit that acquires information regarding the range in which the object may exist; The second calculation unit calculates the distance using the centroid of the histogram, the skewness, and a value obtained by multiplying the skewness by a coefficient corresponding to the information regarding the range in which the object may exist. The optical sensor according to claim 1.
5. comprising a plurality of the light receiving elements having different detection angles. The optical sensor according to claim 1 or 2, characterized by the above.
6. A determination unit that compares the distance calculated by the second calculation unit with a threshold value of the distance to determine whether or not the object is detected is provided. The optical sensor according to claim 1 or 2, characterized in that.
7. The first calculation unit adjusts the threshold value according to the intensity of the reflected light. The optical sensor according to claim 6, characterized in that.
8. An electronic device including the optical sensor according to any one of claims 1 to 7.
9. A light emitting element that irradiates light to an area where an object exists, A light receiving element that receives the reflected light from the object, A distance calculation method for an optical sensor including: A generation step of generating a histogram showing the relationship between the time from when the light emitting element irradiates the light until the light receiving element receives the reflected light and the intensity of the reflected light received by the light receiving element; A first calculation step of calculating a skewness indicating the distortion from the normal distribution of the histogram; A second calculation step of calculating the distance between the optical sensor and the object with reference to the histogram and the skewness; Including, In the second calculation step, the distance is calculated using the centroid of the histogram and the skewness. The distance calculation method characterized by the above.
10. A light emitting element that irradiates light to an area where an object exists, A light receiving element that receives the reflected light from the object, A distance calculation method for an optical sensor including: A generation step of generating a histogram showing the relationship between the time from when the light emitting element irradiates the light until the light receiving element receives the reflected light and the intensity of the reflected light received by the light receiving element; A first calculation step of calculating a skewness indicating the distortion from the normal distribution of the histogram; A second calculation step of calculating the distance between the optical sensor and the object with reference to the histogram and the skewness; Including, In the generation step, a first histogram corresponding to the object before the optical sensor and the object approach and a second histogram corresponding to the object after the optical sensor and the object approach are generated respectively; In the second calculation step, the distance is calculated with reference to the difference between the first histogram and the second histogram. The distance calculation method characterized by the above.
11. A non-transitory recording medium of a program for causing a computer to function as the generation unit, the first calculation unit, and the second calculation unit included in the optical sensor according to claim 1 or 2.
Citation Information
Patent Citations
Distance measuring apparatus
JP2005331526A
Optical displacement meter
JP2009186336A
Optical measurement device, optical measurement method, and optical measurement program
JP2018091760A
Electronic device and method therefor
JP2020153707A
Multipath detector and multipath detection method
JP2020197422A