Optical sensor, electronic device, distance calculation method, and program recording medium

By generating a histogram in the optical sensor and calculating the skewness, the problem of inaccurate distance calculation caused by mixing reflected light components of multiple objects in the prior art is solved, and a high-precision object distance calculation is achieved.

CN115220048BActive Publication Date: 2025-02-18SHARP SEMICON INNOVATION CORP TENRI CITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210411510.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-04-21
Filing Date
2022-04-19
Publication Date
2025-02-18
Estimated Expiration
2042-04-19

AI Technical Summary

Technical Problem

In the prior art, when calculating that the reflected light components of multiple objects exist in the histogram, the distance calculation accuracy of a single object cannot be improved, especially when non-object objects exist around the object, the reflected light mixing causes the distance. The calculation is inaccurate.

Method used

By introducing histogram generation, skewness calculation and correction mechanisms into the optical sensor, a histogram is generated to represent the time and intensity relationship between the light emitting element irradiating light to the light receiving reflective light, the skewness of the histogram is calculated, and using The skew correction histogram is used to calculate the distance between the optical sensor and the object.

Benefits of technology

It is realized that even if there are non-object objects around the object, the distance of the object can be calculated with high accuracy, and the accuracy of distance calculation is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115220048B_ABST
    Figure CN115220048B_ABST
Patent Text Reader

Abstract

The optical sensor (1) includes: a light emitting element (13) for irradiating light to an object, a signal light receiving unit (21) for receiving reflected light from the object, a histogram generating unit (25) for generating a histogram representing the relationship between the time from light irradiation to reflected light reception and the intensity of the reflected light, and a computing unit (26) for calculating the skewness of the histogram and calculating the distance between the optical sensor and the object with reference to the histogram and the skewness.
Need to check novelty before this filing date? Find Prior Art

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 calculating the distance to an object using a ToF (Time of Flight) sensor, as an example, the reflected light is counted by a TDC (Time to Digital Convertor) circuit according to the time from irradiation to reception of reflected light from the object (light flight time), and a histogram is formed. Then, the distance from the sensor to the object is calculated using the time with the largest count in the light flight time.

[0003] For example, Japanese Patent No. 6709335 discloses a method of subtracting a crosstalk component caused by a sensor cover and an external disturbance light component in addition to a reflected light component of an object.

[0004] Specifically, in order to improve the measurement time as the resolution of the camera is improved, the reflected light of the pulse light emitted from the light emitting element reflected by the object and incident on the first light receiving unit and the reference light (crosstalk inside the sensor) of the pulse light emitted from the light emitting element directly incident on the 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. Summary of the invention

[0005] However, in the prior art, when the reflected light components from multiple objects are mixed in the histogram, there is a problem that the distance calculation accuracy of one object cannot be improved. This is because even if the calculation of 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 with the reflected light from the object, so the distance to the object cannot be calculated with high accuracy.

[0006] An object of one embodiment of the present invention is to calculate the distance to an object with high accuracy even if there are non-objects around the object.

[0007] In order to solve the above-mentioned problem, an optical sensor involved in one embodiment of the present invention includes: a light-emitting element, which irradiates light to an area where an object is present; a light-receiving element, which receives reflected light from the object; a generating unit, which generates a histogram, wherein the histogram represents the relationship between the time from the time when the light-emitting element irradiates the light to the time when the light-receiving element receives the reflected light and the intensity of the reflected light received by the light-receiving element; a first computing unit, which calculates the skewness of the histogram; and a second computing unit, which calculates the distance between the optical sensor and the object with reference to the histogram and the skewness.

[0008] In addition, a distance calculation method involved in one embodiment 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 an area where the object is present; a light-receiving element that receives reflected light from the object; the distance calculation method is characterized in that it comprises the following steps: a generation step of generating a histogram, the histogram representing the relationship between the time from the time the light-emitting element irradiates the light to the time the light-receiving element receives the reflected light and the intensity of the reflected light received by the light-receiving element; a first operation step of calculating the skewness of the histogram generated in the generation step, the skewness representing the degree of distortion from a normal distribution; and a second operation step of using the skewness calculated in the first operation step to correct the histogram generated in the generation step, and calculating the distance between the optical sensor and the object from the histogram.

[0009] Effects of the Invention

[0010] According to one aspect of the present invention, the distance to an object can be calculated with high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 It is a block diagram showing the structure of the optical sensor involved in the first embodiment of the present invention.

[0012] Figure 2 It is a diagram showing an image of a histogram according to the first embodiment of the present invention.

[0013] Figure 3 This is a flowchart showing the processing of the optical sensor according to the first embodiment of the present invention.

[0014] Figure 4 It is a diagram showing a specific example according to the first embodiment of the present invention.

[0015] Figure 5 This is a diagram showing a histogram of distances between an optical sensor, an object, and a non-object according to the second embodiment of the present invention.

[0016] Figure 6 This is a flowchart showing the processing of the optical sensor according to the second embodiment of the present invention.

[0017] Figure 7 It is a diagram showing a specific example according to the second embodiment of the present invention.

[0018] Figure 8 It is a block diagram showing the structure of an optical sensor according to a third embodiment of the present invention.

[0019] Fig. 9 It is a block diagram showing the structure of an optical sensor according to a sixth embodiment of the present invention.

[0020] Fig.10 It is a diagram showing changes in signal values ​​detected by the optical sensor due to differences in distances according to the sixth embodiment of the present invention.

[0021] Fig.11 This is a flowchart showing the processing of the optical sensor involved in the sixth embodiment of the present invention.

[0022] Fig.12 It is a diagram showing a specific example involved in the sixth embodiment of the present invention. DETAILED DESCRIPTION

[0023] [First embodiment]

[0024] Hereinafter, a first embodiment of the present invention will be described in detail.

