WO2023084790A1 - 3次元計測システム、並びにその制御方法及び制御プログラム - Google Patents

3次元計測システム、並びにその制御方法及び制御プログラム Download PDF

Info

Publication number
WO2023084790A1
WO2023084790A1 PCT/JP2021/041969 JP2021041969W WO2023084790A1 WO 2023084790 A1 WO2023084790 A1 WO 2023084790A1 JP 2021041969 W JP2021041969 W JP 2021041969W WO 2023084790 A1 WO2023084790 A1 WO 2023084790A1
Authority
WO
WIPO (PCT)
Prior art keywords
exposure
contrast
image
exposure condition
dimensional measurement
Prior art date
Application number
PCT/JP2021/041969
Other languages
English (en)
French (fr)
Inventor
颯太 廣瀬
弘之 岡
Original Assignee
東京ロボティクス株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 東京ロボティクス株式会社 filed Critical 東京ロボティクス株式会社
Priority to PCT/JP2021/041969 priority Critical patent/WO2023084790A1/ja
Publication of WO2023084790A1 publication Critical patent/WO2023084790A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/24Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures
    • G01B11/25Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures by projecting a pattern, e.g. one or more lines, moiré fringes on the object
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing

Definitions

  • the present invention relates to a three-dimensional measurement system, and a control method and control program for the three-dimensional measurement system.
  • the active stereo method is known as a method for acquiring three-dimensional information such as depth information without contact.
  • a striped pattern of light in which bright portions and dark portions are periodically repeated is projected onto an object from a projector, and the pattern light projected onto the object is photographed by a camera.
  • the distance from the projector or camera to the object is calculated, and depth information is acquired.
  • Patent Document 1 When colors such as black and white that have a large difference in brightness values coexist on the object, when the pattern light projected onto the object is photographed under one exposure condition, the pattern light can not be recognized, and the depth information of the object may not be acquired. This is because the dynamic range of a camera is generally narrow, and if the exposure condition is adjusted to either black or white, the gradation of the other is lost. In view of this, it has been proposed to obtain depth information of an object by photographing pattern light projected onto the object under different exposure conditions (Patent Document 1).
  • the pattern light projected onto the object is photographed with different exposure times.
  • the exposure time is relatively short, pattern light projected onto a bright portion such as white can be photographed without losing gradation.
  • the exposure time is relatively long, the pattern light projected onto a dark portion such as black can be photographed without losing gradation.
  • Images shot with different exposure times are integrated so as not to impair the gradation, thereby generating an image with a wide dynamic range.
  • the lack of three-dimensional information is suppressed by recognizing the pattern light based on the image acquired in this way.
  • the exposure conditions suitable for the object cannot be determined by just looking at the object.
  • the user repeats projection and photography while changing the exposure conditions (this work is hereinafter referred to as “pre-imaging”), and based on the photographed image and depth information obtained by pre-imaging, the target is projected and photographed. Determines exposure conditions suitable for objects. Therefore, a great deal of labor is required to search and determine exposure conditions.
  • the present invention has been made in view of the above-mentioned technical background, and its purpose is to reduce labor in determining exposure conditions in three-dimensional measurement.
  • a three-dimensional measurement system includes a projector that projects a plurality of striped pattern lights onto an object; a camera that generates a photographed image of the above; a contrast calculation unit that calculates the contrast of a target pixel of the plurality of photographed images for each of the plurality of exposure conditions; and the contrast calculated from the plurality of exposure conditions is a predetermined contrast.
  • a suitable exposure condition determination unit that determines, for each pixel of interest, an exposure condition that satisfies a condition as a suitable exposure condition; and an output unit that outputs a suitable exposure condition image showing the determined suitable exposure condition for each pixel.
  • the user can grasp the exposure conditions suitable for projecting/photographing the target simply by confirming the image of the suitable exposure conditions. Therefore, it is possible to reduce labor in determining exposure conditions in three-dimensional measurement.
  • the projector projects a plurality of gray code pattern lights in which bright portions and dark portions are periodically repeated, and the contrast calculator obtains a luminance value of the pixel of interest for each of the plurality of gray code pattern lights, A difference between the obtained maximum value and minimum value of the luminance values may be calculated as the contrast.
  • the projector projects a plurality of sinusoidal phase-shifted pattern lights whose phases are shifted at equal intervals, and the contrast calculation unit obtains a luminance value at the pixel of interest for each of the plurality of sinusoidal phase-shifted pattern lights.
  • a sinusoidal waveform may be obtained from the obtained luminance values, and the amplitude of the sinusoidal waveform may be calculated as the contrast.
  • the original sinusoidal waveform can be estimated to some extent. This can reduce errors in contrast calculation.
  • the exposure condition may be at least one of exposure time, camera aperture and sensitivity, and emission intensity of the projector.
  • the exposure time, aperture, sensitivity, and emission intensity of the projector are related to contrast. Therefore, by changing these conditions, a contrast that allows pattern light to be recognized can be obtained. Therefore, it is possible to increase the number of effective depth pixels and improve the accuracy of three-dimensional measurement.
  • the suitable exposure condition determination unit may determine the exposure condition that maximizes the calculated contrast as the suitable exposure condition.
  • the exposure condition is an exposure time representing the light emission time of the projector and the exposure time of the camera.
  • the shortest exposure time may be determined as the preferred exposure time.
  • the preferred exposure time image indicates the shortest exposure time with the contrast exceeding the predetermined threshold. Therefore, the user can grasp the shortest exposure time suitable for photographing the pattern light projected onto the object only by confirming the suitable exposure time image.
  • the predetermined threshold may be selected by the user from a plurality of options prepared in advance.
  • the user can select the threshold from the recommended options. This can further reduce the user's effort.
  • the predetermined threshold may be specified by the user.
  • the output unit may determine the gradation value of the suitable exposure condition image for each pixel according to the determined suitable exposure condition, and indicate the suitable exposure condition by color coding.
  • the user can grasp the exposure conditions suitable for projecting/photographing the target at a glance of the suitable exposure condition image. Therefore, it is possible to further reduce labor in determining exposure conditions in three-dimensional measurement.
  • the present invention provides control of a three-dimensional measurement system comprising a projector that projects a plurality of striped pattern lights onto an object, and a camera that photographs the object and generates a photographed image.
  • a pattern light image generating step of capturing the plurality of pattern lights projected onto the target object by the projector under a plurality of exposure conditions using the camera to generate a plurality of captured images;
  • a contrast calculation step of calculating, for each of the plurality of exposure conditions, a contrast in a pixel of interest of the photographed image; and an output step of outputting a suitable exposure condition image showing the determined suitable exposure condition for each pixel.
  • the present invention provides control of a three-dimensional measurement system comprising a projector that projects a plurality of striped pattern lights onto an object, and a camera that photographs the object and generates a photographed image.
  • a pattern light image generation step of generating a plurality of photographed images by photographing the plurality of pattern lights projected onto the object by the projector under a plurality of exposure conditions using the camera;
  • a contrast calculation step of calculating, for each of the plurality of exposure conditions, a contrast in a pixel of interest of the photographed image; and an output step of outputting a suitable exposure condition image showing the determined suitable exposure condition for each pixel.
  • the user can grasp the exposure conditions suitable for projecting/photographing the target simply by confirming the image of the suitable exposure conditions. Therefore, it is possible to reduce labor in determining exposure conditions in three-dimensional measurement.
  • the user can grasp exposure conditions suitable for projecting/photographing an object simply by checking the image of suitable exposure conditions. Therefore, it is possible to reduce labor in determining exposure conditions in three-dimensional measurement.
  • FIG. 1 is an overall configuration diagram of a three-dimensional measurement system
  • FIG. FIG. 4 is an explanatory diagram showing the relationship among the exposure time, the light emission time of the projector, and the exposure time of the camera in the three-dimensional measurement system
  • 4 is a general flowchart of preprocessing
  • 9 is a detailed flowchart of pattern light image generation processing
  • 4 is a detailed flowchart of image processing
  • 4 is a detailed flowchart of decoding processing
  • FIG. 10 is a schematic diagram for explaining a process of calculating contrast at the coordinates of a pixel of interest when pattern light is gray code pattern light
  • FIG. 8 is a schematic configuration diagram of an object and a three-dimensional measurement system used to obtain the pattern light image shown in FIG. 7(a);
  • FIG. 10 is a table showing an example of exposure time, coordinates on a projection image obtained by decoding processing for target pixel coordinates, and contrast calculated for target pixel coordinates (i, j);
  • FIG. FIG. 4 is a conceptual diagram relating to correction of barrel distortion;
  • FIG. 4 is a conceptual diagram regarding parallelization conversion processing;
  • FIG. 4 is a conceptual diagram regarding calculation of parallax;
  • 13(a) is a schematic diagram of an image captured by a camera in a state in which pattern light is not projected onto an object; It is an example of the suitable exposure time image obtained by execution.
  • FIG. 10 is a schematic diagram for explaining a process of calculating contrast at the coordinates of a pixel of interest when pattern light is sinusoidal phase-shifted pattern light;
  • the three-dimensional measurement system includes at least a device or system capable of generating three-dimensional information such as depth information, depth information, or distance information, and may be referred to by other terms such as a three-dimensional camera.
  • the device may be configured as a device further provided with other functions.
  • FIG. 1 is an overall configuration diagram of a three-dimensional measurement system 100 according to this embodiment.
  • the three-dimensional measurement system 100 includes a controller unit 1 and a sensor head unit 3 connected to the controller unit 1.
  • FIG. The three-dimensional measurement system 100 uses these configurations to generate depth information of the object 5 .
  • the sensor head unit 3 includes a camera (imaging device) 31 and a projector (projection device) 35 horizontally adjacent to the camera 31 .
  • the axis parallel to the imaging surface of the camera 31 or the projection surface of the projector 35 is sometimes referred to as the x-axis, and the direction perpendicular to the paper surface is sometimes referred to as the y-axis.
  • the camera 31 includes an image sensor 311 and an objective lens 312, and is arranged so as to contain the object 5 within its angle of view. As will be described later, the image information generated by the image sensor 311 is captured by the image acquisition section 15 into the controller unit 1 .
  • the projector 35 includes a light source 351, and has a plane wave conversion lens 352, a mirror 353, a DMD 355, a relay lens 356 and an objective lens 357 in order from the light source 351 side on the optical path.
  • the DMD 355 is an abbreviation for Digital Micromirror Device, and is a device that controls the direction of light on a pixel-by-pixel basis by driving an array of extremely small mirrors to tilt at high speed.
  • the projector 35 is arranged at a position capable of projecting pattern light, which will be described later, onto the object 5 . Further, it is configured to be able to project desired pattern light under the control of a projection control unit 12, which will be described later.
  • the controller unit 1 includes an input reception unit 11 that receives an input such as a measurement start signal, a projection control unit 12 that controls projection of pattern light by the projector 35, a photography control unit 13 that controls photography by the camera 31, and a and a storage unit 14 for storing various information such as exposure time data.
  • the controller unit 1 further includes an image acquisition unit 15 that acquires an image captured by the camera 31, an image processing unit 16 that performs image processing on the acquired image, and an output unit 17 that outputs depth information. and have. These functions are implemented by a control device such as a CPU or a circuit that executes programs.
  • the configurations of the camera 31 and the projector 35 are both exemplary and schematic configurations. Other configurations are therefore possible, such as including additional lenses.
  • controller unit 1 and the sensor head unit 3 are configured separately in this embodiment, the present invention is not limited to such a configuration. Therefore, all components may be located in one device, or some may be configured as separate devices.
  • the three-dimensional measurement system 100 configured as described above projects pattern light onto the object 5 and photographs the pattern light projected onto the object 5 .
  • the parallax between the projector 35 and the camera 31 is determined, and the object is detected from the projector 35 or camera 31 using the principle of triangulation.
  • the distance to 5 is calculated and the shape of the object 5 is measured.
  • a spatial coding method (or a spatial coding method) is adopted as a technique for analyzing the correspondence relationship between the camera 31 and the projector 35, and the pattern light is a Gray code pattern for horizontal coding.
  • Light and/or gray code pattern light for vertical encoding is a vertical striped pattern (vertical pattern) in which bright portions and dark portions are periodically repeated.
  • the Gray code pattern light for vertical encoding is a horizontal striped pattern (horizontal pattern) in which bright portions and dark portions are periodically repeated.
  • the three-dimensional measurement system 100 there are appropriate exposure conditions for each surface color of the object 5. For example, the proper exposure time is relatively short for a portion with a white surface color, and the proper exposure time is relatively long for a portion with a black surface color. Therefore, the three-dimensional measurement system 100 is configured to be able to acquire depth information of the object 5 by projecting and photographing the object 5 with different exposure times.
  • Exposure means a phenomenon in which the image sensor 311 of the camera 31 is exposed.
  • Exposure time means the time during which the projector 35 emits light and the camera 31 is exposed (when the shutter of the camera 31 is open). . That is, the exposure time represents the emission time of the projector and the exposure time of the camera.
  • the shutter of the camera 31 is not a physical shutter that blocks light, but an electronic shutter that releases the charge of the image sensor 311 so that no charge is accumulated in the image sensor 311. be.
  • the state in which the shutter of the camera 31 is open is the state in which the image sensor 311 accumulates charges.
  • FIG. 2 is a graph showing the relationship between the exposure time, the emission time of the projector 35, and the exposure time of the camera 31.
  • FIG. 2 the light emission of the projector 35 and the exposure of the camera 31 are substantially synchronized, and the light emission time of the projector 35 is changed as the exposure time of the camera 31 is changed. Specifically, after the exposure of the camera 31 starts (for example, after 0.2 msec), the light emission of the projector 35 starts, and the exposure of the camera 31 and the light emission of the projector 35 end almost simultaneously. This prevents waiting time from occurring after the exposure of the camera 31 ends.
  • the three-dimensional measurement system 100 determines an exposure time suitable for projecting/photographing the pattern light onto the object 5 from a plurality of exposure times, and adjusts the determined exposure time. It is configured to be able to output information. Therefore, the user's effort in determining the exposure time can be reduced.
  • FIG. 3 is a general flowchart of preprocessing. As is clear from the figure, when the process starts, the camera 31 performs a photographing process (S11). At this time, pattern light is not projected onto the object 5, and this photographing is normal color image photographing by the camera 31. FIG. The captured image is acquired by the image acquisition unit 15 and stored in the storage unit 14 .
  • the projection control unit 12 and the imaging control unit 13 perform pattern light image generation processing (S12).
  • FIG. 4 is a detailed flowchart of pattern light image generation processing (S12). As is clear from the figure, when the process starts, the projection control unit 12 and the photographing control unit 13 read out the exposure time data and the information on the number of emitted pattern lights from the storage unit 14 (S111).
  • the exposure time data includes seven different exposure times ET1 to ET7.
  • the seven different exposure times ET1-ET7 can be, for example, the times shown in Table 1.
  • the number of emitted pattern lights is 22 (11 types, forward/reverse).
  • the exposure time data is not limited to a form including seven different exposure times, and may be a form including two to six or eight or more different exposure times. Also, the exposure time intervals may not be equal. Furthermore, the number of pattern lights to be emitted is not limited to 22.
  • the projection control unit 12 After the reading process of the exposure time data and the information on the number of emitted pattern lights, the projection control unit 12 performs a process of reading the pattern light data from the storage unit 14 (S112).
  • the pattern light data includes at least one of data for generating gray code pattern light for horizontal encoding and data for generating gray code pattern light for vertical encoding.
  • the projection control unit 12 and the photographing control unit 13 After reading the pattern light data, the projection control unit 12 and the photographing control unit 13 issue an exposure time setting command corresponding to one of the read exposure time data to the projector 35 and the camera 31 (S113). ). Based on this exposure time setting command, the projector 35 sets the light emission time to a value corresponding to one of the read exposure time data, and the camera 31 sets the exposure time to one of the read exposure time data. set to a value that corresponds to one of the
  • the shooting control unit 13 issues an exposure command to the camera 31 (S114). Based on this exposure command, the camera 31 opens the electronic shutter and puts the image sensor 311 into a state of accumulating charges. After that (for example, after 0.2 msec), the imaging control unit 13 outputs an electrical trigger signal for synchronization to the projection control unit 12 . Upon detecting this trigger signal, the projection control unit 12 issues a command to the projector 35 to emit pattern light corresponding to one of the read pattern light data (S115). Based on this pattern light emission command, the projector 35 emits and projects the corresponding pattern light. Note that the output mode of the electrical trigger signal is not limited to such an example.
  • an electrical trigger signal for synchronization is output from the projection control unit 12 to the photographing control unit 13 0.2 msec before projection, and when the photographing control unit 13 detects the trigger signal, an exposure command is issued.
  • the command timing of the projection control section 12 and the photographing control section 13 may be controlled using signals from an external trigger signal generator (not shown).
  • the camera 31 When the exposure time elapses after the projector 35 starts emitting pattern light, the camera 31 performs exposure stop processing, and the projector 35 performs light emission stop processing (S116). This completes the photographing of pattern light and generates a pattern light image.
  • the image acquisition unit 15 acquires the pattern light image captured by the camera 31 and stores it in the storage unit 14 (S117).
  • FIG. 5 is a detailed flowchart of image processing (S13). As is clear from the figure, when the processing starts, the image processing unit 16 performs decoding processing (decoding processing) on the plurality of pattern light images stored in the storage processing (S117) (S211).
  • decoding processing decoding processing
  • FIG. 6 is a detailed flowchart of the decoding process (S211).
  • the image processing unit 16 initializes variables i and j for designating pixels in the pattern light image (S2111). After that, a process of reading the plurality of pattern light image data stored in the storage process (S117) from the storage unit 14 is performed (S2112).
  • the image processing unit 16 After reading the pattern light image data, the image processing unit 16 selects one of the plurality of exposure times as the target exposure time, and sets the target pixel coordinates (i , j) is subjected to decoding processing (decoding processing) (S2113).
  • decoding processing decoding processing
  • Various methods known to those skilled in the art can be used for the decoding process.
  • coordinate information on the projection image corresponding to the target pixel coordinates (i, j) on the pattern light image is obtained.
  • the image processing unit 16 performs a process of calculating the difference in luminance value between the bright image and the dark image as the contrast for the target pixel coordinates (i, j) (S2114).
  • FIG. 7 is a schematic diagram for explaining the process of calculating the contrast at the target pixel coordinates (i, j).
  • FIG. 7(a) shows six examples of pattern light images obtained by photographing with the camera 31, together with the indices of the pattern light.
  • the projector 35 constituting the three-dimensional measurement system 100 projects pattern light onto a predetermined area including one surface of the cuboid object 5. and obtained by photographing it with the camera 31 constituting the three-dimensional measurement system 100 .
  • the target pixel coordinates (i, j) are a dark image when the pattern light indexes are 1, 3, 4, and 6, and a bright image when the pattern light indexes are 2 and 5. becomes.
  • FIG. 7(b) is a graph showing the relationship between the pattern light index and the luminance value at the target pixel coordinates (i, j).
  • the luminance value of the target pixel coordinates (i, j) is the minimum value when the pattern light indices are 1, 3, 4, and 6, and the pattern light indices are 2 and 5.
  • the contrast at the target pixel coordinates (i, j) is the luminance value of the target pixel coordinates (i, j) when the indices of the pattern light are 2 and 5, and It is calculated as a difference between the luminance value of the target pixel coordinates (i, j) at the time of .
  • pattern light whose brightness is reversed is also projected.
  • pattern light indexes 1 to 11 are normal pattern light whose brightness is not reversed (pattern light that is repeated in order of dark, bright, . . . from the left as shown in FIG. 7(a)).
  • the pattern light indexes 12 to 22 are assumed to be reversed pattern lights in which the brightness is reversed. Projecting forward pattern light and reverse pattern light eliminates dark pixels in all pattern light indices, and contrast can be calculated for all pixels.
  • the image processing unit 16 stores the coordinate information on the projected image and the contrast information at the target pixel coordinates (i, j) to the storage unit 14. is stored (S2115).
  • the pattern light is suitable for photographing at the target pixel coordinates (i, j).
  • a process for determining a suitable exposure time is performed (S2118).
  • FIG. 9 is a table showing an example of the exposure time, the coordinates on the projection image obtained by decoding the target pixel coordinates (i, j), and the contrast calculated for the target pixel coordinates (i, j).
  • the correct coordinates on the projection image corresponding to the target pixel coordinates (i, j) on the pattern light image are "870", and the exposure times are ET3, ET4, ET5 and ET6.
  • the coordinates on the projection image obtained by the decoding process are "870", which indicates that the decoding is correct.
  • the exposure times are ET1, ET2 and ET7
  • the coordinates on the projection image obtained by the decoding process are "300", "700” and "600”. I can't say It can be said that this is because the contrast at the target pixel coordinates (i, j) is not high enough to appropriately recognize the pattern light. In other words, the higher the calculated contrast, the more accurately the pattern light can be recognized.
  • the exposure time that maximizes the contrast is determined as the suitable exposure time.
  • ET5 is determined as the preferred exposure time.
  • the image processing unit 16 converts the coordinate information on the projection image obtained by the decoding process using the pattern light image photographed with the suitable exposure time and the determined suitable exposure time information.
  • a process of storing in the storage unit 14 is performed (S2119).
  • the image processing unit 16 performs processing for determining whether or not the variable i is equal to the maximum value i_max of i (S2120). If the variable i is not yet the maximum value (S2120 NO), the variable i is incremented by 1 (S2121), and the series of processes is performed again (S2113 to S2120). If the variable i is equal to the maximum value i_max (S2120YES), the image processing unit 16 performs processing to initialize the variable i (S2122).
  • the image processing unit 16 After the variable i initialization process, the image processing unit 16 performs a process of determining whether or not the variable j is equal to the maximum value j_max of j (S2123). If the variable j is not yet the maximum value (S2123 NO), the process of incrementing the variable j by 1 is performed (S2124), and the series of processes are performed again (S2113 to S2123). If the variable j is equal to the maximum value j_max (S2123YES), the process ends.
  • the preferred exposure time can be determined for each pixel of the pattern light image, it is possible to generate a preferred exposure time image that indicates the preferred exposure time for each pixel.
  • the distortion correction process is executed (S212).
  • the distortion is distortion caused by the optical system of the camera 31 and the projector 35, and is barrel distortion, for example.
  • Distortion correction processing can be corrected by known techniques known to those skilled in the art.
  • FIG. 10 is a conceptual diagram regarding barrel distortion correction. As is clear from the figure, the grid on the left side of the figure is distorted to expand near the center. In this state, when barrel distortion correction processing is performed, the coordinates (x, y) of the pixel of interest before correction on the left side of FIG. be associated. In this manner, distortion correction processing is executed.
  • Parallelization conversion processing can be performed by a known method known to those skilled in the art, for example, it can be performed by projective transformation that makes the epipolar line horizontal.
  • FIG. 11 is a conceptual diagram of parallelization conversion processing.
  • point P is the point on the object 5
  • point A is the position of the projector 35
  • point B is the position of the camera 31.
  • the point P corresponds to a predetermined point on a predetermined two-dimensional coordinate system (x c , y c ) relating to the camera image, ie, the intersection point P c of the line connecting the point B and the point P and the imaging plane.
  • the point P corresponds to a predetermined point on the two-dimensional coordinate system (x p , y p ) relating to the projection image, that is, the intersection point P p of the line segment connecting the point A and the point P and the projection plane. .
  • the projector 35 and the camera 31 are not parallelized mechanically or optically before the parallelization conversion in the upper part of FIG. 11 .
  • the projector 35 and the camera 31 are mechanically or optically parallelized as shown in the lower part of the figure.
  • the two-dimensional coordinates (x p , y p ) related to the projected image on the upper side of the figure and the two-dimensional coordinates (x c , y c ) related to the camera image are respectively the two-dimensional coordinates ( x p '', y p '') and the two-dimensional coordinates (x c '', y c '') associated with the camera image. In this manner, parallelization conversion processing is executed.
  • parallax calculation processing is executed (S214).
  • Parallax calculation processing can be performed by a known method known to those skilled in the art, and can be calculated as a positional shift between points corresponding to each other in the projection image and the camera image.
  • FIG. 12 is a conceptual diagram regarding calculation of parallax.
  • point P, point A, point B, point Pp and point Pc are the same as point P, point A, point B, point Pp and point Pc in FIG.
  • the parallax d is obtained as the distance between the points P c and P p ''.
  • the parallax d can be obtained for each pixel in the pattern light image.
  • the image processing unit 16 performs depth information generation processing (S14).
  • depth information generation processing in addition to the parallax, using known parameters (focal length f and distance Z between the camera 31 and the projector 35) stored in the storage unit 14, the object 5 from the camera 31 or the projector 35 Calculate the distance (depth) to
  • the distance Z from the projector 35 or camera 31 to the object 5 can be calculated by obtaining the parallax d. Also, since such a distance Z can be generated for each pixel, a so-called depth image can be generated.
  • the depth image generation processing is next performed (S15).
  • the image processing unit 16 generates point cloud data in a three-dimensional space using normal images and depth images captured in the imaging process (S11).
  • the output unit 17 outputs the depth image and the suitable exposure time image to a display (not shown) or the like.
  • the distance image and the suitable exposure time image may be displayed side by side, or the distance image and the suitable exposure time image may be displayed in a switchable manner. .
  • FIG. 13(a) is a schematic diagram of an image captured by the camera 31 in a state in which pattern light is not projected onto the object 5
  • FIG. 13(b) is a schematic view of the object shown in FIG. 5 is an example of a preferred exposure time image obtained by performing preprocessing on .5.
  • the exposure times suitable for photographing the pattern light projected onto the object 5 are ET1, ET7 and ET5 from the left. Therefore, the user can grasp the exposure time suitable for projecting/photographing the pattern light onto the object 5 only by confirming the image of the suitable exposure time. Therefore, it is possible to reduce labor in determining the exposure time in three-dimensional measurement.
  • a distance image can be output in addition to the suitable exposure time image. Therefore, the user can grasp the exposure time suitable for projecting and photographing the pattern light onto the object 5 while confirming the distance image. Therefore, it is possible to further reduce labor in determining the exposure time in three-dimensional measurement.
  • the type of hatching is determined according to the preferred exposure time, and the preferred exposure time is divided according to the type of hatching. , may be determined for each pixel according to the preferred exposure time, and the preferred exposure time may be indicated by different colors.
  • the user can grasp the exposure time suitable for photographing the pattern light projected on the object 5 by looking at the suitable exposure time image at a glance. Therefore, it is possible to further reduce labor in selecting an exposure time in three-dimensional measurement.
  • FIG. 14 is a general flowchart of the three-dimensional measurement process.
  • the input receiving unit 11 enters a standby state for receiving a measurement start signal (S31).
  • S31 a measurement start signal
  • the measurement start signal may be transmitted from a system higher than the three-dimensional measurement system 100, or may be generated by an input from the user.
  • the measurement start signal is transmitted or generated when preparations for three-dimensional measurement of another object 5 similar in color to the object 5 used in preprocessing are completed. That is, when the other object 5 is placed within the angle of view of the camera 31 and within the pattern light projection range of the projector 35, a measurement start signal is transmitted or generated.
  • the camera 31 After receiving the measurement start signal, the camera 31 performs image capturing processing, and the captured image is obtained by the image obtaining unit 15 (S32). This photographing is normal color image photographing by the camera 31 .
  • the projection control unit 12 and the imaging control unit 13 perform pattern light image generation processing (S33).
  • FIG. 15 is a detailed flowchart of pattern light image generation processing.
  • the projection control unit 12 and the photographing control unit 13 read out the exposure time data and the information on the number of emitted pattern lights from the storage unit 14 (S311).
  • the read exposure time data is only the data related to the exposure time selected by the user through preprocessing.
  • the read exposure time data is data including only ET1, ET5, and ET7 shown in FIG. 13(b).
  • the projection control unit 12 After the reading process of the exposure time data, the projection control unit 12 performs the process of reading the pattern light data from the storage unit 14 (S312). At this time, the pattern light data read out is substantially the same as the pattern light data read out in the pre-processing.
  • the projection control unit 12 and the photographing control unit 13 After reading the pattern light data, the projection control unit 12 and the photographing control unit 13 issue an exposure time setting command corresponding to one of the read exposure time data to the projector 35 and the camera 31 (S313). ). Based on this exposure time setting command, the projector 35 sets the light emission time to a value corresponding to one of the read exposure time data, and the camera 31 sets the exposure time to one of the read exposure time data. set to a value that corresponds to one of the
  • the shooting control unit 13 After issuing the exposure time setting command, the shooting control unit 13 issues an exposure command to the camera 31 (S314). Based on this exposure command, the camera 31 opens the electronic shutter and puts the image sensor 311 into a state of accumulating charges. After that (for example, after 0.2 msec), the imaging control unit 13 outputs an electrical trigger signal for synchronization to the projection control unit 12 . Upon detecting this trigger signal, the projection control unit 12 issues a command to the projector 35 to emit pattern light corresponding to one of the read pattern light data (S315). Based on this pattern light emission command, the projector 35 emits and projects the corresponding pattern light. Note that the output mode of the electrical trigger signal is not limited to such an example.
  • the projection control unit 12 outputs an electrical trigger signal for synchronization to the shooting control unit 13 0.2 msec before projection, and when the shooting control unit 13 detects the trigger signal, it issues an exposure command.
  • the shooting control unit 13 may be configured. Further, a configuration may be adopted in which command timings of the projection control section 12 and the photographing control section 13 are controlled using signals from an external trigger signal generator (not shown).
  • the camera 31 When the exposure time elapses after the projector 35 starts emitting pattern light, the camera 31 performs exposure stop processing, and the projector 35 performs light emission stop processing (S316). This completes the photographing of pattern light and generates a pattern light image.
  • the image acquisition unit 15 acquires the pattern light image captured by the camera 31 and stores it in the storage unit 14 (S317).
  • the pattern light image generation processing (S311 to S321), the pattern light is photographed only at the exposure time selected by the user through preprocessing. Therefore, the number of times of photographing can be reduced, and the time required for processing can be shortened.
  • FIG. 16 is a detailed flowchart of image processing (S33). As is clear from the figure, when the processing starts, the image processing unit 16 performs decoding processing (decoding processing) on the plurality of pattern light images stored in the storage processing (S317) (S411).
  • decoding processing decoding processing
  • FIG. 17 is a detailed flowchart of the decoding process (S411). As is clear from the figure, when the process starts, the image processing unit 16 initializes variables i and j for designating pixels in the pattern light image (S4111). After that, a process of reading the plurality of pattern light image data stored in the storage process (S317) from the storage unit 14 is performed (S4112).
  • the image processing unit 16 After the reading process of the pattern light image data, the image processing unit 16 sets one of the exposure times selected by the user through the pre-processing as the target exposure time, and selects one of the target exposure times as the target exposure time.
  • a decoding process (decoding process) is performed on the target pixel coordinates (i, j) (S4113). Various methods known to those skilled in the art can be used for the decoding process. As a result of this decoding process, coordinate information on the projection image corresponding to the target pixel coordinates (i, j) on the pattern light image is obtained.
  • the image processing unit 16 performs a process of calculating the difference in luminance value between the bright image and the dark image as the contrast for the target pixel coordinates (i, j) (S4114).
  • the processing for calculating the contrast at the target pixel coordinates (i, j) is almost the same as the contrast calculation processing in the pre-processing, so details thereof will be omitted.
  • the image processing unit 16 After the contrast calculation process for the target pixel coordinates (i, j), the image processing unit 16 stores the coordinate information on the projected image and the contrast information at the target pixel coordinates (i, j) in the storage unit 14. (S4115).
  • the image processing unit 16 performs processing for determining whether or not the variable i is equal to the maximum value i_max of i (S4119). If the variable i is not yet the maximum value (S4119 NO), the process of incrementing the variable i by 1 is performed (S4120), and the series of processes are performed again (S4113 to S4119). If the variable i is equal to the maximum value i_max (S4119YES), the image processing unit 16 performs processing to initialize the variable i (S4121).
  • the image processing unit 16 After the variable i initialization process, the image processing unit 16 performs a process of determining whether or not the variable j is equal to the maximum value j_max of j (S4122). If the variable j is not yet the maximum value (S4122 NO), the variable j is incremented by 1 (S4123), and the series of processes are performed again (S4113-S4122). If the variable j is equal to the maximum value j_max (S4122YES), the process ends.
  • the distortion correction process is executed (S412). Distortion is distortion caused by the optical systems of the camera 31 and the projector 35, and the like. Since the distortion correction processing is substantially the same as the distortion correction processing in the pre-processing, details thereof will be omitted.
  • the parallelization conversion process is executed (S413). Since the parallelization conversion process is substantially the same as the parallelization conversion process in the pre-processing, details thereof will be omitted.
  • parallax calculation processing is executed (S414). Since the parallax calculation process is substantially the same as the parallax calculation process in the pre-processing, details thereof will be omitted.
  • the image processing unit 16 performs depth information generation processing (S35).
  • the depth information generation process is almost the same as the parallax calculation process in the pre-processing, so the details thereof will be omitted.
  • the depth image generation processing and output processing are performed next (S36). Since the depth image generation processing and output processing are substantially the same as the depth image generation processing and output processing in the pre-processing, details thereof will be omitted.
  • the 3D measurement process ends.
  • the exposure time that maximizes the contrast is determined as the suitable exposure time in the suitable exposure time determination process in the pre-processing (S2118 in FIG. 6). Therefore, in the example shown in FIG. 9, ET5 is determined as the optimum exposure time.
  • the exposure time is ET3, it can be decoded correctly. Since the longer the exposure time is, the longer the time required for one photographing is, it is preferable to set the optimum exposure time to ET3 instead of ET5 from the viewpoint of shortening the photographing time in the three-dimensional measurement processing after preprocessing. In other words, when there are a plurality of exposure times for appropriately recognizing the pattern light at the target pixel coordinates (i, j), it is preferable to set the shortest exposure time as the optimum exposure time.
  • the contrast at the target pixel coordinates (i, j) exceeds a predetermined threshold and the shortest exposure time is suitable exposure. Decide as time. Therefore, the preferred exposure time image output in the preprocessing indicates the shortest exposure time with the contrast exceeding the predetermined threshold. Therefore, the user can grasp the exposure time suitable for projecting/photographing the pattern light onto the object 5 only by checking the image of the suitable exposure time.
  • the predetermined threshold may be a value selected by the user from multiple options, or may be a value specified by the user. If the predetermined threshold is a value selected by the user from multiple options, the user can select the predetermined threshold from among the recommended options. Therefore, the user's effort can be further reduced. If the predetermined threshold is specified by the user, the user can change the predetermined threshold. Therefore, the user can easily adjust the balance between the accuracy of three-dimensional measurement and the time required for three-dimensional measurement.
  • pattern light instead of the gray code pattern light, a plurality of sinusoidal phase shift patterns whose phases are shifted at equal intervals may be used.
  • the processing (S2114) for calculating the contrast for the target pixel coordinates (i, j) when the pattern light is a sine wave phase shift pattern will be described with reference to FIG.
  • FIG. 18(a) shows six examples of sinusoidal phase-shifted pattern light images captured by the camera 31 together with the pattern light index.
  • the configuration including the object and the three-dimensional measurement system used to obtain the pattern light image shown in FIG. 18A is substantially the same as the configuration shown in the schematic configuration diagram of FIG. The illustration thereof is omitted here.
  • the target pixel coordinates (i, j) have a luminance value that rises sinusoidally from index 1 to 2 of the pattern light, and a luminance value that rises sinusoidally from index 2 to 3. is the maximum value of Further, the brightness value decreases sinusoidally from the index of 3 to 5 of the pattern light, and the brightness value becomes the minimum value of the sine wave from the index of 5 to 6.
  • FIG. 18(b) is a graph showing the relationship between the pattern light index and the luminance value at the target pixel coordinates (i, j). As shown in FIG. 18B, a sine wave approximation can be calculated based on the change in luminance value of the target pixel coordinates (i, j). The contrast at the target pixel coordinates (i, j) is calculated as the amplitude of the calculated approximate expression.
  • the original sinusoidal waveform can be estimated to some extent. This can reduce errors in contrast calculation.
  • the exposure condition is the exposure time. good. That is, the exposure condition is at least one of exposure time, aperture and sensitivity of camera 31 , and emission intensity of projector 35 .
  • the exposure time, the aperture and sensitivity of the camera 31, and the emission intensity of the projector 35 are related to contrast. Therefore, by changing these conditions, a contrast that allows pattern light to be recognized can be obtained. Therefore, the accuracy of three-dimensional measurement can be improved.
  • the camera 31 and the projector 35 are arranged horizontally in the first and second embodiments, the camera 31 and the projector 35 may be arranged vertically. In this case, the direction in which the pattern light is spatially encoded and the direction in which the difference is taken for parallax may be determined with reference to the direction parallel to the virtual line connecting them.
  • the present invention can be used at least in industries that manufacture three-dimensional measurement systems and the like.
  • controller unit 11 input reception unit 12 projection control unit 13 photography control unit 14 storage unit 15 image acquisition unit 16 image processing unit 17 output unit 3 sensor head unit 31 camera 311 image sensor 312 objective lens 35 projector 351 light source 352 plane wave conversion lens 353 Mirror 355 DMD 356 mirror lens 5 object 100 three-dimensional measurement system

