WO2017163537A1 - 距離計測装置及び距離計測方法 - Google Patents

距離計測装置及び距離計測方法 Download PDF

Info

Publication number
WO2017163537A1
WO2017163537A1 PCT/JP2017/000240 JP2017000240W WO2017163537A1 WO 2017163537 A1 WO2017163537 A1 WO 2017163537A1 JP 2017000240 W JP2017000240 W JP 2017000240W WO 2017163537 A1 WO2017163537 A1 WO 2017163537A1
Authority
WO
WIPO (PCT)
Prior art keywords
distance
unit
distance measurement
image
image blur
Prior art date
Application number
PCT/JP2017/000240
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 US16/062,069 priority Critical patent/US10955235B2/en
Priority to CN201780019331.1A priority patent/CN108885098B/zh
Priority to DE112017001464.6T priority patent/DE112017001464B4/de
Priority to JP2018506790A priority patent/JP6377295B2/ja
Publication of WO2017163537A1 publication Critical patent/WO2017163537A1/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
    • 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
    • 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/2518Projection by scanning of the object
    • 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/254Projection of a pattern, viewing through a pattern, e.g. moiré
    • 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
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • G06T7/55Depth or shape recovery from multiple images
    • G06T7/571Depth or shape recovery from multiple images from focus
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C3/00Measuring distances in line of sight; Optical rangefinders
    • G01C3/10Measuring distances in line of sight; Optical rangefinders using a parallactic triangle with variable angles and a base of fixed length in the observation station, e.g. in the instrument
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C3/00Measuring distances in line of sight; Optical rangefinders
    • G01C3/10Measuring distances in line of sight; Optical rangefinders using a parallactic triangle with variable angles and a base of fixed length in the observation station, e.g. in the instrument
    • G01C3/12Measuring distances in line of sight; Optical rangefinders using a parallactic triangle with variable angles and a base of fixed length in the observation station, e.g. in the instrument with monocular observation at a single point, e.g. coincidence type
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C3/00Measuring distances in line of sight; Optical rangefinders
    • G01C3/32Measuring distances in line of sight; Optical rangefinders by focusing the object, e.g. on a ground glass screen