[0025] (Configuration of Optical Sensor 1)

[0026] Figure 1 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 that measures the distance to an object based on the time from irradiation of light to reception of reflected light from the object.

[0027] like Figure 1 As shown, the optical sensor 1 includes a reference pulse generating 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 generating unit (generating unit) 25 and a computing unit (first computing unit, second computing unit) 26.

[0028] The reference pulse generating unit 11 applies a waveform reference pulse to the driver 12. In addition, the reference pulse generating unit 11 supplies a reference clock signal to the first TDC 22 and the second TDC 24.

[0029] The driver 12 causes the light emitting element 13 to irradiate pulse light based on the reference pulse from the reference pulse generating unit 11. The light emitting element 13 irradiates light to the area where the target (object) 2 exists. The pulse light irradiated from the light emitting element 13 is reflected by the target 2 and the non-target 3 and enters the signal light receiving unit 21. In addition, the pulse 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".

[0030] The signal light receiving unit 21 is a light receiving element that receives reflected light from the object 2 and the non-object 3, and outputs pulses synchronized with the reflected light from the object 2 and the non-object 3 to the first TDC 22. The first TDC 22 outputs a timestamp indicating the pulse output timing of the pulse output by the signal light receiving unit 21 to the histogram generating unit 25.

[0031] The reference light receiving unit 23 outputs a pulse synchronized with the reference light from the light emitting element 13 to the second TDD 24. The second TDC 24 outputs a time stamp indicating a pulse output time of the pulse output by the reference light receiving unit 23 to the histogram generating unit 25.

[0032] The histogram generating unit 25 generates a histogram representing the relationship between the time from the irradiation of light by the light-emitting element 13 to the reception of reflected light by the signal light receiving unit 21 and the intensity of the reflected light received by the signal light receiving unit 21. Specifically, the histogram generating unit 25 receives a timestamp from the first TDC 22, and increases the count value of the bin as the measurement interval corresponding to the timestamp. Then, the histogram generating unit 25 counts the timestamps at a predetermined period, and generates a histogram based on the count. The histogram generating unit 25 also receives a timestamp from the second TDC 24, performs the same processing as above, and generates a histogram. In addition, the intensity of the reflected light is proportional to the count value of the bin.

[0033] The calculation unit 26 calculates the detection distance based on the difference between the center position of the histogram obtained by the time stamp from the first TDC 22 and the center position of the histogram obtained by the time stamp from the second TDC 24 in the histogram generated by the histogram generating unit 25, with the center position of the histogram obtained by the time stamp from the second TDC 24 as the origin.

[0034] Next, the calculation unit (first calculation unit) 26 calculates the skewness indicating the degree of distortion of the histogram set at the origin from the normal distribution. Then, the calculation unit (second calculation unit) 26 calculates the distance between the optical sensor 1 and the object 2 with reference to the histogram generated by the histogram generating unit 25 and the calculated skewness.

[0035] In addition, the optical sensor 1 can also communicate via I2C (Inter-Integrated Circuit) to output the calculated distance data to other devices located at a close distance (for example, a memory on the same substrate, etc.).

[0036] Figure 2 2 is a diagram showing an image of a histogram according to the present embodiment. The optical sensor 1 has the above-mentioned distance detection structure, so when non-objects 3 other than the object 2 are mixed in the sensing range of the histogram, as shown in FIG. Figure 2 As shown, the reflected light components from the object 2 and the non-object 3 are synthesized in the signal acquired by the signal light receiving unit 21 of the optical sensor 1. Therefore, the histogram showing the result of counting the signal for each bin has a distorted shape.

[0037] That is, in Figure 2 In the histogram, the position of the center of gravity of the histogram is shifted, so the level at which the degree becomes the peak is shifted. In this histogram, since the time from light irradiation to reception of reflected light corresponding to the level cannot be accurately determined, it is impossible to perform high-precision distance calculation.

[0038] In this embodiment, in order to cope with the displacement of the center of gravity, the degree of distortion of the histogram of a plurality of objects obtained by the optical sensor 1 is calculated as the skewness, and correction corresponding to the skewness is performed when calculating the distance, thereby improving the accuracy of the distance calculation.

[0039] (Description of skewness)

[0040] The so-called "skewness" is a statistical method that indicates how much a distribution graph (histogram) deviates from a normal distribution. Figure 2 As shown in FIG. 1 , in a histogram in which the lower edge of the rear is pulled to tilt forward, the skewness becomes a positive value (e.g., 0.76). In addition, in a histogram in which the lower edge of the front is pulled to tilt backward, the skewness becomes a negative value (e.g., -0.76). This is an indicator that the stronger the tendency, the larger the absolute value.

[0041] According to the skewness β1 1 / 2 To quantify the degree of deformation of the histogram shape, use β1 1 / 2 To calibrate the distance to the object and detect the object. 1 / 2 Calculated according to formula (1). b is the interval number of the histogram bin interval (measurement interval). bis the signal amount in each bin (the count value of the timestamp per unit time shorter than the measurement interval). μ is the average value of the interval number b. In other words, μ is the interval number with the highest frequency of signal generation. σ is the positive square root of the variance of the interval number b (i.e., standard deviation).

[0042] [Mathematical formula 1]

[0043]

[0044] By using the skewness β1 1 / 2 By correcting the distance value of the object 2 in the direction, a more accurate distance calculation can be performed. 1 / 2 By determining a threshold value related to the determination of object detection, it is possible to perform object detection that is not easily affected by non-objects.

[0045] (Processing of optical sensor 1)

[0046] Figure 3 1 is a flowchart showing the processing of the optical sensor 1 according to the first embodiment. Figure 3 The processing of the optical sensor 1 will be described.

[0047] (Step S11: Generation Step)