Abstract

【課題】3次元計測での露光条件の決定における労力を軽減する。 【解決手段】縞状の複数のパターン光を対象物に投射するプロジェクタと、前記対象物に投射された前記複数のパターン光を複数の露光条件で撮影して複数の撮影画像を生成するカメラと、前記複数の撮影画像の注目画素におけるコントラストを前記複数の露光条件毎に算出するコントラスト算出部と、前記複数の露光条件から、算出された前記コントラストが所定のコントラスト条件を満たしている露光条件を好適露光条件として前記注目画素毎に決定する好適露光条件決定部と、決定された前記好適露光条件を画素毎に示す好適露光条件画像を出力する出力部と、を備えた、3次元計測システムが提供される。

Description

3次元計測システム、並びにその制御方法及び制御プログラム
 この発明は、3次元計測システム、並びに3次元計測システムの制御方法及び制御プログラムに関する。
 深度情報等の3次元情報を非接触で取得する手法として、アクティブステレオ法が知られている。アクティブステレオ法では、プロジェクタから対象物に対して明部と暗部が周期的に繰り返された縞状のパターン光を投射し、対象物に投射されたパターン光をカメラで撮影する。撮影された画像を解析することにより、プロジェクタ又はカメラから対象物までの距離を算出し、深度情報を取得する。
 黒色と白色のような輝度値の差が大きい色が対象物に混在する場合には、対象物に投射されたパターン光を一の露光条件で撮影したときに、画像上の一部でパターン光を認識できず、対象物の深度情報を取得できないことがある。これは、カメラのダイナミックレンジが一般に狭いことが原因で、黒色か白色のどちらかに露光条件を合わせると、もう一方の階調が潰れてしまうためである。そこで、対象物に投射されたパターン光を異なる露光条件で撮影し対象物の深度情報を取得することが提案されている(特許文献1)。
 特許文献1に開示された3次元形状計測方法では、まず、対象物に投射されたパターン光を異なる露光時間で撮影する。露光時間が相対的に短い場合には、白色のような明るい部分に投射されたパターン光を、階調が潰れることなく撮影できる。露光時間が相対的に長い場合には、黒色のような暗い部分に投射されたパターン光を、階調が潰れることなく撮影できる。そして、これらの異なる露光時間で撮影された画像を、階調性が損なわれないように統合することで、ダイナミックレンジの広い画像を生成する。こうして取得した画像に基づいてパターン光を認識することで3次元情報の欠落を抑制する。
