WO2020235067A1 - 3次元計測システム及び3次元計測方法 - Google Patents

3次元計測システム及び3次元計測方法 Download PDF

Info

Publication number
WO2020235067A1
WO2020235067A1 PCT/JP2019/020355 JP2019020355W WO2020235067A1 WO 2020235067 A1 WO2020235067 A1 WO 2020235067A1 JP 2019020355 W JP2019020355 W JP 2019020355W WO 2020235067 A1 WO2020235067 A1 WO 2020235067A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
pattern
camera
measurement system
dimensional measurement
Prior art date
Application number
PCT/JP2019/020355
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 US17/606,850 priority Critical patent/US20220222843A1/en
Priority to CN201980095872.1A priority patent/CN113748313B/zh
Priority to EP19929385.3A priority patent/EP3951314B1/en
Priority to PCT/JP2019/020355 priority patent/WO2020235067A1/ja
Priority to JP2021519994A priority patent/JP7168077B2/ja
Publication of WO2020235067A1 publication Critical patent/WO2020235067A1/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
    • G01B11/2513Measuring 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 with several lines being projected in more than one direction, e.g. grids, patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • G06T7/55Depth or shape recovery from multiple images
    • G06T7/593Depth or shape recovery from multiple images from stereo images
    • 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
    • G01B11/2509Color coding
    • 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
    • G01B11/2545Measuring 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 with one projection direction and several detection directions, e.g. stereo
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • G06T7/521Depth or shape recovery from laser ranging, e.g. using interferometry; from the projection of structured light
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20076Probabilistic image processing