[0048] In the optical sensor 1, the histogram generating unit 25 generates a histogram based on a signal from the signal light receiving unit 21 receiving the signal light outside the optical sensor 1. In addition, the histogram generating unit 25 generates a histogram based on a signal from the reference light receiving unit 23 receiving the reference light inside the optical sensor 1.

[0049] (Step S12)

[0050] 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 generated in step S11. This allows the origin position to be set in the histogram. In the present embodiment, the histogram is used in steps S13 and S14.

[0051] (Step S13: First calculation step)

[0052] The calculation unit 26 calculates the skewness from the histogram of the result obtained by setting the origin position in step S12 using equation (1).

[0053] (Step S14: Second calculation step)

[0054] The calculation unit 26 calculates the distance between the optical sensor 1 and the object 2 by referring to the histogram of the result obtained by setting the origin position in step S12, the skewness calculated in step S13, and the predetermined distortion coefficient. Specifically, the calculation unit 26 calculates the distance based on the histogram and corrects the distance using the skewness and the distortion coefficient. For example, as shown in formula (2), the calculation unit 26 calculates the distance such that the centroid position G of the histogram is hist The distance value Range is obtained by multiplying the histogram width W, and using the skewness β1 1 / 2 The distance value Range is corrected by multiplying the value by the distortion coefficient K.

[0055] [Mathematical formula 2]

[0056] Range = G hist ×W+β1 1 / 2 ×K Formula (2)

[0057] The distortion coefficient K may be, for example, a numerical value obtained experimentally, or may be appropriately set according to the measurement range of the optical sensor 1 and the like.

[0058] Based on the above, the optical sensor 1 can calculate the distance to the object 2 with high accuracy.

[0059] In the above, the case where reference light is used as origin information is described, but the present embodiment is not limited to this. For example, as a modified example, components associated with 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 second half of step S11), origin setting (step S12), etc.) may be omitted, and a histogram based on the signal light generated in the first half of step S11 may be used in steps S13 and S14.

[0060] <Example 1>

[0061] Figure 4 FIG. 1 is a diagram for explaining a specific example of the present embodiment. Figure 4 In the example shown, the object 2 is transparent and is placed on the ground, that is, on the non-object 3 .

[0062] exist Figure 4 In the example shown, the optical sensor 1 according to the present embodiment obtains distortion of a histogram in which reflected light from the object 2 and reflected light from the non-object 3 are mixed, and corrects the distance value Range to the object 2 using equation (3).

[0063] [Mathematical formula 3]

[0064] Range = G his t×7.5+β1 1 / 2×13.9 Formula (3)

[0065] Here, G hist is the centroid of the histogram. 7.5 is the histogram width. 13.9 is the distortion coefficient.

[0066] In addition, equation (4) represents distance calculation in the conventional method.

[0067] [Formula 4]

[0068] Range = G hist ×7.5 Formula (4)

[0069] 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 multiplied by the distortion coefficient to the distance Range of equation (4).

[0070] exist Figure 4 The skewness β1 in the mixed existence state 1 / 2 The value is -1.06, indicating that not only the signal of the object 2 but also the signal of the non-object 3 is mixed. It can be determined that this is a histogram in which the signal of the non-object 3 whose lower edge is pulled in the front is dominant.

[0071] The calculated distance value of the center of gravity position of the lower edge portion corrected based on formula (3) is represented by the position A'1. Even in the case of a transparent object 2 where the influence of reflection within the object 2 or reflection generated by the non-object 3 is strong and distance detection is originally difficult, a distance close to the theoretical distance value P1 between the optical sensor 1 and the object 2 can be calculated compared to the position of the calculated distance value A1 in the mixed existence state before correction based on formula (4).

[0072] [Second embodiment]

[0073] Hereinafter, a second embodiment of the present invention will be described. In order to facilitate the description, the same reference numerals are attached to components having the same functions as those described in the first embodiment, and the description thereof will not be repeated.

[0074] When the optical sensor 1 detects the object 2, when the optical sensor 1 approaches the object 2, there is a tendency that the amount of signal from the object 2 changes greatly with respect to the light received by the optical sensor 1, while the amount of signal from the non-object 3 does not change 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. The calculation unit (second calculation unit) 26 calculates the distance between the optical sensor 1 and the object 2 by referring 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.

[0075] Figure 5 1 is a diagram showing a histogram of the distances between the optical sensor 1, the object 2, and the non-object 3 according to the present embodiment, wherein the horizontal axis represents the bin 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. Figure 5 As shown, the histogram (Hist1) is a histogram of a state where objects and non-objects exist together before the movement, and is represented by a solid line without a plotting mark. Figure 2 (Hist2) is a histogram of a state where the moved objects and non-objects are mixed, and is represented by a dotted line without a plotting mark. Figure 3 (Hist3) is the Figure 2 Subtract histogram Figure 1 The generated histogram is represented by a single-point dashed line marked with a quadrilateral drawing mark.

[0076] exist Figure 5 , if the straight Figure 1 With histogram Figure 2 By comparison, the histogram of the case where the distance between the optical sensor 1 and the object 2 is shortened due to the movement of the optical sensor 1 or the object 2 is Figure 2 The histogram is longer than the distance before moving. Figure 1 , the signal of object 2 is larger. Figure 5 As shown in the triangular curve graph of , 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, so the shorter the distance, the greater the signal amount representing the intensity of light. On the other hand, Figure 5 As shown in the circle graph, the amount of signal received by the optical sensor 1 from the non-object 3 does not change much before and after the movement. In addition, since the amount of each signal is different for the object 2, the non-object 3, and the state where the object 2 and the non-object 3 are mixed, Figure 5As shown, the histogram of the mixed state can easily obtain the distorted shape.

[0077] Therefore, by Figure 5 The square shown Figure 2 Subtract histogram Figure 1 , generate a histogram Figure 3 Thus, the distance between the optical sensor 1 and the object 2 can be calculated with high accuracy.