特開2007-315864号公報
 特許文献1に開示された3次元形状計測方法では、露光条件を増やし撮影回数を増やすほど有効な深度画素が増え、かつ計測精度が向上するが、撮影回数が増える分、撮影時間が長くなり現実的ではない。そこで、複数の露光条件から、対象物に適した露光条件を例えば2~3つに絞って、対象物に投射されたパターン光を撮影することが行われている。
 しかしながら、対象物に適した露光条件は、対象物を見ただけではわからない。現状では、事前準備として、ユーザは、露光条件を変えて繰り返し投射・撮影し(以降、この作業を「プレ撮影」と呼ぶ)、プレ撮影により得られた撮影画像や深度情報に基づいて、対象物に適した露光条件を決定している。そのため、露光条件の探索・決定に多大な労力が必要とされる。
 本発明は上述の技術的背景に鑑みてなされたものであり、その目的は、3次元計測での露光条件の決定における労力を軽減することにある。
 上述の技術的課題は、以下の構成を有する3次元計測システム等により解決することができる。
 すなわち、本発明に係る3次元計測システムは、縞状の複数のパターン光を対象物に投射するプロジェクタと、前記対象物に投射された前記複数のパターン光を複数の露光条件で撮影して複数の撮影画像を生成するカメラと、前記複数の撮影画像の注目画素におけるコントラストを前記複数の露光条件毎に算出するコントラスト算出部と、前記複数の露光条件から、算出された前記コントラストが所定のコントラスト条件を満たしている露光条件を好適露光条件として前記注目画素毎に決定する好適露光条件決定部と、決定された前記好適露光条件を画素毎に示す好適露光条件画像を出力する出力部と、を備えている。
 このような構成によれば、ユーザは、好適露光条件画像を確認するだけで、対象物の投射・撮影に適した露光条件を把握することができる。したがって、3次元計測での露光条件の決定における労力の軽減を実現することができる。
 前記プロジェクタは、明部と暗部とが周期的に繰り返された複数のグレイコードパターン光を投射し、前記コントラスト算出部は、前記注目画素における輝度値を前記複数のグレイコードパターン光毎に求め、求められた前記輝度値の最大値と最小値との差分を前記コントラストとして算出してもよい。
 このような構成によれば、プロジェクタからグレイコードパターン光を投射する3次元計測システムでも、各注目画素について好適露光条件を決定することができる。
 前記プロジェクタは、位相を等間隔でずらした複数の正弦波位相シフトパターン光を投射し、前記コントラスト算出部は、前記注目画素における輝度値を前記複数の正弦波位相シフトパターン光毎に求め、求められた前記輝度値から正弦波形を求め、前記正弦波形の振幅を前記コントラストとして算出してもよい。
 このような構成によれば、複数のパターン光のうちの一部の画像で注目画素の輝度値が飽和しても、元の正弦波形をある程度推定することができる。これにより、コントラストの算出における誤差を減らすことができる。
 前記露光条件は、露光時間、カメラの絞り及び感度、並びに前記プロジェクタの発光強度の少なくとも1つであってもよい。
 このような構成によれば、露光時間、絞り及び感度、並びにプロジェクタの発光強度は、コントラストに関わる。そのため、これらの条件を変えることにより、パターン光を認識できるコントラストが得られる。したがって、有効な深度画素が増え、かつ3次元計測の精度を高めることができる。
 また、前記好適露光条件決定部は、算出された前記コントラストが最大となる前記露光条件を前記好適露光条件として決定してもよい。
 このような構成によれば、好適露光条件でコントラストが最大となるため、パターン光を撮影したときに階調が良好な画像を取得でき、パターンの認識ミスをより減らすことで無効な深度画素を減らすことが可能になる。したがって、有効な深度画素が増え、かつ3次元情報の精度を高めることができる。
 また、前記露光条件は、前記プロジェクタの発光時間と前記カメラの露出時間を表す露光時間であり、前記好適露光条件決定部は、算出された前記コントラストが所定の閾値以上となる前記露光時間のうち最も短い露光時間を好適露光時間として決定してもよい。
 このような構成によれば、好適露光時間画像は、コントラストが所定の閾値を超えかつ最も短い露光時間を示すことになる。したがって、ユーザは、好適露光時間画像を確認するだけで、対象物に投射されたパターン光の撮影に適した最短の露光時間を把握することができる。
 また、前記所定の閾値は、予め用意された複数の選択肢からユーザによって選択されてもよい。
 このような構成によれば、ユーザは、推奨の選択肢の中から閾値を選ぶことができる。これによりユーザの労力をより軽減することができる。
 また、前記所定の閾値は、ユーザにより指定されてもよい。
 このような構成によれば、ユーザによる所定の閾値の変更が可能になる。したがって、3次元測定の精度と3次元測定に要する時間とのバランスをユーザが容易に調整することができる。
 また、前記出力部は、前記好適露光条件画像の階調値を、決定された前記好適露光条件に応じて画素毎に決定し、前記好適露光条件を色分けして示してもよい。
 このような構成によれば、ユーザは、好適露光条件画像を一目見て、対象物の投射・撮影に適した露光条件を把握することができる。したがって、3次元計測での露光条件の決定における労力をより軽減することができる。
 別の側面から見た本発明は、縞状の複数のパターン光を対象物に投射するプロジェクタと、前記対象物を撮影して撮影画像を生成するカメラと、を備えた3次元計測システムの制御方法であって、前記プロジェクタにより前記対象物に投射された前記複数のパターン光を前記カメラを用いて複数の露光条件で撮影して複数の撮影画像を生成するパターン光画像生成ステップと、前記複数の撮影画像の注目画素におけるコントラストを前記複数の露光条件毎に算出するコントラスト算出ステップと、前記複数の露光条件から、算出された前記コントラストが所定のコントラスト条件を満たしている露光条件を好適露光条件として前記注目画素毎に決定する好適露光条件決定ステップと、決定された前記好適露光条件を画素毎に示す好適露光条件画像を出力する出力ステップと、を備えている。
 別の側面から見た本発明は、縞状の複数のパターン光を対象物に投射するプロジェクタと、前記対象物を撮影して撮影画像を生成するカメラと、を備えた3次元計測システムの制御プログラムであって、前記プロジェクタにより前記対象物に投射された前記複数のパターン光を前記カメラを用いて複数の露光条件で撮影して複数の撮影画像を生成するパターン光画像生成ステップと、前記複数の撮影画像の注目画素におけるコントラストを前記複数の露光条件毎に算出するコントラスト算出ステップと、前記複数の露光条件から、算出された前記コントラストが所定のコントラスト条件を満たしている露光条件を好適露光条件として前記注目画素毎に決定する好適露光条件決定ステップと、決定された前記好適露光条件を画素毎に示す好適露光条件画像を出力する出力ステップと、を備えている。
 このような構成によれば、ユーザは、好適露光条件画像を確認するだけで、対象物の投射・撮影に適した露光条件を把握することができる。したがって、3次元計測での露光条件の決定における労力の軽減を実現することができる。
 本発明によれば、ユーザは、好適露光条件画像を確認するだけで、対象物の投射・撮影に適した露光条件を把握することができる。したがって、3次元計測での露光条件の決定における労力の軽減を実現することができる。
3次元計測システムの全体構成図である。 3次元計測システムにおける露光時間、プロジェクタの発光時間、及びカメラの露出時間の関係を示す説明図である。 事前処理のゼネラルフローチャートである。 パターン光画像の生成処理の詳細フローチャートである。 画像処理の詳細フローチャートである。 デコード処理の詳細フローチャートである。 パターン光をグレイコードパターン光としたときの注目画素座標におけるコントラストを算出する処理を説明するための概略図である。 図7(a)示されるパターン光画像を得るために用いられた対象物と3次元計測システムの概略構成図である。 露光時間、注目画素座標に対するデコード処理によって得られた投影画像上の座標、及び注目画素座標(i,j)について算出されたコントラストの一例を示す表である。 樽型歪みの補正に関する概念図である。 平行化変換処理に関する概念図である。 視差の計算に関する概念図である。 (a)は、パターン光が対象物に投射されていない状態においてカメラにより撮影された画像の概略図であり、(b)は、図13(a)に示される対象物に対して事前処理を実行して得られた好適露光時間画像の一例である。 3次元計測処理のゼネラルフローチャートである。 パターン光画像の生成処理の詳細フローチャートである。 画像処理の詳細フローチャートである。 デコード処理の詳細フローチャートである。 パターン光を正弦波位相シフトパターン光としたときの注目画素座標におけるコントラストを算出する処理を説明するための概略図である。
 以下、本発明の好適な実施の形態について添付の図面を参照しつつ詳細に説明する。
 (1.第1の実施形態)
  まず、第1の実施形態として、本発明を3次元計測システムに適用した例について説明する。なお、ここで、3次元計測システムとは、少なくとも、深度情報、奥行情報又は距離情報等の3次元情報を生成可能な装置又はシステムを含み、3次元カメラ等他の用語で称呼してもよい。また、他の機能をさらに備えた装置として構成してもよい。
 (1.1 システムの構成)
  図1は、本実施形態に係る3次元計測システム100の全体構成図である。同図から明らかな通り、3次元計測システム100は、コントローラユニット1と、コントローラユニット1に接続されるセンサヘッドユニット3と、を含んでいる。3次元計測システム100は、これらの構成を利用して、対象物5の深度情報を生成する。
 センサヘッドユニット3は、カメラ(撮像装置)31と、カメラ31と水平方向に隣り合うプロジェクタ(投影装置)35を含んでいる。なお、以下では、カメラ31の撮像面又はプロジェクタ35の投射面に平行な軸をx軸と称し、紙面に対して垂直な方向をy軸と称することがある。
 カメラ31は、イメージセンサ311と、対物レンズ312と、を含み、対象物5をその画角内に収めるように配置されている。なお、後述の通り、イメージセンサ311にて生成された画像情報は、画像取得部15によりコントローラユニット1へと取り込まれる。
 プロジェクタ35は、光源351を含み、その光路上に、光源351側から順に、平面波変換レンズ352、ミラー353、DMD355、リレーレンズ356及び対物レンズ357を備えている。なお、DMD355は、デジタル・マイクロミラー・デバイス(Digital Micromirror Device)の略称であり、アレイ状に並んだ極小ミラーを高速で傾斜駆動させることにより画素単位で光の方向を制御する装置である。プロジェクタ35は、後述のパターン光を対象物5に対して投射可能な位置に配置されている。また、後述の投射制御部12により制御されて所望のパターン光を投射することができるよう構成されている。
 コントローラユニット1は、測定開始信号等の入力を受け付ける入力受付部11と、プロジェクタ35におけるパターン光の投射を制御する投射制御部12と、カメラ31における撮影を制御する撮影制御部13と、後述の露光時間データ等の種々の情報を記憶する記憶部14と、を備えている。また、コントローラユニット1は、さらに、カメラ31において撮影された画像を取得する画像取得部15と、取得された画像に対して画像処理を行う画像処理部16と、深度情報を出力する出力部17と、を備えている。これらの機能は、プログラムの実行を行うCPU等の制御装置や回路により実現される。
 なお、カメラ31及びプロジェクタ35の構成は、いずれも例示的、概略的な構成である。したがって、追加のレンズを含む等、他の構成であってもよい。
 また、本実施形態においては、コントローラユニット1とセンサヘッドユニット3とを別々に構成したものの、本発明はそのような構成に限定されない。したがって、すべての構成を1つの装置内に配置してもよいし、一部を別の装置として構成してもよい。
 上記のように構成された3次元計測システム100は、対象物5にパターン光を投射し、対象物5に投射されたパターン光を撮影する。カメラ31において撮影された画像上のパターン光に対してデコード処理(復号処理)を行うことにより、プロジェクタ35とカメラ31の視差を割り出し、三角測量の原理を用いてプロジェクタ35又はカメラ31から対象物5までの距離を算出し対象物5の形状を測定する。
 本実施形態においては、カメラ31とプロジェクタ35との対応関係を解析する手法として、空間コード化法(又は空間符号化法)が採用され、パターン光は、水平方向の符号化を行うグレイコードパターン光と、垂直方向の符号化を行うグレイコードパターン光と、の少なくとも一方を含む。水平方向の符号化を行うグレイコードパターン光とは、明部と暗部とが周期的に繰り返された垂直の縞模様(垂直パターン)である。垂直方向の符号化を行うグレイコードパターン光とは、明部と暗部とが周期的に繰り返された水平の縞模様(水平パターン)である。
 3次元計測システム100による3次元計測では、対象物5の表面色ごとに適正な露光条件がある。例えば、表面色が白色の部分では、適正な露光時間は相対的に短く、表面色が黒色の部分では、適正な露光時間は相対的に長い。そこで、3次元計測システム100は、対象物5に対して異なる露光時間となるように投射・撮影し、対象物5の深度情報を取得可能に構成されている。
 なお、「露光」は、カメラ31のイメージセンサ311が露光されている現象を意味する。「露光時間」は、露光している時間を意味し、プロジェクタ35による発光と、カメラ31の露出(カメラ31のシャッターが開いている状態)と、の両方が行われている状態の時間である。つまり、露光時間は、前記プロジェクタの発光時間と前記カメラの露出時間を表す。本実施形態においては、カメラ31のシャッターは、光を遮る物理的なシャッターではなく、イメージセンサ311の電荷を開放状態にすることでイメージセンサ311に電荷が蓄積されない状態とする電子的なシャッターである。換言すれば、カメラ31のシャッターが開いている状態は、イメージセンサ311に電荷を蓄積する状態である。
 図2は、露光時間、プロジェクタ35の発光時間、及びカメラ31の露出時間の関係を示すグラフである。図2に示すように、プロジェクタ35の発光とカメラ31の露出とはほぼ同期しており、カメラ31の露出時間の変更に伴って、プロジェクタ35の発光時間が変更される。具体的には、カメラ31の露出開始後(例えば0.2msec後)、プロジェクタ35の発光が開始し、カメラ31の露出とプロジェクタ35の発光とがほぼ同時に終わるようになっている。これにより、カメラ31の露出が終了した後に待ち時間ができるのを防いでいる。
 また、3次元計測システム100は、以下に示すシステムの動作により、複数の露光時間から、対象物5へのパターン光の投射・撮影に適した露光時間を決定すると共に、決定された露光時間の情報を出力可能に構成されている。したがって、露光時間の決定におけるユーザの労力を軽減することができる。
 (1.2 システムの動作)
  図3~図17を参照しつつ、3次元計測システム100の動作について説明する。なお、本実施形態に係る3次元計測システム100においては、実際の3次元計測処理の前に、対象物5へのパターン光の投射・撮影に適した露光時間を出力する事前処理を行う。以下、事前処理の詳細について順に説明する。
 (1.2.1 事前処理)
  図3は、事前処理のゼネラルフローチャートである。同図から明らかな通り、処理が開始すると、カメラ31において撮影処理がなされる(S11)。このとき、パターン光は対象物5に投射されておらず、この撮影は、カメラ31による通常のカラー画像の撮影である。当該撮影された画像は、画像取得部15により取得され、記憶部14へと記憶される。
 その後、投射制御部12及び撮影制御部13は、パターン光画像の生成処理を行う(S12)。
 図4は、パターン光画像の生成処理(S12)の詳細フローチャートである。同図から明らかな通り、処理が開始すると、投射制御部12及び撮影制御部13は、露光時間データとパターン光の発光枚数の情報とを記憶部14から読み出す処理を行う(S111)。
 本実施形態では、露光時間データは、7つの異なる露光時間ET1~ET7を含む。7つの異なる露光時間ET1~ET7は、例えば、表1に示す時間とすることができる。
Figure JPOXMLDOC01-appb-T000001
 また、本実施形態では、カメラ31とプロジェクタ35との対応関係を解析する手法が空間コード化法であるため、パターン光の発光枚数は、22枚(11種類、正転・反転)である。
 なお、露光時間データは、7つの異なる露光時間を含む形態に限られず、2つ~6つ又は8つ以上の異なる露光時間を含む形態であってもよい。また、露光時間の間隔は等間隔でなくてもよい。さらに、パターン光の発光枚数は、22枚に限られない。
 露光時間データ及びパターン光の発光枚数の情報の読出処理の後、投射制御部12は、パターン光データを記憶部14から読み出す処理を行う(S112)。パターン光データは、水平方向の符号化を行うグレイコードパターン光を生成するためのデータと、垂直方向の符号化を行うグレイコードパターン光を生成するためのデータと、の少なくとも一方を含む。
 パターン光データの読出処理の後、投射制御部12及び撮影制御部13は、読み出した露光時間データのうちの1つに対応する露光時間の設定指令をプロジェクタ35及びカメラ31に対して行う(S113)。この露光時間の設定指令に基づいて、プロジェクタ35は、発光時間を、読み出した露光時間データのうちの1つに対応する値に設定し、カメラ31は、露出時間を、読み出した露光時間データのうちの1つに対応する値に設定する。
 プロジェクタ35及びカメラ31への露光時間の設定指令が行われると、撮影制御部13は、露出指令をカメラ31に対して行う(S114)。この露出指令に基づいて、カメラ31は、電子的なシャッターを開いてイメージセンサ311に電荷を蓄積する状態とする。その後(例えば0.2msec後)、撮影制御部13は、投射制御部12に対して同期のための電気的なトリガ信号を出力する。投射制御部12は、このトリガ信号を検知すると、読み出したパターン光データのうちの1つに対応するパターン光の発光指令をプロジェクタ35に対して行う(S115)。このパターン光の発光指令に基づいて、プロジェクタ35は、対応するパターン光を発し投射を行う。なお、電気的なトリガ信号の出力態様はこのような例に限定されない。従って、例えば、投射制御部12から撮影制御部13に同期のための電気的なトリガ信号を投射0.2msec前に出力し、撮影制御部13がそのトリガ信号を検知すると露出指令を行うという構成としてもよい。また、不図示の外部トリガ信号発生器の信号を使用して、投射制御部12と撮影制御部13の指令タイミングを制御する構成としてもよい。
 プロジェクタ35がパターン光の発光を開始してから露光時間が経過すると、カメラ31は、露出停止処理を行い、プロジェクタ35は、発光停止処理を行う(S116)。これにより、パターン光の撮影が完了し、パターン光画像が生成される。
 露出停止処理及び発光停止処理の後、画像取得部15は、カメラ31から撮影されたパターン光画像を取得し、記憶部14へと記憶する処理を行う(S117)。
 この処理の後、読み出したすべてのパターン光について撮影が完了したか否かが判定される(S118)。未撮影のパターン光がある場合には(S118NO)、投射するパターン光を変更する処理を行った後(S119)、カメラ31への露出指令から画像取得処理及び記憶処理までの一連の処理を再び行う(S114~S118)。
 一方、すべてのパターン光について撮影が完了した場合には(S118YES)、読み出したすべての露光時間について撮影が完了したか否かが判定される(S120)。未撮影の露光時間がある場合には(S120NO)、露光時間を変更する処理を行った後(S121)、露光時間の設定指令から画像取得処理及び記憶処理までの一連の処理を再び行う(S113~S120)。すべての露光時間について撮影が完了した場合には(S120YES)、パターン光画像の生成処理は終了する。
 図3に戻り、パターン光画像の生成処理が完了すると、画像処理が実行される(S13)。
 図5は、画像処理(S13)の詳細フローチャートである。同図から明らかな通り、処理が開始すると、画像処理部16は、記憶処理(S117)にて記憶された複数のパターン光画像に対してデコード処理(復号処理)を行う(S211)。
 図6は、デコード処理(S211)の詳細フローチャートである。同図から明らかな通り、処理が開始すると、画像処理部16は、パターン光画像における画素を指定するための変数i及び変数jの初期化処理を行う(S2111)。その後、記憶処理(S117)にて記憶された複数のパターン光画像データを記憶部14から読み出す処理を行う(S2112)。
 パターン光画像データの読出処理の後、画像処理部16は、複数の露光時間のうちの1つを注目露光時間とし当該注目露光時間で撮影された複数のパターン光画像上の注目画素座標(i,j)に対して、デコード処理(復号処理)を行う(S2113)。デコード処理の方法は、当業者に知られる種々の方法が採用できる。このデコード処理の結果、パターン光画像上の注目画素座標(i,j)に対応する投影画像上の座標情報が得られる。
 その後、画像処理部16は、注目画素座標(i,j)について、明の画像と暗の画像の輝度値の差分をコントラストとして算出する処理を行う(S2114)。図7は、注目画素座標(i,j)におけるコントラストを算出する処理を説明するための概略図である。
 図7(a)には、カメラ31において撮影して得られたパターン光画像の例が、パターン光のインデックスとともに6つ示されている。なお、図7(a)に係る各画像は、図8に示される通り、3次元計測システム100を構成するプロジェクタ35から直方体の対象物5の一面を含む所定の領域に対してパターン光を投射し、それを3次元計測システム100を構成するカメラ31により撮影することにより取得されたものである。図7に示される例では、注目画素座標(i,j)は、パターン光のインデックスが1,3,4,6のときには暗の画像となり、パターン光のインデックスが2,5のときには明の画像となる。
 図7(b)は、注目画素座標(i,j)におけるパターン光のインデックスと輝度値との関係を示すグラフである。図7(b)に示すように、注目画素座標(i,j)の輝度値は、パターン光のインデックスが1,3,4,6のときに最小値となり、パターン光のインデックスが2,5のときに最大値となる。つまり、注目画素座標(i,j)におけるコントラストは、パターン光のインデックスが2,5のときの注目画素座標(i,j)の輝度値と、パターン光のインデックスが1,3,4,6のときの注目画素座標(i,j)の輝度値と、の差分として算出される。
 なお、図7(a)に示される例では、パターン光インデックス1~6において暗となる画素が存在する。この場合には、当該画素についてはコントラストを算出することができない。そこで、図示を省略するが、本実施形態では、明暗が反転したパターン光も投射する。具体的には、パターン光インデックス1~11を明暗が反転していない正転パターン光(図7(a)に示されるように左から暗、明、・・・の順で繰り返されるパターン光)とし、パターン光インデックス12~22を明暗が反転した反転パターン光とする。正転パターン光と反転パターン光を投射することで、全てのパターン光インデックスにおいて暗となる画素がなくなり、全ての画素でコントラストを計算することができる。
 図6に戻り、注目画素座標(i,j)についてコントラストの算出処理の後、画像処理部16は、投影画像上の座標情報と注目画素座標(i,j)におけるコントラスト情報とを記憶部14へと記憶する処理を行う(S2115)。
 この処理の後、すべての露光時間について、注目画素座標(i,j)に対するデコード処理及びコントラストの算出処理が完了したか否かが判定される(S2116)。未処理の露光時間がある場合には(S2116NO)、注目露光時間を変更する処理を行い(S2117)、再度、一連の処理を行う(S2113~S2116)。
 一方、すべての露光時間について、注目画素座標(i,j)に対するデコード処理及びコントラストの算出処理が完了した場合には(S2116YES)、注目画素座標(i,j)においてパターン光の撮影に適した好適露光時間を決定する処理が行われる(S2118)。
 図9は、露光時間、注目画素座標(i,j)に対するデコード処理によって得られた投影画像上の座標、及び注目画素座標(i,j)について算出されたコントラストの一例を示す表である。同図に示される例では、パターン光画像上の注目画素座標(i,j)に対応する投影画像上の正しい座標は「870」であるところ、露光時間がET3,ET4,ET5及びET6である場合には、デコード処理によって得られた投影画像上の座標は「870」となっており、正しくデコードできている。一方、露光時間がET1,ET2及びET7である場合には、デコード処理によって得られた投影画像上の座標は「300」,「700」及び「600」となっており、正しくデコードできているとは言えない。これは、注目画素座標(i,j)におけるコントラストが、パターン光を適切に認識できる程度にないためであるといえる。換言すれば、算出されたコントラストが大きいほど、パターン光を精度よく認識することが可能になる。
 そこで、図6に戻り、好適露光時間の決定処理(S2118)では、コントラストが最大となる露光時間を好適露光時間として決定する。図9に示される例では、露光時間がET5のときにコントラストが最大となるため、ET5を好適露光時間として決定する。
 好適露光時間の決定処理の後、画像処理部16は、好適露光時間で撮影されたパターン光画像を用いたデコード処理によって得られた投影画像上の座標情報、及び決定された好適露光時間情報を記憶部14へと記憶する処理を行う(S2119)。
 その後、画像処理部16は、変数iがiの最大値i_maxに等しいか否かを判定する処理を行う(S2120)。変数iが未だ最大値ではない場合(S2120NO)、変数iを1だけ増加(インクリメント)する処理を行い(S2121)、再度、一連の処理を行う(S2113~S2120)。変数iが最大値i_maxに等しい場合(S2120YES)、画像処理部16は、変数iを初期化する処理を行う(S2122)。
 変数iの初期化処理の後、画像処理部16は、変数jがjの最大値j_maxに等しいか否かを判定する処理を行う(S2123)。変数jが未だ最大値ではない場合(S2123NO)、変数jを1だけ増加(インクリメント)する処理を行い(S2124)、再度、一連の処理を行う(S2113~S2123)。変数jが最大値j_maxに等しい場合(S2123YES)、処理は終了する。
 好適露光時間は、パターン光画像の画素毎に決定可能なので、画素毎に好適露光時間を示す好適露光時間画像を生成することができる。
 図5に戻り、デコード処理が完了すると、歪み補正処理が実行される(S212)。歪みは、カメラ31及びプロジェクタ35の光学系等により生じる歪みであり、例えば樽型歪みである。歪み補正処理は、当業者に知られる公知の手法にて補正することができる。
 図10は、樽型歪みの補正に関する概念図である。同図から明らかな通り、同図左側の格子は中心付近において膨らむように歪んでいる。この状態において、樽型歪み補正処理が行われると、同図左側の補正前の注目画素の座標(x,y)は、同図右側のひずみ補正後の座標(x',y')へと対応付けられる。このようにして、歪み補正処理が実行される。
 図5に戻り、歪み補正処理の後、平行化変換処理が実行される(S213)。平行化変換処理は、当業者に知られる公知の手法にて行うことができ、例えば、エピポーラ線を水平とする射影変換にて行うことができる。
 図11は、平行化変換処理に関する概念図である。同図において、点Pは、対象物5上の点であり、点Aは、プロジェクタ35位置であり、点Bは、カメラ31位置である。点Pは、カメラ画像に係る所定の2次元座標系(x,y)上の所定の点、すなわち、点Bと点Pとを結ぶ線と撮像面との交点Pに対応する。一方、点Pは、投影画像に係る2次元座標系(x,y)上の所定の点、すなわち、点Aと点Pとを結ぶ線分と投影面との交点Pに対応する。
 図11上側の平行化変換前では、プロジェクタ35とカメラ31とが機械的又は光学的に平行化されていない。この状態において、平行化変換処理が行われると、同図下側に示すように、プロジェクタ35とカメラ31とが機械的又は光学的に平行化される。同図上側の投影画像に係る2次元座標(x,y)及びカメラ画像に係る2次元座標(x、y)は、それぞれ、同図下側の投影画像に係る2次元座標(x'',y'')及びカメラ画像に係る2次元座標(x''、y'')へと対応付けられる。このようにして、平行化変換処理が実行される。
 なお、カメラ31とプロジェクタ35とが機械的又は光学的に平行がとれていることが保証されている場合、平行化変換処理を行う必要はない。
 図5に戻り、平行化変換処理の後、視差の計算処理が実行される(S214)。視差の計算処理は、当業者に知られる公知の手法にて行うことができ、投影画像及びカメラ画像における互いに対応する点の位置のずれとして算出することができる。
 図12は、視差の計算に関する概念図である。同図において、点P、点A、点B、点P及び点Pは、図11における点P、点A、点B、点P及び点Pと同じである。点Bから線分APに平行に伸ばした線とカメラ画像との交点を点P''とすると、視差dは、点Pと点P''との間の距離として求められる。視差dは、パターン光画像における画素毎に求めることができる。
 図5に戻り、視差の計算処理が完了すると、画像処理が終了する。
 図3に戻り、画像処理の後、画像処理部16は、深度情報の生成処理を行う(S14)。本実施形態においては、視差に加えて、記憶部14に記憶された既知のパラメータ(焦点距離f、及びカメラ31とプロジェクタ35との距離Z)を用いて、カメラ31又はプロジェクタ35から対象物5までの距離(深度)を算出する。
 図12において、焦点距離fは、点Bとカメラ画像との間の距離に相当する。三角形PABと三角形BP'Pとは、互いに相似の関係にあるため、点A又は点Bから点Pまでの距離Zは、以下の数式の通り、距離Bと焦点距離fとの席を視差dで除した値(Z=B×f/d)として計算される。
 すなわち、視差dを求めることでプロジェクタ35又はカメラ31から対象物5までの距離Zを算出することができる。また、このような距離Zは画素毎に生成可能なので、いわゆるデプス画像を生成することができる。
 図3に戻り、深度情報の生成処理が完了すると、次に、深度画像の生成処理が行われる(S15)。本実施形態においては、画像処理部16は、撮影処理(S11)において撮影された通常の画像と深度画像を用いて、3次元空間の点群データを生成する。
 深度画像の生成処理の後、出力部17は、深度画像及び好適露光時間画像をディスプレイ(不図示)等に出力する。深度画像及び好適露光時間画像をディスプレイに出力する場合には、距離画像と好適露光時間画像とが並べて表示されてもよいし、距離画像と好適露光時間画像とが切換え可能に表示されてもよい。
 図13(a)は、パターン光が対象物5に投射されていない状態においてカメラ31により撮影された画像の概略図であり、図13(b)は、図13(a)に示される対象物5に対して事前処理を実行して得られた好適露光時間画像の一例である。同図から明らかなように、対象物5に投射されたパターン光の撮影に適した露光時間は、左からET1,ET7及びET5であることがわかる。そのため、ユーザは、好適露光時間画像を確認するだけで、対象物5へのパターン光の投射・撮影に適した露光時間を把握することができる。したがって、3次元計測での露光時間の決定における労力を軽減することができる。
 また、本実施形態では、好適露光時間画像に加えて距離画像を出力可能である。そのため、ユーザは、距離画像を確かめつつ、対象物5へのパターン光の投射・撮影に適した露光時間を把握することができる。したがって、3次元計測での露光時間の決定における労力をより軽減することができる。
 なお、図13(b)において、ET6を好適露光時間であると示している領域は、背景である。そのため、ユーザは、ET6を露光時間として選択する必要はない。
 図13(b)に示される好適露光時間画像では、好適露光時間に応じてハッチングの種類が決められハッチングの種類により好適露光時間を分けて示しているが、好適露光時間画像の階調値を、好適露光時間に応じて画素毎に決定し、好適露光時間を色分けして示してもよい。この場合には、ユーザは、好適露光時間画像を一目見て、対象物5に投射されたパターン光の撮影に適した露光時間を把握することができる。したがって、3次元計測での露光時間の選択における労力をより軽減することができる。
 (1.2.2 3次元計測処理)
  次に、事前処理を経てユーザが露光時間を選択した後に行われる、3次元計測処理について説明する。
 図14は、3次元計測処理のゼネラルフローチャートである。同図から明らかな通り、処理が開始すると、入力受付部11は、測定開始信号の受信待機状態となる(S31)。この状態において、測定開始信号を受信すると(S31YES)、後続の処理が実行される。なお、測定開始信号は、3次元計測システム100のさらに上位システムから送信されてもよいし、ユーザからの入力により生成されてもよい。
 測定開始信号は、事前処理にて用いられた対象物5と色合いが似た別の対象物5を3次元計測する準備が整うと送信又は生成される。すなわち、当該別の対象物5がカメラ31の画角内かつプロジェクタ35のパターン光投射範囲内に配置されると、測定開始信号が送信又は生成される。
 測定開始信号受信後、カメラ31において撮影処理がなされ、同撮影画像は画像取得部15により取得される(S32)。この撮影は、カメラ31による通常のカラー画像の撮影である。
 その後、投射制御部12及び撮影制御部13は、パターン光画像の生成処理を行う(S33)。
 図15は、パターン光画像の生成処理の詳細フローチャートである。同図から明らかな通り、処理が開始すると、投射制御部12及び撮影制御部13は、露光時間データとパターン光の発光枚数の情報とを記憶部14から読み出す処理を行う(S311)。このとき、読み出される露光時間データは、事前処理を経てユーザが選択した露光時間に係るデータのみである。例えば、読み出される露光時間データは、図13(b)に示されるET1,ET5,ET7のみを含むデータである。
 露光時間データの読出処理の後、投射制御部12は、パターン光データを記憶部14から読み出す処理を行う(S312)。このとき、読み出されるパターン光データは、事前処理にて読み出されるパターン光データと略同一である。
 パターン光データの読出処理の後、投射制御部12及び撮影制御部13は、読み出した露光時間データのうちの1つに対応する露光時間の設定指令をプロジェクタ35及びカメラ31に対して行う(S313)。この露光時間の設定指令に基づいて、プロジェクタ35は、発光時間を、読み出した露光時間データのうちの1つに対応する値に設定し、カメラ31は、露光時間を、読み出した露光時間データのうちの1つに対応する値に設定する。
 露光時間設定指令の後、撮影制御部13は、露出指令をカメラ31に対して行う(S314)。この露出指令に基づいて、カメラ31は、電子的なシャッターを開いてイメージセンサ311に電荷を蓄積する状態とする。その後(例えば0.2msec後)、撮影制御部13は、投射制御部12に対して同期のための電気的なトリガ信号を出力する。投射制御部12は、このトリガ信号を検知すると、読み出したパターン光データのうちの1つに対応するパターン光の発光指令をプロジェクタ35に対して行う(S315)。このパターン光の発光指令に基づいて、プロジェクタ35は、対応するパターン光を発し投射を行う。なお、電気的なトリガ信号の出力態様はこのような例に限定されない。従って、例えば、投射制御部12から撮影制御部13に同期のための電気的なトリガ信号を投射0.2msec前に出力し、撮影制御部13がそのトリガ信号を検知すると露出指令を行う、という構成としてもよい。また、不図示の外部トリガ信号発生器の信号を使用して投射制御部12と撮影制御部13の指令タイミングを制御するという構成としてもよい。
 プロジェクタ35がパターン光の発光を開始してから露光時間が経過すると、カメラ31は、露出停止処理を行い、プロジェクタ35は、発光停止処理を行う(S316)。これにより、パターン光の撮影が完了し、パターン光画像が生成される。
 露出停止処理及び発光停止処理の後、画像取得部15は、カメラ31から撮影されたパターン光画像を取得し、記憶部14へと記憶する処理を行う(S317)。
 この処理の後、読み出したすべてのパターン光について撮影が完了したか否かが判定される(S318)。未撮影のパターン光がある場合には(S318NO)、投射するパターン光を変更する処理を行った後(S319)、カメラ31への露出指令から画像取得処理及び記憶処理までの一連の処理を再び行う(S314~S318)。
 一方、すべてのパターン光について撮影が完了した場合には(S318YES)、読み出したすべての露光時間について撮影が完了したか否かが判定される(S320)。未撮影の露光時間がある場合には(S320NO)、露光時間を変更する処理を行った後(S321)、露光時間の設定指令から画像取得処理及び記憶処理までの一連の処理を再び行う(S313~S320)。すべての露光条件について撮影が完了した場合には(S320YES)、パターン光画像の生成処理は終了する。
 パターン光画像の生成処理(S311~S321)では、事前処理を経てユーザが選択した露光時間でのみ、パターン光の撮影を行う。そのため、撮影回数を減らすことができ、処理に要する時間を短縮することができる。
 図14に戻り、パターン光画像の生成処理が完了すると、画像処理が実行される(S33)。
 図16は、画像処理(S33)の詳細フローチャートである。同図から明らかな通り、処理が開始すると、画像処理部16は、記憶処理(S317)にて記憶された複数のパターン光画像に対してデコード処理(復号処理)を行う(S411)。
 図17は、デコード処理(S411)の詳細フローチャートである。同図から明らかな通り、処理が開始すると、画像処理部16は、パターン光画像における画素を指定するための変数i及び変数jの初期化処理を行う(S4111)。その後、記憶処理(S317)にて記憶された複数のパターン光画像データを記憶部14から読み出す処理を行う(S4112)。
 パターン光画像データの読出処理の後、画像処理部16は、事前処理を経てユーザが選択した露光時間のうちの1つを注目露光時間とし当該注目露光時間で撮影された複数のパターン光画像上の注目画素座標(i,j)に対して、デコード処理(復号処理)を行う(S4113)。デコード処理の方法は、当業者に知られる種々の方法が採用できる。このデコード処理の結果、パターン光画像上の注目画素座標(i,j)に対応する投影画像上の座標情報が得られる。
 その後、画像処理部16は、注目画素座標(i,j)について、明の画像と暗の画像の輝度値の差分をコントラストとして算出する処理を行う(S4114)。注目画素座標(i,j)におけるコントラストを算出する処理は、事前処理におけるコントラストの算出処理とほぼ同じであるため、その詳細については省略する。
 注目画素座標(i,j)についてコントラストの算出処理の後、画像処理部16は、投影画像上の座標情報と注目画素座標(i,j)におけるコントラスト情報とを記憶部14へと記憶する処理を行う(S4115)。
 この処理の後、事前処理を経てユーザが選択したすべての露光時間について、注目画素座標(i,j)に対するデコード処理及びコントラストの算出処理が完了したか否かが判定される(S4116)。未処理の露光時間がある場合には(S4116NO)、注目露光時間を変更する処理を行い(S4117)、再度、一連の処理を行う(S4113~S4116)。全ての露光時間について処理が完了した場合(S4116YES)、パターン光画像を用いたデコード処理によって得られた投影画像上の座標情報を記憶部14へと記憶する処理を行う(S4118)。
 その後、画像処理部16は、変数iがiの最大値i_maxに等しいか否かを判定する処理を行う(S4119)。変数iが未だ最大値ではない場合(S4119NO)、変数iを1だけ増加(インクリメント)する処理を行い(S4120)、再度、一連の処理を行う(S4113~S4119)。変数iが最大値i_maxに等しい場合(S4119YES)、画像処理部16は、変数iを初期化する処理を行う(S4121)。
 変数iの初期化処理の後、画像処理部16は、変数jがjの最大値j_maxに等しいか否かを判定する処理を行う(S4122)。変数jが未だ最大値ではない場合(S4122NO)、変数jを1だけ増加(インクリメント)する処理を行い(S4123)、再度、一連の処理を行う(S4113~S4122)。変数jが最大値j_maxに等しい場合(S4122YES)、処理は終了する。
 デコード処理(S4111~S4123)では、事前処理を経てユーザが選択した露光時間で撮影されたパターン光画像のみを用いて、投影画像上の座標と注目画素座標(i,j)におけるコントラストとを算出する。そのため、処理回数を減らすことができ、処理に要する時間を短縮することができる。
 図16に戻り、デコード処理が完了すると、歪み補正処理が実行される(S412)。歪みは、カメラ31及びプロジェクタ35の光学系等により生じる歪みである。歪み補正処理は、事前処理における歪み補正処理とほぼ同じであるため、その詳細については省略する。
 歪み補正処理の後、平行化変換処理が実行される(S413)。平行化変換処理は、事前処理における平行化変換処理とほぼ同じであるため、その詳細については省略する。
 平行化変換処理の後、視差の計算処理が実行される(S414)。視差の計算処理は、事前処理における視差の計算処理とほぼ同じであるため、その詳細については省略する。
 視差の計算処理が完了すると、画像処理が終了する。
 図14に戻り、画像処理の後、画像処理部16は、深度情報の生成処理を行う(S35)。深度情報の生成処理は、事前処理における視差の計算処理とほぼ同じであるため、その詳細については省略する。
 深度情報の生成処理が完了すると、次に、深度画像の生成処理及び出力処理が行われる(S36)。深度画像の生成処理及び出力処理は、事前処理における深度画像の生成処理及び出力処理とほぼ同じであるため、その詳細については省略する。
 深度画像の生成処理及び出力処理の後、3次元計測処理が終了する。
 (2.第2の実施形態)
  次に、本発明の第2の実施形態について説明する。なお、以下では、第1の実施形態と同一の構成については同一の符号が付与される。
 (2.1 システムの構成)
  第2実施形態におけるシステムの構成は、第1実施形態におけるシステムの構成と略同一であるため、ここではその詳細については省略する。
 (2.2 システムの動作)
  (2.2.1 事前処理)
  第1実施形態では、事前処理における好適露光時間の決定処理にて(図6のS2118)、コントラストが最大となる露光時間を好適露光時間として決定している。そのため、図9に示される例では、ET5を最適露光時間として決定している。
 しかしながら、図9に示される例では、露光時間がET3であっても正しくデコードできている。露光時間が長いほど1回の撮影に要する時間が長くなるため、事前処理後の3次元計測処理において撮影時間を短くする観点からは、最適露光時間をET5ではなくET3とすることが好ましい。つまり、注目画素座標(i,j)におけるパターン光を適切に認識できる露光時間が複数ある場合には、最も短い露光時間を最適露光時間とすることが好ましい。
 そこで、第2実施形態では、事前処理における好適露光時間の決定処理にて(図6のS2118)、注目画素座標(i,j)におけるコントラストが所定の閾値を超えかつ最も短い露光時間を好適露光時間として決定する。そのため、事前処理にて出力される好適露光時間画像は、コントラストが所定の閾値を超えかつ最も短い露光時間を示すことになる。したがって、ユーザは、好適露光時間画像を確認するだけで、対象物5へのパターン光の投射・撮影に適した露光時間を把握することができる。
 所定の閾値は、複数の選択肢からユーザによって選択される値であってもよいし、ユーザから指定された値であってもよい。所定の閾値が複数の選択肢からユーザによって選択される値である場合には、ユーザは、推奨の選択肢の中から所定の閾値を選ぶことができる。したがって、ユーザの労力をより軽減することができる。所定の閾値がユーザにより指定される場合には、ユーザによる所定の閾値の変更が可能になる。したがって、3次元測定の精度と3次元測定に要する時間とのバランスをユーザが容易に調整することができる。
 (2.2.2 3次元計測処理)
  第2実施形態における3次元計測処理は、第1実施形態における3次元計測処理と略同一であるため、ここではその詳細については省略する。
 (3.変形例)
  本発明は、様々に変更して実施することができる。
 (3.1 パターン光の変形例)
  例えば、パターン光として、グレイコードパターン光に代えて、位相を等間隔でずらした複数の正弦波位相シフトパターンを使用してもよい。パターン光を正弦波位相シフトパターンとしたときの、注目画素座標(i,j)についてコントラストを算出する処理(S2114)について、図18を参照して説明する。
 図18(a)には、カメラ31において撮影された正弦波位相シフトパターン光画像の例が、パターン光のインデックスとともに6つ示されている。なお、図18(a)に示されるパターン光画像を得るために用いられた対象物と3次元計測システムを含む構成は、図8の概略構成図に示された構成と略同一であるため、ここではその図示を省略する。図18(a)に示される例では、注目画素座標(i,j)は、パターン光のインデックスが1から2にかけて輝度値が正弦波状に上昇し、インデックスが2から3にかけて輝度値が正弦波の最大値となる。また、パターン光のインデックスが3から5にかけて輝度値が正弦波状に低下し、インデックスが5から6にかけて輝度値が正弦波の最小値となる。
 図18(b)は、注目画素座標(i,j)におけるパターン光のインデックスと輝度値との関係を示すグラフである。図18(b)に示すように、注目画素座標(i,j)の輝度値の変化に基づいて、正弦波の近似式を算出することができる。注目画素座標(i,j)におけるコントラストは、算出された近似式の振幅として算出される。
 正弦波位相シフトパターンを用いる場合には、複数のパターン光のうちの一部の画像で注目画素の輝度値が飽和しても、元の正弦波形をある程度推定することができる。これにより、コントラストの算出における誤差を減らすことができる。
 (3.2 露光条件の変形例)
  第1及び第2の実施形態では、露光条件が露光時間である場合について説明したが、露光条件は、カメラ31の絞り及び感度(例えば、ISO感度)、並びにプロジェクタ35の発光強度であってもよい。つまり、露光条件は、露光時間、カメラ31の絞り及び感度、並びにプロジェクタ35の発光強度の少なくとも1つである。
 露光時間、カメラ31の絞り及び感度、並びにプロジェクタ35の発光強度は、コントラストに関わる。そのため、これらの条件を変えることにより、パターン光を認識できるコントラストが得られる。したがって、3次元計測の精度を高めることができる。
 (3.3 カメラ31とプロジェクタ35の配置の変形例)
  第1及び第2の実施形態では、カメラ31とプロジェクタ35とが水平に配置される場合について説明したが、カメラ31とプロジェクタ35とが垂直に配置されていてもよい。この場合には、それらを結ぶ仮想線に平行な方向を基準として、パターン光の空間符号化を行う方向や、視差のために差分をとる方向を決定してもよい。
 以上、本発明の実施形態について説明したが、上記実施形態は本発明の適用例の一部を示したに過ぎず、本発明の技術的範囲を上記実施形態の具体的構成に限定する趣旨ではない。また、上記の実施形態は、矛盾が生じない範囲で適宜組み合わせ可能である。
 本発明は、少なくとも3次元計測システム等を製造する産業において利用可能である。
 1 コントローラユニット
 11 入力受付部
 12 投射制御部
 13 撮影制御部
 14 記憶部
 15 画像取得部
 16 画像処理部
 17 出力部
 3 センサヘッドユニット
 31 カメラ
 311 イメージセンサ
 312 対物レンズ
 35 プロジェクタ
 351 光源
 352 平面波変換レンズ
 353 ミラー
 355 DMD
 356 ミラーレンズ
 5 対象物
 100 3次元計測システム

Claims (11)

  1.  縞状の複数のパターン光を対象物に投射するプロジェクタと、
     前記対象物に投射された前記複数のパターン光を複数の露光条件で撮影して複数の撮影画像を生成するカメラと、
     前記複数の撮影画像の注目画素におけるコントラストを前記複数の露光条件毎に算出するコントラスト算出部と、
     前記複数の露光条件から、算出された前記コントラストが所定のコントラスト条件を満たしている露光条件を好適露光条件として前記注目画素毎に決定する好適露光条件決定部と、
     決定された前記好適露光条件を画素毎に示す好適露光条件画像を出力する出力部と、
    を備えた、3次元計測システム。
  2.  前記プロジェクタは、明部と暗部とが周期的に繰り返された複数のグレイコードパターン光を投射し、
     前記コントラスト算出部は、前記注目画素における輝度値を前記複数のグレイコードパターン光毎に求め、求められた前記輝度値の最大値と最小値との差分を前記コントラストとして算出する、
    請求項1に記載の3次元計測システム。
  3.  前記プロジェクタは、位相を等間隔でずらした複数の正弦波位相シフトパターン光を投射し、
     前記コントラスト算出部は、前記注目画素における輝度値を前記複数の正弦波位相シフトパターン光毎に求め、求められた前記輝度値から正弦波形を求め、前記正弦波形の振幅を前記コントラストとして算出する、
    請求項1に記載の3次元計測システム。
  4.  前記露光条件は、露光時間、前記カメラの絞り及び感度、並びに前記プロジェクタの発光強度の少なくとも1つである、
    請求項1から3のいずれか1項に記載の3次元計測システム。
  5.  前記好適露光条件決定部は、算出された前記コントラストが最大となる前記露光条件を前記好適露光条件として決定する、
    請求項1から4のいずれか1項に記載の3次元計測システム。
  6.  前記露光条件は、露光時間であり、
     前記好適露光条件決定部は、算出された前記コントラストが所定の閾値以上となる前記露光時間のうち最も短い露光時間を好適露光時間として決定する、
    請求項1から3のいずれか1項に記載の3次元計測システム。
  7.  前記所定の閾値は、予め用意された複数の選択肢からユーザによって選択される、
    請求項6に記載の3次元計測システム。
  8.  前記所定の閾値は、ユーザにより指定される、
    請求項6に記載の3次元計測システム。
  9.  前記出力部は、前記好適露光条件画像の階調値を、決定された前記好適露光条件に応じて画素毎に決定し、前記好適露光条件を色分けして示す、
    請求項1から8のいずれか1項に記載の3次元計測システム。
  10.  縞状の複数のパターン光を対象物に投射するプロジェクタと、前記対象物を撮影して撮影画像を生成するカメラと、を備えた3次元計測システムの制御方法であって、
     前記プロジェクタにより前記対象物に投射された前記複数のパターン光を前記カメラを用いて複数の露光条件で撮影して複数の撮影画像を生成するパターン光画像生成ステップと、
     前記複数の撮影画像の注目画素におけるコントラストを前記複数の露光条件毎に算出するコントラスト算出ステップと、
     前記複数の露光条件から、算出された前記コントラストが所定のコントラスト条件を満たしている露光条件を好適露光条件として前記注目画素毎に決定する好適露光条件決定ステップと、
     決定された前記好適露光条件を画素毎に示す好適露光条件画像を出力する出力ステップと、
    を備えた、制御方法。
  11.  縞状の複数のパターン光を対象物に投射するプロジェクタと、前記対象物を撮影して撮影画像を生成するカメラと、を備えた3次元計測システムの制御プログラムであって、
     前記プロジェクタにより前記対象物に投射された前記複数のパターン光を前記カメラを用いて複数の露光条件で撮影して複数の撮影画像を生成するパターン光画像生成ステップと、
     前記複数の撮影画像の注目画素におけるコントラストを前記複数の露光条件毎に算出するコントラスト算出ステップと、
     前記複数の露光条件から、算出された前記コントラストが所定のコントラスト条件を満たしている露光条件を好適露光条件として前記注目画素毎に決定する好適露光条件決定ステップと、
     決定された前記好適露光条件を画素毎に示す好適露光条件画像を出力する出力ステップと、
    を備えた、制御プログラム。
PCT/JP2021/041969 2021-11-15 2021-11-15 3次元計測システム、並びにその制御方法及び制御プログラム WO2023084790A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2021/041969 WO2023084790A1 (ja) 2021-11-15 2021-11-15 3次元計測システム、並びにその制御方法及び制御プログラム

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2021/041969 WO2023084790A1 (ja) 2021-11-15 2021-11-15 3次元計測システム、並びにその制御方法及び制御プログラム

Publications (1)

Publication Number Publication Date
WO2023084790A1 true WO2023084790A1 (ja) 2023-05-19

Family

ID=86335475

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2021/041969 WO2023084790A1 (ja) 2021-11-15 2021-11-15 3次元計測システム、並びにその制御方法及び制御プログラム

Country Status (1)

Country Link
WO (1) WO2023084790A1 (ja)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009033338A (ja) * 2007-07-25 2009-02-12 Olympus Imaging Corp 撮像装置
JP2013036791A (ja) * 2011-08-05 2013-02-21 Sony Corp 3次元測定装置、3次元測定方法及びプログラム
JP2016045019A (ja) * 2014-08-20 2016-04-04 オムロン株式会社 基板検査装置のティーチング装置及びティーチング方法
JP2019027947A (ja) * 2017-07-31 2019-02-21 株式会社キーエンス 形状測定装置及び形状測定方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009033338A (ja) * 2007-07-25 2009-02-12 Olympus Imaging Corp 撮像装置
JP2013036791A (ja) * 2011-08-05 2013-02-21 Sony Corp 3次元測定装置、3次元測定方法及びプログラム
JP2016045019A (ja) * 2014-08-20 2016-04-04 オムロン株式会社 基板検査装置のティーチング装置及びティーチング方法
JP2019027947A (ja) * 2017-07-31 2019-02-21 株式会社キーエンス 形状測定装置及び形状測定方法