Definitions

  • the present invention relates to a distance measuring device and a distance measuring method for measuring a distance to a subject.
  • JP 2013-512626 A paragraphs 0009-0032, FIG. 1, FIG. 2A, FIG. 2B
  • JP-A-5-332737 page 3-5, FIG. 1
  • Patent Document 1 does not include a light projecting device that emits pattern light, the distance to a subject that does not have a point (feature point) suitable for feature extraction such as an edge is accurately determined. There is a problem that it cannot be measured.
  • Patent Document 2 since the apparatus disclosed in Patent Document 2 includes a light projecting device that emits pattern light, the distance to a subject having no feature point can be measured, but the camera cannot be focused. There is a problem that the distance to the subject at the position (position where the image blur exists) cannot be accurately measured.
  • an object of the present invention is to provide a distance measuring device and a distance measuring method capable of accurately measuring a distance to a subject regardless of whether or not an image is blurred.
  • a distance measuring apparatus includes a projection unit that projects a plurality of pattern lights onto a subject, an optical system that includes a mechanism that changes a focal length, and imaging that captures the subject via the optical system. And a plurality of pattern lights corresponding to the plurality of pattern lights by causing the projection part to sequentially project the plurality of pattern lights when the focal length of the optical system is set to a first focal length.
  • the projection unit causes the plurality of pattern lights to be obtained.
  • a first distance measuring unit that obtains a first distance that is a distance to the subject for each pixel from an image blur index value indicating a degree of the image blur, the plurality of first captured images, and the plurality of the plurality of first captured images
  • a second distance measurement unit that obtains a second distance, which is a distance to the subject, for each pixel by triangulation from the second captured image, and the first distance measurement unit has the image blur.
  • a measurement result combining unit that outputs the first distance for the determined pixel and outputs the second distance for the pixel determined to have no image blur is provided.
  • a distance measurement method for photographing a subject via the optical system a projection unit that projects a plurality of pattern lights onto the subject, an optical system that includes a mechanism for changing a focal length, and the like.
  • a distance measurement method in an apparatus including an imaging unit, wherein when the focal length of the optical system is set to a first focal length, the projection unit sequentially projects the plurality of pattern lights. Causing the imaging unit to acquire a plurality of first captured images corresponding to the plurality of pattern lights, and causing the focal length of the optical system to be set to a second focal length longer than the first focal length.
  • FIG. 1 is a block diagram showing a schematic configuration of an image processing apparatus according to Embodiment 1 of the present invention. It is a figure which shows roughly arrangement
  • (A1), (A2), (B1), (B2), (C1), (C2), (D1), (D2), (E1), (E2), (F1), and (F2) are It is a figure which shows the example of 12 types of pattern light projected by the projection part shown by FIG. (A)
  • (B) is a figure which shows the pattern light whose arrangement
  • (C) and (D) are FIG.
  • F) and (G) are pixel values (images) of a captured image obtained by imaging the object on which the pattern light in FIGS. 4 (A) and (B) is projected.
  • H) is a diagram showing a pixel value difference between FIGS. 4 (F) and 4 (G).
  • FIG. 1 shows the image blur presence flag and image blur index value flag which are output corresponding to the combination with the second determination result when set to (position) in a table format.
  • (A) And (B) is a figure which shows the example of LUT as data used in order that the 1st distance measurement part shown by FIG. 1 may obtain
  • the position numbers of the stripes constituting the pattern light (position numbers of the bright area stripe and the dark area stripe in FIGS. 3A1 and 3A2) for indicating the position on the subject on which the pattern light is projected. It is a figure which shows the calculation method.
  • FIG. 1 shows the distance measurement method which the 2nd distance measurement part shown by FIG. 1 performs based on the positional relationship of a projection part, an imaging part, and a to-be-photographed object.
  • 6 is a flowchart showing an output process of a subject distance measurement result in the image data processing unit shown in FIG. 1. It is a block diagram which shows schematic structure of the distance measuring device which concerns on Embodiment 2 of this invention.
  • FIG. 12 is a flowchart showing an output process of a subject distance measurement result in the image data processing unit shown in FIG.
  • (A) is a figure which shows the pixel position referred when determining the moving direction of the photographing unit with respect to the error occurrence area
  • (B) to (E) are pixel positions referred when determining the moving direction of the photographing unit with respect to the error generating area.
  • FIG. It is a figure which shows the movement of the position of the imaging
  • It is a hardware block diagram which shows the structure of the modification of the distance measuring device which concerns on Embodiment 1 and 2.
  • FIG. 1 is a block diagram showing a schematic configuration of a distance measuring apparatus 1 according to Embodiment 1 of the present invention.
  • the distance measuring device 1 is a device that can implement the distance measuring method according to the first embodiment. As shown in FIG. 1, the distance measuring device 1 has an image data acquisition unit (camera and light projecting device) 10 that acquires a captured image (image data) by photographing a subject (object) as a main configuration.
  • an image data acquisition unit camera and light projecting device
  • the distance to the subject is determined using the image data acquired by the image data acquisition unit 10 (for example, the luminance value of each pixel in the captured image), and distance data Zout (for example, indicating the determined distance) And an image data processing unit 20 that outputs (distance data for each pixel).
  • the image data processing unit 20 may include a display unit (liquid crystal display unit) for displaying the distance data Zout numerically or as a map indicating the distance data and an operation unit for user operation.
  • the image data acquisition unit 10 includes an optical system 11 including an optical member such as a lens or a lens group and a mechanism for changing a focal length (focal position), and an optical system 11 (
  • an imaging unit 12 that photographs a subject (via a lens) and a projection unit 13 that is a light projecting device that projects (irradiates) a plurality of pattern lights onto the subject existing in the imaging space are provided.
  • the optical system 11 may have an aperture adjustment mechanism that adjusts the aperture.
  • the image data acquisition unit 10 includes a control unit 14 that controls the entire image data acquisition unit 10 (in the first embodiment, the optical system 11, the imaging unit 12, and the projection unit 13).
  • the control unit 14 sets the focal length of the optical system 11 to the first focal length (short focal length, that is, the focal position close to the imaging unit 12) f1, and at this time, the projection unit 13 is supplied with a plurality of pattern lights.
  • the imaging unit 12 acquires a plurality of first captured images G1 corresponding to a plurality of pattern lights.
  • An example of the plurality of pattern lights is shown in FIGS. 3A1, 3A2, B1, B2, C1, C2, D1, D2, E1, and E2, which will be described later. ), (F1), and (F2).
  • the plurality of first captured image G1 corresponding to a plurality of patterned light G1 A1, G1 A2, G1 B1, G1 B2, G1 C1, G1 C2, G1 D1, G1 D2, G1 E1, G1 E2, G1 F1, Also expressed as G1 F2 .
  • control unit 14 sets the focal length of the optical system 11 to a second focal length (long focal length, that is, a focal position far from the imaging unit 12) f2 longer than the first focal length f1, and at this time
  • the projection unit 13 sequentially projects a plurality of pattern lights, and causes the imaging unit 12 to acquire a plurality of second captured images G2 corresponding to the plurality of pattern lights.
  • An example of the plurality of pattern lights is shown in FIGS. 3A1, 3A2, B1, B2, C1, C2, D1, D2, E1, and E2, which will be described later. ), (F1), and (F2).
  • the plurality of second captured image G2 corresponding to a plurality of patterned light, G2 A1, G2 A2, G2 B1, G2 B2, G2 C1, G2 C2, G2 D1, G2 D2, G2 E1, G2 E2, G2 F1, Also denoted as G2 F2 .
  • the image data processing unit 20 includes a first distance measurement unit (image blur determination unit) 21, a second distance measurement unit (triangulation unit) 22, and a measurement result synthesis unit 23.
  • the control unit 24 is provided.
  • the first distance measurement unit 21 may include a storage unit 21a such as a memory that stores information.
  • the second distance measurement unit 22 may include a storage unit 22a such as a memory that stores information.
  • the storage unit 21 a may be provided outside the first distance measurement unit 21.
  • the storage unit 22 a may be provided outside the second distance measurement unit 22.
  • the storage units 21a and 22a may be different areas of the same memory.
  • the first distance measurement unit 21 determines the presence or absence of image blur for each pixel from the plurality of first captured images G1 and the plurality of second captured images G2 received from the imaging unit 12, and the result of this determination is determined.
  • the indicated image blur presence / absence flag Qf is output.
  • the first distance measuring unit 21 outputs an image blur index value flag Qi indicating the degree of image blur.
  • the first distance measuring unit 21 acquires and outputs a first distance Zd that is a distance to the subject for each pixel from the image blur index value If.
  • the control unit 14 sets the focal length of the optical system 11 to the first focal length (short focal length, that is, the focal position close to the imaging unit 12) f1, and at this time, the projection unit 13
  • the plurality of pattern lights are sequentially projected to cause the imaging unit 12 to acquire a plurality of first captured images G1 corresponding to the plurality of pattern lights. Examples of the plurality of pattern lights are shown in FIGS. 3A1, (A2), (B1), (B2), (C1), (C2), (D1), (D2), (E1), (E2), It is shown in (F1) and (F2).
  • the normalized pixel value difference Df in the vicinity of the pixel of interest (for example, a range including a vertical 5 pixel and a horizontal 5 pixel rectangle with the pixel of interest at the center)
  • the average value of the pixel average value Sf of the target pixel in the vicinity of the target pixel is Sf_avg.
  • the first distance measurement unit 21 determines that the image blur index value If has a predetermined image blur index value If when the pixel average value Sf_avg in the vicinity of the target pixel is equal to or greater than the pixel average value threshold Ta (Sf_avg ⁇ Ta). If it is larger than Tf (If> Tf), it is determined that there is no image blur at the target pixel position, and if it is equal to or less than the image blur determination threshold Tf (If ⁇ Tf), it is determined that there is image blur.
  • the first distance measurement unit 21 obtains the image blur index value If, there is a possibility that the error (noise component) of the pixel value difference Df normalized by noise or the like of the original image may be large.
  • FIG. 5 shows the determination result when the first distance measuring unit 21 sets the focal length of the optical system 11 to the first focal position (short first focal distance f1) which is a close position.
  • Information image blurring presence / absence flag
  • the first distance measuring unit 21 performs a process of determining whether or not there is an image blur by projecting pattern light onto a subject, and a first focal position (first focal distance near the optical system 11). f1) (first setting) and the image when the focal length is set to the second focal position (second focal length f2) far from the optical system 11 (second setting). The determination at the time of the first setting and the determination at the time of the second setting are performed. The first distance measuring unit 21 determines the final determination for the combination of images by combining the determination results at the two types of focal positions.
  • the first distance measurement unit 21 outputs the subject distance Zd based on the image blur presence / absence flag Qf, the image blur index value flag Qi, and the image blur amount by combining the determination results at the two types of focus positions.
  • FIGS. 6A and 6B show examples of a look-up table (LUT) as data used by the first distance measurement unit 21 shown in FIG. 1 to obtain the subject distance from the image blur index value If.
  • LUT look-up table
  • the LUT is stored in advance in the storage unit 21a of the first distance measurement unit 21, for example.
  • the image blur index value Ifn of the image with the shorter focal distance is the image blur index value of the image with the longer focal distance. If it is greater than Iff, the first distance measuring unit 21 performs distance measurement assuming that the subject exists on the side closer to the focal length. The subject distance is obtained from the image blur index value Ifn with reference to the LUT for when the subject is present on the near side (FIG. 6A).
  • the second distance measuring unit 22 determines the value of bit0 of the pattern position number S based on the relationship between the pixel values P (A1) and P (A2).
  • the second distance measurement unit 22 sets the pattern position number to S (6-bit value), and uses the predetermined threshold value Ts, and if P (A1) + Ts ⁇ P (A2), the pattern position number S 1 is assigned to bit0, and if P (A1)> P (A2) + Ts, 0 is assigned to bit0 of pattern position number S.
  • the second distance measuring unit 22 sets a value indicating an error in the pattern position number S as an error if
  • the second distance measuring unit 22 determines the value of bit3 of the pattern position number S based on the relationship between P (D1) and P (D2).
  • the second distance measuring unit 22 assigns 1 to bit3 of the pattern position number S if P (D1) + Ts ⁇ P (D2), and the pattern position if P (D1)> P (D2) + Ts. 0 is assigned to bit 3 of number S.
  • the second distance measurement unit 22 sets a value indicating an error in the pattern position number S as an error if
  • the second distance measuring unit 22 determines the value of bit 5 of the pattern position number S based on the relationship between P (F1) and P (F2).
  • the second distance measuring unit 22 assigns 1 to bit 5 of the pattern position number S if P (F1) + Ts ⁇ P (F2), and the pattern position if P (F1)> P (F2) + Ts. 0 is assigned to bit 5 of number S.
  • the second distance measuring unit 22 sets a value indicating an error in the pattern position number S as an error if
  • a second look-up table (LUT) for associating the horizontal coordinate of the subject on the image with the angle ⁇ is prepared in the storage unit 22a in advance, and the angle ⁇ is obtained by referring to it.
  • the distance z to the subject from the values of the angle ⁇ , the angle ⁇ , and the baseline length L is calculated by the following equation (4).
  • z L / (tan ⁇ + tan ⁇ ) (4) Note that the above processing is performed on images of two types of focal positions f1 and f2, and distances corresponding to the images are obtained.
  • a distance z calculated using an image having a focal position closer to the optical system 11 is denoted as Zn, and the focal position is determined from the optical system 11.
  • the distance z calculated using the image of the far side is denoted as Zf.
  • FIG. 10 is a flowchart showing processing performed by the measurement result synthesis unit 23 of the image data processing unit 20.
  • the measurement result synthesis unit 23 includes the subject distance Zd obtained based on the image blur presence / absence flag Qf, the image blur index value flag Qi, and the image blur amount output from the first distance measurement unit 21, and the second distance. Based on the subject distances Zn and Zf indicated by the two types of distance information calculated by the measurement unit 22, an output signal (a signal indicating the subject distance or a signal indicating an error) Zout is determined for each pixel.
  • step ST5 When the determination in step ST5 is NO (Qi ⁇ 1) (Ifn ⁇ Iff, that is, when the image blur of the image with the longer focal distance is small), the measurement result synthesis unit 23 outputs the output signal Zout as the output signal Zout.
  • ⁇ 1-3 Effect In conventional distance measurement by distance measurement by triangulation, accurate distance information could not be obtained for a region where there is image blur in a captured image.
  • the distance Zd obtained based on the amount of image blur is output as the subject distance Zout for the region where there is image blur.
  • the distance Zn or the distance Zf calculated by distance measurement by triangulation is output as the subject distance Zout for the area without blur. For this reason, according to the distance measuring device 1 and the distance measuring method according to Embodiment 1, the distance to the subject can be accurately measured regardless of the presence or absence of image blur.
  • Embodiment 2 ⁇ 2-1 Configuration
  • the projection unit 13 and the imaging unit 12 are fixed at one position, and the distance data Zout is obtained by combining the distance measurement using the image blur amount and the distance measurement by triangulation.
  • An apparatus and method for outputting have been described.
  • an area where the pattern light does not hit the subject is a blind spot. There are things you can do.
  • the subject distance may not be accurately measured even using the distance measuring apparatus 1 and method according to the first embodiment.
  • FIG. 11 is a block diagram showing a schematic configuration of the distance measuring apparatus 2 according to Embodiment 2 of the present invention.
  • the distance measuring device 2 is a device that can implement the distance measuring method according to the second embodiment.
  • the same or corresponding components as those shown in FIG. 1 are denoted by the same reference numerals as those in FIG.
  • the distance measuring apparatus 2 includes a camera arm unit 15 as a moving and rotating mechanism in addition to the optical system 11, the imaging unit 12, the projection unit 13, the control unit 14, and the image data processing unit 20. .
  • the optical system 11, the imaging unit 12, and the projection unit 13 are attached to the same support member to constitute a photographing unit (camera) 10b.
  • the camera arm unit 15 is an arm extending from a fixed reference position, and the photographing unit 10b according to the second embodiment is attached to the tip.
  • the camera arm unit 15 is controlled by the control unit 14 and used to change the position of the photographing unit 10b with respect to the subject.
  • the camera arm unit 15 may be either a mechanism whose position and angle can be changed by a user, or a mechanism whose position and angle can be changed by a driving force generation mechanism such as a motor and a driving force transmission mechanism such as a gear. Good.
  • the distance measuring apparatus 2 first performs distance measurement (first distance measurement) by a combination of distance measurement by image blur and distance measurement by triangulation, and then a camera arm.
  • the unit 15 is controlled to move the position of the photographing unit 10b to measure the distance after the second time.
  • Case A a case where the corresponding portion R0 is a blind spot of the projection light (case A1), and the subject has low reflectivity or a material having a metallic luster, so that diffuse reflection hardly occurs, and the projection light reaches. However, it is classified as a case (case A2) in which the component of the reflected light toward the imaging unit 12 is weak.
  • (Method 1) extend the exposure time (time during which the shutter is opened in the imaging unit 12), (Method 2) increase the aperture of the aperture in the optical system 11, (Method 3) There is a method of increasing the sensor gain of the image sensor in the unit 12.
  • a control unit (not shown) of the image data processing unit 20 performs control with priority in the order of, for example, (Method 1), (Method 2), and (Method 3) within a range that can be set based on system constraints. .
  • (Method 1) is given the highest priority is that there is no disadvantage to the captured image by extending the exposure time on the premise that the subject does not move during shooting, whereas if the aperture of the aperture is increased, the imaging unit 12 This is because the depth of field becomes shallow and the captured image tends to be blurred.
  • the reason why the priority of (Method 3) is low is that when the sensor gain is increased, the noise of the captured image by the imaging unit 12 increases, and the magnitude relationship between the captured images may not be correctly determined. Because it becomes high.
  • the captured image is darkened and photographed.
  • (Method 4) shortening the exposure time (time during which the shutter is opened in the imaging unit 12), (Method 5) lowering the aperture of the diaphragm in the optical system 11, (Method 6) imaging
  • a control unit (not shown) of the image data processing unit 20 performs control in the order of (Method 6), (Method 5), and (Method 4) within a possible range based on system constraints.
  • Locations where the error is not resolved even when the image is taken while changing the brightness of the image may be locations where the pattern light does not reach (dead spots), so the distance of the second and subsequent times by moving the position of the imaging unit 10b Measure.
  • the distance measurement results on the upper and lower sides of the error occurrence area are compared, and the distance measurement results on the left and right sides of the error occurrence area are compared.
  • a group of error occurrence positions continuous in the vertical direction and the horizontal direction is extracted as an error occurrence area.
  • FIG. 13A is a diagram showing a pixel position to be referred to when determining the moving direction of the photographing unit 10b with respect to the error occurrence region.
  • FIGS. 13B to 13E show the error occurrence shown in FIG. It is a figure which shows the pixel position referred when determining the moving direction of the imaging
  • the pixel position (the pixel in the bold line) that satisfies the condition that the immediately lower side is the error occurrence region is set.
  • the average value of the distance measurement results at each pixel position is obtained.
  • the control unit 14 changes the position of the image capturing unit 10b and the image capturing direction of the image capturing unit 12 as described below, where M is a predetermined distance difference threshold Tz, the moving distance and rotation angle of the image capturing unit 10b (the image capturing unit 10b is changed) Rotate).
  • the photographing unit 10b when Zout_u> Zout_d + Tz, the photographing unit 10b is moved upward, and the photographing direction of the imaging unit 12 of the photographing unit 10b is changed downward by M degrees (for example, an angle corresponding to the moving distance) (the photographing unit 10b is changed). Rotate). Further, when Zout_u + Tz ⁇ Zout_d, the photographing unit 10b is moved downward, and the photographing direction of the imaging unit 12 of the photographing unit 10b is changed upward by M degrees (the photographing unit 10b is rotated). When
  • the exposure time control when the photographing unit 10b is moved is set to the same setting as that at the first distance measurement, and in the same way as at the first distance measurement according to the occurrence of the measurement error at the position after the movement. Take a picture with settings to brighten or darken the image.
  • the moving positions of the photographing unit 10b with respect to all error occurrence areas are listed in advance, and overlapping photographing is performed.
  • the movement position and the rotation of the photographing unit 10b and the distance measurement may be performed after combining the movement positions of the unit 10b into one.