[0078] When the optical sensor 1 is close to the object 2, before and after the optical sensor 1 moves, as shown in FIG. Figure 5 As shown in the triangular curve of , the signal amount of the object 2 approaching the optical sensor 1 increases significantly, while Figure 5 As shown in the circled curve graph, the signal amount of the non-object 3 far away from the optical sensor 1 does not change much.

[0079] Therefore, by the above-mentioned subtraction operation, the signal component of the non-object 3 is almost cancelled, and the signal component of the object 2 is subtracted from the smaller signal amount from the larger signal amount, so most of the signal component of the object 2 remains. Thus, the distance can be calculated with high accuracy. In addition, the operation unit 26 does not necessarily subtract the histogram before the movement from the histogram after the movement, and can also subtract the histogram with a smaller signal amount from the histogram with a larger signal amount in the histogram before the movement and the histogram after the movement.

[0080] (Processing of optical sensor 1)

[0081] Figure 6 1 is a flowchart showing the processing of the optical sensor 1 according to the first embodiment. Figure 6 The processing of the optical sensor 1 will be described.

[0082] (Step S21)

[0083] Before the object 2 moves, in the optical sensor 1, the histogram generating unit 25 generates a histogram based on the signal from the signal light receiving unit 21 for receiving the signal light outside the optical sensor 1. In addition, the histogram generating unit 25 generates a histogram based on the signal from the reference light receiving unit 23 for receiving the reference light inside the optical sensor 1. Then, the computing unit 26 subtracts the centroid position of the histogram based on the reference light from the centroid position of the generated histogram based on the signal light. In this way, the histogram before the movement can be obtained. Figure 1 (Hist1: Figure 5 The origin position is set in the solid line of the mixed existence state before movement in FIG.

[0084] (Step S22)

[0085] After the object 2 moves, in the optical sensor 1, the histogram generating unit 25 generates a histogram based on the signal from the signal light receiving unit 21 for receiving the signal light outside the optical sensor 1. In addition, the histogram generating unit 25 generates a histogram based on the signal from the reference light receiving unit 23 for receiving the reference light inside the optical sensor 1. Then, the computing unit 26 subtracts the centroid position of the histogram based on the reference light from the centroid position of the generated histogram based on the signal light. Thus, the histogram after the movement can be obtained. Figure 2 (Hist2: Figure 5 The origin position is set in the dotted line of the mixed state after movement in the figure.

[0086] (Step S23)

[0087] The calculation unit 26 uses the equation (1) of the first embodiment and calculates the value of Figure 1 Calculate the skewness.

[0088] (Step S24)

[0089] The calculation unit 26 uses the histogram obtained in step S22 Figure 2 Subtract the histogram obtained in step S21 Figure 1 , generate a histogram for signal extraction Figure 3 (Hist3: Figure 5 The single-dotted line represents the signal difference of the object to be detected in FIG.

[0090] In this case, if the non-object 3 exists behind the object 2, Figure 5 As shown in the curve diagram of the non-object before and after the movement, the position of the non-object 3 is considered to be approximately constant, and the signal amount is also approximately constant. In addition, the signal amount as the intensity of light is inversely proportional to the square of the distance. Therefore, by moving from the mixed state to the histogram Figure 2 Subtract the histogram before the mixed state is moved Figure 1 , thus schematically generating a histogram for signal extraction Figure 3 , the histogram Figure 3 This is a histogram after only object 2 has moved.

[0091] (Step S25)

[0092] The calculation unit 26 extracts the histogram for the signal generated in step S24. Figure 3 , calculate the distance value between the optical sensor 1 and the object 2, and correct the distance value using the skewness calculated in step S23 and a prescribed distortion coefficient.

[0093] <Example 2>

[0094] Figure 72 is a diagram showing a specific example of the present embodiment. As a specific example of the present embodiment, a case where signals before and after the movement are subtracted from a histogram in which the object 2 and the non-object 3 are mixed will be described.

[0095] like Figure 7 As shown in FIG. 1 , after the subtraction, the lower edge component is removed, resulting in a shape close to a histogram of only the object 2 , and the object component becomes dominant, compared to before the subtraction.

[0096] When the centroid is calculated based on the conventional histogram, it is located at 7.3 bin, and when the centroid is calculated based on the histogram after the subtraction operation, it is located at 5.7 bin, which is a value close to the ideal value of 3.7 bin in this embodiment.

[0097] If the calculation is performed in the conventional manner based on the conventional histogram, the distance becomes the distance shown in A2. Figure 4 Compared with the distance shown in A'1, if equations (1) and (2) are calculated based on the differential histogram, it becomes Figure 7 The distance shown in A'2 is effective for improving accuracy (refer to Figure 7 ).

[0098] Here, b is the interval number of the histogram bin interval (measurement interval), and n b is the signal in 1 bin. μ is the mean value in bin b. σ is the positive square root of the dispersion in bin b. G hist is the centroid of the histogram. 7.5 is the histogram width. 13.9 is the distortion coefficient.

[0099] [Third embodiment]

[0100] Hereinafter, a third embodiment of the present invention will be described. In order to facilitate the description, the same reference numerals are given to components having the same functions as those described in the first and second embodiments, and the description thereof will not be repeated.

[0101] Figure 8 : is a block diagram showing the structure of the optical sensor 1a involved in this embodiment. The optical sensor 1a is further provided with an information acquisition unit (acquisition unit) 30, which is used to acquire range-related information related to the range in which the object (object) 2 may exist, and the calculation unit 26 calculates the skewness with reference to the range-related information. In detail, the calculation unit 26 sets the element range of the histogram used for calculating the skewness (the range of ∑ in the above-mentioned formula (1)) to correspond to the range in which the object 2 may exist. As a result, the accuracy of the calculated distance is improved.

[0102] In one embodiment, the information acquisition unit 30 may receive input of range-related information from a user or other device. Examples of the range-related information include 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, and a measurement range required by the optical sensor 1a. The measurement range is a range arbitrarily determined according to the purpose of the optical sensor 1a, and is a range that overlaps with a detection range specified by the performance of the optical sensor 1a.

[0103] In one embodiment, the information acquisition unit 30 may detect the position of the non-object 3 such as the position of the predetermined object 2, and acquire the range-related information based on the position of the non-object 3. For example, when the object 2 is arranged on the non-object 3 or in the non-object 3, the information acquisition unit 30 may acquire the range-related information related to the range where the object 2 may exist based on the position of the non-object 3. For example, when calibrating the optical sensor 1a, the distance to the non-object 3 may be measured by the optical sensor 1a instead of the object 2, and the information acquisition unit 30 may acquire the range-related information based on the result.

[0104] According to the above configuration, the calculation unit 26 sets the element range of the histogram used for calculating the skewness (the ∑ range of the above formula (1)) to correspond to the range where the object 2 may exist, and thus, when calculating the skewness, it is possible to exclude the influence of the reflected light from the non-object 3 that exists outside the range where the object 2 may exist. As a result, the accuracy of the calculated distance is improved.

[0105] [Fourth embodiment]

[0106] Hereinafter, a fourth embodiment of the present invention will be described. For convenience of description, the same reference numerals are given to components having the same functions as those described in the first to third embodiments, and their description will not be repeated.

[0107] In this embodiment, similarly to the third embodiment, the optical sensor 1a further includes an information acquisition unit (acquisition unit) 30 for acquiring range-related information related to a range in which the object (object) 2 may exist. Furthermore, the calculation unit 26 of the optical sensor 1a calculates the distance using a distortion coefficient corresponding to the information related to a range in which the object 2 may exist. Thus, the accuracy of the calculated distance is improved.

[0108] The optical sensor 1a generally has a detection range having a central axis extending from the optical sensor 1a. The detection range may be expressed in a substantially conical shape, or may be expressed in a substantially three-dimensional shape by the shape of a window provided on the optical sensor 1a. 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 close proximity, and the ratio of the space occupied by the mixed objects of the non-object 3 and the object 2 within the detection range increases. In this way, when the optical sensor 1a and the object 2 are in a close state, the distortion coefficient is set in such a way that the distortion correction amount when the computing unit 26 computes the distance increases, thereby obtaining a solution close to the actual distance.

[0109] As an example, when the object 2 is arranged on the non-object 3, the information acquisition unit 30 acquires the distance between the optical sensor 1a and the non-object 3 as the range-related information, and the operation unit 26 can set K in the above formula (2) to K1 when the distance between the optical sensor 1a and the non-object 3 is less than the threshold value, and can set K in the above formula (2) to K2 (K1>K2) when the distance between the optical sensor 1a and the non-object 3 is greater than the threshold value. That is, the operation unit 26 can set the distortion coefficient in such a way that the distortion coefficient is higher as the range where the object 2 may exist is closer to the optical sensor 1a. The closer the range where the object 2 may exist is to the optical sensor 1a, the operation unit 26 can change the distortion coefficient in two or more stages, or can gradually increase the distortion coefficient. The value of the distortion coefficient set by the operation unit 26 can be obtained, for example, by experiment.

[0110] [Fifth embodiment]

[0111] Hereinafter, a fifth embodiment of the present invention will be described. In addition, for the sake of convenience of description, the same reference numerals are given to components having the same functions as those described in the first to fourth embodiments, and their description will not be repeated.

[0112] 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. Therefore, the plurality of light receiving elements detect signal light from the object 2 and the non-object 3 at different detection angles.

[0113] According to the above configuration, by detecting the signal light from the object 2 and the non-object 3 at different detection angles, the distance between the optical sensor 1 and the object 2 can be calculated with high accuracy. In addition, by making the light emitting element 13 or the signal light receiving unit 21 have different incident angles or detection angles, the accuracy of the detection distance can be selectively improved.

[0114] Take the edge detection of the object 2 using the present embodiment as an example. When the positional relationship of the object 2 is not fixed and the position of the object 2 relative to the optical sensor 1 is not constrained, the signal light receiving unit 21 having different detection angles of the optical sensor 1 can be used to calculate the distance, and the calculation of the distance flexibly applies the signal of the light receiving element that appropriately captures the object 2. As a result, it is possible to improve the tolerance to the position change of the object 2. In other words, since the optical sensor 1 has a plurality of light receiving elements with different detection angles, even if the position of the object 2 changes, since any light receiving element receives light at an appropriate angle and uses the signal of the light receiving element, it is possible to maintain high accuracy in distance calculation. In addition, compared with the configuration of the light receiving element having a single angle, the configuration of the present embodiment can calculate the distance with high accuracy, and the range of the object 2 is widened, so it is very effective.

[0115] [Sixth embodiment]

[0116] Hereinafter, a sixth embodiment of the present invention will be described. In addition, for the sake of convenience of description, the same reference numerals are given to components having the same functions as those described in the first to fifth embodiments, and their description will not be repeated.

[0117] This embodiment is applicable to, for example, an electronic device including the optical sensor 1b. As an example, the electronic device may be a water purifier or a measuring device that performs a specific operation when an object is within a predetermined distance, but the electronic device is not limited to these.

[0118] Fig. 9 1 is a block diagram showing the structure of the optical sensor 1b according to the present embodiment. Figure 1 and Fig. 9 As can be seen from the comparison, the optical sensor 1b further includes a determination unit 27 for the optical sensor 1. The determination unit 27 compares the distance between the optical sensor 1b and the object 2 calculated by the operation unit (second operation unit) 26 with the threshold value of the distance, and determines whether the object 2 is detected. Specifically, when the distance between the optical sensor 1b and the object 2 is less than the threshold value, the determination unit 27 determines that the object 2 is detected.

[0119] Fig.10 2 is a diagram showing changes in the signal value detected by the optical sensor 1b due to the difference in distance between the optical sensor 1b and the object 2 according to the present embodiment. Fig.10As shown in FIG. 1 , the closer the optical sensor 1b is to the object 2, the more the signal amount increases. On the other hand, the farther the optical sensor 1b is from the object 2, the less the signal amount decreases. If the signal amount decreases, the difference between the signal light and the surrounding noise light becomes smaller, so the noise light cannot be ignored. The signal amount detected by the optical sensor 1b also changes depending on the reflectivity of the object 2 and the non-object 3.

[0120] Due to such characteristics, the operation unit (first operation unit) 26 can also adjust the threshold of the distance according to the intensity of the reflected light from the object 2. For example, when the amount of detection signal is large (the reflected light is strong), the SN ratio is good, so the operation unit 26 sets a threshold close to the ideal distance suitable for performing a prescribed action. On the other hand, when the amount of detection signal is small (the reflected light is weak), due to the influence of noise light, there is a possibility that the distance is calculated to be longer than the distance from the light source of the noise light, so the operation unit 26 sets the threshold to be larger than the above-mentioned ideal distance. In this way, it is possible to achieve an improvement in tolerance to noise light.

[0121] (Processing of Optical Sensor 1b)

[0122] Fig.11 1b is a flowchart showing the processing of the optical sensor 1b according to the present embodiment. Fig.11 The processing of the optical sensor 1b will be described.

[0123] (Step S61)

[0124] Before the object 2 moves, in the optical sensor 1b, the histogram generating unit 25 generates a histogram based on the signal from the signal light receiving unit 21 for receiving the signal light outside the optical sensor 1b. In addition, the histogram generating unit 25 generates a histogram based on the signal from the reference light receiving unit 23 for receiving the reference light inside the optical sensor 1b. Then, the computing unit 26 subtracts the centroid position of the histogram based on the reference light from the centroid position of the generated histogram based on the signal light. Thus, the histogram before the movement can be obtained. Figure 1 Set the origin position in .

[0125] (Step S62)

[0126] After the object 2 moves, in the optical sensor 1b, the histogram generating unit 25 generates a histogram based on the signal from the signal light receiving unit 21 for receiving the signal light outside the optical sensor 1b. In addition, the histogram generating unit 25 generates a histogram based on the signal from the reference light receiving unit 23 for receiving 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 generated histogram based on the signal light. In this way, the histogram after the movement can be obtained. Figure 2 Set the origin position in .

[0127] (Step S63)

[0128] The calculation unit 26 calculates the histogram obtained in step S61. Figure 1 And the histogram of the result obtained in step S62 Figure 2 The signal amount is used to adjust the threshold value of the distance value used for detection judgment. In addition, the operation unit 26 can adjust the threshold value not only according to the signal amount, but also according to the height (or movement amount) of the optical sensor 1b. In this case, the optical sensor 1b also has an information acquisition unit 30. And the operation unit 26 obtains the height of the optical sensor 1b (or the movement amount of the optical sensor 1b) from the information acquisition unit 30. Then, the operation unit 26 makes an adjustment so that the farther the position of the optical sensor 1b is from the assumed light source of noise light (for example, the ground that becomes the light source of reflected light), the larger the threshold value.

[0129] (Step S64)

[0130] The calculation unit 26 uses the equation (1) of the first embodiment and calculates the value of Figure 1 And the histogram of the result obtained in step S62 Figure 2 Calculate the skewness separately.

[0131] (Step S65)

[0132] The calculation unit 26 uses the histogram obtained in step S62 to calculate the Figure 2 Subtract the histogram obtained in step S61 Figure 1 , generate a histogram for signal extraction Figure 3 .

[0133] (Step S66)

[0134] The calculation unit 26 uses the skewness calculated in step S64 and a predetermined distortion coefficient to calculate the histogram for signal extraction generated in step S65. Figure 3 The distortion is corrected according to the histogram. Figure 3 , calculate the distance value between the optical sensor 1b and the object 2.

[0135] (Step S67)

[0136] The determination unit 27 compares the distance value calculated in step S66 with the threshold value adjusted in step S63 , and determines whether the object 2 is detected or not.

[0137] Specifically, the determination unit 27 determines whether the distance value calculated in step S66 is less than the threshold value adjusted in step S63. When the distance value is less than the threshold value, the determination unit 27 determines that the object 2 is detected. When the distance value is greater than the threshold value, the determination unit 27 determines that the object 2 is not detected. In addition, even when the distance value becomes less than the threshold value, if the distance to the object 2 decreases, although the signal does not increase due to the distance square law of light, it becomes a histogram. Figure 2 The signal volume < histogram Figure 1 In the case of a signal amount of , the judgment unit 27 may also invalidate the detection of the object 2.

[0138] <Example 3>

[0139] In order to more specifically describe the effect of the present embodiment, an example of detecting the tip of an object 2 made of different materials in an environment where the object 2 and the non-object 3 are mixed will be described.

[0140] Fig.12 1 is a diagram showing changes in the signal amount and the calculated distance value when the optical sensor 1b moves relative to the object 2 made of different materials. Fig.12 In the example, it is desirable to calculate the distance indicated by the dashed line. In addition, the material 2 is a substance with a higher reflectivity than the material 1. In addition, in addition to the material of the object 2, the reflectivity of the object 2 also varies depending on the color and shape.

[0141] When the optical sensor 1b is close to the object 2, the influence of noise is small, and the optical sensor 1b can easily calculate a more accurate distance value of the object 2. Fig.12 As shown in the dashed curve graph, the closer the optical sensor 1b is to the object 2 (the smaller the distance on the horizontal axis), the more the signal amount increases in a square manner, so the influence of noise, etc. is smaller, and the reflected light from the object 2 is captured.

[0142] In contrast, when the optical sensor 1b is far from the object 2 or the material (raw material) of the object 2 is different, the influence of noise is large, and the optical sensor 1b is likely to calculate a distance value with a large influence from the non-object 3. Fig.12 As shown in the graph with white circles in the figure, in the case of material 1 with low reflectivity, the signal amount increases only after the distance reaches a shorter position compared to material 2 with high reflectivity, which shows that the influence of noise is large. Fig.12 As shown in the graph with the blank triangle in the drawing mark, even for the material 2 with high reflectivity, the change in the signal amount at a position with a long distance is not in a square pattern, which shows that the influence of noise is large.

[0143] Therefore, by adjusting the threshold of the detection distance according to the amount of signal received by the optical sensor 1b, the detection distance is switched between a case where it is more suitable for detecting the object 2 and a case where the object 2 is not detected, and object detection can be achieved at an appropriate position without being affected by different materials and with strong noise resistance.

[0144] like Fig.12 As shown in the figure, the change in the calculated distance of the material 1 with low reflectivity (solid line with circles in the figure) is nonlinear compared to the change in the calculated distance of the material 2 with high reflectivity (solid line with triangles in the figure). Moreover, even if the actual distance is the same, different calculated distances are shown in the material 1 and the material 2.

[0145] Therefore, since the magnitude of the signal depends on the object 2, the operation unit 26 may switch the threshold value according to the magnitude of the signal. In one embodiment, the operation unit 26 may use a threshold value shorter than the threshold value when the signal magnitude is greater than the predetermined magnitude as a threshold value relative to the calculated distance value.

[0146] For example, in Fig.12 In the example shown, when the calculation unit 26 sets the threshold value relative to the calculated distance value to 72 mm when (i) the signal amount is less than 300, and sets the threshold value relative to the calculated distance value to 55 mm when (ii) the signal amount is greater than 300, the judgment unit 27 judges that the calculated distance exceeds the threshold value when (i) the object 2 of the material 1 with low reflectivity is actually located at a distance of 55 mm, and judges that the calculated distance exceeds the threshold value when (ii) the object 2 of the material 2 with high reflectivity is actually located at a distance of 60 mm. Thus, the judgment unit 27 can make the difference in the actual distance when judging that the calculated distance exceeds the threshold value smaller than the case of using a certain threshold value. Therefore, for the object 2 of different raw materials, even if the raw materials are different, the optical sensor 1b can judge that the calculated distance exceeds the threshold value.

[0147] 〔Software-based implementation example〕

[0148] The functions of the optical sensors 1, 1a, 1b (hereinafter referred to as "optical sensors") can be realized by a program, which is a program for enabling a computer to function as the optical sensor, and the program is used to enable the computer to function as each control block of the optical sensor (especially the histogram generating unit 25, the computing unit 26 and the judging unit 27).

[0149] In this case, the optical sensor is provided with a computer having at least one control device (e.g., a processor) and at least one storage device (e.g., a memory) as hardware for executing the program. The control device and the storage device execute the program, thereby realizing the functions described in the above embodiments.

[0150] The above program may not be temporary, but may be recorded in one or more computer-readable recording media. The recording medium may or may not have the above device. In the latter case, the above program may be provided to the above device via any transmission medium, whether wired or wireless.

[0151] In addition, part or all of the functions of the above-mentioned control blocks can also be realized by logic circuits. For example, an integrated circuit having a logic circuit that functions as the above-mentioned control blocks is also included in the scope of the present invention. In addition, the functions of the above-mentioned control modules can also be realized by, for example, a quantum computer.

[0152] 〔Summarize〕

[0153] The optical sensor involved in mode 1 of the present invention includes: a light-emitting element, which irradiates light to an area where an object is present; a light-receiving element, which receives reflected light from the object; a generating unit, which generates a histogram, wherein the histogram represents the relationship between the time from the time the light-emitting element irradiates the light to the time the light-receiving element receives the reflected light and the intensity of the reflected light received by the light-receiving element; a first computing unit, which calculates the skewness of the histogram; and a second computing unit, which calculates the distance between the optical sensor and the object with reference to the histogram and the skewness.

[0154] According to the above configuration, since the histogram and the skewness are referred to, even when there are a plurality of objects, the distance to the object can be calculated with high accuracy.

[0155] The optical sensor according to aspect 2 of the present invention may be configured such that, in aspect 1, the second calculation unit calculates the distance using the centroid of the histogram and a value obtained by multiplying the skewness by a distortion coefficient.

[0156] According to the above configuration, since the centroid of the histogram and the value obtained by multiplying the skewness by the distortion coefficient are used, the distance to the object can be calculated with higher accuracy.

[0157] The optical sensor involved in mode 3 of the present invention may also be that in the above-mentioned mode 1 or 2, the histogram includes a first histogram corresponding to the object before movement and a second histogram corresponding to the object after movement, the generating unit generates the first histogram and the second histogram respectively, and the second calculation unit calculates the distance with reference to the difference between the first histogram and the second histogram.

[0158] According to the above-mentioned configuration, when the optical sensor moves, by referring to the difference between the histograms before and after the movement, most of the component of the object's reflected light close to the optical sensor can be retained, while the component of the object far from the optical sensor can be roughly offset. Therefore, the distance to the object to be measured close to the optical sensor can be calculated with high accuracy.

[0159] The optical sensor involved in mode 4 of the present invention may also be, in any one of the above-mentioned modes 1 to 3, including an acquisition unit, which acquires information related to the range where the object may exist, and the first calculation unit calculates the skewness with reference to the information related to the range where the object may exist.

[0160] 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 thus the accuracy of the distance corrected using the skewness is improved.

[0161] The optical sensor involved in mode 5 of the present invention may also be, in the above-mentioned mode 2, including an acquisition unit, which acquires information related to the range where the object may exist, and the second operation unit uses the distortion coefficient, and the distortion coefficient corresponds to the information related to the range where the object may exist.

[0162] 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.

[0163] The optical sensor according to aspect 6 of the present invention, in any one of aspects 1 to 3 described above, may be constituted by a plurality of light receiving elements having different detection angles.

[0164] According to the above configuration, the plurality of light receiving elements have different detection angles, and thus the accuracy of the detection distance can be selectively improved.

[0165] The optical sensor involved in mode 7 of the present invention may also be, in any one of the above-mentioned modes 1 to 3, including a judgment unit, which compares the distance calculated by the second operation unit with a threshold value of the distance to determine whether the object is detected.

[0166] According to the above configuration, for example, when the distance is equal to or smaller than a threshold value, it can be determined that an object has been detected.

[0167] The optical sensor according to aspect 8 of the present invention may be such that, in the above-mentioned aspect 7, the first calculation unit adjusts the threshold value according to the intensity of the reflected light.

[0168] 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 tolerance to noise light.

[0169] An electronic device according to a ninth aspect of the present invention includes the optical sensor according to any one of the first to eighth aspects.

[0170] According to the above configuration, since the histogram and the skewness are referred to, even when there are a plurality of objects, the distance to the object can be calculated with high accuracy.

[0171] The distance calculation method involved in mode 10 of the present invention is a distance calculation method for an optical sensor, wherein the optical sensor includes: a light-emitting element, which irradiates light to an area where an object is present; a light-receiving element, which receives reflected light from the object; the distance calculation method is characterized in that it includes the following steps: a generation step, generating a histogram, wherein the histogram represents the relationship between the time from the time the light-emitting element irradiates the light to the time the light-receiving element receives the reflected light and the intensity of the reflected light received by the light-receiving element; a first operation step, calculating the skewness of the histogram; and a second operation step, calculating the distance between the optical sensor and the object with reference to the histogram and the skewness.

[0172] According to the above configuration, since the histogram and the skewness are referred to, even when there are a plurality of objects, the distance to the object can be calculated with high accuracy.

[0173] The optical sensors involved in various embodiments of the present invention can also be implemented by a computer. In this case, the control program of the optical sensor implemented by the computer by operating the computer as the various parts (software elements) possessed by the above-mentioned optical sensor and the computer-readable storage medium storing the program are also included in the scope of the present invention.

[0174] The present invention is not limited to the above-mentioned embodiments, and various changes can be made within the scope of the claims. The embodiments obtained by appropriately combining the technical means disclosed in different embodiments are also included in the technical scope of the present invention. Moreover, new technical features can be formed by combining the technical methods disclosed in each embodiment.

Claims

1. An optical sensor, characterized in that: include: a light emitting element that radiates light toward the area where the object exists; a light receiving element for receiving reflected light from the object; a generating unit configured to generate a histogram indicating a relationship between a time from when the light emitting element irradiates the light to when the light receiving element receives the reflected light and an intensity of the reflected light received by the light receiving element; A first operation unit, which calculates the skewness of the histogram; as well as A second calculation unit calculates the distance between the optical sensor and the object by referring to the histogram and the skewness.

2. The optical sensor according to claim 1, characterized in that The second calculation unit calculates the distance using the centroid of the histogram and a value obtained by multiplying the skewness by a distortion coefficient.

3. The optical sensor according to claim 1 or 2, characterized in that: The histogram includes a first histogram corresponding to the object before the movement and a second histogram corresponding to the object after the movement, The generating unit generates the first histogram and the second histogram respectively. The second calculation unit calculates the distance by referring to the difference between the first histogram and the second histogram.

4. The optical sensor according to claim 1 or 2, characterized in that: comprising an acquisition unit, the acquisition unit acquiring information related to a range in which the object may exist, The first calculation unit calculates the degree of skewness by referring to information on a range in which the object may exist.

5. The optical sensor according to claim 2, characterized in that comprising an acquisition unit, the acquisition unit acquiring information related to a range in which the object may exist, The second calculation unit uses the distortion coefficient corresponding to information on a range in which the object may exist.

6. The optical sensor according to claim 1 or 2, characterized in that: A plurality of light receiving elements having different detection angles are included.

7. The optical sensor according to claim 1 or 2, characterized in that: A determination unit is included, which compares the distance calculated by the second calculation unit with a threshold value of the distance to determine whether the object is detected.

8. The optical sensor according to claim 7, characterized in that The first calculation unit adjusts the threshold value according to the intensity of the reflected light.

9. An electronic device comprising the optical sensor according to claim 1 or 2.

10. A distance calculation method for an optical sensor, the optical sensor comprising: a light emitting element that radiates light toward the area where the object exists; a light receiving element for receiving reflected light from the object; The distance calculation method is characterized in that it comprises the following steps: A generating step of generating a histogram, wherein the histogram represents a relationship between a time from when the light emitting element irradiates the light to when the light receiving element receives the reflected light and an intensity of the reflected light received by the light receiving element; The first operation step is to calculate the skewness of the histogram; as well as The second operation step is to calculate the distance between the optical sensor and the object by referring to the histogram and the skewness.

11. A recording medium of a program, wherein the program is for causing a computer to function as the optical sensor according to claim 1 or 2, characterized in that: The program causes a computer to function as the generating unit, the first calculating unit, and the second calculating unit.

Citation Information

Patent Citations

  • Image display device and / or method therefor

    CN104221051A

  • Apparatus, method for taking an image and apparatus, method for processing an image and program thereof

    CN1925562A