Similar Documents

Publication Publication Date Title
CN109155843B (zh) 图像投影系统和图像投影方法
JP6456156B2 (ja) 法線情報生成装置、撮像装置、法線情報生成方法および法線情報生成プログラム
WO2021085419A1 (ja) 三次元計測装置
KR20130032368A (ko) 삼차원 계측장치, 삼차원 계측방법 및 기억매체
KR20100134403A (ko) 깊이 정보를 생성하기 위한 장치 및 방법
JP2004132829A (ja) 3次元撮影装置と3次元撮影方法及びステレオアダプタ
JP6556013B2 (ja) 処理装置、処理システム、撮像装置、処理方法、プログラム、および記録媒体
JP7078173B2 (ja) 画像処理装置及び3次元計測システム
JP2015184056A (ja) 計測装置、方法及びプログラム
US9894339B2 (en) Image processing apparatus, image processing method and program
WO2020049965A1 (ja) 3次元計測システム、3次元計測カメラ、3次元計測方法及びプログラム
WO2023084790A1 (ja) 3次元計測システム、並びにその制御方法及び制御プログラム
JP2020003432A (ja) 撮像装置、画像処理方法、画像処理プログラムおよび記録媒体
JP7213686B2 (ja) 形状計測装置、制御方法及びプログラム
JP2021127998A (ja) 距離情報取得装置および距離情報取得方法
JP2021004762A (ja) 計測装置、撮像装置、計測システム、制御方法、プログラム及び記録媒体
US11754833B2 (en) Image processing apparatus and control method for image processing apparatus
CN111373222A (zh) 光投射系统
JP7309425B2 (ja) 処理装置、処理システム、撮像装置、処理方法、および、プログラム
JP7401024B2 (ja) 三次元計測装置
WO2023238736A1 (ja) 計測装置、ロボットシステム、計測方法、物品の製造方法、及び記憶媒体
US20210385390A1 (en) Processing apparatus, processing system, image pickup apparatus, processing method, and memory medium
JP2023133723A (ja) 三次元計測装置
JP6608238B2 (ja) 画像処理装置、撮像装置、画像処理方法、プログラム
JP2022076368A (ja) 画像処理装置、撮像装置、情報処理装置、画像処理方法、及びプログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21964143

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2023559396

Country of ref document: JP