Abstract

距離計測装置(1)は、光学系(11)を第1の焦点距離に設定したときに撮像部(12)にパターン光に対応する複数の第1の撮像画像を取得させ、光学系(11)を第2の焦点距離に設定したときに、撮像部(12)にパターン光に対応する第2の撮像画像を取得させる制御部(14)と、画像ぼけの有無を判定し、画像ぼけの程度を示す画像ぼけ指標値から被写体までの第1の距離を取得する第1の距離計測部(21)と、三角測量によって被写体までの第2の距離を取得する第2の距離計測部(22)と、第1の距離計測部(21)で画像ぼけが有ると判定された画素については第1の距離(Zd)を出力し、画像ぼけが無いと判定された画素については第2の距離(Zn又はZf)を出力する計測結果合成部(23)とを備える。

Description

距離計測装置及び距離計測方法
 本発明は、被写体までの距離を計測する距離計測装置及び距離計測方法に関する。
 従来、カメラの撮像部によって得られた撮像画像(画像データ)のぼけ量を用いて、被写体(物体)までの距離(被写体距離)を計測する距離計測装置が知られている(例えば、特許文献1参照)。また、投光装置によってパターン光が照射されている被写体(被測定物体)をカメラで撮影して得られた撮像画像(画像データ)に基づいて被測定物体の形状を計測する装置が知られている(例えば、特許文献2参照)。
特表2013-512626号公報(段落0009-0032、図1、図2A、図2B) 特開平5-332737号公報(第3-5頁、図1)
 しかしながら、特許文献1に示される装置は、パターン光を照射する投光装置を備えていないので、エッジなどのような特徴抽出に適した点(特徴点)を持たない被写体までの距離を正確に計測することができないという問題がある。
 また、特許文献2に示される装置は、パターン光を照射する投光装置を備えているので、特徴点を持たない被写体までの距離を計測することができるが、カメラの焦点を合わせることができない位置(画像ぼけが存在する位置)にある被写体までの距離を正確に計測することができないという問題がある。
 そこで、本発明は、画像ぼけの有無にかかわらず、被写体までの距離を正確に計測することができる距離計測装置及び距離計測方法を提供することを目的とする。
 本発明の一態様に係る距離計測装置は、被写体に複数のパターン光を投写する投写部と、焦点距離を変更する機構を備えた光学系と、前記光学系を介して前記被写体を撮影する撮像部と、前記光学系の前記焦点距離を第1の焦点距離に設定させたときに、前記投写部に前記複数のパターン光を順次投写させて前記撮像部に前記複数のパターン光に対応する複数の第1の撮像画像を取得させ、及び、前記光学系の前記焦点距離を前記第1の焦点距離よりも長い第2の焦点距離に設定させたときに、前記投写部に前記複数のパターン光を順次投写させて前記撮像部に前記複数のパターン光に対応する複数の第2の撮像画像を取得させる制御部と、前記複数の第1の撮像画像及び前記複数の第2の撮像画像から、画素ごとに画像ぼけの有無を判定し、前記画像ぼけの程度を示す画像ぼけ指標値から、画素ごとに前記被写体までの距離である第1の距離を取得する第1の距離計測部と、前記複数の第1の撮像画像及び前記複数の第2の撮像画像から、三角測量によって画素ごとに前記被写体までの距離である第2の距離を取得する第2の距離計測部と、前記第1の距離計測部で前記画像ぼけが有ると判定された画素については前記第1の距離を出力し、前記画像ぼけが無いと判定された画素については前記第2の距離を出力する計測結果合成部とを備えたことを特徴としている。
 本発明の他の態様に係る距離計測方法は、被写体に複数のパターン光を投写する投写部と、焦点距離を変更する機構を備えた光学系と、前記光学系を介して前記被写体を撮影する撮像部とを備えた装置における、距離計測方法であって、前記光学系の前記焦点距離を第1の焦点距離に設定させたときに、前記投写部に前記複数のパターン光を順次投写させて前記撮像部に前記複数のパターン光に対応する複数の第1の撮像画像を取得させる工程と、前記光学系の前記焦点距離を前記第1の焦点距離よりも長い第2の焦点距離に設定させたときに、前記投写部に前記複数のパターン光を順次投写させて前記撮像部に前記複数のパターン光に対応する複数の第2の撮像画像を取得させる工程と、前記複数の第1の撮像画像及び前記複数の第2の撮像画像から、画素ごとに画像ぼけの有無を判定し、前記画像ぼけの程度を示す画像ぼけ指標値から、画素ごとに前記被写体までの距離である第1の距離を取得する工程と、前記複数の第1の撮像画像及び前記複数の第2の撮像画像から、三角測量によって画素ごとに前記被写体までの距離である第2の距離を取得する工程と、前記第1の距離を取得する前記工程で前記画像ぼけが有ると判定された画素については前記第1の距離を出力し、前記画像ぼけが無いと判定された画素については前記第2の距離を出力する工程とを備えたことを特徴としている。
 本発明によれば、画像ぼけの有無にかかわらず、被写体までの距離を正確に計測することができる。
本発明の実施の形態1に係る画像処理装置の概略構成を示すブロック図である。 図1に示される光学系、撮像部、及び投写部の配置を概略的に示す図である。 (A1)、(A2)、(B1)、(B2)、(C1)、(C2)、(D1)、(D2)、(E1)、(E2)、(F1)、及び(F2)は、図1に示される投写部によって投写される12種類のパターン光の例を示す図である。 (A)及び(B)は、明部領域のストライプと暗部領域のストライプの配列順が互いに逆順であるパターン光を示す図であり、(C)及び(D)は、図4(A)及び(B)のパターン光が投写された物体を撮像して得られた撮像画像の画素値(画像ぼけが無いとき)を示す図であり、(E)は、図4(C)及び(D)の画素値差分を示す図であり、(F)及び(G)は、図4(A)及び(B)のパターン光が投写された物体を撮像して得られた撮像画像の画素値(画像ぼけが有るとき)を示す図であり、(H)は、図4(F)及び(G)の画素値差分を示す図である。 図1に示される第1の距離計測部が、光学系の焦点距離を近い位置(第1の位置)に設定したときにおける第1の判定結果と光学系の焦点距離を遠い位置(第2の位置)に設定したときにおける第2の判定結果との組合せに対応して、出力する画像ぼけ有無フラグ及び画像ぼけ指標値フラグを表形式で示す図である。 (A)及び(B)は、図1に示される第1の距離計測部が、画像ぼけ指標値から被写体距離を求めるために使用するデータとしてのLUTの例を示す図である。 パターン光が投写された被写体上の位置を示すための、パターン光を構成するストライプの位置番号(図3(A1)及び(A2)の明部領域のストライプと暗部領域のストライプの位置番号)の算出方法を示す図である。 パターン光が投写された被写体上の位置とパターン光を構成するストライプの位置番号(図3(A1)及び(A2)の明部領域のストライプと暗部領域のストライプの位置番号)との関係を示す図である。 図1に示される第2の距離計測部が、投写部、撮像部、及び被写体の位置関係に基づいて行う距離計測方法を示す図である。 図1に示される画像データ処理部における被写体距離の計測結果の出力処理を示すフローチャートである。 本発明の実施の形態2に係る距離計測装置の概略構成を示すブロック図である。 図11に示される画像データ処理部における被写体距離の計測結果の出力処理を示すフローチャートである。 (A)は、エラー発生領域に対する撮影ユニットの移動方向決定時に参照する画素位置を示す図であり、(B)から(E)は、エラー発生領域に対する撮影ユニットの移動方向決定時に参照する画素位置を示す図である。 図11に示される光学系、撮像部、及び投写部を含む撮影ユニットの位置の移動を示す図である。 実施の形態1及び2に係る距離計測装置の変形例の構成を示すハードウェア構成図である。
《1》実施の形態1
《1-1》構成
 図1は、本発明の実施の形態1に係る距離計測装置1の概略構成を示すブロック図である。距離計測装置1は、実施の形態1に係る距離計測方法を実施することができる装置である。図1に示されるように、距離計測装置1は、主要な構成として、被写体(物体)を撮影することで撮像画像(画像データ)を取得する画像データ取得部(カメラ及び投光装置)10と、画像データ取得部10で取得された画像データ(例えば、撮像画像における各画素の輝度値)を用いて被写体までの距離(被写体距離)を求め、求められた距離を示す距離データZout(例えば、画素ごとの距離データ)を出力する画像データ処理部20とを備えている。画像データ処理部20は、距離データZoutを数値で、又は、距離データを示すマップとして表示するための表示部(液晶表示部)及びユーザー操作のための操作部を備えてもよい。
 図1に示されるように、画像データ取得部10は、レンズ又はレンズ群などの光学部材と焦点距離(焦点位置)を変更する機構とを備えた光学系11と、光学系11を介して(例えば、レンズを介して)被写体を撮影する撮像部12と、撮像空間内に存在する被写体に複数のパターン光を投写(照射)する投光装置である投写部13とを備えている。また、光学系11は、絞りを調節する絞り調節機構を有してよい。また、画像データ取得部10は、画像データ取得部10の全体(実施の形態1においては、光学系11、撮像部12、及び投写部13)を制御する制御部14を備えている。
 制御部14は、光学系11の焦点距離を第1の焦点距離(短い焦点距離、すなわち、撮像部12に近い焦点位置)f1に設定させ、このときに、投写部13に複数のパターン光を順次投写させて撮像部12に複数のパターン光に対応する複数の第1の撮像画像G1を取得させる。複数のパターン光の一例は、後述する図3(A1)、(A2)、(B1)、(B2)、(C1)、(C2)、(D1)、(D2)、(E1)、(E2)、(F1)、及び(F2)に示される。複数のパターン光に対応する複数の第1の撮像画像G1は、G1A1,G1A2,G1B1,G1B2,G1C1,G1C2,G1D1,G1D2,G1E1,G1E2,G1F1,G1F2とも表記される。
 また、制御部14は、光学系11の焦点距離を第1の焦点距離f1よりも長い第2の焦点距離(長い焦点距離、すなわち、撮像部12から遠い焦点位置)f2に設定させ、このときに、投写部13に複数のパターン光を順次投写させて撮像部12に複数のパターン光に対応する複数の第2の撮像画像G2を取得させる。複数のパターン光の一例は、後述する図3(A1)、(A2)、(B1)、(B2)、(C1)、(C2)、(D1)、(D2)、(E1)、(E2)、(F1)、及び(F2)に示される。複数のパターン光に対応する複数の第2の撮像画像G2は、G2A1,G2A2,G2B1,G2B2,G2C1,G2C2,G2D1,G2D2,G2E1,G2E2,G2F1,G2F2とも表記される。
 図1に示されるように、画像データ処理部20は、第1の距離計測部(画像ぼけ判定部)21と、第2の距離計測部(三角測量部)22と、計測結果合成部23と、制御部24とを備えている。第1の距離計測部21は、情報を記憶するメモリなどの記憶部21aを有してもよい。第2の距離計測部22は、情報を記憶するメモリなどの記憶部22aを有してもよい。記憶部21aは、第1の距離計測部21の外部に備えられてもよい。記憶部22aは、第2の距離計測部22の外部に備えられてもよい。記憶部21aと22aとは、同じメモリの異なる領域であってもよい。
 第1の距離計測部21は、撮像部12から受け取った複数の第1の撮像画像G1及び複数の第2の撮像画像G2から、画素ごとに画像ぼけの有無を判定し、この判定の結果を示す画像ぼけ有無フラグQfを出力する。また、第1の距離計測部21は、画像ぼけの程度を示す画像ぼけ指標値フラグQiを出力する。さらに、第1の距離計測部21は、画像ぼけ指標値Ifから、画素ごとに被写体までの距離である第1の距離Zdを取得して出力する。
 第2の距離計測部22は、撮像部12から受け取った複数の第1の撮像画像G1及び複数の第2の撮像画像G2から、三角測量によって画素ごとに被写体までの距離である第2の距離Zn,Zfを取得する。第2の距離Znは、光学系11の焦点距離を第1の焦点距離f1(光学系11に近い焦点位置)に設定したときにおける複数の第1の撮像画像G1から三角測量によって計算された距離である。第2の距離Zfは、光学系11の焦点距離を第2の焦点距離f2(光学系11から遠い焦点位置)に設定したときにおける複数の第2の撮像画像G2から三角測量によって計算された距離である。
 計測結果合成部23は、第1の距離計測部21で画像ぼけが有ると判定された画素(Qf=1)については出力値Zoutとして第1の距離Zdを出力し、画像ぼけが無いと判定された画素(Qf=0)については出力値Zoutとして第2の距離Zf又はZnを出力する。なお、計測結果合成部23は、第1の距離計測部21における判定結果がエラーである画素(Qf=-1)については、出力値Zoutとしてエラーを示すデータを出力する。
 図2は、図1の光学系11、撮像部12、及び投写部13の配置を概略的に示す図である。図2に示されるように、距離計測装置1の画像データ取得部10は、投写部13により撮像空間JS内の被写体OJ1,OJ2に向けて、交互に並ぶ明部領域(投写部13からの光が照射される領域)のストライプと明部領域よりも暗い暗部領域(投写部13からの光が照射されない領域)のストライプとから構成される(すなわち、明るいストライプと暗いストライプから構成される)パターン光13aを投写し、パターン光13aが投写されている被写体OJ1,OJ2を、光学系11を通して撮像部12で撮影する。
 図3(A1)、(A2)、(B1)、(B2)、(C1)、(C2)、(D1)、(D2)、(E1)、(E2)、(F1)、及び(F2)は、図1に示される投写部13によって投写される12種類のパターン光13aの例、すなわち、明部領域(図における網掛け領域)のストライプと暗部領域(図における白い領域)のストライプとが配列方向(図における横方向)に交互に並ぶパターン光の例を示す図である。パターン光13aの例は、図示の例に限定されず、パターン光13aの種類の数も12種類に限定されない。
 図3(A1)、(A2)は、明部領域のストライプの配列方向の幅が最も狭いパターン光を示す。図3(B1)、(B2)のパターン光のストライプの幅は、図3(A1)、(A2)のパターン光のストライプの幅の2倍である。図3(C1)、(C2)のパターン光のストライプの幅は、図3(B1)、(B2)のパターン光のストライプの幅の2倍である。図3(D1)、(D2)のパターン光のストライプの幅は、図3(C1)、(C2)のパターン光のストライプの幅の2倍である。図3(E1)、(E2)のパターン光のストライプの幅は、図3(D1)、(D2)のパターン光のストライプの幅の2倍である。図3(F1)、(F2)のパターン光のストライプの幅は、図3(E1)、(E2)のパターン光のストライプの幅の2倍である。
 図3(A1)のパターン光における明部領域のストライプと暗部領域のストライプとを入れ替える(逆にする)ことによって得られたパターン光が、図3(A2)のパターン光である。図3(B1)のパターン光における明部領域のストライプと暗部領域のストライプとを入れ替える(逆にする)ことによって得られたパターン光が、図3(B2)のパターン光である。図3(C1)のパターン光における明部領域のストライプと暗部領域のストライプとを入れ替える(逆にする)ことによって得られたパターン光が、図3(C2)のパターン光である。図3(D1)のパターン光における明部領域のストライプと暗部領域のストライプとを入れ替える(逆にする)ことによって得られたパターン光が、図3(D2)のパターン光である。図3(E1)のパターン光における明部領域のストライプと暗部領域のストライプとを入れ替える(逆にする)ことによって得られたパターン光が、図3(E2)のパターン光である。図3(F1)のパターン光における明部領域のストライプと暗部領域のストライプとを入れ替える(逆にする)ことによって得られたパターン光が、図3(F2)のパターン光である。