Definitions

  • the present invention relates to three-dimensional measurement using an image.
  • Active measurement is known as a method for performing three-dimensional measurement of an object using an image.
  • shooting is performed with pattern light projected onto the object, and from the position of the pattern on the obtained image, three-dimensional information of the object (for example, depth information of each pixel) using the principle of triangulation. Ask for.
  • Non-Patent Document 1 depth information is obtained by projecting a spatially coded pattern (referred to as a "spatial coded pattern”) onto the surface of an object for imaging, and decoding the pattern appearing in the image.
  • a spatially coded pattern referred to as a "spatial coded pattern”
  • the required method is disclosed. Although this method enables high-speed and high-precision measurement, there is a problem that the spatial resolution is low due to the calculation of the depth value using a plurality of pixels.
  • stereo matching also called a stereo camera method
  • FIG. 23 shows the principle of stereo matching.
  • stereo matching for example, two cameras arranged on the left and right photograph the object O at the same time to obtain two images.
  • One is the reference image I1 and the other is the comparison image I2, and the pixel in the reference image I1 (reference point P1) and the pixel having the closest image feature (corresponding point P2) are searched along the epipolar line E in the comparison image I2. Then, the difference in coordinates (parallax) between the reference point P1 and the corresponding point P2 is obtained. Since the geometrical position of each camera is known, the distance D (depth) in the depth direction can be calculated from the parallax by the principle of triangulation, and the three-dimensional shape of the object O can be restored.
  • Stereo matching can improve the measurement accuracy by using a high-resolution camera, and also increase the number of measurement points (pixels for which the corresponding points have been found and the distance information has been successfully acquired) and the spatial resolution. It has the characteristic that it can be used. However, on the other hand, as the number of pixels of the input image captured from the camera increases, it takes time to search for the corresponding point, and there is a demerit that the measurement time increases remarkably.
  • the present invention has been made in view of the above circumstances, and an object of the present invention is to provide a technique for achieving both high accuracy and high-speed processing in measurement by stereo matching.
  • One aspect of the present invention is a floodlight device that projects pattern light onto an object, a first camera that photographs the object, and a second camera that photographs the object from a different viewpoint from the first camera.
  • the image processing device includes an image processing device that acquires three-dimensional information of the object by processing a first image obtained from the first camera and a second image obtained from the second camera. Is a first measuring means for acquiring the first depth information by the spatial coding pattern method using the first image, and the first image and the second image predicted from the first depth information.
  • It has a second measuring means for acquiring a second depth information having a spatial resolution higher than that of the first depth information, and the pattern light has a regular unit element which is a region corresponding to one depth value.
  • a three-dimensional measurement system characterized by having a composite pattern in which an arranged spatial coding pattern and a random pattern in which a plurality of random pieces are irregularly arranged are synthesized.
  • the search range of the corresponding point is limited based on the predicted parallax.
  • the search range can be remarkably narrowed, so that the time required for searching for the corresponding point can be significantly shortened.
  • the pattern light obtained by synthesizing a random pattern is used, the complexity of the light-dark distribution on the surface of the object (various image features) increases. This makes it possible to improve the success rate and accuracy of stereo matching, that is, the corresponding point search. Therefore, according to this system, three-dimensional measurement with high spatial resolution can be performed at high speed and with high accuracy.
  • the composite pattern is 0.02 ⁇ S2 / S1 ⁇ 0.12 May be satisfied.
  • the synthetic pattern is 0.04 ⁇ S2 / S1 ⁇ 0.1 May be satisfied. By setting it in this range, it can be expected that the accuracy and speed of stereo matching can be substantially maximized.
  • the unit element includes one or more structures representing the value of the unit element, and the random piece may be added to a region of the unit element other than the region where the structure is arranged. According to such an arrangement, the possibility that the random piece adversely affects the pattern decoding can be reduced.
  • the unit element includes one or more structures representing the value of the unit element, and the random piece has a brightness or color distinguishable from the structure in the region of the unit element where the structure is arranged. It may be added. By adding the random pieces in a manner distinguishable by brightness or color, it is also possible to superimpose the random pieces on the structure. This increases the degree of freedom of the position where the random piece can be added, so that it can be combined with various types of spatial coding patterns.
  • the composite pattern is S4 ⁇ S3 / 2 May be satisfied. If the size of the random piece is smaller than half the size of the structure, even if the random piece overlaps the structure, the structure of the spatially coded pattern is not changed, so that the decoding rate of the pattern can be maintained.
  • the floodlight device and the first camera may be set so that the unit element forms an image on the image sensor of the first camera in a size of 3 pixels ⁇ 3 pixels or more. This is because if one side of the unit element is smaller than 3 pixels, the structure in the unit element is not resolved and the decoding rate of the pattern may decrease.
  • the structure of the floodlight device, the first camera, and the second camera is imaged in a size of 3/2 pixels ⁇ 3/2 pixels or more on the image sensors of the first camera and the second camera, respectively. It may be set to. This is because if one side of the structure is smaller than 3/2 pixels, the structure may not be resolved well and the decoding rate of the pattern may decrease.
  • the random pieces are connected to a size of 1/4 pixel ⁇ 1/4 pixel or more on the image sensors of the first camera and the second camera, respectively. It may be set to image. By setting the minimum size of the random piece in this way, the effect of the random pattern can be guaranteed.
  • One aspect of the present invention is a space using the first image, a step of projecting a pattern light onto an object, a step of photographing the object from different viewpoints and acquiring a first image and a second image.
  • Search for corresponding points in stereo matching based on the step of acquiring the first depth information by the coding pattern method and the parallax between the first image and the second image predicted from the first depth information.
  • the pattern light has a step of acquiring depth information, and the pattern light has a spatial coding pattern in which unit elements, which are regions corresponding to one depth value, are regularly arranged, and a plurality of random pieces are irregularly arranged.
  • a three-dimensional measurement method characterized by having an arranged random pattern and a composite pattern in which is synthesized.
  • the present invention may be regarded as an image processing device or a three-dimensional measurement system having at least a part of the above means. Further, the present invention may be regarded as an image processing method including at least a part of the above processing, a three-dimensional measurement method, a distance measuring method, a control method of an image processing device, a control method of a three-dimensional measurement system, or the like. A program for realizing such a method or the program may be regarded as a recording medium for recording non-temporarily.
  • the present invention can be constructed by combining each of the above means and treatments with each other as much as possible.
  • FIG. 1 is a diagram schematically showing a configuration example of a three-dimensional measurement system, which is one of the application examples of the present invention.
  • FIG. 2 is a diagram schematically showing an outline of functions and processing of a three-dimensional measurement system.
  • FIG. 3 is a diagram showing an example of a composite pattern in which a spatial coding pattern and a random pattern are combined.
  • FIG. 4 is a diagram showing an example of unit elements constituting the spatial coding pattern.
  • FIG. 5 is a diagram showing a change in the success rate of stereo matching under low contrast conditions when the addition amount of the random pattern is changed.
  • FIG. 6 is a diagram showing an example of a unit element in which a random pattern is synthesized.
  • 7A and 7B are diagrams showing simulations of images obtained when the unit element of FIG.
  • FIG. 6 is projected onto an object and photographed under low contrast conditions.
  • FIG. 8 is a diagram showing a change in the success rate of pattern decoding of the spatial coding pattern method under low contrast conditions when the addition amount of the random pattern is changed.
  • 9A-9C are diagrams showing an example in which a white random piece overlaps a black structure.
  • FIG. 10 is a diagram showing a case where the contrast of the random pattern is the smallest.
  • 11A and 11B are diagrams showing other examples of synthetic patterns.
  • 12A-12D are diagrams showing other examples of synthetic patterns.
  • 13A-13D are diagrams showing other examples of synthetic patterns.
  • 14A-14D are diagrams showing other examples of synthetic patterns.
  • 15A and 15B are diagrams showing other examples of synthetic patterns.
  • 16A and 16B are diagrams showing other examples of synthetic patterns.
  • FIG. 17 is a functional block diagram of the three-dimensional measurement system according to the embodiment of the present invention.
  • FIG. 18 is a diagram showing a configuration example of the pattern floodlight unit.
  • FIG. 19 is a flow chart showing the flow of measurement processing.
  • FIG. 20 is a diagram showing another configuration example of the pattern floodlight unit.
  • FIG. 21 is a diagram showing another configuration example of the pattern floodlight unit.
  • FIG. 22 is a diagram showing another configuration example of the pattern floodlight unit.
  • FIG. 23 is a diagram illustrating the principle of stereo matching.
  • FIG. 1 is a diagram schematically showing a configuration example of a three-dimensional measurement system, which is one of application examples of the present invention.
  • the three-dimensional measurement system 1 is a system for measuring the three-dimensional shape of the object 12 by image sensing, and is roughly composed of a sensor unit 10 and an image processing device 11.
  • the sensor unit 10 includes at least a floodlight device that projects pattern light and one or more cameras (also referred to as an image sensor or an image pickup device), and may include other sensors and lighting as needed.
  • the output of the sensor unit 10 is taken into the image processing device 11.
  • the image processing device 11 is a device that performs various processes using the data captured from the sensor unit 10.
  • the processing of the image processing device 11 may include, for example, distance measurement (distance measurement), three-dimensional shape recognition, object recognition, scene recognition, and the like.
  • the processing result of the image processing device 11 is output to an output device such as a display, transferred to the outside, and used for inspection, control of other devices, and the like.
  • Such a three-dimensional measurement system 1 is applied to a wide range of fields, including, for example, computer vision, robot vision, and machine vision.
  • the configuration of FIG. 1 is just an example, and the hardware configuration may be appropriately designed according to the application of the three-dimensional measurement system 1.
  • the sensor unit 10 and the image processing device 11 may be wirelessly connected, or the sensor unit 10 and the image processing device 11 may be configured as an integrated device.
  • the sensor unit 10 and the image processing device 11 may be connected via a wide area network such as a LAN or the Internet.
  • a plurality of sensor units 10 may be provided for one image processing device 11, or conversely, the output of one sensor unit 10 may be provided to the plurality of image processing devices 11.
  • the viewpoint of the sensor unit 10 may be movable by attaching the sensor unit 10 to a robot or a moving body.
  • FIG. 2 is a diagram schematically showing an outline of the functions and processing of the three-dimensional measurement system 1.
  • the three-dimensional measurement system 1 includes two measurement systems, a first measurement system 21 and a second measurement system 22, as measurement systems for measuring the distance of the object 12.
  • the functions and processes of the measurement systems 21 and 22 are realized by the sensor unit 10 and the image processing device 11 in cooperation with each other.
  • the first measurement system 21 is a first distance measuring means that measures the depth distance (depth) to the object 12 by the spatial coding pattern method.
  • the second measurement system 22 is a second distance measuring means that measures the depth distance (depth) to the object 12 by stereo matching (also called a stereo camera method).
  • stereo matching also called a stereo camera method.
  • the distance information (first depth information) obtained by the spatial coding pattern method is compared with stereo.
  • the distance information (second depth information) obtained by matching has a higher spatial resolution. Therefore, this system 1 uses the distance information obtained by the first measurement system 21 as an auxiliary for the purpose of roughly predicting the parallax observed by the second measurement system 22 and narrowing down the search range in stereo matching.
  • the distance information generated by the second measurement system 22 is used as the final output.
  • the sensor unit 10 projects pattern light from the floodlight device onto the object 12.
  • a composite pattern 32 in which the spatial coding pattern 30 and the random pattern 31 are combined is used.
  • the space coding pattern 30 is a pattern for distance measurement by the space coding pattern method, and unit elements 300 of a predetermined size are regularly arranged.
  • the unit element 300 is the minimum region corresponding to one depth value.
  • the random pattern 31 is a pattern in which a plurality of small pieces (referred to as random pieces) are irregularly arranged.
  • the sensor unit 10 photographs an object 12 on which pattern light is projected and acquires a stereo image pair consisting of two images (referred to as a first image and a second image). These two images are taken of the object 12 from different viewpoints (line-of-sight directions) so as to cause parallax with respect to the object 12.
  • the first image and the second image may be captured by the two cameras at the same time.
  • the first image and the second image may be acquired by a single camera by continuously shooting while moving the camera.
  • the first measurement system 21 acquires the first depth information of the object 12 by the spatial coding pattern method using the first image.
  • the first measurement system 21 predicts the disparity between the first image and the second image based on the first depth information, and outputs the two-dimensional spatial distribution of the predicted disparity as a disparity map.
  • the parallax map generated by the first measurement system 21 is referred to as a "reference parallax map" in order to distinguish it from the parallax map generated by the stereo matching of the second measurement system 22.
  • the spatial resolution of the first depth information and the reference parallax map depends on the size of the unit element 300 of the spatial coding pattern 30. For example, when the unit element 300 has a size of 4 pixels ⁇ 4 pixels in the first image, the spatial resolution of the first depth information and the reference parallax map is 1/4 of the resolution of the first image.
  • the second measurement system 22 sets the search range of the corresponding points in stereo matching using the reference parallax map acquired from the first measurement system 21. Since it is inevitable that the predicted parallax includes a certain amount of error, the search range of the corresponding point may be set so as to include the error range. For example, when the value of the predicted parallax is d [pixels] and the error is ⁇ derr [pixels], the search range may be set as d-derr-c to d + derr + c. c is a margin.
  • the search range may be set individually for all the pixels in the image, or if the change in local parallax in the image is not large, the image is divided into a plurality of areas and the area unit. You may set the search range with.
  • the second measurement system 22 searches for the corresponding point of each pixel between the first image and the second image from the set search range. For example, when the first image is used as a reference image and the second image is used as a comparison image, the pixel in the second image having the closest image feature to the pixel (reference point) in the first image is selected as the corresponding point, and the reference point is selected. The difference between the coordinates of the corresponding point and the corresponding point is obtained as the parallax at the reference point.
  • a search for corresponding points is performed for all the pixels in the first image, and a parallax map is generated from the search results.
  • the parallax map is data in which parallax information is associated with the coordinates of each pixel.
  • the second measurement system 22 uses the principle of triangulation to convert the parallax information of the parallax map into distance information and generate a depth map (second depth information).
  • the spatial resolution of the second depth information obtained by the second measurement system 22 is determined by the resolutions of the first image and the second image. Therefore, it is possible to obtain depth information having a higher spatial resolution than that of the first measurement system 21.
  • the search range of the corresponding point is limited based on the predicted parallax.
  • the search range can be remarkably narrowed, so that the time required for searching for the corresponding point can be significantly shortened.
  • the pattern light obtained by synthesizing a random pattern is used, the complexity of the light-dark distribution on the surface of the object (various image features) increases. This makes it possible to improve the success rate and accuracy of stereo matching, that is, the corresponding point search. Therefore, according to the present system 1, three-dimensional measurement with high spatial resolution can be performed at high speed and with high accuracy.
  • the composite pattern 32 of FIG. 3 is a random pattern 31 superimposed (composited) on the base spatial coding pattern 30.
  • the composite pattern 32 may be projected from one floodlight device, or the spatial coding pattern 30 and the random pattern 31 may be projected individually from the two floodlight devices, and the two patterns 30 and 31 are projected on the surface of the object. It may be overlapped.
  • the pattern is drawn in black and white in FIG. 3 and the like, it is assumed that the white part represents the bright part (the area irradiated with light) and the black part represents the dark part (the area not irradiated with light).
  • the pattern does not have to be a binary of black and white (light and dark), and may be a multi-valued pattern.
  • FIG. 4 shows an example of the unit element 300 constituting the spatial coding pattern 30.
  • the unit element 300 is a minimum area corresponding to one depth value, and is also called a "primitive".
  • the unit element 300 shown in FIG. 4 has a structure in which a rectangle called a “bit” is arranged in the center of a 2 ⁇ 2 grid called a “grid”. Since there are two types of grids and two types of bits, the unit element 300 can take four types of values depending on the combination of the grid and the bits.
  • the random pattern 31 is a pattern in which a plurality of random pieces are irregularly arranged.
  • the “irregular arrangement” may be a completely random arrangement having no regularity or reproducibility, or an arrangement determined by using pseudo-random numbers.
  • Each random piece is composed of one dot (pixel) or a plurality of consecutive dots (pixels), and the shape and size thereof may be fixed or variable, and may be one type or a plurality of types.
  • One or more random pieces may be added within the region of the unit element 300, and each random piece may have a brightness or color distinguishable from the structures (bits, grids) within the unit element 300. In the example of FIG. 3, the brightness of each random piece is set so that the brightness (black and white) of the random piece and the structure in the unit element 300 is inverted.
  • the success rate and accuracy of stereo matching can be expected to be improved as compared with the case where only the spatial coding pattern 30 is projected. Since the light-dark distribution appearing on the surface of the object has regularity only with the space coding pattern 30, there is a high possibility that the corresponding point of the incorrect answer is selected in the corresponding point search, whereas the light-dark distribution is distributed by adding the random pattern 31. This is because as the complexity (variability of image features) increases, it becomes easier to detect the corresponding points of the correct answers. In particular, the effect becomes remarkable under low contrast conditions in which the image features on the surface of the object are unknown.
  • FIG. 5 shows the change in the success rate of stereo matching under low contrast conditions when the addition amount of the random pattern is changed.
  • the horizontal axis is the ratio of the random pattern 31 to the spatial coding pattern 30, and the vertical axis is the success rate of stereo matching (success rate of corresponding point search).
  • the ratio of the random pattern 31 to the spatial coding pattern 30 is represented by the index S2 / S1.
  • S1 is the area of the unit element 300 of the space coding pattern 30, and S2 is the total area of the random pieces added in the area of the unit element 300.
  • Graph 50 in FIG. 5 shows the experimental results when the unit element 300 is set to form an image on the image sensor of the camera in a size of 4 pixels ⁇ 4 pixels.
  • the unit element 300 is on the image sensor. This is an experimental result when the image is set to have a size of 10 pixels ⁇ 10 pixels.
  • the imaging size of the unit element 300 can be arbitrarily set by adjusting the projection magnification of the floodlight device, the lens magnification of the camera, the arrangement of the floodlight device and the camera (distance from the object), and the like.
  • 7A and 7B are simulations of images obtained when the unit element 300 of FIG. 6 is projected onto an object and photographed under low contrast conditions.
  • FIG. 7A is an image having an image formation size of 4 pixels ⁇ 4 pixels
  • FIG. 7B is an image having an image formation size of 10 pixels ⁇ 10 pixels.
  • the addition amount S2 / S1 of the random pattern is preferably larger than 0.02, more preferably larger than 0.04.
  • FIG. 8 shows a change in the success rate of pattern decoding of the spatial coding pattern method under low contrast conditions when the addition amount of the random pattern is changed.
  • the horizontal axis is the ratio of the random pattern 31 to the spatial coding pattern 30, and the vertical axis is the success rate of pattern decoding.
  • Graph 80 in FIG. 8 shows the experimental results when the unit element 300 is set to form an image on the image sensor of the camera in a size of 4 pixels ⁇ 4 pixels. In graph 81, the unit element 300 is on the image sensor. This is an experimental result when the image is set to have a size of 10 pixels ⁇ 10 pixels.
  • the success rate drops sharply. If the success rate of pattern decoding is low, the number of points where depth can be calculated, that is, parallax can be predicted, is small. In that case, in stereo matching, there are few places where the range of the corresponding point search can be limited, and as a result, the processing time of stereo matching increases.
  • the addition amount S2 / S1 of the random pattern is preferably smaller than 0.12, and more preferably smaller than 0.1.
  • the additional amount S2 / S1 of the random pattern is at least 0.02 ⁇ S2 / S1 ⁇ 0.12 It is preferable to satisfy. By setting this range, it is possible to perform processing in which the success rate of stereo matching and the processing time are well-balanced.
  • the additional amount S2 / S1 of the random pattern is 0.04 ⁇ S2 / S1 ⁇ 0.1 Is more preferable.
  • Random pattern size The size of the random pattern may be set to a size that does not change the structure of the spatially coded pattern. "Changing the structure” means that an incorrect value is obtained when a pattern is decoded from an image taken by a camera, or that the decoding itself fails.
  • the area of the smallest structure (bit, grid, etc.) representing the value of the unit element 300 is added to S3 and the unit element 300 at random.
  • S4 the area of the largest piece
  • S4 ⁇ S3 / 2 It is advisable to set the size of the random pattern so as to satisfy.
  • FIG. 9A-9C show an example in which a white random piece 91 overlaps a black structure 90.
  • FIG. 9A is an example of the structure 90.
  • FIG. 9B if the random piece 91 occupies more than half of the area of the structure 90 (S4 ⁇ S3 / 2), the white area becomes wider, so that the structure 90 that should be interpreted as “black” is It is misinterpreted as "white”.
  • FIG. 9C if the size of the random piece 91 is smaller than half the size of the structure 90 (S4 ⁇ S3 / 2), even if the random piece 91 overlaps the structure 90, it still has a black area. This structure 90 is correctly determined to be "black” because it is wider.
  • the image size of the unit element 300 is preferably 3 pixels ⁇ 3 pixels or more.
  • the structure (bits, grid) in the unit element 300 is not resolved, the brightness (black and white) of the structure cannot be accurately discriminated, and the decoding rate of the pattern is significantly lowered.
  • the image size of the unit element 300 should be as large as possible.
  • the spatial resolution of the depth information obtained by the spatial coding pattern method decreases. Therefore, practically, it is preferably about 3 pixels ⁇ 3 pixels to 10 pixels ⁇ 10 pixels.
  • the imaging size of the structure in the unit element 300 is preferably 3/2 pixels ⁇ 3/2 pixels or more. If one side of the structure is smaller than 3/2 pixels, the structure will not be resolved well (for example, when the structure is imaged at a position that spans exactly two pixels), and the brightness (black and white) of the structure will be accurately discriminated. This is because it becomes impossible and the decoding rate of the pattern decreases.
  • the upper limit of the size of the structure is determined in relation to the size of the unit element 300. For example, when the area of the unit element 300 is S1 and the area of the structure is S3, it is preferable to set S3 ⁇ S1 / 4.
  • the imaging size of the random piece is preferably 1/4 pixel ⁇ 1/4 pixel or more.
  • the difference between the signal values of the random piece and the pixels around it should be at least 2 bits or more.
  • the case where the random piece 95 straddles the pixels of the image sensor 96 is the case where the contrast of the pattern is the smallest (that is, the effect of the pattern is lost).
  • the area of the random piece 95 included in the pixel 97 needs to be equivalent to 1/64 pixel or larger. is there.
  • the imaging size of an 8-bit output camera is illustrated here, the preferred imaging size can recognize the difference in signal value between the random piece and its peripheral pixels according to the specifications and performance of the camera (imaging element). It may be set appropriately so as to be.
  • FIG. 11A is an example in which the shape of the bit is circular
  • FIG. 11B is an example in which the shape of the bit is a rhombus (the shape of the grid is the same as the example in FIG. 3). In either case, it is advisable to attach the same random pattern as described above.
  • the shape of the bit may be any shape other than a square, a circle, and a rhombus.
  • 12A to 12D show the difference in the number of structures existing in the unit element 300.
  • 12A is an example of one
  • FIG. 12B is an example of two
  • FIG. 12C is an example of three
  • FIG. 12D is an example of four.
  • the left side shows the unit element 300 of the spatial coding pattern
  • the right side shows the composite pattern to which the random pattern is added.
  • the method of adding the random pattern may be the same as that described above.
  • FIGS. 13A to 13D are examples of patterns using lines (broken line, dot line, etc.).
  • 13A is an example of one line
  • FIG. 13B is an example of two lines
  • FIG. 13C is an example of three lines
  • FIG. 13D is an example of four lines.
  • the left side shows the unit element 300 of the spatial coding pattern
  • the right side shows the composite pattern to which the random pattern is added.
  • the method of adding the random pattern may be the same as that described above.
  • FIGS. 14A to 14D are examples of patterns using a grid.
  • 14A is an example of one grid line
  • FIG. 14B is an example of two grid lines
  • FIG. 14C is an example of three grid lines
  • FIG. 14D is an example of four grid lines.
  • the left side shows the unit element 300 of the spatial coding pattern
  • the right side shows the composite pattern to which the random pattern is added.
  • the method of adding the random pattern may be the same as that described above.
  • a random piece is added to an area (also referred to as a background area) other than the area where the structure is arranged.
  • an area also referred to as a background area
  • the random pieces may be arranged so as to overlap the structure.
  • FIG. 15A is an example of a pattern using shading.
  • This pattern consists of one cycle of luminance change, and the value is represented by the phase of the luminance change.
  • Random pieces may be added at arbitrary positions within the unit element. However, in the image taken by the camera, the random piece needs to be distinguishable from the surrounding brightness change pattern. Therefore, for example, the brightness of the random piece may be set so that the difference in brightness between the random piece and its surroundings is 2 bits or more.
  • FIG. 15B is an example of a pattern using a wavelength (color). Although FIG. 15B is drawn in black and white for the sake of illustration, it is actually a colorful pattern. This pattern consists of one cycle of wavelength change, and the value is represented by the phase of the wavelength change. Random pieces may be added at arbitrary positions within the unit element. However, in the image taken by the camera, the random piece needs to be distinguishable from the ambient wavelength change pattern. Therefore, for example, the brightness of the random piece may be set so that the difference in brightness between the random piece and its surroundings is 2 bits or more. Alternatively, the wavelength (color) of the random piece may be set so that a predetermined wavelength difference is obtained.
  • FIG. 16A is an example of a pattern using polarized light.
  • This pattern is a combination of linearly polarized light 160 in the vertical direction and linearly polarized light 161 in the horizontal direction instead of light and dark (black and white).
  • FIG. 16B an image as shown in FIG. 16B can be obtained. That is, the polarization component in the vertical direction is transmitted and becomes a white pixel on the image, and the polarization component in the horizontal direction is cut and becomes a black pixel on the image.
  • FIG. 17 is a functional block diagram of the three-dimensional measurement system 1.
  • the sensor unit 10 includes a first camera 101, a second camera 102, a pattern floodlight unit 103, an illumination unit 104, an image transfer unit 105, and a drive control unit 106.
  • the first camera 101 and the second camera 102 are a pair of cameras constituting a so-called stereo camera, and are arranged at a predetermined distance. By simultaneously shooting with the two cameras 101 and 102, an image pair shot from different viewpoints can be obtained (the image of the first camera 101 is called the first image, and the image of the second camera 102 is called the second image). ).
  • the two cameras 101 and 102 may be arranged so that their optical axes intersect each other and the horizontal lines (or vertical lines) are on the same plane. By adopting such an arrangement, the epipolar line becomes parallel to the horizontal line (or vertical line) of the image, so that the corresponding point in stereo matching may be searched from within the horizontal line (or vertical line) at the same position. This is because the search process can be simplified.
  • a monochrome camera or a color camera may be used as the cameras 101 and 102.
  • the pattern light projecting unit 103 is a light projecting device for projecting the pattern light used in the distance measurement of the space coding pattern method onto the object 12, and is also called a projector.
  • FIG. 18 schematically shows a configuration example of the pattern floodlight unit 103.
  • the pattern floodlight unit 103 includes, for example, a light source unit 180, a light guide lens 181, a pattern generation unit 182, a projection lens 183, and the like.
  • As the light source unit 180 an LED, a laser, a VCSEL (Vertical cavity Surface-emitting Laser), or the like can be used.
  • the light guide lens 181 is an optical element for guiding light from the light source unit 180 to the pattern generation unit 182, and a lens, a glass rod, or the like can be used.
  • the pattern generation unit 182 is a member or device that generates a composite pattern, and is a photo mask, a diffractive optical element (for example, DOE (Diffractive Optical Element)), a light modulation element (for example, DLP (Digital Light Processing), LCD (Liquid Crystal)). Display), LCoS (Liquid Crystal on Silicon), MEMS (Micro Electro Mechanical Systems)) and the like can be used.
  • the projection lens 183 is an optical element that magnifies and projects the generated pattern.
  • the illumination unit 104 is uniform illumination used for capturing a general visible light image.
  • white LED lighting is used.
  • the illumination may be in the same wavelength band as the active projection.
  • the image transfer unit 105 transfers the data of the first image taken by the first camera 101 and the data of the second image taken by the second camera 102 to the image processing device 11.
  • the image transfer unit 105 may transfer the first image and the second image as separate image data, or join the first image and the second image to generate a side-by-side image and transfer it as a single image data. You may.
  • the drive control unit 106 is a unit that controls the first camera 101, the second camera 102, the pattern floodlight unit 103, and the illumination unit 104.
  • the image transfer unit 105 and the drive control unit 106 may be provided on the image processing device 11 side instead of the sensor unit 10 side.
  • the image processing device 11 includes an image acquisition unit 110, a pattern decoding unit 111, a parallax prediction unit 112, a preprocessing unit 113, a search range setting unit 115, a corresponding point search unit 116, a parallax map post-processing unit 117, and a depth map generation unit 118.
  • the image acquisition unit 110 has a function of capturing necessary image data from the sensor unit 10.
  • the image acquisition unit 110 sends the first image to the pattern decoding unit 111, and sends a stereo image pair composed of the first image and the second image to the preprocessing unit 113.
  • the pattern decoding unit 111 has a function of acquiring distance information (first depth information) from the first image by the spatial coding pattern method.
  • the spatial resolution is determined depending on the size of the unit element used. For example, when a unit element of 5 pixels ⁇ 5 pixels is used, the spatial resolution of the distance information is 1/25 of the input image.
  • the parallax prediction unit 112 has a function of predicting the parallax between the first image and the second image based on the distance information obtained by the pattern decoding unit 111 and outputting a reference parallax map.
  • the preprocessing unit 113 has a function of performing necessary preprocessing on the first image and the second image.
  • the search range setting unit 115 has a function of setting the search range of the corresponding point based on the predicted parallax.
  • the corresponding point search unit 116 has a function of searching for a corresponding point between the first image and the second image and generating a parallax map (second depth information) based on the search result.
  • the parallax map post-processing unit 117 has a function of performing necessary post-processing on the parallax map.
  • the depth map generation unit 118 has a function of converting the parallax information of the parallax map into the distance information and generating the depth map.
  • the image processing device 11 is composed of, for example, a computer including a CPU (processor), a RAM (memory), a non-volatile storage device (hard disk, SSD, etc.), an input device, an output device, and the like.
  • the CPU expands the program stored in the non-volatile storage device into the RAM and executes the program to realize the various functions described above.
  • the configuration of the image processing device 11 is not limited to this, and all or part of the above-mentioned functions may be realized by a dedicated circuit such as FPGA or ASIC, or realized by cloud computing or distributed computing. You may.
  • the first camera 101, the pattern floodlight unit 103, the image transfer unit 105, the image acquisition unit 110, the drive control unit 106, the pattern decoding unit 111, and the parallax prediction unit 112 make up the first measurement system 21 in FIG.
  • the second measurement system 22 of FIG. 2 is configured by the map post-processing unit 117 and the depth map generation unit 118.
  • FIG. 19 is a flow chart showing a flow of processing executed by the image processing device 11.
  • the image acquisition unit 110 acquires the first image and the second image from the sensor unit 10.
  • the first image and the second image are images taken by the first camera 101 and the second camera 102, respectively, in a state where the pattern light is projected from the pattern projection unit 103 onto the object 12.
  • the image acquisition unit 110 divides the side-by-side image into a first image and a second image.
  • the image acquisition unit 110 sends the first image to the pattern decoding unit 111, and sends the first image and the second image to the preprocessing unit 113.
  • step S402 the preprocessing unit 113 performs parallelization processing (rectification) on the first image and the second image.
  • the parallelization process is a process of geometrically transforming one or both images so that the corresponding points between the two images are on the same horizontal line (or vertical line) in the image. Since the epipolar line becomes parallel to the horizontal line (or vertical line) of the image by the parallelization process, the process of searching for the corresponding point in the subsequent stage becomes easy. If the parallelism of the image captured from the sensor unit 10 is sufficiently high, the parallelization process in step S402 may be omitted.
  • step S403 the preprocessing unit 113 calculates the hash feature amount for each pixel of the parallelized first image and the second image, and replaces the value of each pixel with the hash feature amount.
  • the hash feature amount represents the luminance feature of the local region centered on the pixel of interest, and here, the hash feature amount consisting of a bit string of eight elements is used.
  • step S404 the pattern decoding unit 111 analyzes the first image and decodes the pattern to acquire distance information in the depth direction at a plurality of points on the first image.
  • step S405 the same point as the two-dimensional coordinates when the disparity prediction unit 112 projects each point onto the parallelized image coordinate system of the first image based on the distance information of each point obtained in step S405. Is calculated with the two-dimensional coordinates when projected onto the image coordinate system of the parallelized second image, and the difference in coordinates between the two images is calculated. This difference is the predicted parallax.
  • the parallax prediction unit 112 obtains the predicted parallax for all the points for which the distance information has been obtained in step S404, and outputs the data as a reference parallax map.
  • the search range setting unit 115 sets the search range of the corresponding points for the first image and the second image based on the predicted parallax.
  • the size of the search range is determined in consideration of the prediction error. For example, when the prediction error is ⁇ 10 pixels, it is considered sufficient to set about ⁇ 20 pixels centered on the predicted parallax in the search range even if the margin is included. If the horizontal line has 640 pixels and the search range can be narrowed down to ⁇ 20 pixels (that is, 40 pixels), the search process can be simply reduced to 1/16 compared to searching the entire horizontal line. Can be done.
  • step S407 the corresponding point search unit 116 searches for the corresponding point between the first image and the second image after pixel reduction, and obtains the parallax of each pixel.
  • the corresponding point search unit 116 generates parallax data in which parallax information is associated with points (pixel coordinates) that have succeeded in detecting the corresponding points. This information is the parallax map.
  • step S408 the parallax map post-processing unit 117 corrects the parallax map. Since the parallax map estimated by the corresponding point search includes erroneous measurement points and measurement omissions, the erroneous measurement points are corrected and the measurement omissions are complemented based on the parallax information of the surrounding pixels.
  • step S409 the depth map generation unit 118 converts the parallax information of each pixel of the parallax map into three-dimensional information (distance information in the depth direction) to generate a depth map.
  • This depth map (three-dimensional point cloud data) is used, for example, for shape recognition and object recognition of the object 12.
  • FIG. 20 shows another configuration example of the pattern floodlight unit.
  • two types of floodlights are provided: a spatially coded pattern floodlight 200 for projecting the spatially coded pattern 30 and a random pattern floodlight 201 for projecting the random pattern 31. ing.
  • the two patterns 30 and 31 projected from the light projecting units 200 and 201 are superposed on the surface of the object to form the synthetic pattern 32. Even with such a configuration, the same effect as that of the above-described embodiment can be obtained.
  • FIG. 21 shows another configuration example of the pattern floodlight unit.
  • a light source 210, a light guide lens 211, and a pattern generation unit 212 for the spatial coding pattern 30, and a light source 213, a light guide lens 214, and a pattern generation unit 215 for the random pattern 31 are provided.
  • the beam combiner 216 synthesizes the two pattern lights, and the projection lens 217 projects the composite pattern 32. Even with such a configuration, the same effect as that of the above-described embodiment can be obtained.
  • FIG. 22 shows another configuration example of the pattern floodlight unit.
  • a first light source 220 and a first light guide lens 221 and a second light source 222 and a second light guide lens 223 are provided.
  • two types of light are combined by the beam combiner 224, and the combined pattern 32 is projected from the projection lens 226 via the pattern generation unit 225.
  • the two types of light sources 220 and 222 for example, light sources having different wavelengths, light sources having different polarization directions, and the like can be used.
  • the sensor unit may be provided with three or more cameras.
  • the combination of the cameras to be paired may be changed, stereo matching may be performed, and the reliability of the measurement result may be improved by using a plurality of measurement results obtained by each combination. As a result, the accuracy can be improved.
  • the hash feature amount is used for stereo matching, but another method may be used for the similarity evaluation of the corresponding points.
  • an evaluation index of similarity there is a similarity calculation method of pixels of left and right images by SAD (Sum of Absolute Difference), SSD (Sum of Squared Difference), NC (Normalized Correlation) and the like.
  • the camera image common to the generation of the reference depth map (prediction of parallax) and the stereo matching is used, but different camera images for three-dimensional measurement may be used.
  • a floodlight device (103) that projects pattern light onto an object (12), and The first camera (101) for photographing the object (12) and A second camera (102) that captures the object (12) from a viewpoint different from that of the first camera (101).
  • An image processing device (12) that acquires three-dimensional information of the object (12) by processing a first image obtained from the first camera (101) and a second image obtained from the second camera (102). 11) and The image processing device (11)
  • a setting means (115) for setting a search range for corresponding points in stereo matching based on the parallax between the first image and the second image predicted from the first depth information.
  • a second depth information having a spatial resolution higher than that of the first depth information is acquired by performing stereo matching limited to the set search range using the first image and the second image.
  • the pattern light includes a spatial coding pattern (30) in which unit elements, which are regions corresponding to one depth value, are regularly arranged, and a random pattern (31) in which a plurality of random pieces are irregularly arranged.
  • a three-dimensional measurement system (1) characterized in that it has a composite pattern (32) in which.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Optics & Photonics (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Measurement Of Optical Distance (AREA)

Abstract

3次元計測システムが、対象物にパターン光を投影し、対象物を異なる視点から撮影して第1画像と第2画像を取得し、第1画像を用い、空間符号化パターン方式により、第1のデプス情報を取得し、第1のデプス情報から予測される第1画像と第2画像の間の視差に基づき対応点の探索範囲を設定し、第1画像と第2画像を用い、設定された探索範囲に限定したステレオマッチングを行うことにより、第1のデプス情報よりも空間分解能の高い第2のデプス情報を取得する。パターン光は、1つのデプス値に対応する領域である単位要素が規則的に配置された空間符号化パターンと、複数のランダム片が不規則に配置されたランダムパターンと、が合成された合成パターンを有する。

Description

3次元計測システム及び3次元計測方法
 本発明は、画像を用いた3次元計測に関する。
 画像を用いて対象物の3次元計測を行う手法として、アクティブ計測が知られている。アクティブ計測では、対象物にパターン光を投影した状態で撮影を行い、得られた画像上のパターンの位置から、三角測量の原理を用いて対象物の3次元情報(例えば各画素のデプス情報)を求める。
 非特許文献1には、空間的な符号化がなされたパターン(「空間符号化パターン」と呼ぶ)を対象物表面に投影して撮像を行い、画像に現れるパターンを復号することでデプス情報を求める手法が開示されている。この手法は高速かつ高精度な計測が可能であるが、複数画素を利用してデプス値を算出することに起因して、空間分解能が低いという課題がある。
 一方、空間分解能が高い手法として、異なる視点から撮影された2つの画像を用いて対象物の3次元形状を計測する、いわゆるステレオマッチング(ステレオカメラ方式とも呼ばれる)が知られている。図23にステレオマッチングの原理を示す。ステレオマッチングでは、例えば左右に配置した2台のカメラで対象物Oを同時に撮影し、2枚の画像を得る。一方を基準画像I1、他方を比較画像I2とし、基準画像I1中の画素(基準点P1)と画像特徴が最も近い画素(対応点P2)を、比較画像I2中のエピポーラ線Eに沿って探索し、基準点P1と対応点P2の間の座標の差(視差)を求める。各カメラの幾何学的な位置は既知であるので、三角測量の原理により、視差から奥行方向の距離D(デプス)を算出でき、対象物Oの3次元形状を復元することができる。
P. Vuylsteke and A. Oosterlinck, Range Image Acquisition with a Single Binary-Encoded Light Pattern, IEEE PAMI 12(2), pp. 148-164, 1990.
 ステレオマッチングは、高解像のカメラを用いることによって、計測精度の向上を図ることができるとともに、計測点(対応点が見つかり、距離情報の取得に成功した画素)の数及び空間分解能を高めることができる、という特性をもつ。しかしその反面、カメラから取り込まれる入力画像の画素数が多くなるほど、対応点の探索に時間を要し、計測時間が著しく増大するというデメリットがある。
 本発明は、上記実情に鑑みてなされたものであり、ステレオマッチングによる計測において、高い精度と高速な処理を両立するための技術を提供することを目的とする。
 本発明の一側面は、対象物にパターン光を投影する投光装置と、前記対象物を撮影する第1カメラと、前記第1カメラとは異なる視点で前記対象物を撮影する第2カメラと、前記第1カメラから得られる第1画像及び前記第2カメラから得られる第2画像を処理することによって、前記対象物の3次元情報を取得する画像処理装置と、を備え、前記画像処理装置は、前記第1画像を用い、空間符号化パターン方式により、第1のデプス情報を取得する第1計測手段と、前記第1のデプス情報から予測される前記第1画像と前記第2画像の間の視差に基づき、ステレオマッチングにおける対応点の探索範囲を設定する設定手段と、前記第1画像と前記第2画像を用い、前記設定された探索範囲に限定したステレオマッチングを行うことにより、前記第1のデプス情報よりも空間分解能の高い第2のデプス情報を取得する第2計測手段と、を有し、前記パターン光は、1つのデプス値に対応する領域である単位要素が規則的に配置された空間符号化パターンと、複数のランダム片が不規則に配置されたランダムパターンと、が合成された合成パターンを有することを特徴とする3次元計測システムを提供する。
 従来の一般的なステレオマッチングでは、比較画像の全体から対応点の探索を行うため、高解像度の画像を用いると不可避的に処理時間が長くなってしまう。これに対し、上記構成では、予測された視差に基づき対応点の探索範囲が限定される。これにより、探索範囲を格段に狭くできるため、対応点の探索に要する時間を大幅に短縮することができる。また、ランダムパターンを合成したパターン光を用いたので、対象物表面の明暗分布の複雑さ(画像特徴の多様さ)が増す。これにより、ステレオマッチング、つまり対応点探索の成功率及び精度を向上することができる。したがって、本システムによれば、空間分解能の高い3次元計測を、高速かつ高精度に行うことができる。
 前記単位要素の面積をS1、前記単位要素の領域内に付加されたランダム片の合計面積をS2、としたときに、前記合成パターンは、
  0.02<S2/S1<0.12
を満たしてもよい。この範囲に設定することで、ステレオマッチングの成功率と処理時間のバランスがとれた処理が可能となる。
 前記合成パターンは、
  0.04<S2/S1<0.1
を満たしてもよい。この範囲に設定することで、ステレオマッチングの精度と速度を実質的に最大化することができると期待できる。
 前記単位要素は、当該単位要素の値を表す構造を1つ以上含み、前記ランダム片は、前記単位要素のうち前記構造が配置されている領域以外の領域に付加されてもよい。このような配置によれば、ランダム片がパターン復号に悪影響を与える可能性を小さくできる。
 前記単位要素は、当該単位要素の値を表す構造を1つ以上含み、前記ランダム片は、前記単位要素のうち前記構造が配置されている領域に、前記構造と区別可能な輝度又は色で、付加されてもよい。輝度又は色で区別可能な態様でランダム片を付加することにより、構造の上にランダム片を重ねることも可能となる。これにより、ランダム片を付加できる位置の自由度が増すので、さまざまな方式の空間符号化パターンとの組み合わせが可能となる。
 前記構造の最小面積をS3、前記ランダム片の最大面積をS4、としたときに、前記合成パターンは、
  S4<S3/2
を満たしてもよい。ランダム片のサイズが構造のサイズの半分より小さければ、構造の上にランダム片が重なったとしても、空間符号化パターンの構造を変化させないので、パターンの復号率を維持することができる。
 前記投光装置及び前記第1カメラは、前記単位要素が前記第1カメラの撮像素子上で3画素×3画素以上のサイズに結像するように設定されてもよい。単位要素の一辺が3画素より小さくなると、単位要素内の構造が解像されず、パターンの復号率が低下するおそれがあるからである。
 前記投光装置、前記第1カメラ、及び前記第2カメラは、前記構造が前記第1カメラ及び前記第2カメラそれぞれの撮像素子上で3/2画素×3/2画素以上のサイズに結像するように設定されてもよい。構造の一辺が3/2画素より小さくなると、構造がうまく解像されず、パターンの復号率が低下するおそれがあるからである。
 前記投光装置、前記第1カメラ、及び前記第2カメラは、前記ランダム片が前記第1カメラ及び前記第2カメラそれぞれの撮像素子上で1/4画素×1/4画素以上のサイズに結像するように設定されてもよい。ランダム片の最小サイズをこのように設定することにより、ランダムパターンの効果を担保することができる。
 本発明の一側面は、対象物にパターン光を投影するステップと、前記対象物を異なる視点から撮影して、第1画像と第2画像を取得するステップと、前記第1画像を用い、空間符号化パターン方式により、第1のデプス情報を取得するステップと、前記第1のデプス情報から予測される前記第1画像と前記第2画像の間の視差に基づき、ステレオマッチングにおける対応点の探索範囲を設定するステップと、前記第1画像と前記第2画像を用い、前記設定された探索範囲に限定したステレオマッチングを行うことにより、前記第1のデプス情報よりも空間分解能の高い第2のデプス情報を取得するステップと、を有し、前記パターン光は、1つのデプス値に対応する領域である単位要素が規則的に配置された空間符号化パターンと、複数のランダム片が不規則に配置されたランダムパターンと、が合成された合成パターンを有することを特徴とする3次元計測方法を提供する。
 本発明は、上記手段の少なくとも一部を有する画像処理装置又は3次元計測システムとして捉えてもよい。また、本発明は、上記処理の少なくとも一部を含む画像処理方法、3次元計測方法、測距方法、画像処理装置の制御方法、3次元計測システムの制御方法などとして捉えてもよく、または、かかる方法を実現するためのプログラムやそのプログラムを非一時的に記録した記録媒体として捉えてもよい。なお、上記手段および処理の各々は可能な限り互いに組み合わせて本発明を構成することができる。
 本発明によれば、ステレオマッチングによる計測において、高い精度と高速な処理を両立することが可能である。
図1は、本発明の適用例の一つである3次元計測システムの構成例を模式的に示す図である。 図2は、3次元計測システムの機能及び処理の概要を模式的に示す図である。 図3は、空間符号化パターンとランダムパターンが合成された合成パターンの例を示す図である。 図4は、空間符号化パターンを構成する単位要素の例を示す図である。 図5は、ランダムパターンの付加量を変えた場合の、低コントラスト条件下でのステレオマッチングの成功率の変化を示す図である。 図6は、ランダムパターンが合成された単位要素の例を示す図である。 図7A及び図7Bは、図6の単位要素を対象物に投影し、低コントラスト条件下で撮影した場合に得られる画像のシミュレーションを示す図である。 図8は、ランダムパターンの付加量を変えた場合の、低コントラスト条件下での空間符号化パターン方式のパターン復号の成功率の変化を示す図である。 図9A~図9Cは、黒色の構造に白色のランダム片が重なる例を示す図である。 図10は、ランダムパターンのコントラストが最も小さくなる場合を示す図である。 図11A及び図11Bは、合成パターンの他の例を示す図である。 図12A~図12Dは、合成パターンの他の例を示す図である。 図13A~図13Dは、合成パターンの他の例を示す図である。 図14A~図14Dは、合成パターンの他の例を示す図である。 図15A及び図15Bは、合成パターンの他の例を示す図である。 図16A及び図16Bは、合成パターンの他の例を示す図である。 図17は、本発明の実施形態に係る3次元計測システムの機能ブロック図である。 図18は、パターン投光部の構成例を示す図である。 図19は、計測処理の流れを示すフロー図である。 図20は、パターン投光部の他の構成例を示す図である。 図21は、パターン投光部の他の構成例を示す図である。 図22は、パターン投光部の他の構成例を示す図である。 図23は、ステレオマッチングの原理を説明する図である。
 <適用例>
 図1は、本発明の適用例の一つである3次元計測システムの構成例を模式的に示す図である。3次元計測システム1は、画像センシングによって対象物12の3次元形状を計測するためのシステムであり、概略、センサユニット10と画像処理装置11から構成される。センサユニット10は、少なくとも、パターン光を投影する投光装置と1つ以上のカメラ(イメージセンサや撮像装置とも呼ばれる)を備えており、必要に応じて他のセンサや照明を備える場合もある。センサユニット10の出力は画像処理装置11に取り込まれる。画像処理装置11は、センサユニット10から取り込まれたデータを用いて各種の処理を行うデバイスである。画像処理装置11の処理としては、例えば、距離計測(測距)、3次元形状認識、物体認識、シーン認識などが含まれてもよい。画像処理装置11の処理結果は、例えば、ディスプレイなどの出力装置に出力されたり、外部に転送されて検査や他の装置の制御等に利用される。このような3次元計測システム1は、例えば、コンピュータビジョン、ロボットビジョン、マシンビジョンをはじめとして、幅広い分野に適用される。
 図1の構成はあくまで一例であり、3次元計測システム1の用途に応じてそのハードウェア構成は適宜設計すればよい。例えば、センサユニット10と画像処理装置11は無線で接続されてもよいし、センサユニット10と画像処理装置11が一体の装置で構成されていてもよい。また、センサユニット10と画像処理装置11をLAN又はインターネット等の広域ネットワークを介して接続してもよい。また、1つの画像処理装置11に対し複数のセンサユニット10を設けてもよいし、逆に、1つのセンサユニット10の出力を複数の画像処理装置11に提供してもよい。さらに、センサユニット10をロボットや移動体に取り付けるなどしてセンサユニット10の視点を移動可能にしてもよい。
 図2は、3次元計測システム1の機能及び処理の概要を模式的に示す図である。3次元計測システム1は、対象物12の距離を計測するための計測系として、第1の計測系21と第2の計測系22の2つを備えている。各計測系21、22の機能及び処理は、センサユニット10と画像処理装置11とが協働して実現されるものである。
 第1の計測系21は、空間符号化パターン方式によって対象物12までの奥行距離(デプス)を計測する、第1の測距手段である。第2の計測系22は、ステレオマッチング(ステレオカメラ方式とも呼ばれる)によって対象物12までの奥行距離(デプス)を計測する、第2の測距手段である。第1の計測系21と第2の計測系22で同じカメラ(つまり、同じ解像度の画像)を用いる場合、空間符号化パターン方式により得られる距離情報(第1のデプス情報)に比べて、ステレオマッチングで得られる距離情報(第2のデプス情報)の方が空間分解能が高い。したがって、本システム1は、第1の計測系21で得られる距離情報を、第2の計測系22で観測される視差を大まかに予測しステレオマッチングにおける探索範囲を絞り込む目的で補助的に利用し、第2の計測系22によって生成される距離情報を最終的な出力とする。
 続いて、図2及び図3を参照して、3次元計測システム1による計測処理の大まかな流れを説明する。
 (1)センサユニット10が、投光装置から対象物12にパターン光を投影する。図3に示すように、本システム1では、空間符号化パターン30とランダムパターン31とが合成された合成パターン32が用いられる。空間符号化パターン30は、空間符号化パターン方式による距離計測のためのパターンであり、所定サイズの単位要素300が規則的に配置されたものである。単位要素300は、1つのデプス値に対応する最小領域である。ランダムパターン31は、複数の小片(ランダム片と呼ぶ)が不規則に配置されたパターンである。
 (2)センサユニット10が、パターン光が投影された対象物12を撮影し、2枚の画像(第1画像、第2画像と呼ぶ)からなるステレオ画像ペアを取得する。この2枚の画像は、対象物12に対する視差が生ずるように、対象物12を異なる視点(視線方向)から撮影したものである。センサユニット10が複数のカメラを備えている場合には、2台のカメラで第1画像と第2画像を同時に撮影してもよい。あるいは、カメラを移動させながら連続的に撮影することで、単一のカメラで第1画像と第2画像を取得してもよい。
 (3)第1の計測系21が、第1画像を用い、空間符号化パターン方式により、対象物12の第1のデプス情報を取得する。第1の計測系21は、第1のデプス情報に基づき第1画像と第2画像の間の視差を予測し、その予測した視差の2次元空間分布を視差マップとして出力する。本明細書では、第2の計測系22のステレオマッチングで生成される視差マップと区別するため、第1の計測系21で生成される視差マップを「参考視差マップ」と呼ぶ。第1のデプス情報及び参考視差マップの空間分解能は、空間符号化パターン30の単位要素300のサイズに依存して決まる。例えば、単位要素300が第1画像において4画素×4画素のサイズとなる場合、第1のデプス情報及び参考視差マップの空間分解能は、第1画像の解像度の1/4となる。
 (4)第2の計測系22が、第1の計測系21から取得した参考視差マップを用いて、ステレオマッチングにおける対応点の探索範囲を設定する。予測視差がある程度の誤差を含むことは避けられないため、対応点の探索範囲は、その誤差範囲を包含するように設定するとよい。例えば、予測視差の値がd[画素]であり、誤差が±derr[画素]である場合には、探索範囲をd-derr-c~d+derr+cのように設定してもよい。cはマージンである。なお、画像内のすべての画素に対し個別に探索範囲を設定してもよいし、画像内での局所的な視差の変化が大きくない場合などは、画像を複数のエリアに分割してエリア単位で探索範囲を設定してもよい。
 (5)第2の計測系22が、設定された探索範囲の中から、第1画像と第2画像の間の各画素の対応点を探索する。例えば、第1画像を基準画像、第2画像を比較画像とした場合、第1画像中の画素(基準点)に画像特徴が最も近い第2画像中の画素が対応点として選ばれ、基準点と対応点の座標の差が、当該基準点における視差として求まる。第1画像中のすべての画素について対応点の探索が行われ、その探索結果から視差マップが生成される。視差マップは、各画素の座標に視差情報が関連付けられたデータである。
 (6)第2の計測系22は、三角測量の原理を用いて、視差マップの視差情報を距離情報に変換し、デプスマップ(第2のデプス情報)を生成する。第2の計測系22により得られる第2のデプス情報の空間分解能は、第1画像及び第2画像の解像度により決まる。したがって、第1の計測系21に比べて、空間分解能が高いデプス情報を得ることができる。
 従来の一般的なステレオマッチングでは、比較画像の全体から対応点の探索を行うため、高解像度の画像を用いると不可避的に処理時間が長くなってしまう。これに対し、上記構成では、予測された視差に基づき対応点の探索範囲が限定される。これにより、探索範囲を格段に狭くできるため、対応点の探索に要する時間を大幅に短縮することができる。また、ランダムパターンを合成したパターン光を用いたので、対象物表面の明暗分布の複雑さ(画像特徴の多様さ)が増す。これにより、ステレオマッチング、つまり対応点探索の成功率及び精度を向上することができる。したがって、本システム1によれば、空間分解能の高い3次元計測を、高速かつ高精度に行うことができる。
 <パターン光の説明>
 次に、図3の合成パターン32について詳しく説明する。合成パターン32は、ベースとなる空間符号化パターン30に対しランダムパターン31が重畳(合成)されたものである。1つの投光装置から合成パターン32を投影してもよいし、2つの投光装置から空間符号化パターン30とランダムパターン31を個別に投影し、対象物表面上で2つのパターン30、31を重ね合せてもよい。図3等においてパターンを白黒で描いているが、白色の部分が明部(光が照射される領域)、黒色の部分が暗部(光が照射されない領域)を表すものとする。なお、パターンは白黒(明暗)の二値である必要はなく、多値のパターンでもよい。
 (空間符号化パターン)
 図4は、空間符号化パターン30を構成する単位要素300の例を示している。単位要素300は、1つのデプス値に対応する最小領域であり、「プリミティブ」とも呼ばれる。図4に示す単位要素300は、「グリッド」と呼ばれる2×2の格子の中央に、「ビット」と呼ばれる矩形が配置された構造を有している。グリッドの種類が2つ、ビットの種類が2つであるため、グリッドとビットの組合せにより、単位要素300は4種類の値をとることができる。
 (ランダムパターン)
 ランダムパターン31は、複数のランダム片が不規則に配置されたパターンである。「不規則に配置」とは、全く規則性も再現性も無い完全にランダムな配置であってもよいし、擬似乱数を用いて決定した配置であってもよい。各ランダム片は、1つのドット(画素)又は連続する複数のドット(画素)から構成され、その形状及びサイズは固定でも可変でもよく、また1種類でも複数種類でもよい。単位要素300の領域内に、1つ以上のランダム片が付加されるとよく、各ランダム片は単位要素300内の構造(ビット、グリッド)と区別可能な輝度又は色をもつとよい。図3の例では、ランダム片と単位要素300内の構造との明暗(白黒)が反転するように、各ランダム片の輝度が設定されている。
 ランダムパターン31を付加することによって、空間符号化パターン30のみを投影した場合に比べ、ステレオマッチングの成功率及び精度の向上が期待できる。空間符号化パターン30のみでは対象物表面上に現れる明暗分布が規則性をもつため、対応点探索において不正解の対応点を選んでしまうおそれが高いのに対し、ランダムパターン31の付加により明暗分布の複雑さ(画像特徴の多様さ)が増すと、正解の対応点を検出することが容易になるからである。特に、対象物表面の画像特徴が不明りょうとなる低コントラスト条件下で、その効果が顕著となる。
 (ランダムパターンの付加量)
 図5は、ランダムパターンの付加量を変えた場合の、低コントラスト条件下でのステレオマッチングの成功率の変化を示している。横軸が、空間符号化パターン30に対するランダムパターン31の割合であり、縦軸が、ステレオマッチングの成功率(対応点探索の成功率)である。
 本明細書では、空間符号化パターン30に対するランダムパターン31の割合を指標S2/S1で表す。ここで、S1は、空間符号化パターン30の単位要素300の面積であり、S2は、単位要素300の領域内に付加されているランダム片の合計面積である。図6の例であれば、単位要素300が64画素(8画素×8画素)の正方形からなり、その中に、4つのランダム片60(1画素のランダム片が3つと、3画素のランダム片が1つ。)が付加されているので、S1=64、S2=6であり、S2/S1=0.09375となる。
 図5のグラフ50は、単位要素300がカメラの撮像素子上で4画素×4画素のサイズに結像するように設定した場合の実験結果であり、グラフ51は、単位要素300が撮像素子上で10画素×10画素のサイズに結像するように設定した場合の実験結果である。単位要素300の結像サイズは、投光装置の投影倍率、カメラのレンズ倍率、投光装置やカメラの配置(対象物からの距離)などを調整することで任意に設定することができる。図7A及び図7Bは、図6の単位要素300を対象物に投影し、低コントラスト条件下で撮影した場合に得られる画像のシミュレーションである。図7Aが4画素×4画素の結像サイズの画像であり、図7Bが10画素×10画素の結像サイズの画像である。
 図5のグラフ50、51からわかるように、ランダムパターンが付加されていない場合(S2/S1=0)にステレオマッチングの成功率は最も低く、ランダムパターンの付加量が増加するほどステレオマッチングの成功率が上昇する。本発明者らの実験によると、ランダムパターンの付加量S2/S1は、0.02より大きいとよく、0.04より大きいとさらに好ましい。
 図8は、ランダムパターンの付加量を変えた場合の、低コントラスト条件下での空間符号化パターン方式のパターン復号の成功率の変化を示している。横軸が、空間符号化パターン30に対するランダムパターン31の割合であり、縦軸が、パターン復号の成功率である。図8のグラフ80は、単位要素300がカメラの撮像素子上で4画素×4画素のサイズに結像するように設定した場合の実験結果であり、グラフ81は、単位要素300が撮像素子上で10画素×10画素のサイズに結像するように設定した場合の実験結果である。
 図8のグラフ80、81からわかるように、ランダムパターンが付加されていない場合(S2/S1=0)にパターン復号の成功率が最も高く、ランダムパターンの付加量がある閾値を超えるとパターン復号の成功率が急激に低下する。パターン復号の成功率が低いと、デプスを計算できる点、すなわち視差を予測できる点の数が少なくなる。そうなると、ステレオマッチングにおいて、対応点探索の範囲を限定できる箇所が少なくなり、その結果として、ステレオマッチングの処理時間が増大してしまう。本発明者らの実験によると、ランダムパターンの付加量S2/S1は、0.12より小さいとよく、0.1より小さいとさらに好ましい。
 以上のことから、ランダムパターンの付加量S2/S1は、少なくとも、
  0.02<S2/S1<0.12
を満足することが好ましい。この範囲に設定することで、ステレオマッチングの成功率と処理時間のバランスがとれた処理が可能となる。
 さらに、ランダムパターンの付加量S2/S1は、
  0.04<S2/S1<0.1
であることがより好ましい。この範囲に設定することで、ステレオマッチングの成功率とパターン復号の成功率の両方を実質的に最大化できる。すなわち、ステレオマッチングの精度と速度を実質的に最大化することができる。
 (ランダムパターンのサイズ)
 ランダムパターンのサイズは、空間符号化パターンの構造を変化させない程度の大きさに設定するとよい。「構造を変化させる」とは、カメラで撮影した画像からパターンを復号したときに間違った値が得られてしまうこと、又は、復号そのものに失敗すること、を意味する。
 例えば、本実施形態のような白黒の二値のパターンの場合において、単位要素300の値を表す構造(ビット、グリッドなど)のうち最も小さいものの面積をS3、単位要素300内に付加されたランダム片のうち最も大きいものの面積をS4としたときに、
  S4<S3/2
を満足するように、ランダムパターンのサイズを設定するとよい。
 図9A~図9Cに、黒色の構造90に白色のランダム片91が重なる例を示す。図9Aは構造90の例である。図9Bのように、もしランダム片91が構造90の面積の半分以上(S4≧S3/2)を占めると、白色の面積の方が広くなるため、「黒」と解釈されるべき構造90が「白」と誤って解釈されてしまう。これに対し、図9Cのように、ランダム片91のサイズが構造90のサイズの半分より小さければ(S4<S3/2)、構造90にランダム片91が重なったとしても、依然として黒色の面積の方が広いため、この構造90は「黒」と正しく判定される。
 (結像サイズ)
 本発明者らの実験によると、単位要素300の結像サイズは3画素×3画素以上であることが好ましい。単位要素300の一辺が3画素より小さくなると、単位要素300内の構造(ビット、グリッド)が解像されず、構造の明暗(白黒)が正確に判別できなくなり、パターンの復号率が著しく低下するからである。パターンの復号率の観点では、単位要素300の結像サイズはできるだけ大きい方がよい。ただし、結像サイズが大きくなるほど、空間符号化パターン方式で得られるデプス情報の空間解像度が低下するため、実用上は、3画素×3画素~10画素×10画素程度が好ましい。
 また、単位要素300内の構造の結像サイズは3/2画素×3/2画素以上であることが好ましい。構造の一辺が3/2画素より小さくなると、(例えば、構造がちょうど2つの画素にまたがる位置に結像した場合などに)構造がうまく解像されず、構造の明暗(白黒)が正確に判別できなくなり、パターンの復号率が低下するからである。なお、構造のサイズの上限は、単位要素300のサイズとの関係で決まる。例えば、単位要素300の面積をS1、構造の面積をS3としたとき、S3≦S1/4に設定するとよい。
 一方で、ランダム片の結像サイズは1/4画素×1/4画素以上であることが好ましい。ランダムパターンを画像上で認識できる信号値で撮像するには、ランダム片とその周辺の画素との信号値の差を少なくとも2digit以上にするとよい。図10のようにランダム片95が撮像素子96の画素にまたがる場合が最もパターンのコントラストが小さくなる(つまり、パターンの効果が失われる)場合である。例えば、信号値を8bit(=256digit)で出力するカメラの場合、白画素の信号値を128digitとすると、画素97に含まれるランダム片95の面積は1/64画素相当かそれより大きくする必要がある。そのためには、撮像素子96上で1/16画素(=1/4画素×1/4画素)以上にする必要がある。なお、ここでは8bit出力のカメラにおける結像サイズを例示したが、好ましい結像サイズは、カメラ(撮像素子)の仕様や性能に応じ、ランダム片とその周辺画素との信号値の差が認識可能となるように適宜設定すればよい。
 (他のパターン)
 合成パターンの他の例を説明する。図11Aは、ビットの形状を円形にした例であり、図11Bは、ビットの形状をひし形にした例である(グリッドの形状は図3の例と同じ)。いずれの場合も、これまで説明したものと同じランダムパターンを付すとよい。なお、ビットの形状は、正方形、円形、ひし形以外の任意の形状を用いてもよい。
 図12A~図12Dは、単位要素300内に存在する構造の数の違いを示している。図12Aが1個の例、図12Bが2個の例、図12Cが3個の例、図12Dが4個の例である。各図において左側が空間符号化パターンの単位要素300を示し、右側がランダムパターンが付加された合成パターンを示している。ランダムパターンの付加方法は、これまで説明したものと同じでよい。
 図13A~図13Dは、ライン(破線、ドットラインなど)を利用したパターンの例である。図13Aは、ラインが1本の例、図13Bは、ラインが2本の例、図13Cは、ラインが3本の例、図13Dは、ラインが4本の例である。各図において左側が空間符号化パターンの単位要素300を示し、右側がランダムパターンが付加された合成パターンを示している。ランダムパターンの付加方法は、これまで説明したものと同じでよい。
 図14A~図14Dは、グリッドを利用したパターンの例である。図14Aは、グリッドラインが1本の例、図14Bは、グリッドラインが2本の例、図14Cは、グリッドラインが3本の例、図14Dは、グリッドラインが4本の例である。各図において左側が空間符号化パターンの単位要素300を示し、右側がランダムパターンが付加された合成パターンを示している。ランダムパターンの付加方法は、これまで説明したものと同じでよい。
 図12A~図12D、図13A~図13D、図14A~図14Dでは、構造が配置されている領域以外の領域(背景領域とも呼ぶ)にランダム片が付加されている。このような配置によれば、ランダム片がパターン復号に悪影響を与える可能性を小さくできるという利点がある。もちろん、前述の例と同様、構造の上にランダム片が重なるように配置してもよい。
 図15Aは、濃淡を利用したパターンの例である。このパターンは、1周期の輝度変化からなり、輝度変化の位相によって値を表している。ランダム片は単位要素内の任意の位置に付加してよい。ただし、カメラで撮影した画像において、ランダム片が周囲の輝度変化パターンから区別可能である必要がある。そこで、例えば、ランダム片とその周囲との明暗差が2digit以上になるように、ランダム片の輝度を設定するとよい。
 図15Bは、波長(色)を利用したパターンの例である。図示の関係で図15Bは白黒で描画しているが、実際には、カラフルなパターンである。このパターンは、1周期の波長変化からなり、波長変化の位相によって値を表している。ランダム片は単位要素内の任意の位置に付加してよい。ただし、カメラで撮影した画像において、ランダム片が周囲の波長変化パターンから区別可能である必要がある。そこで、例えば、ランダム片とその周囲との明暗差が2digit以上になるように、ランダム片の輝度を設定するとよい。あるいは、所定の波長差がつくように、ランダム片の波長(色)を設定してもよい。
 図16Aは、偏光を利用したパターンの例である。このパターンは、明暗(白黒)の代わりに、縦方向の直線偏光160と横方向の直線偏光161とを組み合わせたものである。例えば、縦方向の直線偏光を透過する偏光子162をもったカメラで図16Aのパターンを撮影すると、図16Bのような画像が得られる。すなわち、縦方向の偏光成分は透過され画像上は白画素になり、横方向の偏光成分はカットされ画像上は黒画素になる。ランダムパターンを付加する場合には、ランダム片とその周囲との偏光方向が相違するように、ランダム片の偏光方向を設定するとよい。
 <実施形態>
 図17を参照して、本発明の実施形態に係る3次元計測システム1の構成例について説明する。図17は、3次元計測システム1の機能ブロック図である。
 (センサユニット)
 センサユニット10は、第1カメラ101、第2カメラ102、パターン投光部103、照明部104、画像転送部105、駆動制御部106を有する。
 第1カメラ101と第2カメラ102は、いわゆるステレオカメラを構成するカメラ対であり、所定の距離だけ離れて配置されている。2つのカメラ101、102で同時に撮影を行うことで、異なる視点から撮影した画像ペアを得ることができる(第1カメラ101の画像を第1画像、第2カメラ102の画像を第2画像と呼ぶ)。2つのカメラ101、102は、互いの光軸が交差し、且つ、水平ライン(又は垂直ライン)が同一平面上にくるように、配置されるとよい。このような配置をとることで、エピポーラ線が画像の水平ライン(又は垂直ライン)と平行になるため、ステレオマッチングにおける対応点を同じ位置の水平ライン(又は垂直ライン)内から探索すればよく、探索処理の簡易化が図れるからである。なお、カメラ101、102としては、モノクロのカメラを用いてもよいし、カラーのカメラを用いてもよい。
 パターン投光部103は、空間符号化パターン方式の測距で用いるパターン光を対象物12に投影するための投光装置であり、プロジェクタとも呼ばれる。図18にパターン投光部103の構成例を模式的に示す。パターン投光部103は、例えば、光源部180、導光レンズ181、パターン生成部182、投写レンズ183などから構成される。光源部180としては、LED、レーザー、VCSEL(Vertical cavity Surface-emitting Laser)などを用いることができる。導光レンズ181は光源部180からパターン生成部182に光を導くための光学素子であり、レンズ又はガラスロッドなどを用いることができる。パターン生成部182は、合成パターンを生成する部材ないし装置であり、フォトマスク、回折光学素子(例えばDOE(Diffractive Optical Element))、光変調素子(例えば、DLP(Digital Light Processing)、LCD(Liquid Crystal Display)、LCoS(Liquid Crystal on Silicon)、MEMS(Micro Electro Mechanical Systems))などを用いることができる。投写レンズ183は生成されたパターンを拡大し投写する光学素子である。
 照明部104は、一般的な可視光画像を撮影するために用いられる均一照明である。例えば白色LED照明などが用いられる。もしくはアクティブ投光と同じ波長帯の照明でもよい。
 画像転送部105は、第1カメラ101で撮影された第1画像のデータ、及び、第2カメラ102で撮影された第2画像のデータを、画像処理装置11へ転送する。画像転送部105は、第1画像と第2画像を別々の画像データとして転送してもよいし、第1画像と第2画像を繋ぎ合わせてサイドバイサイド画像を生成し単一の画像データとして転送してもよい。駆動制御部106は、第1カメラ101、第2カメラ102、パターン投光部103、及び、照明部104を制御するユニットである。なお、画像転送部105と駆動制御部106は、センサユニット10側ではなく、画像処理装置11側に設けてもよい。
 (画像処理装置)
 画像処理装置11は、画像取得部110、パターン復号部111、視差予測部112、前処理部113、探索範囲設定部115、対応点探索部116、視差マップ後処理部117、デプスマップ生成部118を有する。
 画像取得部110は、センサユニット10から必要な画像データを取り込む機能を有する。画像取得部110は、パターン復号部111に第1画像を送り、前処理部113に第1画像と第2画像からなるステレオ画像ペアを送る。
 パターン復号部111は、空間符号化パターン方式によって、第1画像から距離情報(第1のデプス情報)を取得する機能をもつ。空間符号化パターン方式は、用いる単位要素のサイズに依存して空間分解能が決まる。例えば、5画素×5画素の単位要素を用いる場合、距離情報の空間分解能は入力画像の1/25となる。視差予測部112は、パターン復号部111で得られた距離情報に基づき第1画像と第2画像の間の視差を予測し参考視差マップを出力する機能を有する。
 前処理部113は、第1画像と第2画像に対して、必要な前処理を行う機能を有する。探索範囲設定部115は、予測視差に基づいて対応点の探索範囲を設定する機能を有する。対応点探索部116は、第1画像と第2画像の間の対応点を探索し、その探索結果に基づき視差マップ(第2のデプス情報)を生成する機能を有する。視差マップ後処理部117は、視差マップに対して必要な後処理を行う機能を有する。デプスマップ生成部118は、視差マップの視差情報を距離情報に変換し、デプスマップを生成する機能を有する。
 画像処理装置11は、例えば、CPU(プロセッサ)、RAM(メモリ)、不揮発性記憶装置(ハードディスク、SSDなど)、入力装置、出力装置などを備えるコンピュータにより構成される。この場合、CPUが、不揮発性記憶装置に格納されたプログラムをRAMに展開し、当該プログラムを実行することによって、上述した各種の機能が実現される。ただし、画像処理装置11の構成はこれに限られず、上述した機能のうちの全部又は一部を、FPGAやASICなどの専用回路で実現してもよいし、クラウドコンピューティングや分散コンピューティングにより実現してもよい。
 本例では、第1カメラ101、パターン投光部103、画像転送部105、画像取得部110、駆動制御部106、パターン復号部111、視差予測部112によって、図2の第1の計測系21が構成されており、第1カメラ101、第2カメラ102、パターン投光部103、画像転送部105、駆動制御部106、前処理部113、探索範囲設定部115、対応点探索部116、視差マップ後処理部117、デプスマップ生成部118によって、図2の第2の計測系22が構成されている。
 (計測処理)
 図19を参照して、本実施形態の計測処理の流れを説明する。図19は、画像処理装置11により実行される処理の流れを示すフロー図である。
 ステップS400、S401において、画像取得部110が、センサユニット10から第1画像と第2画像を取得する。第1画像及び第2画像はそれぞれ、パターン投光部103から対象物12にパターン光を投影した状態で、第1カメラ101及び第2カメラ102で撮影された画像である。なお、センサユニット10からサイドバイサイド画像形式のデータが取り込まれた場合は、画像取得部110がサイドバイサイド画像を第1画像と第2画像に分割する。画像取得部110は、パターン復号部111に第1画像を送り、前処理部113に第1画像と第2画像を送る。
 ステップS402において、前処理部113が、第1画像及び第2画像に対し平行化処理(レクティフィケーション)を行う。平行化処理とは、2つの画像の間の対応点が画像中の同じ水平ライン(又は垂直ライン)上に存在するように、一方又は両方の画像を幾何変換する処理である。平行化処理によりエピポーラ線が画像の水平ライン(又は垂直ライン)と平行になるため、後段の対応点探索の処理が簡単になる。なお、センサユニット10から取り込まれる画像の平行度が十分高い場合には、ステップS402の平行化処理は省略してもよい。
 ステップS403において、前処理部113が、平行化された第1画像及び第2画像の各画素についてハッシュ特徴量を計算し、各画素の値をハッシュ特徴量に置き換える。ハッシュ特徴量は、注目画素を中心とする局所領域の輝度特徴を表すものであり、ここでは、8要素のビット列からなるハッシュ特徴量を用いる。このように、各画像の輝度値をハッシュ特徴量に変換しておくことで、後段の対応点探索における局所的な輝度特徴の類似度計算が極めて効率化される。
 ステップS404において、パターン復号部111が、第1画像を解析しパターンを復号することによって、第1画像上の複数の点における奥行方向の距離情報を取得する。
 ステップS405において、視差予測部112が、ステップS405で得られた各点の距離情報に基づき、各点を平行化された第1画像の画像座標系に射影したときの2次元座標と、同じ点を平行化された第2画像の画像座標系に射影したときの2次元座標とを計算し、2つの画像の間での座標の差を計算する。この差が予測視差である。視差予測部112は、ステップS404で距離情報が得られたすべての点についての予測視差を求め、そのデータを参考視差マップとして出力する。
 ステップS406において、探索範囲設定部115が、予測視差に基づいて、第1画像及び第2画像に対し、対応点の探索範囲を設定する。探索範囲の大きさは、予測の誤差を考慮して決定される。例えば、予測の誤差が±10画素である場合には、マージンを含めても、予測視差を中心とした±20画素程度を探索範囲に設定すれば十分と考えられる。仮に水平ラインが640画素である場合に、探索範囲を±20画素(つまり40画素)に絞り込むことができれば、水平ライン全体を探索するのに比べて探索処理を単純に1/16に削減することができる。
 ステップS407において、対応点探索部116が、画素削減後の第1画像と第2画像の間で対応点の探索を行い、各画素の視差を求める。対応点探索部116は、対応点の検出に成功した点(画素の座標)に視差情報を関連付けた視差データを生成する。この情報が視差マップである。
 ステップS408において、視差マップ後処理部117が、視差マップの修正を行う。対応点探索によって推定された視差マップには誤計測点や計測抜けなどが含まれるため、周囲の画素の視差情報に基づき誤計測点の修正や計測抜けの補完を行う。
 ステップS409において、デプスマップ生成部118が、視差マップの各画素の視差情報を3次元情報(奥行方向の距離情報)に変換し、デプスマップを生成する。このデプスマップ(3次元点群データ)は、例えば、対象物12の形状認識、物体認識などに利用される。
 <変形例>
 上記実施形態は、本発明の構成例を例示的に説明するものに過ぎない。本発明は上記の具体的な形態には限定されることはなく、その技術的思想の範囲内で種々の変形が可能である。
 図20は、パターン投光部の他の構成例を示している。図20の構成では、空間符号化パターン30を投射するための空間符号化パターン投光部200と、ランダムパターン31を投射するためのランダムパターン投光部201の2種類の投光部が設けられている。各投光部200、201から投射された2つのパターン30、31が対象物表面上で重ね合わされ、合成パターン32が形成される。このような構成でも上述した実施形態と同様の作用効果を得ることができる。
 図21は、パターン投光部の他の構成例を示している。図21の構成では、空間符号化パターン30用の光源210、導光レンズ211、パターン生成部212と、ランダムパターン31用の光源213、導光レンズ214、パターン生成部215とが設けられる。そして、ビームコンバイナー216によって2つのパターン光が合成され、投写レンズ217から合成パターン32が投影される。このような構成でも上述した実施形態と同様の作用効果を得ることができる。
 図22は、パターン投光部の他の構成例を示している。図22の構成では、第1の光源220及び第1の導光レンズ221と、第2の光源222及び第2の導光レンズ223とが設けられる。そして、ビームコンバイナー224によって2種類の光が合成され、パターン生成部225を介して投写レンズ226から合成パターン32が投影される。2種類の光源220、222としては、例えば、波長の異なる光源、偏光方向の異なる光源などを用いることができる。
 上記実施形態では、第1カメラと第2カメラの2つのカメラを用いたが、センサユニットに3つ以上のカメラを設けてもよい。ペアリングするカメラの組合せを変えて、ステレオマッチングを行い、各組合せで得られた複数の計測結果を用いて計測結果の信頼性を向上させてもよい。その結果、精度を向上させることができる。
 上記実施形態では、ステレオマッチングにハッシュ特徴量を利用したが、対応点の類似度評価には他の手法を用いてもよい。例えば、類似度の評価指標としてはSAD(Sum of Absolute Difference)、SSD(Sum of Squared Difference)、NC(Normalized Correlation)などによる左右画像の画素の類似度計算法がある。また、上記実施形態では、参考デプスマップの生成(視差の予測)とステレオマッチングとで共通するカメラの画像を用いたが、それぞれ異なる三次元計測用のカメラ画像を用いてもよい。
 <付記>
(1)対象物(12)にパターン光を投影する投光装置(103)と、
 前記対象物(12)を撮影する第1カメラ(101)と、
 前記第1カメラ(101)とは異なる視点で前記対象物(12)を撮影する第2カメラ(102)と、
 前記第1カメラ(101)から得られる第1画像及び前記第2カメラ(102)から得られる第2画像を処理することによって、前記対象物(12)の3次元情報を取得する画像処理装置(11)と、を備え、
 前記画像処理装置(11)は、
  前記第1画像を用い、空間符号化パターン方式により、第1のデプス情報を取得する第1計測手段(21、111)と、
  前記第1のデプス情報から予測される前記第1画像と前記第2画像の間の視差に基づき、ステレオマッチングにおける対応点の探索範囲を設定する設定手段(115)と、
  前記第1画像と前記第2画像を用い、前記設定された探索範囲に限定したステレオマッチングを行うことにより、前記第1のデプス情報よりも空間分解能の高い第2のデプス情報を取得する第2計測手段(22、116)と、を有し、
 前記パターン光は、1つのデプス値に対応する領域である単位要素が規則的に配置された空間符号化パターン(30)と、複数のランダム片が不規則に配置されたランダムパターン(31)と、が合成された合成パターン(32)を有する
ことを特徴とする3次元計測システム(1)。
1:3次元計測システム
10:センサユニット
11:画像処理装置
12:対象物
21:第1の計測系
22:第2の計測系

Claims (11)

  1.  対象物にパターン光を投影する投光装置と、
     前記対象物を撮影する第1カメラと、
     前記第1カメラとは異なる視点で前記対象物を撮影する第2カメラと、
     前記第1カメラから得られる第1画像及び前記第2カメラから得られる第2画像を処理することによって、前記対象物の3次元情報を取得する画像処理装置と、を備え、
     前記画像処理装置は、
      前記第1画像を用い、空間符号化パターン方式により、第1のデプス情報を取得する第1計測手段と、
      前記第1のデプス情報から予測される前記第1画像と前記第2画像の間の視差に基づき、ステレオマッチングにおける対応点の探索範囲を設定する設定手段と、
      前記第1画像と前記第2画像を用い、前記設定された探索範囲に限定したステレオマッチングを行うことにより、前記第1のデプス情報よりも空間分解能の高い第2のデプス情報を取得する第2計測手段と、を有し、
     前記パターン光は、1つのデプス値に対応する領域である単位要素が規則的に配置された空間符号化パターンと、複数のランダム片が不規則に配置されたランダムパターンと、が合成された合成パターンを有する
    ことを特徴とする3次元計測システム。
  2.  前記単位要素の面積をS1、
     前記単位要素の領域内に付加されたランダム片の合計面積をS2、
    としたときに、
     前記合成パターンは、
      0.02<S2/S1<0.12
    を満たす
    ことを特徴とする請求項1に記載の3次元計測システム。
  3.  前記合成パターンは、
      0.04<S2/S1<0.1
    を満たす
    ことを特徴とする請求項2に記載の3次元計測システム。
  4.  前記単位要素は、当該単位要素の値を表す構造を1つ以上含み、
     前記ランダム片は、前記単位要素のうち前記構造が配置されている領域以外の領域に付加される
    ことを特徴とする請求項1~3のうちいずれか一項に記載の3次元計測システム。
  5.  前記単位要素は、当該単位要素の値を表す構造を1つ以上含み、
     前記ランダム片は、前記単位要素のうち前記構造が配置されている領域に、前記構造と区別可能な輝度又は色で、付加される
    ことを特徴とする請求項1~3にうちいずれか一項に記載の3次元計測システム。
  6.  前記構造の最小面積をS3、
     前記ランダム片の最大面積をS4、
    としたときに、
     前記合成パターンは、
      S4<S3/2
    を満たす
    ことを特徴とする請求項4又は5に記載の3次元計測システム。
  7.  前記投光装置及び前記第1カメラは、前記単位要素が前記第1カメラの撮像素子上で3画素×3画素以上のサイズに結像するように設定される
    ことを特徴とする請求項1~6のうちいずれか一項に記載の3次元計測システム。
  8.  前記投光装置、前記第1カメラ、及び前記第2カメラは、前記構造が前記第1カメラ及び前記第2カメラそれぞれの撮像素子上で3/2画素×3/2画素以上のサイズに結像するように設定される
    ことを特徴とする請求項4~6のうちいずれか一項に記載の3次元計測システム。
  9.  前記投光装置、前記第1カメラ、及び前記第2カメラは、前記ランダム片が前記第1カメラ及び前記第2カメラそれぞれの撮像素子上で1/4画素×1/4画素以上のサイズに結像するように設定される
    ことを特徴とする請求項1~8のうちいずれか一項に記載の3次元計測システム。
  10.  対象物にパターン光を投影するステップと、
     前記対象物を異なる視点から撮影して、第1画像と第2画像を取得するステップと、
     前記第1画像を用い、空間符号化パターン方式により、第1のデプス情報を取得するステップと、
     前記第1のデプス情報から予測される前記第1画像と前記第2画像の間の視差に基づき、ステレオマッチングにおける対応点の探索範囲を設定するステップと、
     前記第1画像と前記第2画像を用い、前記設定された探索範囲に限定したステレオマッチングを行うことにより、前記第1のデプス情報よりも空間分解能の高い第2のデプス情報を取得するステップと、を有し、
     前記パターン光は、1つのデプス値に対応する領域である単位要素が規則的に配置された空間符号化パターンと、複数のランダム片が不規則に配置されたランダムパターンと、が合成された合成パターンを有する
    ことを特徴とする3次元計測方法。
  11.  3次元計測システムが有する1つ以上のプロセッサに、請求項10に記載の3次元計測方法の各ステップを実行させるためのプログラム。
PCT/JP2019/020355 2019-05-22 2019-05-22 3次元計測システム及び3次元計測方法 WO2020235067A1 (ja)

Priority Applications (5)

Application Number Priority Date Filing Date Title
US17/606,850 US20220222843A1 (en) 2019-05-22 2019-05-22 Three-dimensional measurement system and three-dimensional measurement method
CN201980095872.1A CN113748313B (zh) 2019-05-22 2019-05-22 三维测量系统及三维测量方法
EP19929385.3A EP3951314B1 (en) 2019-05-22 2019-05-22 Three-dimensional measurement system and three-dimensional measurement method
PCT/JP2019/020355 WO2020235067A1 (ja) 2019-05-22 2019-05-22 3次元計測システム及び3次元計測方法
JP2021519994A JP7168077B2 (ja) 2019-05-22 2019-05-22 3次元計測システム及び3次元計測方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2019/020355 WO2020235067A1 (ja) 2019-05-22 2019-05-22 3次元計測システム及び3次元計測方法

Publications (1)

Publication Number Publication Date
WO2020235067A1 true WO2020235067A1 (ja) 2020-11-26

Family

ID=73458176

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2019/020355 WO2020235067A1 (ja) 2019-05-22 2019-05-22 3次元計測システム及び3次元計測方法

Country Status (5)

Country Link
US (1) US20220222843A1 (ja)
EP (1) EP3951314B1 (ja)
JP (1) JP7168077B2 (ja)
CN (1) CN113748313B (ja)
WO (1) WO2020235067A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022137579A1 (ja) * 2020-12-24 2022-06-30 オムロン株式会社 検査システムおよび検査方法
WO2024070954A1 (ja) * 2022-09-30 2024-04-04 パナソニックIpマネジメント株式会社 距離測定装置、距離測定方法、距離測定プログラム

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7113327B1 (ja) * 2021-07-12 2022-08-05 パナソニックIpマネジメント株式会社 撮像装置
CN117146730B (zh) * 2023-10-27 2024-01-19 清华大学 全光智能计算三维感知系统及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011013706A (ja) * 2009-06-30 2011-01-20 Hitachi Ltd ステレオ画像処理装置およびステレオ画像処理方法
JP2014138691A (ja) * 2012-12-20 2014-07-31 Olympus Corp 画像処理装置、電子機器、内視鏡装置、プログラム及び画像処理方法
JP2017037189A (ja) * 2015-08-10 2017-02-16 株式会社リコー パターン照射装置、システム、操作方法、及びプログラム
WO2018139297A1 (ja) * 2017-01-27 2018-08-02 日立オートモティブシステムズ株式会社 カメラ装置

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002013918A (ja) * 2000-06-29 2002-01-18 Fuji Xerox Co Ltd 3次元画像生成装置および3次元画像生成方法
JP2006528770A (ja) * 2003-07-24 2006-12-21 コグニテンス リミテッド 対象物の3次元表面再構築の方法およびシステム
CN101509765A (zh) * 2009-03-30 2009-08-19 天津工业大学 一种用于高精度三维测量的细纹幂增立体匹配方法
FR2950157A1 (fr) * 2009-09-15 2011-03-18 Noomeo Procede de numerisation tridimensionnelle d'une surface comprenant laprojection d'un motif combine
JP6009206B2 (ja) * 2012-04-23 2016-10-19 シャープ株式会社 3次元計測装置
US20140078264A1 (en) * 2013-12-06 2014-03-20 Iowa State University Research Foundation, Inc. Absolute three-dimensional shape measurement using coded fringe patterns without phase unwrapping or projector calibration
JP6254849B2 (ja) * 2014-01-17 2017-12-27 キヤノン株式会社 画像処理装置、画像処理方法
JP6687886B2 (ja) * 2015-03-11 2020-04-28 株式会社リコー 画像処理システム、移動体制御システム、移動体装置、物体検出方法、物体検出プログラム
JP6566768B2 (ja) * 2015-07-30 2019-08-28 キヤノン株式会社 情報処理装置、情報処理方法、プログラム
US10410365B2 (en) * 2016-06-02 2019-09-10 Verily Life Sciences Llc System and method for 3D scene reconstruction with dual complementary pattern illumination
US20180347967A1 (en) * 2017-06-01 2018-12-06 RGBDsense Information Technology Ltd. Method and apparatus for generating a random coding pattern for coding structured light
KR102468897B1 (ko) * 2017-10-16 2022-11-21 삼성전자주식회사 깊이 값을 추정하는 방법 및 장치
JP6879168B2 (ja) * 2017-11-01 2021-06-02 オムロン株式会社 3次元測定装置、3次元測定方法及びプログラム

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011013706A (ja) * 2009-06-30 2011-01-20 Hitachi Ltd ステレオ画像処理装置およびステレオ画像処理方法
JP2014138691A (ja) * 2012-12-20 2014-07-31 Olympus Corp 画像処理装置、電子機器、内視鏡装置、プログラム及び画像処理方法
JP2017037189A (ja) * 2015-08-10 2017-02-16 株式会社リコー パターン照射装置、システム、操作方法、及びプログラム
WO2018139297A1 (ja) * 2017-01-27 2018-08-02 日立オートモティブシステムズ株式会社 カメラ装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
P. VUYLSTEKEA. OOSTERLINCK: "Range Image Acquisition with a Single Binary-Encoded Light Pattern", IEEE PAMI, vol. 12, no. 2, 1990, pages 148 - 164

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022137579A1 (ja) * 2020-12-24 2022-06-30 オムロン株式会社 検査システムおよび検査方法
WO2024070954A1 (ja) * 2022-09-30 2024-04-04 パナソニックIpマネジメント株式会社 距離測定装置、距離測定方法、距離測定プログラム

Also Published As

Publication number Publication date
EP3951314A1 (en) 2022-02-09
JPWO2020235067A1 (ja) 2020-11-26
US20220222843A1 (en) 2022-07-14
EP3951314B1 (en) 2023-07-19
JP7168077B2 (ja) 2022-11-09
EP3951314A4 (en) 2022-11-09
CN113748313B (zh) 2023-11-21
CN113748313A (zh) 2021-12-03

Similar Documents

Publication Publication Date Title
US11486698B2 (en) Systems and methods for estimating depth from projected texture using camera arrays
JP7168077B2 (ja) 3次元計測システム及び3次元計測方法
US10600193B2 (en) Three-dimensional measurement apparatus, three-dimensional measurement method and program
EP3531066B1 (en) Three-dimensional scanning method including a plurality of lasers with different wavelengths, and scanner
WO2019100933A1 (zh) 用于三维测量的方法、装置以及系统
WO2018161466A1 (zh) 深度图像获取系统和方法
US10782126B2 (en) Three-dimensional scanning method containing multiple lasers with different wavelengths and scanner
KR20200088357A (ko) 카메라들 및 회절 광학 엘리먼트들의 외부 교정을 위한 시스템 및 방법들
JP7078172B2 (ja) 画像処理装置及び3次元計測システム
JP7078173B2 (ja) 画像処理装置及び3次元計測システム
JP7184203B2 (ja) 画像処理装置、3次元計測システム、画像処理方法
JP6975106B2 (ja) 3次元形状計測システム、3次元形状計測方法、及び3次元形状計測プログラム
JP2020021126A (ja) 画像処理装置およびその制御方法、距離検出装置、撮像装置、プログラム
CN112750157B (zh) 一种深度图像生成方法及装置
JP2021018219A (ja) 3次元形状計測システム、3次元形状計測方法、及び3次元形状計測プログラム
CN112602118B (zh) 图像处理装置和三维测量系统
WO2023084790A1 (ja) 3次元計測システム、並びにその制御方法及び制御プログラム

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: 19929385

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2019929385

Country of ref document: EP

Effective date: 20211026

ENP Entry into the national phase

Ref document number: 2021519994

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE