Control device, light source control method, and program
The control device addresses measurement inaccuracies in distance measuring devices by dynamically adjusting light intensity based on depth value variations, enhancing measurement accuracy and precision.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- CASIO COMPUTER CO LTD
- Filing Date
- 2024-12-20
- Publication Date
- 2026-07-02
AI Technical Summary
Conventional distance measuring devices using light sources face challenges in maintaining accurate measurement due to issues with light intensity, leading to increased noise and saturation, which affect measurement accuracy and vary with distance to the object.
A control device adjusts light intensity based on the analysis of depth value variations using multiple index values derived from the distance measuring device, ensuring appropriate light emission to maintain accurate measurements.
This approach maintains consistent measurement accuracy by dynamically adjusting light intensity, reducing noise and saturation, thereby improving the precision of distance measurements.
Smart Images

Figure 2026110404000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a control device, a method for controlling a light source, and a program.
Background Art
[0002] Conventionally, a distance measuring device using a ToF (Time of Flight) method for measuring the distance to an object based on the time from when light is emitted from a light source until the light reflected by the object is received by a light receiving element has been disclosed (for example, Patent Document 1).
Prior Art Documents
Patent Documents
[0003]
Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0004] However, in a distance measuring device using light, if the amount of light emitted from the light source is too small, the ratio of noise to the light detection signal increases, and the distance measurement accuracy decreases. On the other hand, if the amount of light is increased too much, the output value of the light receiving element may saturate, resulting in a decrease in measurement accuracy. Furthermore, since the appropriate amount of light for obtaining appropriate measurement accuracy varies depending on the distance from the light source to the object, it is not easy to control the light source so as to maintain an appropriate amount of light. Therefore, the conventional technology has a problem that it is difficult to maintain appropriate measurement accuracy in a distance measuring device.
[0005] An object of the present invention is to maintain appropriate measurement accuracy in a distance measuring device.
Means for Solving the Problems
[0006] To solve the above problems, the control device according to the present invention is A control device comprising a control unit for controlling the light source of a distance measuring device, The distance measuring device derives a plurality of depth values relating to the distance to the object based on the time from when light is emitted from the light source until the reflected light from the object is detected by a plurality of light-receiving elements. The control unit, The distance measuring device obtains the plurality of depth values derived by the distance measuring device, Based on a plurality of target depth values which are at least a portion of the plurality of depth values, an index value relating to the magnitude of variation of the plurality of target depth values is derived. The adjustment details for the light intensity are determined based on the aforementioned index value and predetermined reference value. The light source is controlled so that the amount of light changes according to the determined adjustment settings. [Effects of the Invention]
[0007] According to the present invention, appropriate measurement accuracy can be maintained in a distance measuring device. [Brief explanation of the drawing]
[0008] [Figure 1] This is a diagram showing the configuration of an information processing system. [Figure 2] This is a block diagram showing the functional configuration of the control device. [Figure 3] This is a block diagram showing the functional configuration of a depth camera. [Figure 4] This is a flowchart showing the control procedure for equipment control processing. [Figure 5] This is a figure showing a depth image. [Figure 6] This is a diagram showing a mask image. [Figure 7] This flowchart shows the control procedure for the index value derivation process. [Figure 8] This flowchart shows the control procedure for the first indicator value derivation process. [Figure 9] This figure shows the target pixels and target depth values in the region of interest. [Figure 10]This flowchart shows the control procedure for the second indicator value derivation process. [Figure 11] This flowchart shows the control procedure for the third indicator value derivation process. [Figure 12] This figure shows the difference in target depth values between frames. [Figure 13] This is a flowchart showing the control procedure for the light source control process. [Figure 14] This flowchart shows the control procedure for a modified version of the light source control process. [Modes for carrying out the invention]
[0009] Embodiments of the present invention will be described below with reference to the drawings. As shown in Figure 1, the information processing system 1 of this embodiment comprises a control device 10, a distance measuring device 20, and a projector 50. The control device 10 is wirelessly or wiredly connected to the distance measuring device 20 and the projector 50, and is capable of sending and receiving data such as control signals and image data between the control device 10 and the distance measuring device 20 and the projector 50. The control device 10 controls the operation of the distance measuring device 20 and the projector 50 by transmitting control signals to the distance measuring device 20 and the projector 50. The distance measuring device 20 comprises an infrared camera 30 and a depth camera 40. The infrared camera 30 generates an infrared image 132 (see Figure 2) containing brightness information of the shooting range including the operator 60 and transmits it to the control device 10. The depth camera 40 generates a depth image 133 (see Figure 2) containing distance (depth) information to the operator 60 and background structures and transmits it to the control device 10. The control device 10 detects gestures made by the operator 60 with their hand 61 (the object whose distance is being measured) based on the received infrared image 132 and depth image 133. When the control device 10 determines that the operator 60 has performed a predetermined gesture with their hand 61, it sends a control signal to the projector 50 and controls the operation of the projector 50 (such as projecting an image or changing various settings) according to the detected gesture. This enables intuitive operation, for example, by making a gesture of moving the hand 61 to the right, the projector 50 switches the projected image Im to the next image Im, and by making a gesture of moving the hand 61 to the left, it switches the image Im to the previous image Im. In this way, the information processing system 1 is equipped with a three-dimensional user interface (3D-UI) that detects the operator 60's gestures without physical contact.
[0010] As shown in Figure 2, the control device 10 comprises a CPU 11 (Central Processing Unit) (control unit), RAM 12 (Random Access Memory), storage unit 13, display unit 14, operation unit 15, and communication unit 16. Each part of the control device 10 is connected via a data transmission path such as a bus. In this embodiment, the control device 10 is a notebook PC, but is not limited to this; for example, it may be a desktop PC, smartphone, or tablet terminal. The CPU 11 is a processor that controls the operation of the control device 10 by reading and executing the program 131 stored in the storage unit 13 and performing various arithmetic processing. The control device 10 may have multiple processors (multiple CPUs, etc.), and the multiple processes executed by the CPU 11 in this embodiment may be executed by these multiple processors. In this case, the multiple processors correspond to processing units. In this case, the multiple processors may be involved in common processing, or the multiple processors may independently execute different processes in parallel. The RAM 12 provides the CPU 11 with a working memory space and stores temporary data. The memory unit 13 is a non-temporary recording medium readable by the CPU 11 as a computer, and stores the program 131 and various data. The memory unit 13 includes non-volatile memory such as an HDD (Hard Disk Drive) or SSD (Solid State Drive). The program 131 is stored in the memory unit 13 in the form of program code readable by the computer. The data stored in the memory unit 13 includes image data of the infrared image 132 transmitted from the infrared camera 30, image data of the depth image 133 transmitted from the depth camera 40, and image data of the mask image 134, which will be described later. The display unit 14 is equipped with a liquid crystal display or the like and displays various information according to the display control signals transmitted from the CPU 11. The operation unit 15 has at least one of the following: a touch panel superimposed on the display screen of the display unit 14, a pointing device such as a mouse, and an input device such as a keyboard, and outputs operation information to the CPU 11 according to the input operation on the input device.The communication unit 16 is composed of a network card, a communication module, etc., and transmits and receives data to and from the distance measuring device 20 and the projector 50 according to a predetermined communication standard.
[0011] The infrared camera 30 of the distance measuring device 20 includes a light source that emits infrared light (infrared rays) and a sensor in which a plurality of light receiving elements having light receiving sensitivity in the infrared wavelength range are two-dimensionally arranged. The infrared camera 30 emits infrared light to the imaging range including the operator 60 and its background, and images the reflected light with the plurality of light receiving elements to generate an infrared image 132 having a plurality of pixels corresponding to the plurality of light receiving elements. The pixel value of each pixel of the infrared image 132 represents the brightness of the subject. The infrared camera 30 transmits the generated infrared image 132 to the control device 10. Note that instead of the infrared camera 30, a color camera that receives visible light and generates a color image may be used.
[0012] As shown in Figure 3, the depth camera 40 of the distance measuring device 20 comprises a CPU 41, RAM 42, storage unit 43, light source 44, sensor 45, and communication unit 46. Each part of the depth camera 40 is connected via a data transmission path such as a bus. The CPU 41 is a processor that controls the operation of the depth camera 40 by reading and executing a program 431 stored in the storage unit 43 and performing various calculations. The RAM 42 provides the CPU 41 with a working memory space and stores temporary data. The storage unit 43 stores the program 431 and light emission amount setting data 432. The light emission amount setting data 432 includes data that specifies the amount of light emitted by the light source 44. The storage unit 43 includes non-volatile memory such as flash memory. The light source 44 includes a light-emitting element 441 that emits near-infrared light, such as a VCSEL (Vertical Cavity Surface Emitting Laser) or an LED (Light Emitting Diode), and a light-emitting drive unit 442 that supplies a drive current to the light-emitting element 441 to cause it to emit light. For example, wavelengths of 850 nm or 940 nm are used for the emitted light. The light-emitting drive unit 442 causes the light-emitting element 441 to emit near-infrared pulsed light in a light emission pattern and light intensity according to a control signal transmitted from the CPU 41. The CPU 41 generates a control signal and transmits it to the light-emitting drive unit 442 so that the light intensity set in the light intensity setting data 432 is emitted from the light-emitting element 441. Therefore, the light-emitting element 441 emits light of the light intensity specified in the light intensity setting data 432. The sensor 45 has a plurality of two-dimensionally arranged photodetectors 451 that have light-receiving sensitivity in the infrared wavelength range. Each light-receiving element 451 detects light emitted from the light-emitting element 441 and reflected from an object, and outputs detection data corresponding to the detected amount of light. The light-receiving elements 451 rapidly repeat the operation of detecting light for only a short period of time. Based on which period the amount of received light increased, it is possible to derive a depth value that represents the time it takes for light emitted from the light source 44 to be reflected from an object and detected, i.e., the distance to the object. In this embodiment, the multiple light-receiving elements 451 are arranged in a matrix of 240 x 240. However, the number and arrangement of the light-receiving elements 451 are not limited to this.The communication unit 46 is composed of a communication module or the like, and transmits and receives data to and from the distance measuring device 20 according to a predetermined communication standard.
[0013] The CPU 41 of the depth camera 40 derives (acquires) a plurality of depth values (depth information) related to the distance to an object by the TOF method based on the time from when light is emitted from the light source 44 until the light reflected by the object is detected by each of the plurality of light receiving elements 451. Further, the CPU 41 generates a depth image 133 composed of a plurality of pixels having the derived plurality of depth values as pixel values (in this embodiment, 240×240 pixels corresponding to the arrangement of the light receiving elements 451). The depth value of each pixel of the depth image 133 is derived based on the detection data by one of the plurality of light receiving elements 451. In this embodiment, the depth camera 40 photographs a shooting range including the operator 60 and the structures in the background thereof, generates a depth image 133 including a plurality of depth values to the operator 60 and the structures, and transmits it to the control device 10. The depth camera 40 repeatedly generates the depth image 133 at a predetermined frame rate (for example, 30 fps or 15 fps, etc.) and transmits it to the control device 10.
[0014] Next, the control operation of the distance measuring device 20 by the control device 10, particularly the operation of controlling the light amount of the light emitted from the light source 44 of the depth camera 40, will be described. The light amount of the light emitted from the light source 44 affects the measurement accuracy of the distance by the depth camera 40. If the light amount is too small, the ratio of noise to the light detection signal by the light receiving element 451 increases, and the measurement accuracy of the distance decreases. Also, even if the light amount is too large, the measurement accuracy decreases due to the saturation of the output value of the light receiving element 451 when the measurement object is at a short distance or the like. If the light amount is too large, there may also occur a problem that the operating life of each part of the light emitting element 441 and the depth camera 40 is shortened due to the heat generation of the light emitting element 441. Further, the appropriate light amount varies depending on the distance from the depth camera 40 to the measurement object. Usually, the farther the distance to the measurement object, the larger the appropriate light amount. Therefore, in order to maintain the required distance measurement accuracy, it is necessary to continuously adjust the light amount of the light emitted from the light source 44 appropriately according to the usage scene of the depth camera 40 and the distance to the measurement object.
[0015] The excess or deficiency of light is reflected in the variation of depth values in the depth image 133. When the light intensity is insufficient, as described above, the ratio of noise to the light detection signal increases, reducing the accuracy of distance measurement and thus increasing the variation in depth values. On the other hand, when the light intensity is sufficient, the ratio of noise to the light detection signal decreases, improving the accuracy of distance measurement and thus reducing the variation in depth values. Therefore, the control device 10 of this embodiment analyzes the variation in depth values in the depth image 133 and adjusts the amount of light emitted from the light source 44 based on the analysis results of the variation. For example, if the variation in depth values is large, the control device 10 determines that the light intensity is insufficient and adjusts to increase the light intensity, and if the variation in depth values is small, it determines that the light intensity is sufficient and adjusts to maintain or decrease the light intensity.
[0016] The following describes the equipment control processing performed by the CPU 11 of the control device 10 to perform the light intensity adjustment operation described above, with reference to Figure 4. The equipment control processing includes detecting the gesture of the operator 60's hand 61 and controlling the operation of the projector 50 according to the detection result. The equipment control processing is executed when the system starts accepting operation by the operator 60's gesture. When the equipment control processing starts, the CPU 11 sends a control signal to the distance measuring device 20 to start shooting with the infrared camera 30 and the depth camera 40 (step S101). The CPU 11 acquires a depth image 133 from the depth camera 40 (step S102). Here, it is assumed that a depth image 133 of the operator 60 holding their hand 61 forward has been acquired, as shown in Figure 5. In the depth image 133 in Figure 5, a higher pixel density indicates a larger depth value. The CPU 11 performs a predetermined smoothing process on the depth value of the depth image 133 to reduce variations and noise (step S103). The smoothing process may be, for example, a Gaussian filter or a bilateral filter, but is not limited to these. The CPU 11 performs a filtering process on the depth image 133 to extract pixels whose depth values are within a predetermined range, and generates a temporary mask image representing the temporary target region extracted by the filtering process (step S104). The range extracted by the filtering process is predetermined and stored in the storage unit 13 so as to be the depth range where the operator's hand 61 is roughly located. For example, the range extracted by the filtering process is specified in the format of 20 cm or more and 50 cm or less. The temporary mask image is, for example, an image in which the pixel value of pixels within the temporary target region is "1" and the pixel value of other pixels is "0". The CPU 11 shrinks the temporary target region to determine the target region R (see Figure 6) and generates a mask image 134 representing the target region R (step S105). The process of shrinking the temporary target region may be, for example, a process of deleting the pixels of the contour line of the temporary target region a predetermined number of times. As shown in Figure 6, the target region R is the region corresponding to the hand 61, which is the object whose distance is being measured. In addition, the infrared image 132 may also be used to extract the provisional target region and the target region R.For example, in the infrared image 132, a region with brightness corresponding to the hand 61 may be identified, and a provisional target region or target region R may be extracted from that region.
[0017] The CPU 11 determines whether or not it has detected a gesture by the hand 61 from the generated mask image 134 (step S106). Here, the CPU 11 may detect the gesture based on the transition of the target region R in the mask image 134 of multiple most recently generated frames. Note that gesture detection may also be performed based on the provisional target region before contraction. If it is determined that a gesture has been detected ("YES" in step S106), the CPU 11 controls the operation of the projector 50 by sending a control signal corresponding to the detected gesture to the projector 50 (step S107). When step S107 is completed, or if it is determined that no gesture has been detected ("NO" in step S106), the CPU 11 performs an index value derivation process to derive an index value related to the magnitude of variation in depth values in the depth image 133 (step S108). The contents of the index value derivation process will be described later. Next, the CPU 11 determines whether or not it is time to adjust the amount of light emitted from the light source 44 (step S109). The timing for adjusting the light intensity is predetermined and stored in the memory unit 13, for example, at a predetermined frequency such as once every two seconds. If it is determined that it is time to adjust the light intensity ("YES" in step S109), the CPU 11 executes a light source control process to adjust the amount of light emitted from the light source 44 (step S110). The details of the light source control process will be described later. If the light source control process is completed, or if it is determined that it is not time to adjust the light intensity ("NO" in step S109), the CPU 11 determines whether or not to terminate the acceptance of gestures (S111). If it is determined that the acceptance of gestures should continue ("NO" in step S111), the CPU 11 moves the process to step S102 and executes the loop processing from steps S102 to S111. This loop processing is executed at the frame rate at which the depth image 133 is generated (e.g., 30fps or 15fps). If it determines that it is time to stop accepting gestures (YES in step S111), the CPU 11 terminates the device control process.
[0018] Next, the control procedure for the index value derivation process will be explained with reference to Figures 7 to 12. The index value derivation process is a process for evaluating the variation in depth values of multiple target pixels P (see Figure 9) belonging to the target region R among multiple pixels of the depth image 133. Hereinafter, the depth value of the target pixel P will be referred to as the "target depth value V". In the index value derivation process, the depth image 133 before the smoothing process in step S103 of Figure 4 is performed is used. Furthermore, the reason for shrinking the provisional target region in step S105 is as follows: The boundary line of the provisional target region extracted by the filtering process corresponds to the boundary line of hand 61, and it may not be possible to measure an appropriate depth value at this boundary line. For this reason, the variation in depth values at the boundary line of the provisional target region may not be due to the amount of light. Therefore, in the index value derivation process, it is preferable to exclude the variation in depth values at the boundary line of the provisional target region from the judgment target, so the shrinking of the provisional target region is made the target region R. As shown in Figure 7, when the index value derivation process starts, the CPU 11 executes the first index value derivation process (step S201), the second index value derivation process (step S202), and the third index value derivation process (step S203) in this order. However, the order of steps S201 to S203 may be changed as appropriate. Of these, the first index value derivation process and the second index value derivation process are processes that derive the first index value and the second index value, respectively, relating to the magnitude of spatial variation of multiple target depth values V. Specifically, the first index value derivation process is a process that derives the first index value relating to the variation between adjacent pixels. The second index value derivation process is a process that derives the second index value relating to the variation of the smoothed value of the target depth value V of adjacent pixels. The third index value derivation process is a process that derives the third index value relating to the magnitude of temporal variation of multiple target depth values V. More specifically, the third index value derivation process is a process that derives a third index value related to the variation of the target depth value V between frames of the depth image 133. The first index value derivation process, the second index value derivation process, and the third index value derivation process are processes that derive multiple index values using multiple different methods.
[0019] As shown in Figure 8, when the first index value derivation process is started, the CPU 11 selects one target pixel P within the target region R of the depth image 133 as the determination pixel Pa (a certain target pixel) (see Figure 9) (step S301). The CPU 11 sets a region of interest Ra (see Figure 9) that includes the selected determination pixel Pa (step S302). In this embodiment, the region of interest Ra is assumed to be a 3x3 pixel matrix centered on the determination pixel Pa. However, the region of interest Ra is not limited to this, and may be a larger pixel matrix such as 5x5 or 7x7. The CPU 11 derives the standard deviation of the target depth value V within the set region of interest Ra (step S303). The standard deviation is one form of statistics that represents the variability of the target depth value V of each pixel belonging to the region of interest Ra. Note that other statistics, such as variance, the difference (range) between the minimum and maximum values, the interquartile range, the absolute deviation, etc., may be derived instead of the standard deviation. For example, if the target depth value V in the region of interest Ra is the value shown in the right figure of Figure 9 (unit: mm), then a standard deviation of "962 mm" is derived. The derived standard deviation reflects the magnitude of the repeatability error of the depth value (the error when measuring objects at the same distance consecutively). The CPU 11 determines whether the derived standard deviation is greater than or equal to a first threshold (step S304). The first threshold is predetermined and stored in the storage unit 13. If the CPU 11 determines that the standard deviation is greater than or equal to the first threshold ("YES" in step S304), the CPU 11 determines the determination pixel Pa to be a variability pixel (step S305). Here, a variability pixel is a pixel that has a certain or greater influence on the variability of the target depth value V in the target region R. If step S305 is completed, or if it is determined that the derived standard deviation is less than the first threshold ("NO" in step S304), the CPU 11 determines whether or not there are undetermined target pixels P within the target region R (step S306). If it is determined that there are undetermined target pixels P ("YES" in step S306), the CPU 11 returns to step S301 and determines whether or not the next target pixel P is a variability pixel.If it is determined that there are no undetermined target pixels P ("NO" in step S306), the CPU 11 derives the ratio of the number of target pixels P determined to be variable pixels to the number of target pixels P for which the determination of whether or not they are variable pixels was performed, and sets this ratio as the first index value (step S307). In Figure 8, all target pixels P belonging to the target region R are selected as determination pixels Pa and the determination of whether or not they are variable pixels is performed. However, some target pixels P from the target region R may be extracted (for example, randomly) and used as targets for determination of whether or not they are variable pixels (the same applies to the second index value derivation process and the third index value derivation process described later). By extracting some target pixels P from the target region R and using them as targets for determination, the load on the index value derivation process can be reduced and the derivation speed can be improved. On the other hand, by using all target pixels P in the target region R as targets for determination, the reliability of the index value can be improved. When step S307 is completed, the CPU 11 terminates the first index value derivation process.
[0020] As shown in Figure 10, when the second index value derivation process is started, the CPU 11 executes steps S401 and S402. The processing content of steps S401 and S402 is the same as steps S301 and S302 in Figure 8. The CPU 11 derives the median value of the target depth value V within the set region of interest Ra (step S403). The median value is one form of representative depth value that represents the target depth value V of each pixel belonging to the region of interest Ra. In step S403, a representative depth value other than the median value, such as the average value, may also be derived. For example, if the target depth value V of each pixel in the region of interest Ra is the value shown in the right figure of Figure 9, then "442 mm" is derived as the median value. The CPU 11 determines whether the difference between the target depth value Va of the judgment pixel Pa ("429 mm" in Figure 9) and the derived median value ("13 mm" in Figure 9) is greater than or equal to the second threshold (step S404). The second threshold may be, for example, around "200 mm". The second threshold is predetermined and stored in the memory unit 13. An example of a case in which the difference between the target depth value Va of the determination pixel Pa and the median value is greater than or equal to the second threshold is when there is an abnormality in the light-receiving element 451 corresponding to the determination pixel Pa and the target depth value Va becomes an abnormal value. If it is determined that the difference between the target depth value Va of the determination pixel Pa and the median value is greater than or equal to the second threshold ("YES" in step S404), the CPU 11 determines that the determination pixel Pa is a variability pixel (step S405). When step S405 is completed, or if it is determined that the difference between the target depth value Va of the determination pixel Pa and the median value is less than the second threshold ("NO" in step S404), the CPU 11 determines whether or not there is an undetermined target pixel P within the target area R (step S406). If it is determined that there are undetermined target pixels P (YES in step S406), the CPU 11 returns to step S401 and determines whether the next target pixel P is a variable pixel or not. If it is determined that there are no undetermined target pixels P (NO in step S406), the CPU 11 derives the ratio of the number of target pixels P determined to be variable pixels to the number of target pixels P for which the determination of whether or not they are variable pixels has been made, and sets this ratio as the second index value (step S407). When step S407 is completed, the CPU 11 terminates the second index value derivation process.
[0021] As shown in Figure 11, when the third index value derivation process begins, the CPU 11 shrinks the target region R (step S501). The shrinking process is similar to, for example, the shrinking process of the provisional target region in step S105 of Figure 4. By shrinking the target region R, if the speed of the hand 61 is below a certain speed, each target pixel P within the target region R and the pixel corresponding to that target pixel P in the previous frame can be made to be pixels that correspond to the inside of the hand 61. Hereafter, "target region R" in this paragraph refers to the target region R after shrinking in step S501. Note that step S501 may be omitted if it is known in advance that the movement of the hand 61 is slow. The CPU 11 selects one target pixel P within the target region R of the depth image 133 as the determination pixel Pa (step S502). The CPU 11 obtains the depth value of the pixel corresponding to the determination pixel Pa in the depth image 133 used in the previous index value derivation process (hereinafter referred to as the "previous depth value") (step S503). For example, as shown in Figure 12, the CPU 11 obtains the depth value "435 mm" of the pixel corresponding to the determination pixel Pa in the previous depth image 133. The CPU 11 determines whether the difference between the target depth value Va of the determination pixel Pa ("429 mm" in Figure 12) and the previous depth value (hereinafter referred to as the "difference between frames"; "6 mm" in Figure 12) is greater than or equal to a third threshold (step S504). The third threshold may be, for example, around "300 mm". The third threshold is predetermined and stored in the storage unit 13. The difference between frames reflects, for example, electrical noise affecting all pixels and changes in ambient light intensity. If the CPU determines that the difference between frames is greater than or equal to the third threshold ("YES" in step S504), the CPU 11 determines that the determined pixel Pa is a variability pixel (step S505). When step S505 is completed, or if the CPU determines that the difference between frames is less than the third threshold ("NO" in step S504), the CPU 11 determines whether or not there is an undetermined target pixel P within the target region R (step S506). If the CPU 11 determines that there is an undetermined target pixel P ("YES" in step S506), the CPU 11 returns to step S502 and determines whether or not the next target pixel P is a variability pixel.If it is determined that there are no undetermined target pixels P (NO in step S506), the CPU 11 derives the ratio of the number of target pixels P determined to be variable pixels to the number of target pixels P for which the determination of whether or not they are variable pixels was made, and sets this ratio as the third index value (step S507). When step S507 is completed, the CPU 11 terminates the third index value derivation process.
[0022] Returning to Figure 7, when the third index value derivation process in step S203 is completed, the CPU 11 derives a representative index value that represents the first to third index values and stores it in the storage unit 13 (step S204). The representative index value may be the average or median of the first to third index values. For example, if the first to third index values are "0.2", "0.3", and "0.4", respectively, the representative index value, which is the average or median of these values, will be "0.3". In this embodiment, the first to third index values and the representative index value increase as the variability of the target depth value V in the target region R increases. When step S204 is completed, the CPU 11 terminates the index value derivation process and returns the process to the equipment control process in Figure 4.
[0023] Next, the control procedure for the light source control process will be explained with reference to Figure 13. When the light source control process starts, the CPU 11 obtains the direction of light intensity adjustment in the previous light source control process, the representative index value in the previous light source control process, and the current representative index value (the representative index value derived in step S204 of the previous index value derivation process) (step S601). However, if it is the first light source control process, the CPU 11 obtains only the current representative index value. Of these, the previous representative index value corresponds to the "predetermined reference value" and the "value derived based on the previous index value (the previous 1st to 3rd index value)". Thereafter, the CPU 11 executes a determination process (steps S602 to S613) (hereinafter referred to as the "adjustment content determination process") to determine the adjustment content of the light intensity of the light emitted from the light source 44, based on the current representative index value and the previous representative index value as the reference value. First, the CPU 11 determines whether the current representative index value is greater than or equal to the 4th threshold (step S602). The fourth threshold corresponds to the lower limit of the representative index value at which variation in the target depth value V is judged to exist in the target region R, and is predetermined and stored in the memory unit 13. If the CPU 11 determines that the current representative index value is less than the fourth threshold ("NO" in step S602), the CPU 11 determines that there is "no variation" in the target depth value V of the target region R used to derive the current representative index value (step S603). The CPU 11 also decides to "decrease" the direction of adjustment of the amount of light emitted from the light source 44 (step S604).
[0024] On the other hand, if the CPU determines that the current representative index value is above the fourth threshold ("YES" in step S602), the CPU 11 determines that there is "variation" in the target depth value V of the target area R used to derive the current representative index value (step S605). If this is the second or subsequent light source control process ("NO" in step S606), the CPU 11 determines whether the current representative index value is less than the previous representative index value, that is, whether the representative index value has decreased from the previous to the current one (step S607). If the CPU determines that the current representative index value is less than the previous representative index value ("YES" in step S607), the CPU 11 considers that the direction of light intensity adjustment determined in the previous adjustment content determination process was an adjustment direction that reduces variation, and determines the adjustment direction in the current adjustment content determination process to be the same direction as the previous one. Specifically, the CPU 11 determines whether the direction of light intensity adjustment determined in the previous adjustment content determination process was "increased" (step S608). If it is determined that the previous adjustment direction was "increase" (YES in step S608), the CPU 11 decides that the current light intensity adjustment direction is "increase" (step S609). If this is the first light source control process (YES in step S606), the CPU 11 skips steps S607 and S608 and executes step S609. On the other hand, if it is determined that the previous adjustment direction was "decrease" (NO in step S608), the CPU 11 decides that the current light intensity adjustment direction is "decrease" (step S610).
[0025] If the CPU determines that the current representative indicator value is greater than or equal to the previous representative indicator value ("NO" in step S607), the CPU 11 considers that the direction of light intensity adjustment determined in the previous adjustment content determination process was an adjustment direction that increased the variation, and determines the adjustment direction in the current adjustment content determination process to be the opposite direction to the previous one. Specifically, the CPU 11 determines whether the direction of light intensity adjustment determined in the previous adjustment content determination process was "increase" (step S611). If it determines that the previous adjustment direction was "increase" ("YES" in step S611), the CPU 11 determines the direction of light intensity adjustment for the current time to be "decrease" (step S612). On the other hand, if it determines that the previous adjustment direction was "decrease" ("NO" in step S611), the CPU 11 determines the direction of light intensity adjustment for the current time to be "increase" (step S613).
[0026] When any of steps S604, S609, S610, S612, or S613 is completed, the CPU 11 controls the light source 44 so that the light intensity changes according to the determined adjustment. Here, the CPU 11 sends a control signal to the depth camera 40 to perform the adjustment according to the determined adjustment (step S614). This control signal includes a signal to change the light intensity setting value in the light intensity setting data 432 so that the light intensity increases or decreases. The range of change for increasing or decreasing the light intensity may be a predetermined constant range. Alternatively, the range of change may be determined each time according to the difference between the previous representative indicator value and the current representative indicator value. Upon receiving the control signal, the CPU 41 of the depth camera 40 changes the setting value of the light intensity setting data 432 according to the control signal, and thereafter causes the light source 44 to emit light at the light intensity based on the changed setting value. When step S614 is completed, the CPU 11 terminates the light source control process and returns the process to the equipment control process shown in Figure 4.
[0027] The above is an example of a control procedure for light source control processing, and various modifications may be made. For example, in Figure 13, the previous representative index value was used as the reference value, but instead, the reference value may be a predetermined fixed value. For example, a common reference value may be used in the adjustment content determination process for each cycle. When a predetermined reference value is used, the CPU 11 executes the light source control processing shown in Figure 14. In the light source control processing of Figure 14, it is assumed that the variation in the target depth value V decreases as the amount of light emitted from the light source 44 increases. When the light source control processing starts, the CPU 11 acquires the current representative index value (step S701). Thereafter, the CPU 11 executes adjustment content determination processing (steps S702 to S706) to determine the adjustment content of the amount of light emitted from the light source 44 based on the current representative index value and the predetermined reference value. First, the CPU 11 determines whether the acquired representative index value is greater than or equal to the reference value (step S702). In this case, the reference value may be the same as the fourth threshold in Figure 13. If the representative indicator value is determined to be less than the reference value ("NO" in step S702), the CPU 11 determines that there is "no variation" in the target depth value V of the target area R used to derive the representative indicator value (step S703). The CPU 11 also decides to adjust the light intensity of the light emitted from the light source 44 to "decrease" (step S704). On the other hand, if the representative indicator value is determined to be greater than or equal to the reference value ("YES" in step S702), the CPU 11 determines that there is "variation" in the target depth value V of the target area R used to derive the representative indicator value (step S705). The CPU 11 also decides to adjust the light intensity of the light emitted from the light source 44 to "increase" (step S706). When step S704 or S706 is completed, the CPU 11 executes the process in step S707. The process in step S707 is the same as the process in step S614 in Figure 13. When step S707 is completed, the CPU 11 terminates the light source control process and returns the process to the equipment control process shown in Figure 4.
[0028] Furthermore, in the adjustment content determination process shown in Figure 13 or Figure 14, if the direction of light intensity adjustment switches from increasing to decreasing, or from decreasing to increasing, hysteresis may be introduced in the subsequent determination of the adjustment direction. For example, after the adjustment direction switches, the adjustment direction may not be switched back to the opposite direction for a predetermined period. Alternatively, after the adjustment direction switches, the reference value (the previous representative index value) may be adjusted in a direction that makes it less likely for the adjustment direction to switch. This prevents the direction of light intensity adjustment from changing frequently when the representative index value is near the reference value.
[0029] Furthermore, in Figure 13, the presence or absence of variation was determined based on the relative magnitudes of the representative index value and the fourth threshold. However, instead, the presence or absence of variation may be determined first based on each of the first to third index values, and an overall determination result of the presence or absence of variation may be obtained based on these determination results. Specifically, by comparing the first to third index values with a predetermined threshold, it may be determined whether each of the first to third index values corresponds to "variability present" or "no variation," and the greater of these determination results may be used as the overall determination result. If the overall determination result is "no variation," steps S602, S603, and S605 in Figure 13 may be omitted, and the process may proceed to step S604. If "variability present," the process may proceed to step S606. In this case, the determination results of the presence or absence of variation for each of the first to third index values may be weighted based on the external environment of the depth camera 40. For example, in environments where an infrared flash is used, the difference in depth values between frames tends to be large, so the weight of the third index value may be reduced. Also, the greater the distance to the object being measured, the greater the repetition noise, which tends to increase the first index value, and the smaller the difference between frames, which tends to decrease the third index value. For this reason, the greater the distance to the object being measured, the greater the weight of the first index value may be reduced. Furthermore, in environments where a particular index value among the first to third index values becomes too large, adjusting the light intensity according to that particular index value tends to have a smaller effect in reducing variability, so the weight of that particular index value may be reduced.
[0030] As described above, the control device 10 according to this embodiment includes a CPU 11 that controls the light source 44 of the distance measuring device 20. The distance measuring device 20 derives a plurality of depth values related to the distance to an object based on the time from when light is emitted from the light source 44 until the reflected light from the object is detected by a plurality of light receiving elements 451. The CPU 11 acquires the plurality of depth values derived by the distance measuring device 20. The CPU 11 derives an index value related to the magnitude of variation of the plurality of target depth values V based on a plurality of target depth values V, which are at least a part of the plurality of depth values. The CPU 11 determines the adjustment content of the light intensity based on the index value and a predetermined reference value, and controls the light source 44 so that the light intensity changes according to the determined adjustment content. This makes it possible to adjust the light intensity emitted from the light source 44 in an appropriate direction according to the variation of the target depth values V. In other words, it is possible to adjust the light intensity in a direction that suppresses a decrease in the accuracy of distance measurement caused by too little or too much light intensity. Furthermore, by adjusting the light intensity to reduce it when it is too high, it is possible to prevent malfunctions in the operation of various parts of the distance measuring device 20, including the light source 44, or a shortening of its operating life due to excessive light intensity. In addition, by repeatedly performing the above operation, it is possible to maintain an appropriate light intensity in response to changes in the environment of the distance measuring device 20 and changes in the distance to the object to be measured. Therefore, the distance measuring device 20 can be operated normally for a long period of time while maintaining appropriate measurement accuracy.
[0031] Furthermore, the CPU 11 acquires a depth image 133 from the distance measuring device 20, which has multiple pixels corresponding to multiple two-dimensionally arranged photodetectors 451, and includes multiple depth values as the pixel values of the multiple pixels. Based on at least multiple depth values, the CPU 11 identifies a target region R corresponding to the hand 61 (object to be measured) from the depth image 133. From the multiple depth values, the CPU 11 extracts multiple target depth values V corresponding to multiple target pixels P belonging to the target region R. This allows the amount of light emitted from the light source 44 to be adjusted so that the variation in target depth values V within the target region R corresponding to the hand 61 is suppressed, that is, so that the measurement accuracy of the distance to the hand 61 is appropriately maintained.
[0032] Furthermore, the CPU 11 derives a first index value and a second index value related to the magnitude of spatial variation of multiple target depth values V. This allows the amount of light emitted from the light source 44 to be adjusted so that the spatial variation of the target depth values V is suppressed.
[0033] Furthermore, the CPU 11 sets a region of interest Ra in the target region R that includes a determination pixel Pa (a certain target pixel) among multiple target pixels P, and determines whether the determination pixel Pa is a variability pixel that has a certain or greater influence on the variability based on the target depth value V of each pixel belonging to the region of interest Ra. The CPU 11 derives a first index value and a second index value based on the ratio of the number of target pixels P determined to be variability pixels to the number of target pixels P for which the determination of whether or not they are variability pixels has been made. In this way, variability pixels that have a certain or greater influence on the variability can be identified by a simple process based on the distribution of target depth values V in the pixels surrounding each target pixel P. In addition, by a simple process to derive the ratio of variability pixels, the first index value and the second index value representing the variability of target depth values V in the target region R corresponding to hand 61 can be derived.
[0034] Furthermore, the CPU 11 determines that a determination pixel Pa is a variability pixel if the standard deviation representing the variation in the target depth value V of each pixel belonging to the region of interest Ra is greater than or equal to a first threshold. By using the determination result of variability pixels using this method, a first index value that reflects the magnitude of the repeatability error of the depth value can be derived. By executing the adjustment content determination process based on this first index value, the amount of light emitted from the light source 44 can be adjusted so as to suppress the decrease in measurement accuracy caused by the repeatability error of the depth value.
[0035] Furthermore, the CPU 11 determines that a determination pixel Pa is a variability pixel if the difference between the median value representing the target depth value V of each pixel belonging to the region of interest Ra and the target depth value Va of the determination pixel Pa is greater than or equal to a second threshold. By using the determination result of variability pixels using this method, a second index value that reflects the variability caused by abnormal values of the target depth value Va can be derived. By executing the adjustment content determination process based on this second index value, the amount of light emitted from the light source 44 can be adjusted so as to suppress the decrease in measurement accuracy caused by abnormal values of depth values.
[0036] Furthermore, the CPU 11 repeatedly acquires depth images 133 at a predetermined frequency and derives a third index value related to the magnitude of temporal variation of multiple target depth values V. This allows the amount of light emitted from the light source 44 to be adjusted so as to suppress the temporal variation of the target depth values V.
[0037] Furthermore, the CPU 11 determines that a determination pixel Pa is a variability pixel that has a certain or greater influence on the variability if the difference between the target depth value Va of a determination pixel Pa in a certain depth image 133 and the depth value of the pixel corresponding to the determination pixel Pa in a depth image 133 acquired before that depth image 133 is greater than or equal to a third threshold. The CPU 11 derives a third index value based on the ratio of the number of target pixels P determined to be variability pixels to the number of target pixels P for which a determination of whether or not they are variability pixels has been made. By using the determination result of variability pixels using this method, a third index value that reflects the variability of the target depth value V between frames can be derived. By executing the adjustment content determination process based on this third index value, the amount of light emitted from the light source 44 can be adjusted so as to suppress the decrease in measurement accuracy caused by the variability of the target depth value V between frames.
[0038] Furthermore, the CPU 11 derives first to third index values using multiple different methods, and determines the adjustment of the light intensity based on the relationship between a representative index value and a reference value that represents multiple first to third index values. This makes it possible to adjust the light intensity emitted from the light source 44 in a way that suppresses a decrease in measurement accuracy caused by overall variability due to multiple factors.
[0039] Furthermore, CPU 11 derives first to third index values and a representative index value, the larger the variation. CPU 11 repeatedly performs the acquisition of multiple target depth values V, the derivation of the representative index value, and the adjustment content determination process. CPU 11 acquires the representative index value used in the previous adjustment content determination process as a reference value. In the adjustment content determination process, CPU 11 determines whether to decrease or increase the direction of light intensity adjustment. If the current representative index value is less than the previous representative index value, the adjustment direction is determined to be the same as the previous adjustment direction determined in the previous adjustment content determination process. If the current representative index value is greater than or equal to the representative index value, the adjustment direction is determined to be the opposite of the previous adjustment direction determined in the previous adjustment content determination process. According to this, if the current representative index value is less than the representative index value, it can be determined that the adjustment according to the previous adjustment direction was an adjustment that reduced the variation of the target depth value V. Therefore, by setting the current adjustment direction to the same direction as the previous one, it is possible to continue adjusting the light intensity to reduce variation. On the other hand, if the current representative index value is greater than or equal to the current representative index value, it can be determined that the adjustment made in the previous adjustment direction did not reduce the variability of the target depth value V. Therefore, by making the current adjustment direction the opposite to that of the previous adjustment, it is possible to adjust the light intensity in a way that reduces variability. This method allows for adjustments that reduce variability in both cases where the light intensity is too low and the variability is large, and cases where the light intensity is too high and the variability is large.
[0040] Furthermore, if the derived representative index value is below the fourth threshold, the CPU 11 determines the adjustment direction to decrease the amount of light. In this way, when the variation in the target depth value V is kept below a certain level and the necessary measurement accuracy is ensured, the amount of light emitted from the light source 44 can be reduced. This suppresses the temperature rise of each part of the distance measuring device 20, including the light source 44, prevents malfunctions due to high temperatures, and extends the operating life of the distance measuring device 20.
[0041] Furthermore, the CPU 11 may use a predetermined reference value in the adjustment content determination process for each cycle. In this case, in the adjustment content determination process, if the representative index value is less than the reference value, the CPU 11 determines the adjustment direction to decrease the amount of light, and if the representative index value is equal to or greater than the reference value, the CPU 11 determines the adjustment direction to increase the amount of light. This makes it possible to perform an adjustment that reduces the amount of light until the variation in the target depth value V, represented by the representative index value, falls below a certain level. After the variation in the target depth value V falls below a certain level, an adjustment that increases the amount of light can be performed to maintain the accuracy of distance measurement.
[0042] Furthermore, according to the light source control method of this embodiment, the CPU 11 executes the above processing, enabling the distance measuring device 20 to operate normally for a long period of time while maintaining appropriate measurement accuracy. In addition, the program 131 of this embodiment causes the CPU 11 to execute the above processing. This enables the distance measuring device 20 to operate normally for a long period of time while maintaining appropriate measurement accuracy.
[0043] It should be noted that the present invention is not limited to the embodiments described above, and various modifications are possible. For example, while the first index value based on a statistical quantity representing the variability of the target depth value V, the second index value based on the difference between the target depth value V and a representative value, and the third index value based on the difference in the target depth value V between frames have been given as examples of index values used in the adjustment content determination process, the invention is not intended to be limited to these. Index values derived by other methods may be used in place of any of these index values, or in addition to these index values. Furthermore, the number of index values used in the adjustment content determination process is not limited to three, but may be two or fewer, or four or more. Therefore, for example, the adjustment content determination process may be performed using a single index value. When using a single index value, the index value used in the previous adjustment content determination process (previous index value) may be used as the reference value for the current adjustment content determination process.
[0044] Furthermore, the gestures detected using the distance measuring device 20 are not limited to gestures for operating the projector 50. The distance measuring device 20 may also be used to detect gestures for operating other devices such as electrical appliances, machinery, game consoles, toys, etc., to detect touch operations on buttons displayed in the air, or to detect user operations in AR (augmented reality) or VR (virtual reality). In addition, the distance measuring device 20 may simply be a device for measuring the distance to an object.
[0045] Furthermore, the control device 10 may be incorporated into the distance measuring device 20. For example, the CPU 41 of the depth camera 40 may perform the processing that was performed by the CPU 11 of the control device 10 in the above embodiment. In this case, the control device is configured by the CPU 41, RAM 42, and storage unit 43 of the depth camera 40.
[0046] Furthermore, while the above description discloses examples in which the HDD and SSD of the storage unit 13 are used as computer-readable media for the program according to the present invention, the invention is not limited to these examples. Other computer-readable media that can be used include information recording media such as flash memory and CD-ROM. In addition, a carrier wave can also be used as a medium for providing data for the program according to the present invention via a communication line.
[0047] Furthermore, it goes without saying that the detailed configuration and operation of each component of the control device 10 and the distance measuring device 20 in the above embodiments can be appropriately modified without departing from the spirit of the present invention. Although embodiments of the present invention have been described, the scope of the present invention is not limited to the embodiments described above, but includes the scope of the invention as described in the claims and its equivalents. [Explanation of symbols]
[0048] 1…Information processing system, 10…Control device, 11…CPU (control unit), 20…Distance measuring device, 44…Light source, 61…Hand (object to be measured), 133…Depth image, 451…Photodetector, P…Target pixel, Pa…Determination pixel (a certain target pixel), R…Target region, Ra…Region of interest, V…Target depth value
Claims
1. A control device comprising a control unit for controlling the light source of a distance measuring device, The distance measuring device derives a plurality of depth values relating to the distance to the object based on the time from when light is emitted from the light source until the reflected light from the object is detected by a plurality of light-receiving elements. The control unit, The distance measuring device obtains the plurality of depth values derived by the distance measuring device, Based on a plurality of target depth values which are at least a portion of the plurality of depth values, an index value relating to the magnitude of variation of the plurality of target depth values is derived. The adjustment details for the light intensity are determined based on the aforementioned index value and predetermined reference value. The light source is controlled so that the amount of light changes according to the determined adjustment settings. Control device.
2. The control unit, A depth image having a plurality of pixels corresponding to the plurality of light-receiving elements arranged in a two-dimensional array, wherein the depth image, which includes the plurality of depth values as the pixel values of the plurality of pixels, is acquired from the distance measuring device. Based on at least the aforementioned multiple depth values, a target area corresponding to the object whose distance is to be measured is identified from the depth image, From the aforementioned plurality of depth values, the plurality of target depth values corresponding to the plurality of target pixels belonging to the target region are extracted. The control device according to claim 1.
3. The control unit derives the index value relating to the magnitude of spatial variation of the plurality of target depth values. The control device according to claim 2.
4. The control unit, In the aforementioned target region, a region of interest is set that includes a certain target pixel among the plurality of target pixels, and based on the target depth value of each pixel belonging to the region of interest, it is determined whether or not the certain target pixel is a variation pixel that has a certain or greater influence on the variation. The index value is derived based on the ratio of the number of target pixels determined to be variation pixels to the number of target pixels for which the determination of whether or not they are variation pixels was made. The control device according to claim 3.
5. The control unit determines that a certain target pixel is a variability pixel if a predetermined statistical quantity representing the variation in the target depth value of each pixel belonging to the region of interest is greater than or equal to a predetermined first threshold. The control device according to claim 4.
6. The control unit determines that a certain target pixel is a variation pixel if the difference between a representative depth value representing the target depth values of each pixel belonging to the region of interest and the target depth value of a certain target pixel is greater than or equal to a predetermined second threshold. The control device according to claim 4.
7. The control unit repeatedly acquires the depth image at a predetermined frequency and derives the index value relating to the magnitude of the temporal variation of the plurality of target depth values. The control device according to claim 2.
8. The control unit, If the difference between the target depth value of a certain target pixel in a certain depth image and the depth value of the pixel corresponding to the target pixel in a depth image acquired before the certain depth image is greater than or equal to a predetermined third threshold, then it is determined that the certain target pixel is a variability pixel that has a certain or greater influence on the variability. The index value is derived based on the ratio of the number of target pixels determined to be variation pixels to the number of target pixels for which the determination of whether or not they are variation pixels was made. The control device according to claim 7.
9. The control unit, Multiple index values are derived using different methods, The adjustment content of the light quantity is determined based on a representative index value that represents the plurality of index values and the reference value. The control device according to any one of claims 3 to 8.
10. The control unit, The index value is derived by determining that the larger the aforementioned variation, the greater the value. The process of acquiring the multiple target depth values, deriving the index value, and determining the adjustment content of the light quantity is repeatedly performed. The previous index value, which is the index value used in the previous decision process, or a value derived based on the previous index value, is obtained as the reference value. In the aforementioned decision process, The direction of adjusting the light intensity is determined to be either decreasing or increasing, If the index value is less than the reference value, the adjustment direction is determined to be the same as the previous adjustment direction determined in the previous determination process. If the index value is equal to or greater than the reference value, the adjustment direction is determined to be in the opposite direction to the previous adjustment direction determined in the previous determination process. The control device according to claim 1.
11. The control unit determines the adjustment direction to be in the direction in which the amount of light decreases if the derived index value or a representative index value representing a plurality of index values is less than a predetermined fourth threshold. The control device according to claim 10.
12. A method for controlling the light source of a distance measuring device, The distance measuring device derives a plurality of depth values relating to the distance to the object based on the time from when light is emitted from the light source until the reflected light from the object is detected by a plurality of light-receiving elements. The aforementioned control method involves a computer, The distance measuring device obtains the plurality of depth values derived by the distance measuring device, Based on a plurality of target depth values which are at least a portion of the plurality of depth values, an index value relating to the magnitude of variation of the plurality of target depth values is derived. The adjustment details for the light intensity are determined based on the aforementioned index value and predetermined reference value. The light source is controlled so that the amount of light changes according to the determined adjustment settings. A method for controlling a light source.
13. A program executed by the computer of a control device that controls the light source of a distance measuring device, The distance measuring device derives a plurality of depth values relating to the distance to the object based on the time from when light is emitted from the light source until the reflected light from the object is detected by a plurality of light-receiving elements. The computer executes the program, The distance measuring device obtains the plurality of depth values derived by the distance measuring device, Based on a plurality of target depth values which are at least a portion of the plurality of depth values, an index value relating to the magnitude of variation of the plurality of target depth values is derived. The adjustment details for the light intensity are determined based on the aforementioned index value and predetermined reference value. The light source is controlled so that the amount of light changes according to the determined adjustment settings. program.