《1-2》動作
 制御部14は、光学系11の焦点距離を第1の焦点距離(短い焦点距離、すなわち、撮像部12に近い焦点位置)f1に設定させ、このときに、投写部13に複数のパターン光を順次投写させて撮像部12に複数のパターン光に対応する複数の第1の撮像画像G1を取得させる。複数のパターン光の一例は、図3(A1)、(A2)、(B1)、(B2)、(C1)、(C2)、(D1)、(D2)、(E1)、(E2)、(F1)、及び(F2)に示される。
 また、制御部14は、光学系11の焦点距離を第1の焦点距離f1よりも長い第2の焦点距離(長い焦点距離、すなわち、撮像部12から遠い焦点位置)f2に設定させ、このときに、投写部13に複数のパターン光を順次投写させて撮像部12に複数のパターン光に対応する複数の第2の撮像画像G2を取得させる。複数のパターン光の一例は、図3(A1)、(A2)、(B1)、(B2)、(C1)、(C2)、(D1)、(D2)、(E1)、(E2)、(F1)、及び(F2)に示される。
 このように、実施の形態1においては、制御部14は、光学系11に2種類の焦点距離(焦点位置)f1及びf2のいずれかを設定させる制御と、投写部13に複数種類のパターン光を順次投写させる制御と、パターン光の種類の切り替えと同期して撮像部12のシャッターの動作の制御(すなわち、撮影タイミングの制御)とを行うことで、画像データ取得部10に、複数のパターン光の各々について、パターン光投写時の画像を撮影させる。実施の形態1に係る距離計測装置1は、12種類のパターン画像を2種類の焦点位置で撮影するため、合計24枚の撮像画像から画素ごとに被写体距離を求める。
 図4(A)及び(B)は、明部領域のストライプと暗部領域のストライプの配列順が互いに逆順であるパターン光を示す図である。図4(C)及び(D)は、図4(A)及び(B)のパターン光が投写された物体を撮像して得られた撮像画像の画素値(画像ぼけが無いとき)を示す図であり、図4(E)は、図4(C)及び(D)の画素値差分Dfを示す図である。図4(F)及び(G)は、図4(A)及び(B)のパターン光が投写された物体を撮像して得られた撮像画像の画素値(画像ぼけが有るとき)を示す図であり、図4(H)は、図4(F)及び(G)の画素値差分Dfを示す図である。
 第1の距離計測部21は、互いに明部領域と暗部領域とが逆である1対のパターン光に対する撮像画像の差分である画素値差分Dfに基づいて、撮像画像に画像ぼけが有るか無いかを、注目画素を含む局所領域毎に判定する。この判定に使用されるパターン光は、例えば、1本のストライプの幅が最も狭いもの、すなわち、図3(A1)、(A2)から(F1)、(F2)のパターンを用いる場合には、図3(A1)と図3(A2)のパターン光である。また、第1の距離計測部21は、2種類の焦点位置f1,f2で撮影した画像のそれぞれに対して、処理を行う。
 パターン光が投写された被写体上の明るさ(パターンの明るさ)は、被写体の反射率によって異なるため、画素毎に画素値で正規化した画像ぼけ指標値を求める。すなわち、ある(任意の)画素位置Rの画素値をP(A1)、P(A2)とする。P(A1)は、パターン光A1(図3(A1)に示される)を投写したときの、画素位置Rの画素値を示し、P(A2)は、パターン光A2(図3(A2)に示される)を投写したときの、同じ画素位置Rの画素値を示し、Dfは、同じ画素位置Rにおける正規化された画素値差分Dfを示す。画素位置Rにおける画素値差分Dfは、式(1)で表わされ、画素位置Rにおける画素平均値Sfは式(2)で表される。
Df={P(A1)-P(A2)}/{(P(A1)+P(A2))/2}
                              (1)
Sf=(P(A1)+P(A2))/2            (2)
 ある注目画素の画像ぼけ指標値Ifを求める場合には、注目画素近傍(例えば、注目画素を中心として、縦5画素で横5画素の矩形に含まれる範囲)の正規化された画素値差分Dfの最大値Dfmaxと最小値Dfminの差分(Dfmax-Dfmin)を、画像ぼけ指標値Ifとする。すなわち、画像ぼけ指標値Ifは次式(3)で表される。
If=Dfmax-Dfmin               (3)
 また、注目画素の画素平均値Sfの注目画素近傍における平均値を、Sf_avgとする。
 第1の距離計測部21は、注目画素近傍の画素平均値Sf_avgが予め定められた画素平均値閾値Taより小さい場合(Sf_avg<Ta)(すなわち、パターン光の明部領域のストライプの領域が十分に明るくない場合)には、注目画素位置における画像の輝度が不十分であるとみなし、エラーと判定して処理を打ち切る。
 図4(C)、(D)、(E)に示される画像の画像ぼけが無い場合には、図4(F)、(G)、(H)に示される画像の画像ぼけがある場合と比較して、2枚の画像の画素値差分Dfがより大きく変動するため、画像ぼけ指標値Ifが大きくなる。すなわち、画像ぼけ指標値Ifが大きいほど画像ぼけが小さく、画像ぼけ指標値Ifが小さいほど画像ぼけが大きい。
 したがって、第1の距離計測部21は、注目画素近傍の画素平均値Sf_avgが画素平均値閾値Ta以上である場合(Sf_avg≧Ta)に、画像ぼけ指標値Ifが予め定められた画像ぼけ判定閾値Tfより大きければ(If>Tf)、注目画素位置について画像ぼけ無しと判定し、画像ぼけ判定閾値Tf以下の場合には(If≦Tf)、画像ぼけ有りと判定する。
 第1の距離計測部21は、画像ぼけ指標値Ifを求める際には、元画像のノイズ等により正規化された画素値差分Dfの誤差(ノイズ成分)が大きい可能性があるため、画素値差分Dfの最大値と最小値から画像ぼけ指標値Ifを算出せずに、n番目に大きい画素値とn番目に小さい画素値の差分から画像ぼけ指標値Ifを求める方法(n=2、3、4…)を採用してもよい。
 図5は、第1の距離計測部21が、光学系11の焦点距離を近い位置である第1の焦点位置(短い第1の焦点距離f1)に設定したときにおける判定結果と光学系11の焦点距離を遠い位置である第2の焦点位置(第1の焦点距離f1よりも長い第2の焦点距離f2)に設定したときにおける判定結果との組合せに応じて出力する情報(画像ぼけ有無フラグQf及び画像ぼけ指標値フラグQi)を表形式で示す図である。
 第1の距離計測部21は、被写体にパターン光を投写して画像ぼけの有無を調べる画像ぼけ有無の判定処理を、焦点距離を光学系11に近い第1の焦点位置(第1の焦点距離f1)に設定したとき(第1の設定)の画像と焦点距離を光学系11から遠い第2の焦点位置(第2の焦点距離f2)に設定したとき(第2の設定)の画像とに対して行い、第1の設定時の判定と第2の設定時の判定とを行う。第1の距離計測部21は、2種類の焦点位置での判定結果の組合せにより、画像の組合せに対する最終的な判定を決定する。
 第1の距離計測部21は、2種類の焦点位置での判定結果の組合せにより、画像ぼけ有無フラグQf、画像ぼけ指標値フラグQi、画像ぼけ量に基づいた被写体距離Zdを出力する。Qf=1は「画像ぼけ有り」を示す。Qf=0は「画像ぼけ無し」を示す。Qf=-1は「エラー」を示す。図5には、2種類の判定結果の組合せに対する画像ぼけ有無フラグQf及び画像ぼけ指標値フラグQiの出力値を示している。図5において「Qi=*」と記載されている項目については、画像ぼけ指標値If(Ifn、Iff)の大小関係によって値を決定する。
 図5において、「Qi=*」と記載されている項目では、2種類の焦点位置のうち、焦点位置が近い方(第1の焦点距離f1)の画像の画像ぼけ指標値IfをIfn、焦点距離が遠い方(第2の焦点距離f2)の画像の画像ぼけ指標値IfをIffとすると、Ifn>Iffの場合(焦点距離が近い方の画像の画像ぼけが小さい場合)には、Qi=1を設定し、Ifn≦Iffの場合(焦点距離が遠い方の画像の画像ぼけが小さい場合)には、Qi=0を設定する。
 また、Qf=1(画像ぼけ有り)の場合には、被写体距離Zdには、後述する画像ぼけ量に基づく距離計測結果の値を設定する。Qf≠1の場合(すなわち、Qf=0の場合又はQf=-1の場合)には、Zd=0を設定する。
 2種類の焦点位置での判定結果の組合せにより画像ぼけ有りと判定された場合、すなわち、Qf=1(画像ぼけ有り)が設定された場合には、引き続き各画素の距離計測を行う。
 図6(A)及び(B)は、図1に示される第1の距離計測部21が、画像ぼけ指標値Ifから被写体距離を求めるために使用するデータとしてのルックアップテーブル(LUT)の例を示す図である。LUTは、例えば、第1の距離計測部21の記憶部21aに予め記憶されている。
 Ifn>Iffの場合(焦点距離が近い方の画像の画像ぼけが小さい場合)、すなわち、焦点距離が近い方の画像の画像ぼけ指標値Ifnが、焦点距離が遠い方の画像の画像ぼけ指標値Iffよりも大きい場合には、第1の距離計測部21は、被写体は、焦点距離が近い側に存在するものとみなして距離計測を行う。被写体が近い側に存在するとき用のLUT(図6(A))を参照し、画像ぼけ指標値Ifnの値から被写体距離を求める。
 Ifn≦Iffの場合(焦点距離が遠い方の画像の画像ぼけが小さい場合)、すなわち、焦点距離が近い方の画像の画像ぼけ指標値Ifnが、焦点距離が遠い方の画像の画像ぼけ指標値Iff以下の場合には、第1の距離計測部21は、被写体は、焦点距離が遠い側に存在するものとみなして距離計測を行う。被写体が遠い側に存在するとき用のLUT(図6(B))を参照し、画像ぼけ指標値Iffの値から被写体距離を求める。
 第1の距離計測部21は、LUTを用いて求めた距離を、距離Zdとして出力する。
 図7は、パターン光が投写された被写体上の位置を示すための、パターン光を構成するストライプの位置番号(図3(A1)及び(A2)の明部領域のストライプと暗部領域のストライプの位置番号)Sの算出方法を示す図である。図8は、パターン光が投写された被写体上の位置とパターン光を構成するストライプの位置番号(図3(A1)及び(A2)の明部領域のストライプと暗部領域のストライプの位置番号)Sとの関係を示す図である。
 第2の距離計測部(三角測量部)22は、明部領域と暗部領域とが互いに逆である1対のパターン光に対する撮像画像の差分に基づいて、撮像画像上に投写されているパターンの位置を特定し、三角測量の原理で被写体までの距離を計測する。
 図3(A1),(A1)から(F1),(F2)までのパターン光が投写されたときの撮像画像における、ある注目画素の画素値をP(A1)、P(A2)、P(B1)、P(B2)、P(C1)、P(C2)、P(D1)、P(D2)、P(E1)、P(E2)、P(F1)、P(F2)とする。
 第2の距離計測部22は、画素値P(A1)とP(A2)の関係に基づき、パターン位置番号Sのbit0の値を決める。第2の距離計測部22は、パターン位置番号をS(6ビット値)とし、予め決められた閾値Tsを用いて、P(A1)+Ts<P(A2)であれば、パターン位置番号Sのbit0に1を割り当て、P(A1)>P(A2)+Tsであれば、パターン位置番号Sのbit0に0を割り当てる。なお、第2の距離計測部22は、|P(A1)-P(A2)|≦Tsであれば、エラーとしてパターン位置番号Sにエラーを示す値を設定する。エラーの場合には、処理を打ち切ることができる。
 同様に、第2の距離計測部22は、P(B1)とP(B2)の関係に基づき、パターン位置番号Sのbit1の値を決める。第2の距離計測部22は、P(B1)+Ts<P(B2)であれば、パターン位置番号Sのbit1に1を割り当て、P(B1)>P(B2)+Tsであれば、パターン位置番号Sのbit1に0を割り当てる。なお、第2の距離計測部22は、|P(B1)-P(B2)|≦Tsであれば、エラーとしてパターン位置番号Sにエラーを示す値を設定する。エラーの場合には、処理を打ち切ることができる。
 同様に、第2の距離計測部22は、P(C1)とP(C2)の関係に基づき、パターン位置番号Sのbit2の値を決める。第2の距離計測部22は、P(C1)+Ts<P(C2)であれば、パターン位置番号Sのbit2に1を割り当て、P(C1)>P(C2)+Tsであれば、パターン位置番号Sのbit2に0を割り当てる。なお、第2の距離計測部22は、|P(C1)-P(C2)|≦Tsであれば、エラーとしてパターン位置番号Sにエラーを示す値を設定する。エラーの場合には、処理を打ち切ることができる。
 同様に、第2の距離計測部22は、P(D1)とP(D2)の関係に基づき、パターン位置番号Sのbit3の値を決める。第2の距離計測部22は、P(D1)+Ts<P(D2)であれば、パターン位置番号Sのbit3に1を割り当て、P(D1)>P(D2)+Tsであれば、パターン位置番号Sのbit3に0を割り当てる。なお、第2の距離計測部22は、|P(D1)-P(D2)|≦Tsであれば、エラーとしてパターン位置番号Sにエラーを示す値を設定する。エラーの場合には、処理を打ち切ることができる。
 同様に、第2の距離計測部22は、P(E1)とP(E2)の関係に基づき、パターン位置番号Sのbit4の値を決める。第2の距離計測部22は、P(E1)+Ts<P(E2)であれば、パターン位置番号Sのbit4に1を割り当て、P(E1)>P(E2)+Tsであれば、パターン位置番号Sのbit4に0を割り当てる。なお、第2の距離計測部22は、|P(E1)-P(E2)|≦Tsであれば、エラーとしてパターン位置番号Sにエラーを示す値を設定する。エラーの場合には、処理を打ち切ることができる。
 同様に、第2の距離計測部22は、P(F1)とP(F2)の関係に基づき、パターン位置番号Sのbit5の値を決める。第2の距離計測部22は、P(F1)+Ts<P(F2)であれば、パターン位置番号Sのbit5に1を割り当て、P(F1)>P(F2)+Tsであれば、パターン位置番号Sのbit5に0を割り当てる。なお、第2の距離計測部22は、|P(F1)-P(F2)|≦Tsであれば、エラーとしてパターン位置番号Sにエラーを示す値を設定する。エラーの場合には、処理を打ち切ることができる。
 以上の処理により、パターン位置番号Sには、パターン上の位置に対応したユニークな値が設定される。
 図9は、図1に示される第2の距離計測部22が、投写部13、撮像部12、及び被写体の位置関係に基づいて行う距離計測方法を示す図である。図9において、角度θは、先に求めたパターン位置番号Sに基づき算出可能である。具体的には、パターン位置番号Sと角度θを対応付けるためのデータである第1のルックアップテーブル(LUT)を記憶部22aに予め用意しておき、第1のLUTを参照することで角度θを求めることができる。また、図9において、角度φは、撮像部12の撮影によって取得された撮像画像上の位置に基づき算出可能である。画像上の被写体の水平方向座標と角度φを対応付けるための第2のルックアップテーブル(LUT)を記憶部22aに予め用意しておき、参照することで角度φを求める。角度θと角度φ、及び基線長Lの値から被写体までの距離zを、次式(4)で算出する。
z=L/(tanθ+tanφ)              (4)
なお、上記の処理では、2種類の焦点位置f1,f2の画像について実施し、それぞれに対応する距離を求める。2種類の焦点位置f1,f2のうち、焦点位置が光学系11に近い方(第1の焦点距離f1)の画像を用いて算出した距離zをZnと表記し、焦点位置が光学系11から遠い方(第2の焦点距離f2)の画像を用いて算出した距離zをZfと表記する。
 図10は、画像データ処理部20の計測結果合成部23によって行われる処理を示すフローチャートである。計測結果合成部23は、第1の距離計測部21から出力された画像ぼけ有無フラグQf、画像ぼけ指標値フラグQi、及び画像ぼけ量に基づいて得られた被写体距離Zdと、第2の距離計測部22で算出された2種類の距離情報が示す被写体距離Zn及びZfとに基づいて、画素毎の出力信号(被写体距離を示す信号又はエラーを示す信号)Zoutを決定する。
 まず、計測結果合成部23は、第1の距離計測部21から得られた画像ぼけ有無フラグQfが判定エラーを示す-1である(Qf=-1)か否かを判断し(ステップST1)、Qf=-1(ステップST1においてYES)の場合には、出力信号Zoutとして計測エラーを示す-1を出力する(Zout=-1)(ステップST2)。
 ステップST1における判断がNO(Qf≠-1)である場合、計測結果合成部23は、第1の距離計測部21から得られた画像ぼけ有無フラグQfが画像ぼけ有りを示す1である(Qf=1)か否かを判断する(ステップST3)。Qf=-1(ステップST3においてYES)の場合には、計測結果合成部23は、出力信号Zoutとして画像ぼけ量に基づいて得られた距離Zdを出力する(Zout=Zd)(ステップST4)。
 ステップST3において判断がNO(Qf≠1、画像ぼけ無し)である場合、計測結果合成部23は、第1の距離計測部21から得られた画像ぼけ指標値フラグQiが1である(Qi=1)(Ifn>Iffの場合、すなわち、焦点距離が近い方の画像の画像ぼけが小さい場合)か否かを判断する(ステップST5)。Qi=1(ステップST5においてYES)の場合には、計測結果合成部23は、出力信号Zoutとして第2の距離計測部22によって焦点距離が近い方の画像を用いて算出された距離Znを出力する(Zout=Zn)(ステップST6)。ステップST6において、距離Znの算出結果がエラーであった場合には、Zoutとして-1(Zout=Zn=-1)を出力する。
 ステップST5において判断がNO(Qi≠1)である場合(Ifn≦Iffの場合、すなわち、焦点距離が遠い方の画像の画像ぼけが小さい場合)、計測結果合成部23は、出力信号Zoutとして第2の距離計測部22によって焦点距離が遠い方の画像を用いて算出された距離Zfを出力する(Zout=Zf)(ステップST7)。ステップST7において、距離Zfの算出結果がエラーであった場合には、Zoutとして-1(Zout=Zf=-1)を出力する。
 上記の処理を撮像画像上の各点を注目画素として順次行うことにより、撮像画像全体の被写体距離の分布データ(すなわち、撮像画像全体の被写体距離を示すマップ)を得ることができる。
《1-3》効果
 三角測量による距離計測による従来の距離計測では、撮像画像内の画像ぼけが有る領域について、正確な距離情報を得ることができなかった。これに対し、実施の形態1に係る距離計測装置1及び距離計測方法によれば、画像ぼけが有る領域についての被写体距離Zoutとして、画像ぼけ量に基づいて求められた距離Zdを出力し、画像ぼけが無い領域についての被写体距離Zoutとして、三角測量による距離計測によって算出された距離Zn又は距離Zfを出力する。このため、実施の形態1に係る距離計測装置1及び距離計測方法によれば、画像ぼけの有無にかかわらず、被写体までの距離を正確に計測することができる。
《2》実施の形態2
《2-1》構成
 実施の形態1では、投写部13及び撮像部12を1つの位置に固定し、画像ぼけ量を用いた距離計測と三角測量による距離計測とを組み合わせて、距離データZoutを出力する装置及び方法について説明した。しかし、被写体の形状が複雑である場合(例えば、凹部を含む場合)には、1つの位置に固定された投写部13によるパターン光の投写では、被写体上にパターン光が当たらない死角となる領域ができることがある。被写体上のパターン光が当たらない領域では、実施の形態1に係る距離計測装置1及び方法を用いても、被写体距離を正確に計測することができない場合がある。そこで、実施の形態2においては、投写部13、光学系11、及び撮像部12を含む撮影ユニット10bを移動させ、及び、撮像部12の撮影方向を変更し(撮影ユニット10bを回転させ)、複数の位置から複数の撮影角度で撮影を行うことで、パターン光が当たらない領域(距離計測不可能な領域)を減らして(望ましくは、なくして)いる。
 図11は、本発明の実施の形態2に係る距離計測装置2の概略構成を示すブロック図である。距離計測装置2は、実施の形態2に係る距離計測方法を実施することができる装置である。図11において、図1に示される構成要素と同一又は対応する構成要素には、図1における符号と同じ符号が付される。図11に示されるように、距離計測装置2は、光学系11、撮像部12、投写部13、制御部14、画像データ処理部20に加えて、移動回転機構としてのカメラアーム部15を有する。光学系11、撮像部12、及び投写部13は、同じ支持部材に取り付けられて撮影ユニット(カメラ)10bを構成する。
 カメラアーム部15は、固定された基準位置から伸びたアームであり、先端に実施の形態2における撮影ユニット10bが取り付けられている。カメラアーム部15は、制御部14によって制御され、撮影ユニット10bの被写体に対する位置を変化させるために用いられる。カメラアーム部15は、ユーザーにより位置及び角度を変更可能な機構、又は、モータなどの駆動力発生機構とギヤなどの駆動力伝達機構とによって位置及び角度を変更可能な機構のいずれであってもよい。
《2-2》動作
 実施の形態2に係る距離計測装置2は、まず画像ぼけ量による距離計測と三角測量による距離計測の組合せによる距離計測(1回目の距離計測)を実施したのち、カメラアーム部15を制御して、撮影ユニット10bの位置を移動させ、2回目以降の距離計測を行う。
 画像ぼけ量による距離計測と三角測量による距離計測の組合せによる1回目の距離計測は、精度の粗い距離計測であってもよいが(2回目以降の距離計測で精度を向上させることができるから)、実施の形態1における距離計測と同じ処理を採用することができる。
 先ず、1回目の距離計測の結果に基づき、撮影ユニット10bを移動させる位置を決定する方法について説明する。
 1回目の距離計測の結果において、ある箇所(画素位置)R0での距離計測結果がエラーとなるケースは、この箇所R0における反射光が弱く、十分な輝度の撮像画像が得られていないケース(ケースA)、及び、明部領域と暗部領域とが互いに逆である1対のパターン光の画像に対して、該当箇所R0の撮影結果で輝度値の差が十分に大きくならないケース(ケースB)の2通りが考えられる。ケースAは、該当箇所R0が投写光の死角となっているケース(ケースA1)と、被写体の反射率が低い、もしくは、金属光沢をもつ物質で拡散反射が起こりにくく、投写光は、到達しているものの撮像部12に向かう反射光の成分が弱いケース(ケースA2)とに分類される。
 図12は、図11に示される画像データ処理部20の計測結果合成部23における被写体距離の計測結果の出力処理を示すフローチャートである。図12において、図10における処理ステップと同じ処理ステップには、図10におけるステップ番号と同じステップ番号を付す。ケースA(A1、A2)とケースBは、1回目の距離計測時にエラーの発生箇所によって判別することができる。図12の処理は、図10における処理とほぼ同じであるが、エラー時にZoutに設定する値を変える(図10の場合と異なる値にする)ことで、エラーの発生原因が判別できるようにしている。すなわち、Zout=-1の場合(ステップS22)は、ケースAのエラーが発生していることを示す。また、Zout=-2の場合(ステップS26、S27)は、ケースBのエラーが発生していることを示す。
 ケースAのエラー発生箇所は、撮像画像の輝度が暗い可能性があるため、より撮像画像を明るくするための露光制御を行い、画像を撮影する。撮像画像を明るくする制御方法として、(方法1)露光時間(撮像部12においてシャッターを開けている時間)を伸ばす、(方法2)光学系11における絞りの開度を上げる、(方法3)撮像部12における撮像素子のセンサゲインを上げるという方法がある。画像データ処理部20の制御部(図示せず)は、システムの制約に基づき設定可能な範囲で、例えば、(方法1)、(方法2)、(方法3)の順に優先して制御を行う。(方法1)を最優先する理由は、撮影中に被写体が動くことがない前提では、露光時間を伸ばすことで撮像画像に対するデメリットが無いのに対し、絞りの開度を大きくすると撮像部12の被写界深度が浅くなり撮像画像がぼけやすくなるためである。また、(方法3)の優先順位が低い理由は、センサゲインを上げた場合には、撮像部12による撮像画像のノイズが増加し、撮像画像間の輝度の大小関係が正しく判定できない可能性が高くなるからである。
 1回目の距離計測の結果においてZout=-1となっており、撮像画像を明るくして撮影した結果エラーが解消した箇所では、距離計測結果を新たな結果に置き換える。上記の作業を行った結果、未だZout=-1の箇所が残っている場合には、システムの制約の範囲で撮像画像をさらに明るくし、撮影、距離計測を繰り返す。
 次に、1回目の距離計測の結果においてZout=-2となった箇所の距離計測を行うため、撮像画像を暗くして撮影を行う。撮像画像を暗くする制御方法として、(方法4)露光時間(撮像部12においてシャッターを開けている時間)を縮める、(方法5)光学系11における絞りの開度を下げる、(方法6)撮像部12における撮像素子のセンサゲインを下げるという方法がある。画像データ処理部20の制御部(図示せず)は、システムの制約に基づき可能な範囲で(方法6)、(方法5)、(方法4)の順に制御を行う。(方法6)及び(方法5)を優先する理由は、(方法4)については、画質への影響が無いのに対し、(方法6)及び(方法5)は、画質の向上につながる可能性が高いためである。撮像画像を暗くした結果エラーが解消した箇所では、距離計測結果を新たな距離計測結果に置き換える。上記の作業を行った結果、まだZout=-2の箇所が残っている場合には、システムの制約の範囲で撮像画像をさらに暗くし、撮影、距離計測を繰り返す。
 画像の明るさを変えて撮影した結果でもエラーが解消しない箇所は、パターン光が到達しない箇所(死角)となっている可能性があるため、撮影ユニット10bの位置を動かして2回目以降の距離計測を行う。その際、撮影ユニット10bの移動方向を決定するため、エラー発生領域の上側と下側の距離計測結果を比較、エラー発生領域の左側と右側の距離計測結果を比較する。まず、上下方向及び左右方向に連続するエラー発生位置のグループをエラー発生領域として抽出する。
 図13(A)は、エラー発生領域に対する撮影ユニット10bの移動方向決定時に参照する画素位置を示す図であり、図13(B)から(E)は、図13(A)に示されるエラー発生領域に対する撮影ユニット10bの移動方向の決定時に参照する画素位置を示す図である。
 図13(B)に示されるように、エラー発生領域に対し左側の画素を参照する場合には、すぐ右側がエラー発生領域であるという条件に当てはまる画素位置(太線箇所の画素)を抽出し、各画素位置における距離計測結果の平均値を求める。
 同様に、図13(C)に示されるように、エラー発生領域に対し右側の画素を参照する場合には、すぐ左側がエラー発生領域であるという条件に当てはまる画素位置(太線箇所の画素)を抽出し、各画素位置における距離計測結果の平均値を求める。
 同様に、図13(D)に示されるように、エラー発生領域に対し上側の画素を参照する場合には、すぐ下側がエラー発生領域であるという条件に当てはまる画素位置(太線箇所の画素)を抽出し、各画素位置における距離計測結果の平均値を求める。
 同様に、図13(E)に示されるように、エラー発生領域に対し下側の画素を参照する場合には、すぐ上側がエラー発生領域であるという条件に当てはまる画素位置(太線箇所の画素)を抽出し、各画素位置における距離計測結果の平均値を求める。
 図13(B)に示されるエラー発生領域に対し左側の画素を参照する場合の距離計測結果の平均値をZout_lとし、図13(C)に示されるエラー発生領域に対し右側の画素を参照する場合の距離計測結果の平均値をZout_rとし、図13(D)に示されるエラー発生領域に対し上側の画素を参照する場合の距離計測結果の平均値をZout_uとし、図13(C)に示されるエラー発生領域に対し下側の画素を参照する場合の距離計測結果の平均値をZout_dとすると、これらの値の大小関係によって撮影ユニット10bの移動距離及び回転角度を求めることができる。制御部14は、予め定められた距離差分閾値Tz、撮影ユニット10bの移動距離及び回転角度をMとして、下記の通り撮影ユニット10bの位置及び撮像部12の撮影方向を変更する(撮影ユニット10bを回転させる)。
 例えば、Zout_u>Zout_d+Tzのときには、撮影ユニット10bを上方向に移動させ、撮影ユニット10bの撮像部12の撮影方向をM度(例えば、移動距離に応じた角度)下向きに変更する(撮影ユニット10bを回転させる)。
 また、Zout_u+Tz<Zout_dのときには、撮影ユニット10bを下方向に移動させ、撮影ユニット10bの撮像部12の撮影方向をM度上向きに変更する(撮影ユニット10bを回転させる)。
 また、|Zout_u-Zout_d|≦Tzのときには、撮影ユニット10bの上下方向の移動を行わず、撮影ユニット10bの撮像部12の撮影方向も変更しない。
 例えば、Zout_r>Zout_l+Tzのときには、撮影ユニット10bを右方向に移動させ、撮影ユニット10bの撮像部12の撮影方向をM度左向きに変更する(撮影ユニット10bを回転させる)。
 また、Zout_r+Tz<Zout_lのときには、撮影ユニット10bを左方向に移動させ、撮影ユニット10bの撮像部12の撮影方向をM度右向きに変更する(撮影ユニット10bを回転させる)。
 また、|Zout_r-Zout_l|≦Tzのときには、撮影ユニット10bの左右方向の移動を行わず、撮影ユニット10bの撮像部12の撮影方向も変更しない(撮影ユニット10bは回転しない)。
 図14は、図11に示される光学系11、撮像部12、及び投写部13を含む撮影ユニット10bの位置の移動及び回転を示す図である。撮影ユニット10bは、元の撮影ユニット10bの位置を基準として、上下方向又は左右方向に移動(並進)させる。その際、画角の中心は、撮影ユニット10bの移動前と一致するように移動させる。移動の結果、撮影ユニット10bの撮像部12の撮影方向の変化(撮影ユニット10bは回転)がM度となる位置を撮影ユニット10bの移動先とする。判定の結果、上下方向及び左右方向のいずれにも、移動なし、撮影方向の変更なしとなった場合には、撮影ユニット10bの移動及び撮影方向の変更による距離計測可能範囲の拡大が困難であると判断し、注目するエラー発生領域に対しては、距離計測処理を打ち切る。
 撮影ユニット10bを移動させたときの露光時間制御は、1回目の距離計測時と同じ設定とし、移動後の位置における計測エラーの発生に応じて、1回目の距離計測時と同じように、撮像画像を明るくしたり、又は、暗くしたりする設定で、撮影を行う。
 計測結果合成部23は、撮影ユニット10bを移動させて撮影した結果得られた距離データを、1回目の距離計測の結果の距離データと統合する。まず、撮影ユニット10bを移動させる前に距離計測した距離データを、三次元空間上にプロットする。次に、撮影ユニット10bを移動させて取得した距離データを同じ三次元空間上にプロットする。その際、追加してプロットする点と撮影ユニット10bの撮像部12とを結ぶ線上に、撮影ユニット10bを移動させる前に距離計測した距離データの点が存在する場合には、プロットの追加は行わない。このように、三次元空間上に距離データをプロットすることで、撮影ユニット10bからの距離がより近い距離計測結果のみをプロットすることになり、距離計測結果データにおいて、検出漏れにより実際に被写体がある位置を被写体なしと誤判断する可能性を低減できる。
 撮影ユニット10bの位置の移動と距離計測は、エラー発生領域の数だけ繰り返して実施される。距離計測に要する時間を抑えるため、エラー発生領域を構成する画素数に閾値を設けておき、エラー発生領域に含まれる画素数が閾値以下の場合には、撮影ユニット10bの移動及び距離計測の対象から外す処理を行ってもよい。
 また、距離計測に要する時間を抑えるため、実際に撮影ユニット10bの位置の移動と距離計測を実施する前に、予め全てのエラー発生領域に対する撮影ユニット10bの移動位置をリストアップし、重複する撮影ユニット10bの移動位置を1つにまとめた上で、撮影ユニット10bの移動及び回転、並びに、距離計測を行ってもよい。
《2-3》効果
 以上に説明したように、実施の形態2に係る距離計測装置2及び距離計測方法によれば、1回目に実施する距離計測の結果に基づき、エラー発生領域を減らすように撮影ユニット10bを移動及び回転させて、2回目以降の距離計測の露光条件、撮影位置、撮影方向を変化させて画像データを取得し、距離計測を行い、距離計測を行うので、距離計測できないエリアが少なく、精度の高い被写体距離を取得することが可能となる。
《3》変形例
 図15は、上記実施の形態1及び2に係る距離計測装置の画像データ処理部の変形例の構成を示すハードウェア構成図である。距離計測装置1及び2の画像データ処理部20は、ソフトウェアとしてのプログラムを格納する記憶装置としてのメモリ91と、メモリ91に格納されたプログラムを実行する情報処理部としてのプロセッサ92とを用いて(例えば、コンピュータにより)実現することができる。この場合には、図1及び図11における画像データ処理部20は、図15におけるメモリ91とプログラムを実行するプロセッサ92に相当する。なお、図1に示される画像データ処理部20の一部を、図15に示されるメモリ91と、プログラムを実行するプロセッサ92とによって実現してもよい。
 1,2 距離計測装置、 10,10a 画像データ取得部、 10b 撮影ユニット、 11 光学系、 12 撮像部、 13 投写部、 14 制御部、 15 カメラアーム部、 20 画像データ処理部、 21 第1の距離計測部(画像ぼけ判定部)、 22 第2の距離計測部(三角測量部)、 23 計測結果合成部、 24 制御部。

Claims (8)

  1.  被写体に複数のパターン光を投写する投写部と、
     焦点距離を変更する機構を備えた光学系と、
     前記光学系を介して前記被写体を撮影する撮像部と、
     前記光学系の前記焦点距離を第1の焦点距離に設定させたときに、前記投写部に前記複数のパターン光を順次投写させて前記撮像部に前記複数のパターン光に対応する複数の第1の撮像画像を取得させ、及び、前記光学系の前記焦点距離を前記第1の焦点距離よりも長い第2の焦点距離に設定させたときに、前記投写部に前記複数のパターン光を順次投写させて前記撮像部に前記複数のパターン光に対応する複数の第2の撮像画像を取得させる制御部と、
     前記複数の第1の撮像画像及び前記複数の第2の撮像画像から、画素ごとに画像ぼけの有無を判定し、前記画像ぼけの程度を示す画像ぼけ指標値から、画素ごとに前記被写体までの距離である第1の距離を取得する第1の距離計測部と、
     前記複数の第1の撮像画像及び前記複数の第2の撮像画像から、三角測量によって画素ごとに前記被写体までの距離である第2の距離を取得する第2の距離計測部と、
     前記第1の距離計測部で前記画像ぼけが有ると判定された画素については前記第1の距離を出力し、前記画像ぼけが無いと判定された画素については前記第2の距離を出力する計測結果合成部と
     を備えたことを特徴とする距離計測装置。
  2.  前記投写部によって投写される前記複数のパターン光は、
     一方向に規則的に交互に配列され、配列方向に互いに同じ幅を持つ第1の明部領域と第1の暗部領域とを有する第1のパターン光と、
     前記第1のパターン光の前記第1の明部領域と前記第1の暗部領域とを逆にした第2の暗部領域と第2の明部領域とを有する第2のパターン光と、
     を含むことを特徴とする請求項1に記載の距離計測装置。
  3.  前記画像ぼけ指標値は、前記第1のパターン光が投写されたときの前記第1の撮像画像における注目画素の輝度値と前記第2のパターン光が投写されたときの前記第2の撮像画像における前記注目画素の輝度値との差分値を正規化して得られた正規化差分値の最大値と最小値との差であることを特徴とする請求項2に記載の距離計測装置。
  4.  前記第2の距離計測部は、前記第1の焦点距離に設定したときの撮影で取得した近い焦点位置の画像データと前記第2の焦点距離に設定したときの撮影で取得した遠い焦点位置の画像データとを用いて三角測量による距離計測を行い、
     前記計測結果合成部は、
     前記第1の距離計測部において、前記近い焦点位置の画像データと前記遠い焦点位置の画像データの一方の画像が前記画像ぼけが無い、他方の画像が前記画像ぼけが有ると判定された箇所については、前記画像ぼけが無い画像の第2の距離計測部による距離計測結果を出力し、
     前記第1の距離計測部において、前記近い焦点位置の画像データと前記遠い焦点位置の画像データのいずれの画像でも前記画像ぼけが無いと判定された箇所については、前記第2の距離計測部で画像ぼけ量を示す画像ぼけ指標値が大きい方の画像の第2の距離計測部による距離計測結果を出力する
     ことを特徴とする請求項1から3のいずれか1項に記載の距離計測装置。
  5.  前記被写体に対する、前記投写部、前記光学系、及び前記撮像部の位置及び前記撮像部による撮影方向を変化させるカメラアーム部をさらに備え、
     前記第1の距離計測部、前記第2の距離計測部、及び前記計測結果合成部による1回目の距離計測の実施後に、
     前記投写部による前記パターン光の強度と、前記撮像部による撮影位置及び撮影方向とを変えて、前記第1の距離計測部、前記第2の距離計測部、及び前記計測結果合成部による2回目以降の距離計測を実施し、
     前記計測結果合成部は、1回目及び2回目以降の距離計測実施の結果を合成して出力する
     ことを特徴とする請求項1から4のいずれか1項に記載の距離計測装置。
  6.  前記第1の距離計測部、前記第2の距離計測部、及び前記計測結果合成部による1回目の距離計測の実施においてエラーが発生したエラー発生領域の上側と下側の距離計測結果を比較し、前記エラー発生領域の左側と右側の距離計測結果を比較し、前記カメラアーム部は、前記距離計測結果の比較結果に基づいて、前記投写部、前記光学系、及び前記撮像部を移動させ、前記撮像部による撮影方向を変更することを特徴とする請求項5に記載の距離計測装置。
  7.  前記計測結果合成部は、
     前記投写部、前記光学系、及び前記撮像部を移動させる前に計測した被写体距離によって示される点を、出力される計測距離を示す点として、三次元空間上にプロットする処理を行い、
     前記投写部、前記光学系、及び前記撮像部を移動させ、及び前記撮像部による撮影方向を変更させて計測した被写体距離のうち、既にプロットされた点と前記撮像部とを結ぶ線上に前記撮像部を移動させる前に計測した被写体距離によって示される点が存在しない場合にはプロットの追加を行い、既にプロットされた点と前記撮像部とを結ぶ線上に前記撮像部を移動させる前に計測した被写体距離によって示される点が存在する場合にはプロットの追加を行わない
     ことを特徴とする請求項5又は6に記載の距離計測装置。
  8.  被写体に複数のパターン光を投写する投写部と、焦点距離を変更する機構を備えた光学系と、前記光学系を介して前記被写体を撮影する撮像部とを備えた装置における、距離計測方法であって、
     前記光学系の前記焦点距離を第1の焦点距離に設定させたときに、前記投写部に前記複数のパターン光を順次投写させて前記撮像部に前記複数のパターン光に対応する複数の第1の撮像画像を取得させる工程と、
     前記光学系の前記焦点距離を前記第1の焦点距離よりも長い第2の焦点距離に設定させたときに、前記投写部に前記複数のパターン光を順次投写させて前記撮像部に前記複数のパターン光に対応する複数の第2の撮像画像を取得させる工程と、
     前記複数の第1の撮像画像及び前記複数の第2の撮像画像から、画素ごとに画像ぼけの有無を判定し、前記画像ぼけの程度を示す画像ぼけ指標値から、画素ごとに前記被写体までの距離である第1の距離を取得する工程と、
     前記複数の第1の撮像画像及び前記複数の第2の撮像画像から、三角測量によって画素ごとに前記被写体までの距離である第2の距離を取得する工程と、
     前記第1の距離を取得する前記工程で前記画像ぼけが有ると判定された画素については前記第1の距離を出力し、前記画像ぼけが無いと判定された画素については前記第2の距離を出力する工程と
     を備えたことを特徴とする距離計測方法。
PCT/JP2017/000240 2016-03-22 2017-01-06 距離計測装置及び距離計測方法 WO2017163537A1 (ja)

Priority Applications (4)

Application Number Priority Date Filing Date Title
US16/062,069 US10955235B2 (en) 2016-03-22 2017-01-06 Distance measurement apparatus and distance measurement method
CN201780019331.1A CN108885098B (zh) 2016-03-22 2017-01-06 距离计测装置和距离计测方法
DE112017001464.6T DE112017001464B4 (de) 2016-03-22 2017-01-06 Abstandsmessvorrichtung und Abstandsmessverfahren
JP2018506790A JP6377295B2 (ja) 2016-03-22 2017-01-06 距離計測装置及び距離計測方法

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2016-056400 2016-03-22
JP2016056400 2016-03-22

Publications (1)

Publication Number Publication Date
WO2017163537A1 true WO2017163537A1 (ja) 2017-09-28

Family

ID=59899929

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2017/000240 WO2017163537A1 (ja) 2016-03-22 2017-01-06 距離計測装置及び距離計測方法

Country Status (5)

Country Link
US (1) US10955235B2 (ja)
JP (1) JP6377295B2 (ja)
CN (1) CN108885098B (ja)
DE (1) DE112017001464B4 (ja)
WO (1) WO2017163537A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10498948B1 (en) 2018-06-05 2019-12-03 Applied Materials, Inc. Methods and apparatus for absolute and relative depth measurements using camera focus distance
WO2019230320A1 (ja) * 2018-05-29 2019-12-05 オムロン株式会社 視覚センサシステム、制御方法およびプログラム

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10360693B2 (en) * 2017-03-01 2019-07-23 Cognex Corporation High speed structured light system
US11040452B2 (en) * 2018-05-29 2021-06-22 Abb Schweiz Ag Depth sensing robotic hand-eye camera using structured light

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04283608A (ja) * 1991-03-13 1992-10-08 Takaoka Electric Mfg Co Ltd 表面形状測定用光学装置
JP2002022424A (ja) * 2000-07-12 2002-01-23 Minolta Co Ltd 3次元測定装置
JP2012083233A (ja) * 2010-10-12 2012-04-26 Canon Inc 三次元形状測定装置、三次元形状測定方法及びコンピュータプログラム

Family Cites Families (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5332737A (en) 1976-09-08 1978-03-28 Olympus Optical Co Ltd Thermal developing device
JPH0816608B2 (ja) 1991-03-15 1996-02-21 幸男 佐藤 形状計測装置
US6407817B1 (en) * 1993-12-20 2002-06-18 Minolta Co., Ltd. Measuring system with improved method of reading image data of an object
US6044170A (en) * 1996-03-21 2000-03-28 Real-Time Geometry Corporation System and method for rapid shape digitizing and adaptive mesh generation
IL125659A (en) * 1998-08-05 2002-09-12 Cadent Ltd Method and device for three-dimensional simulation of a structure
JP4032603B2 (ja) * 2000-03-31 2008-01-16 コニカミノルタセンシング株式会社 3次元計測装置
US20030123707A1 (en) * 2001-12-31 2003-07-03 Park Seujeung P. Imaging-based distance measurement and three-dimensional profiling system
GB0301775D0 (en) 2003-01-25 2003-02-26 Wilson John E Device and method for 3Dimaging
DE602005009432D1 (de) * 2004-06-17 2008-10-16 Cadent Ltd Verfahren und Gerät zur Farbbildformung einer dreidimensionalen Struktur
JP4380663B2 (ja) * 2006-06-08 2009-12-09 コニカミノルタセンシング株式会社 三次元形状測定方法、装置、及びフォーカス調整方法
TWI433052B (zh) * 2007-04-02 2014-04-01 Primesense Ltd 使用投影圖案之深度製圖
US8229172B2 (en) 2009-12-16 2012-07-24 Sony Corporation Algorithms for estimating precise and relative object distances in a scene
US9295532B2 (en) * 2011-11-10 2016-03-29 Carestream Health, Inc. 3D intraoral measurements using optical multiline method
US9349182B2 (en) * 2011-11-10 2016-05-24 Carestream Health, Inc. 3D intraoral measurements using optical multiline method
JP6370038B2 (ja) * 2013-02-07 2018-08-08 キヤノン株式会社 位置姿勢計測装置及び方法
US20150015701A1 (en) 2013-07-10 2015-01-15 Faro Technologies, Inc. Triangulation scanner having motorized elements
JP6537237B2 (ja) * 2013-11-05 2019-07-03 キヤノン株式会社 情報処理装置および方法
US10119808B2 (en) * 2013-11-18 2018-11-06 Fotonation Limited Systems and methods for estimating depth from projected texture using camera arrays
US9258467B2 (en) * 2013-11-19 2016-02-09 Stmicroelectronics Pte Ltd. Camera module
EP3146291A2 (en) * 2014-05-18 2017-03-29 ADOM Advanced Optical Technologies Ltd. System for tomography and/or topography measurements of a layered object
US9482624B2 (en) * 2014-10-29 2016-11-01 SUNMOON UNIVERSITY Industry-University Cooperation Apparatus for inspecting
JP6552230B2 (ja) * 2015-03-18 2019-07-31 キヤノン株式会社 計測装置
DE102015209402A1 (de) * 2015-05-22 2016-11-24 Sirona Dental Systems Gmbh Vorrichtung zur optischen 3D-Vermessung eines Objekts
JP6366546B2 (ja) * 2015-07-13 2018-08-01 株式会社モリタ製作所 口腔内三次元計測装置、口腔内三次元計測方法及び口腔内三次元計測結果の表示方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH04283608A (ja) * 1991-03-13 1992-10-08 Takaoka Electric Mfg Co Ltd 表面形状測定用光学装置
JP2002022424A (ja) * 2000-07-12 2002-01-23 Minolta Co Ltd 3次元測定装置
JP2012083233A (ja) * 2010-10-12 2012-04-26 Canon Inc 三次元形状測定装置、三次元形状測定方法及びコンピュータプログラム

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7052564B2 (ja) 2018-05-29 2022-04-12 オムロン株式会社 視覚センサシステム、制御方法およびプログラム
WO2019230320A1 (ja) * 2018-05-29 2019-12-05 オムロン株式会社 視覚センサシステム、制御方法およびプログラム
JP2019207140A (ja) * 2018-05-29 2019-12-05 オムロン株式会社 視覚センサシステム、制御方法およびプログラム
US11745352B2 (en) 2018-05-29 2023-09-05 Omron Corporation Vision sensor system, control method, and non-transitory computer readable storage medium
CN111971523A (zh) * 2018-05-29 2020-11-20 欧姆龙株式会社 视觉传感器系统、控制方法及程序
CN111971523B (zh) * 2018-05-29 2022-06-10 欧姆龙株式会社 视觉传感器系统、控制方法及存储介质
WO2019236619A1 (en) * 2018-06-05 2019-12-12 Applied Materials, Inc. Methods and apparatus for absolute and relative depth measurements using camera focus distance
US11032464B2 (en) 2018-06-05 2021-06-08 Applied Materials, Inc. Methods and apparatus for absolute and relative depth measurements using camera focus distance
KR102323421B1 (ko) * 2018-06-05 2021-11-09 어플라이드 머티어리얼스, 인코포레이티드 카메라 초점 거리를 사용한 절대 및 상대 깊이 측정들을 위한 방법들 및 장치
CN112243484A (zh) * 2018-06-05 2021-01-19 应用材料公司 用于使用相机焦距的绝对和相对深度测量的方法和设备
KR20210003310A (ko) * 2018-06-05 2021-01-11 어플라이드 머티어리얼스, 인코포레이티드 카메라 초점 거리를 사용한 절대 및 상대 깊이 측정들을 위한 방법들 및 장치
CN112243484B (zh) * 2018-06-05 2022-08-19 应用材料公司 用于使用相机焦距的绝对和相对深度测量的方法和设备
US11582378B2 (en) 2018-06-05 2023-02-14 Applied Materials, Inc. Methods and apparatus for absolute and relative depth measurements using camera focus distance
US10498948B1 (en) 2018-06-05 2019-12-03 Applied Materials, Inc. Methods and apparatus for absolute and relative depth measurements using camera focus distance

Also Published As

Publication number Publication date
CN108885098A (zh) 2018-11-23
DE112017001464B4 (de) 2021-09-23
JP6377295B2 (ja) 2018-08-22
US20180372484A1 (en) 2018-12-27
JPWO2017163537A1 (ja) 2018-05-24
CN108885098B (zh) 2020-12-04
DE112017001464T5 (de) 2019-01-24
US10955235B2 (en) 2021-03-23

Similar Documents

Publication Publication Date Title
CN108369089B (zh) 3维图像测量装置及方法
JP6377295B2 (ja) 距離計測装置及び距離計測方法
JP7289653B2 (ja) 制御装置、内視鏡撮像装置、制御方法、プログラムおよび内視鏡システム
JP6911192B2 (ja) 画像処理方法、装置および機器
US9503658B2 (en) Method for generating and evaluating an image
CN109831660A (zh) 深度图像获取方法、深度图像获取模组及电子设备
JP5161024B2 (ja) 3次元形状計測用撮影装置および方法並びにプログラム
JP2004260785A (ja) 画像歪み補正機能を備えたプロジェクタ装置
JP2010271199A (ja) 三次元形状測定装置、三次元形状測定方法及びコンピュータプログラム
US9482855B2 (en) Microscope system
JP2005318652A (ja) 画像歪み補正機能を備えたプロジェクタ装置
CN110231018B (zh) 一种结构光测距方法、装置及计算机可读存储介质
JP2017511038A (ja) 2つの投影手段の改良された位置合わせ方法
US20220082370A1 (en) Electronic apparatus, control method thereof and computer readable storage medium
US20160275657A1 (en) Imaging apparatus, image processing apparatus and method of processing image
CN108289170B (zh) 能够检测计量区域的拍照装置、方法及计算机可读介质
JP2004133919A (ja) 擬似3次元画像生成装置および生成方法並びにそのためのプログラムおよび記録媒体
US9843715B2 (en) Photographic apparatus, stroboscopic image prediction method, and a non-transitory computer readable storage medium storing stroboscopic image prediction program
EP3070432B1 (en) Measurement apparatus
JP5055081B2 (ja) 高さ測定装置
JP5322460B2 (ja) 形状測定方法
JP2010121955A (ja) 高さ情報取得装置、高さ情報取得方法、及びプログラム
JP4543821B2 (ja) 3次元形状測定装置および方法
CN109565544B (zh) 位置指定装置及位置指定方法
WO2022213340A1 (zh) 对焦方法、拍摄设备、拍摄系统以及可读存储介质

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2018506790

Country of ref document: JP

Kind code of ref document: A

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

Ref document number: 17769584

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17769584

Country of ref document: EP

Kind code of ref document: A1