WO2018079030A1 - 距離計測装置、距離計測方法、及び距離計測プログラム - Google Patents

距離計測装置、距離計測方法、及び距離計測プログラム Download PDF

Info

Publication number
WO2018079030A1
WO2018079030A1 PCT/JP2017/030090 JP2017030090W WO2018079030A1 WO 2018079030 A1 WO2018079030 A1 WO 2018079030A1 JP 2017030090 W JP2017030090 W JP 2017030090W WO 2018079030 A1 WO2018079030 A1 WO 2018079030A1
Authority
WO
WIPO (PCT)
Prior art keywords
pixel
pattern
pattern lights
captured images
area
Prior art date
Application number
PCT/JP2017/030090
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 JP2018547153A priority Critical patent/JP6567199B2/ja
Publication of WO2018079030A1 publication Critical patent/WO2018079030A1/ja

Links

Images

Classifications

    • 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/02Details
    • G01C3/06Use of electric means to obtain final indication

Definitions

  • the present invention relates to a distance measuring device for measuring a distance to a subject, a distance measuring method and a distance measuring program used for measuring the distance to the subject.
  • a projector that irradiates laser light (pattern light) onto a mechanical part (subject) and a striped projection pattern formed on the surface of the subject by irradiation of the striped pattern light are photographed.
  • a distance measuring device combined with a camera is used.
  • the angle in the direction from the projector to the target position is specified from the brightness and darkness of the target position in the captured image acquired by the camera.
  • the distance to the target position of the subject is calculated by triangulation using the angle in the direction from the projector to the target position, the angle in the direction from the camera to the target position, and the distance between the projector and the camera.
  • This method is called a spatial coding method.
  • the spatial coding method assumes that light diffusely reflected on the surface of a subject is photographed with a camera. For this reason, when the light hitting the surface of the subject is specularly reflected or transmitted, light other than the light diffusely reflected on the surface of the subject (light used for distance measurement by the spatial encoding method) is reflected on the camera. In some cases, secondary reflected light or transmitted light (light that adversely affects distance measurement) is incident and the spatial code cannot be read correctly.
  • Patent Document 1 As a countermeasure, there has been proposed an apparatus for detecting a location where a distance measurement error has occurred by comparing a plurality of distance measurement results obtained by the spatial coding method (see, for example, Patent Document 1).
  • the distance measuring device described in Patent Document 1 performs a plurality of distance measurements using a plurality of pattern lights having different stripe directions, and a deviation between a plurality of distances as a plurality of distance measurement results is greater than a predetermined value. When it is larger, the distance measurement result is determined to be invalid.
  • the distance measurement result is incorrect by repeating a series of processes such as pattern light projection by a projector, photographing of a subject by a camera, and distance measurement calculation based on a captured image, a plurality of times. It was determined whether or not. For this reason, there existed a subject that it took a long time until the determination with respect to a distance measurement result was completed.
  • An object of the present invention is to provide a distance measurement device, a distance measurement method, and a distance measurement program capable of improving the accuracy of a distance measurement result while suppressing an increase in time required for distance measurement.
  • a distance measuring device is compatible with the plurality of pattern lights by imaging a projection unit that sequentially projects a plurality of pattern lights having a bright part region and a dark part region onto the subject.
  • An imaging unit that acquires a plurality of captured images, a triangulation unit that measures a distance from the plurality of captured images to the subject at the target pixel by triangulation, and a pixel value of the target pixel of the plurality of captured images
  • a measurement error occurrence location determination unit that determines whether or not the pixel of interest is a pixel at a location where a possibility of occurrence of a distance measurement error is high, and is sequentially projected by the projection unit.
  • the pixel value of the target pixel in the plurality of captured images acquired when the maximum value of the pixel values of the target pixel in the plurality of captured images acquired at the time and the plurality of second pattern lights are sequentially projected. It is the result of comparison with the maximum value of.
  • the distance measuring method is adapted to cope with the plurality of pattern lights by sequentially projecting a plurality of pattern lights having a bright area and a dark area onto the subject, and imaging the subject.
  • a measurement error occurrence location determination step for determining whether or not the pixel of interest is a pixel at a location where a possibility of occurrence of a distance measurement error is high based on a comparison result, and sequentially projecting by the projection step
  • the plurality of pattern lights includes a plurality of first pattern lights in which the ratio of the area of the bright region to the total area of one pattern light is a first ratio,
  • a distance measurement program includes a projection step in which a projection unit sequentially projects a plurality of pattern lights having a bright region and a dark region on a subject, and the imaging unit captures the subject.
  • the plurality of pattern lights sequentially executed by the projecting step have a ratio of the area of the bright area to the total area of one pattern light.
  • the plurality of second pattern lights match a bright area where the whole area of one pattern light is combined when all of the bright areas of the plurality of second pattern lights are combined,
  • the comparison result of the pixel value of the target pixel is that the maximum value of the pixel values of the target pixel in the plurality of captured images acquired when the plurality of first pattern lights are sequentially projected and the plurality of second patterns. It is a comparison result with the maximum value of the pixel values of the pixel of interest in the plurality of captured images acquired when light is sequentially projected.
  • FIG. 1 It is a block diagram which shows schematic structure of the distance measuring device which concerns on Embodiment 1 of this invention. It is a figure which shows roughly arrangement
  • (A) And (b) is a comparison figure when the pattern light is projected in a plurality of directions and when projected in a single direction. It is a figure which shows the method of calculating the position number of the stripe which comprises the pattern light in a to-be-photographed object position from the pixel value of pattern light. It is a figure which shows the position number of the stripe which comprises pattern light. It is a figure which shows the distance measurement method performed based on the positional relationship of a projection part, an imaging part, and a to-be-photographed object. It is a block diagram which shows schematic structure of the distance measuring device which concerns on Embodiment 2 of this invention.
  • FIG. 10 is a diagram illustrating a method of calculating the position number of a stripe that forms the pattern light at the subject position from the pixel value of the pattern light in the third embodiment.
  • FIG. 10 is a hardware configuration diagram illustrating a modification of the first to third embodiments.
  • 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 measurement device 1 has an image data acquisition unit 10 that acquires a captured image (image data) by capturing a subject (object) in an imaging space as a main configuration, and an image.
  • a distance (subject distance) Z to the subject is obtained using the image data obtained by the data obtaining unit 10 (for example, the luminance value of each pixel in the captured image, ie, the pixel value), and the distance indicating the obtained distance Z
  • an image data processing unit 20 that outputs data Zout (for example, distance data for each pixel).
  • the image data processing unit 20 may include a display unit (for example, a liquid crystal display unit) for displaying the distance data Zout numerically or displaying a map indicating the distance data Zout. Further, the image data processing unit 20 may include a user operation unit that receives a user instruction input for operating the distance measuring device 1.
  • 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 such as a camera that captures 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 (including the optical system 11, the imaging unit 12, and the projection unit 13).
  • the control unit 14 selects the pattern light to be projected from a plurality of predetermined pattern lights, causes the projection unit 13 to sequentially project the pattern light to be projected, and causes the imaging unit 12 to correspond to the plurality of pattern lights.
  • the captured image G is acquired. Examples of a plurality of pattern lights are shown in FIG. 3 to be described later, with 12 types of pattern lights (first pattern lights) A1, A2, B1, B2, C1, C2, D1, D2, E1, E2, F1, F2 (hereinafter referred to as “pattern light”). (Also referred to as “pattern light A1,..., F2”).
  • examples of a plurality of pattern lights used for determination of measurement error occurrence locations are shown as 16 types of pattern lights (second pattern lights) X1,..., X16 in FIG.
  • the image capturing unit 12 captures the plurality of captured images (image data) G A1 , G A2 , G B1 , G B2 , G C1 , G C2 , G D1 , G D2 , G E1 , G E2 , G F1 , G F2 (hereinafter also referred to as “captured images G A1 ,..., G F2 ”) are acquired.
  • the imaging unit 12 acquires the plurality of captured images G X1 ,.
  • the plurality of pattern lights (first pattern lights) A1,..., F2 are formed on the subject, that is, the ratio of the area of the bright area to the total area of the one pattern light (first ratio), that is, on the subject.
  • the ratio of the area of the light projection portion to the total area of the projection pattern is different pattern light.
  • the subject distance Z of the pixel of interest is obtained using a plurality of pattern lights A1,..., F2.
  • the plurality of pattern lights (first pattern lights) A1,..., F2 are a plurality of pairs (for example, eight pairs) of pattern lights, and each pair of pattern lights reverses the bright area and the dark area. Pattern light.
  • the plurality of pattern lights (second pattern lights) X1,..., X16 have the ratio of the area of the bright region (second ratio) to the total area of one pattern light (second ratio). 1 pattern light) Pattern light that is lower than the ratio of the area (first ratio) of A1,... Further, when all the bright areas of the plurality of pattern lights (second pattern lights) X1,..., X16 are combined, the entire pattern light, that is, the entire projection pattern formed on the subject is covered. That is, the plurality of pattern lights (second pattern lights) X1,..., X16 are pattern lights having different bright portion areas, and one pattern is obtained by combining all the bright portion areas of the plurality of second pattern lights. The entire area of light coincides with the combined bright area.
  • the image data processing unit 20 includes a measurement error occurrence location determination unit 21, a triangulation unit 22, and a measurement result synthesis unit 23.
  • the triangulation unit 22 acquires the subject distance Z for each pixel by triangulation using the captured images G A1 ,..., G F2 received from the imaging unit 12.
  • the measurement error occurrence location determination unit 21 uses the plurality of captured images G received from the imaging unit 12, that is, using the captured images G A1 ,..., G F2 and the captured images G X1 ,. Based on the ratio of the pixel value of the target pixel between the captured images and the like, it is determined whether or not the target pixel is a pixel at a location where there is a high possibility of a distance measurement error.
  • the measurement result synthesis unit 23 has a high possibility that a measurement error occurrence location determination unit 21 will generate a distance measurement error among a plurality of subject distances that are a plurality of measurement results obtained for each pixel by the triangulation unit 22.
  • the measurement result of the part determined as is deleted, the deleted part is replaced with “no measurement result”, and the subject distance Z for each pixel and the part determined to be highly likely to cause a distance measurement error are shown.
  • the distance data Zout including the information is output.
  • FIG. 2 is a diagram schematically showing the arrangement of the optical system 11, the imaging unit 12, and the projection unit 13 of FIG.
  • the projection unit 13 is configured by combining a light source and a liquid crystal panel or DMD (Digital Micromirror Device), and is a projector capable of projecting an arbitrary pattern light.
  • the image data acquisition unit 10 of the distance measuring apparatus 1 causes the projection unit 13 to alternately illuminate bright areas (lights from the projection unit 13) toward the subjects OJ1 and OJ2 in the imaging space JS. Are projected) and stripes (hereinafter also referred to as “dark stripes”) of dark areas (areas where light from the projection unit 13 is not projected) darker than the bright areas.
  • the pattern light 13a configured by the above is projected, and the subjects OJ1 and OJ2 on which the pattern light 13a is projected are photographed by the imaging unit 12 through the optical system 11.
  • 12 types of pattern light A1,..., F2 and 16 types of pattern light X1,..., X16 in FIG. 4 are examples of 28 types of pattern light 13a projected by the projection unit 13 shown in FIG. That is, this is an example of pattern light in which the bright stripes in the bright area (white area in the figure) and the dark stripes in the dark area (shaded area in the figure) are alternately arranged in the arrangement direction (horizontal direction in the figure).
  • the example of the pattern light 13a is not limited to the illustrated example, and the number of types of the pattern light 13a is not limited to 28 types.
  • the pattern light obtained by switching (reversing) the bright and dark stripes in the pattern light A1 is the pattern light A2.
  • the pattern light obtained by switching (reversing) the bright part stripe and the dark part stripe in the pattern light B1 is the pattern light B2.
  • the pattern light obtained by switching (reversing) the bright and dark stripes in the pattern light C1 is the pattern light C2.
  • the pattern light obtained by switching (reversing) the bright and dark stripes in the pattern light D1 is the pattern light D2.
  • the pattern light obtained by switching (reversing) the bright and dark stripes in the pattern light E1 is the pattern light E2.
  • the pattern light obtained by exchanging (reversing) the bright and dark stripes in the pattern light F1 is the pattern light F2.
  • the 16 types of pattern light X1,..., X16 shown in FIG. 4 are locations (regions) where the pixel of interest is likely to cause a distance measurement error.
  • Pattern light used for determining whether or not the image is an image.
  • the width of the bright stripe of the pattern light X1,..., X16 shown in FIG. 4 is 1/16 of the width of one period of the pattern light.
  • the sixteen types of pattern light X1,..., X16 have a pattern in which the bright portion stripe is shifted to the right in FIG. 4 in the order of the pattern light X1, X2,. For this reason, when any one of the pattern lights X1,..., X16 is selected and superimposed, all positions of the pattern light projection area are included in the bright portion stripe of any pattern light.
  • the combination of the plurality of pattern lights is configured such that the entire position of the pattern light projection area is included in the bright portion area of any one of the plurality of pattern lights. If it is a thing, it will not be limited to the example of FIG. 4, and the number of pattern lights is not limited to 16 types.
  • the control unit 14 causes the projection unit 13 to sequentially project pattern light, and causes the imaging unit 12 to acquire a plurality of captured images G corresponding to the plurality of pattern lights.
  • Examples of the plurality of pattern lights are the pattern lights A1,..., F2 shown in FIG. 3 and the pattern lights X1,.
  • the measurement error occurrence location determination unit 21 captures captured images G A1 ,... Obtained by photographing the imaging space in which the pattern lights A 1,..., F 2 and the pattern lights X 1,. , G F2 , and the captured images G X1 ,..., G X16 , it is determined whether or not the pixel of interest is a pixel at a location (region) where there is a high possibility of a distance measurement error.
  • FIGS. 5A to 5C are diagrams illustrating examples of paths of the primary reflected light 11a and 11b, the secondary reflected light 11c, and the transmitted light 11d when the pattern light 13a is projected onto the subject.
  • FIG. 5A shows the component of the pattern light 13a emitted from the projection unit 13 that is diffusely reflected once on the surface 15a of the subject 15 to become primary reflected light 11a, and the component of the primary reflected light 11a that is incident on the imaging unit 12. Is shown.
  • the pattern light 13a emitted from the projection unit 13 is diffusely reflected once on the surface of the placement surface 18 on which the subject 15 is placed, and becomes primary reflected light 11a.
  • the path of the primary reflected light 11a shown in FIG. 5A is an optical path to be used for the measurement of the subject distance (the originally assumed desirable optical path). It is desirable that the subject distance Z is measured by using it.
  • FIG. 5B the pattern light 13a emitted from the projection unit 13 is reflected once by the surface 16a of the subject 16 to become the primary reflected light 11b, and further reflected once by the mounting surface 18 and the secondary reflected light 11c.
  • the component which injects into the image pick-up part 12 among this secondary reflected light 11c is shown.
  • FIG. 5B shows an example of the path of the secondary reflected light 11c when the total number of reflections is 2.
  • the secondary reflected light in this application is reflected light having a total number of reflections of 3 or more. Is also included.
  • the secondary reflected light 11c is greatly attenuated light.
  • the luminance of the captured image by the primary reflected light 11a shown in 5 (a) is not greatly affected.
  • the intensity of the primary reflected light 11b is approximately the same as the intensity of the pattern light 13a emitted from the projection unit 13. Therefore, the intensity of the secondary reflected light 11c is also strong, and the secondary reflected light 11c has a great influence on the brightness of the captured image (that is, the brightness of the captured image by the primary reflected light 11a shown in FIG. 5A).
  • FIG. 5C shows a case where the subject 17 is light transmissive (including transparent and translucent), and a part of the transmitted light 11d that has passed through the subject 17 is incident on the imaging unit 12.
  • the secondary reflected light or transmitted light 11d enters the imaging unit 12 and is superimposed on the captured image, so that the luminance of the primary reflected light (primary reflected light 11a shown in FIG. 5A) is increased.
  • a captured image different in size is obtained, and the position (subject distance) of the projection pattern formed on the surface of the subject 17 by projection of the pattern light 13a cannot be accurately calculated.
  • FIGS. 6A and 6B are diagrams showing a case where the pattern light is projected in a plurality of directions and a case where the pattern light is projected in a single direction, respectively.
  • the undesirable secondary reflected light 11a2 travels along a path other than the path of the desired primary reflected light 11a.
  • the undesirable secondary reflected light 11a2 travels in the same direction as the desired primary reflected light 11a and enters the imaging unit 12.
  • the pattern light 13a is projected in a single direction, the pattern light 13a is projected onto a path different from the path that generates the desired primary reflected light 11a. Therefore, the occurrence of an undesirable situation in which the generated secondary reflected light is superimposed on the primary reflected light 11a can be suppressed.
  • the secondary reflected light is described as an example.
  • the transmitted light 11d as shown in FIG.
  • Light traveling along a path other than the path of the reflected light 11a travels in the same direction as the primary reflected light 11a and enters the imaging unit 12, so that a captured image different from the magnitude of the brightness of the primary reflected light 11a is obtained and projected.
  • the reason why the position of the pattern cannot be calculated accurately is the same. Therefore, as shown in FIG. 6B, if the projection direction of the pattern light 13a is a single direction, the occurrence of a situation in which the generated transmitted light 11d is superimposed on the primary reflected light 11a can be suppressed.
  • the secondary reflected light 11c (FIG. 5 (b)), 11a2 (FIG. 6 (a)) and the transmitted light 11d (FIG. 5 (c)) are the pattern light 13a that is the source of the primary reflected light 11a. Is generated by superimposing the primary or secondary reflected light generated by the pattern light 13a2 projected in different directions on the desired primary reflected light 11a, and the secondary reflected light 11a2 and the transmitted light.
  • the ease of occurrence of a situation where 11d is superimposed on the primary reflected light 11a increases in accordance with the area of the light projection portion (bright portion region) in the entire projected pattern light.
  • the light quantity of the pattern light 13a projected from the projection unit 13 that is, the ratio of the area of the bright area to the entire pattern light, and the area of the light projection portion with respect to the total area of the projection pattern formed on the subject
  • the ratio is increased, the possibility of generation of undesirable secondary reflected light 11a2 and transmitted light 11d traveling in the same direction as the primary reflected light 11a through a different path from the desired primary reflected light 11a and entering the imaging unit 12 is high.
  • the smaller the amount of pattern light projected from the projection unit 13 that is, the ratio of the area of the light projection portion to the total area of the projection pattern
  • the light is transmitted to the path where the secondary reflected light 11a2 and the transmitted light 11d are generated.
  • the influence of the secondary reflected light 11a2 and the transmitted light 11d can be reduced. In terms of the captured image, this is superimposed on the primary reflected light 11a by reducing the amount of pattern light projected from the projection unit 13 (that is, the ratio of the area of the light projection portion to the total area of the projection pattern).
  • the path where the light is actually projected decreases, and the amount of the secondary reflected light 11a2 and the transmitted light 11d superimposed on the primary reflected light 11a decreases. It corresponds to that.
  • the amount of pattern light (that is, light projection for the entire area of the projection pattern).
  • the pattern light of FIG. 4 having a low area ratio) is used.
  • the measurement error occurrence location determination unit 21 utilizes the fact that the intensity of the secondary reflected light 11a2 superimposed on the primary reflected light 11a and the intensity of the transmitted light change when the area of the light projection portion in the projection pattern differs as described above. However, when projecting pattern light with a large amount of light (in the first embodiment, when projecting the pattern light in FIG. 3), when projecting pattern light with a low luminance and light amount (in the first embodiment, the pattern light in FIG. 4). A place where the difference (brightness fluctuation) from the brightness at the time of projection) is large is determined as a place where there is a high possibility of a distance measurement error due to the secondary reflected light 11a2 and the transmitted light 11d.
  • the measurement error occurrence location determination unit 21 acquires a first maximum pixel value P MAX1 that is the maximum value of the pixel values P (A1),..., P (F2), and the pixel values P (X1) ,.
  • a second maximum pixel value P MAX2 that is the maximum value of P (X16) is acquired.
  • the measurement error occurrence location determination unit 21 stores a predetermined determination threshold ratio K MAX in the storage unit 21a.
  • the pixel of interest that satisfies is considered to be a location where the amount of secondary reflected light or the amount of transmitted light changes greatly due to the change in the amount of pattern light, and this pixel of interest has a distance measurement error due to the secondary reflected light and transmitted light. It is determined that it is a pixel at a location where there is a high possibility of being. This determination result is sent to the measurement result synthesis unit 23.
  • MAX2 ⁇ P MIN2 a predetermined determination threshold difference K DIF , P DIF1 > P DIF2 * K DIF
  • the pixel of interest that satisfies is considered to be a location where the change in the amount of secondary reflected light or the amount of transmitted light due to the change in the amount of pattern light is large, and this pixel of interest causes a distance measurement error due to the secondary reflected light and transmitted light. It may be determined that the pixel is a pixel at a place where there is a high possibility of being.
  • the triangulation unit 22 determines the position of the projection pattern formed by the pattern light projected on the captured image based on the difference of the captured image with respect to the pair of pattern light in which the bright part stripe and the dark part stripe are opposite to each other. And measure the distance to the subject using the principle of triangulation.
  • the pixel values of certain pixels of interest in the captured image of the projection pattern formed in the imaging space when the pattern lights A1,..., F2 shown in FIG. 3 are projected are respectively P (A1),. ).
  • FIG. 7 is a diagram showing a method of calculating the position number S of the stripes constituting the pattern light at the subject position from the pixel value of the pattern light.
  • FIG. 8 is a diagram showing the position numbers (position numbers of the bright and dark stripes of the pattern lights A1 and A2 in FIG. 3) S forming the pattern light.
  • the triangulation 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 triangulation unit 22 sets the pattern position number to S (6-bit value) and uses a predetermined threshold Ts, If P (A1) + Ts ⁇ P (A2), 1 is assigned to bit 0 of pattern position number S, If P (A1)> P (A2) + Ts, 0 is assigned to bit 0 of the pattern position number S, If
  • the triangulation unit 22 determines the value of bit1 of the pattern position number S based on the relationship between the pixel values P (B1) and P (B2).
  • the triangulation unit 22 If P (B1) + Ts ⁇ P (B2), 1 is assigned to bit1 of the pattern position number S, If P (B1)> P (B2) + Ts, 0 is assigned to bit1 of the pattern position number S, If
  • the triangulation unit 22 determines the value of bit2 of the pattern position number S based on the relationship between the pixel values P (C1) and P (C2).
  • the triangulation unit 22 If P (C1) + Ts ⁇ P (C2), 1 is assigned to bit2 of the pattern position number S, If P (C1)> P (C2) + Ts, 0 is assigned to bit2 of the pattern position number S, If
  • the triangulation unit 22 determines the value of bit3 of the pattern position number S based on the relationship between the pixel values P (D1) and P (D2).
  • the triangulation unit 22 If P (D1) + Ts ⁇ P (D2), 1 is assigned to bit3 of the pattern position number S, If P (D1)> P (D2) + Ts, 0 is assigned to bit3 of the pattern position number S, If
  • the triangulation unit 22 determines the value of bit4 of the pattern position number S based on the relationship between the pixel values P (E1) and P (E2).
  • the triangulation unit 22 If P (E1) + Ts ⁇ P (E2), 1 is assigned to bit 4 of the pattern position number S, If P (E1)> P (E2) + Ts, 0 is assigned to bit 4 of the pattern position number S, If
  • the triangulation unit 22 determines the value of bit 5 of the pattern position number S based on the relationship between the pixel values P (F1) and P (F2).
  • the triangulation unit 22 If P (F1) + Ts ⁇ P (F2), 1 is assigned to bit 5 of the pattern position number S, If P (F1)> P (F2) + Ts, 0 is assigned to bit 5 of the pattern position number S, If
  • FIG. 9 is a diagram illustrating a distance measurement method performed by the triangulation unit 22 illustrated in FIG. 1 based on the positional relationship between the projection unit 13, the imaging unit 12, and the subject.
  • the angle ⁇ can be calculated based on the pattern position number S obtained previously.
  • a first lookup table (LUT) which is data for associating the pattern position number S with the angle ⁇ , is prepared in the storage unit 22a in advance, and the angle ⁇ is referred to by referring to the first LUT. Can be requested.
  • the angle ⁇ can be calculated based on the position on the captured image acquired by the imaging of the imaging unit 12.
  • 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 (1).
  • Z L / (tan ⁇ + tan ⁇ ) (1)
  • the measurement result synthesis unit 23 refers to the results of the measurement error occurrence location determination unit 21 and the triangulation unit 22 for each target pixel position, and corrects the distance measurement result to be output. That is, of the subject distance Z for each pixel obtained by the triangulation unit 22, the measurement result of the pixel at the location where the possibility of occurrence of the measurement error is determined by the measurement error occurrence location determination unit 21 is expressed as “measurement result”. Replace with “None” and output.
  • ⁇ 1-3 Effect
  • a secondary reflected light or transmitted light is superimposed on a captured image, so that a captured image different from the magnitude of the brightness of the primary reflected light is obtained. The position of could not be determined correctly. If the position of the projection pattern is erroneously determined, an incorrect distance measurement result is output at the corresponding location, and the shape of the subject to be measured cannot be correctly grasped.
  • the distance measurement apparatus 1 according to the first embodiment, a plurality of types of pattern light having different amounts of projected pattern light are projected, and pixels having large fluctuations in pixel values of the captured image are measured by the distance measurement.
  • the pixel Since it is determined that the pixel is a pixel at a location where there is a high possibility of an error and is output from the measurement result, the correct subject distance is obtained even under shooting conditions where secondary reflected light or transmitted light is generated. Can be output. Further, the prior art disclosed in Patent Document 1 realizes detection of a measurement error portion in distance measurement by triangulation. However, in the prior art disclosed in Patent Document 1, in order to obtain a final result in order to compare measurement results of distances calculated under a plurality of imaging conditions and determine a location where a plurality of measurement result errors are large as a measurement error.
  • the distance measuring apparatus 1 According to the distance measuring apparatus 1 according to the first embodiment, a plurality of types of pattern light having different amounts of projected pattern light are projected, and the measurement result is validated or invalidated by being included in the distance measurement processing. Therefore, it is not necessary to repeatedly execute the distance measurement process a plurality of times, and an increase in the amount of calculation necessary for detecting a measurement error can be suppressed.
  • FIG. 10 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. 10, components that are the same as or correspond to the components shown in FIG. 1 are assigned the same reference numerals as those shown in FIG.
  • the distance measurement device 2 according to the second embodiment is the distance measurement according to the first embodiment in terms of the number and types of pattern lights projected by the projection unit 13 and the points of the captured image used in the image data processing unit 20a. Different from device 1.
  • the second embodiment there are fewer types of pattern light to be used than in the first embodiment, and the pattern lights E1, E2, and F1 of the pattern lights shown in FIGS. 3 and 4 are used. , F2 and pattern lights X1,..., X16 are used.
  • the second embodiment is the same as the first embodiment. Accordingly, FIGS. 2 to 9 are referred to in the description of the second embodiment.
  • the pattern light A1, A2, B1, B2, C1, C2, D1, D2 shown in FIG. 3 is combined with any of the pattern lights X1,..., X16 shown in FIG. It is possible to make.
  • the pattern light A1 is the same as the combination of the pattern lights X1, X3, X5, X7, X9, X11, X13, and X15 shown in FIG. 4, and the pattern light A2 is the pattern shown in FIG. This is the same as the combination of light X2, X4, X6, X8, X10, X12, X14, and X16.
  • the pattern light B1 is the same as the combination of the pattern lights X1, X2, X5, X6, X9, X10, X13, and X14 shown in FIG. 4, and the pattern light B2 is the pattern light X3 shown in FIG. This is the same as the combination of X4, X7, X8, X11, X12, X15, and X16.
  • the pattern light C1 is the same as the combination of the pattern lights X1, X2, X3, X4, X9, X10, X11, and X12 shown in FIG. 4, and the pattern light C2 is the pattern light X5 shown in FIG.
  • the pattern light D1 is the same as the combination of the pattern lights X1, X2, X3, X4, X5, X6, X7, and X8 shown in FIG. 4, and the pattern light D2 is the pattern light X9, This is the same as the combination of X10, X11, X12, X13, X14, X15, and X16.
  • the measurement error occurrence location determination unit 21 and the triangulation unit 22 can detect the pattern light A1, A2, B1, B2, C1, C2, D1, D2. An image corresponding to the captured image at the time of projection can be obtained.
  • the measurement error occurrence point determination unit 21 and the triangulation unit 22 it is possible to measure the distance of the subject without projecting the pattern lights A1, A2, B1, B2, C1, C2, D1, and D2. It is possible to determine whether or not the position is a place when there is a high probability that a distance measurement error will occur. Thereby, the kind of pattern light required for distance measurement can be reduced, and the time required for one distance measurement can be reduced as compared with the first embodiment.
  • the measurement error occurrence location determination unit 21 first sets P MAX1 as the maximum value of P (E1), P (E2), P (F1), and P (F2), and P (X1) ,.
  • the maximum value of (X16) is P MAX2 , and a predetermined threshold value ratio K MAX is used, P MAX1> target pixel satisfying P MAX2 * K MAX is regarded as point change in the amount of light it is large in quantity or transmitted light of the secondary reflected light to be superimposed on the primary reflected light by the change in the amount of light of the pattern light, the secondary light
  • the pixel is determined to be a pixel at a location where there is a high possibility of occurrence of a distance measurement error due to transmitted light.
  • This determination result is sent to the measurement result synthesis unit 23.
  • the determination using the difference value between the maximum value and the minimum value may be performed.
  • the triangulation unit 22 applies the pattern lights A1, A2, B1, B2, C1, C2, D1, and D2 shown in FIG. 3 to the pattern lights X1,..., X16 shown in FIG. It is also possible to obtain the bit value of the pattern position number S directly from the captured image when each of the pattern lights X1,..., X16 is projected, instead of generating and measuring by combining any of them. .
  • the system in that case is shown below.
  • the bit values bit0,..., Bit3 of the pattern position number S in FIG. 7 are added to values based on the magnitude relationship between the pixel values P (A1) and P (A2), the pixel values P (B1) and P ( A value based on the magnitude relationship between B2), a value based on the magnitude relationship between pixel values P (C1) and P (C2), and a value based on the magnitude relationship between pixel values P (D1) and P (D2) were assigned.
  • the bit value corresponding to the largest value among the pixel values P (X1),..., P (X16) is represented by the bit values bit0, bit1, bit2, and the pattern position number S.
  • the pattern position number S is obtained by assigning to bit3.
  • FIG. 11 is a diagram illustrating a method of calculating the position numbers of the stripes constituting the pattern light at the subject position from the pixel values of the pattern light in the second embodiment.
  • the 4-bit value represented by “bit3, bit2, bit1, bit0” is “0” when P (X1) is maximum, and “1” when P (X2) is maximum.
  • “2” when P (X3) is maximum is maximum
  • “3” when P (X4) is maximum “4” when P (X5) is maximum
  • “2” when P (X6) is maximum.
  • the largest pixel value among the pixel values P (X1),..., P (X16) A difference D from the second largest pixel value may be calculated, and when this difference D is smaller than a predetermined threshold Tx, a value indicating an error may be set as the pattern position number S as an error.
  • bit5 and bit4 the method of calculating the bit values bit5 and bit4 is the same as in the first embodiment.
  • the pattern light used for determining whether or not the target pixel is a pixel at a location where a possibility of occurrence of a distance measurement error is high is determined by the distance. Since it can be used as a substitute for part of the pattern light for measurement, the increase in the total number of projection patterns when simultaneous determination of distance measurement errors can be suppressed compared to when measuring only distance measurement, and measurement It is possible to suppress an increase in time required for the operation.
  • FIG. 12 is a block diagram showing a schematic configuration of the distance measuring apparatus 3 according to Embodiment 3 of the present invention.
  • the distance measuring device 3 is a device that can perform the distance measuring method according to the third embodiment. 12, components that are the same as or correspond to the components shown in FIG. 1 are given the same reference numerals as those shown in FIG.
  • the distance measuring device 3 according to the third embodiment is different from the distance measuring device 1 according to the first embodiment in the configuration of the image data processing unit 20b.
  • the distance measurement result for a portion determined to have a high possibility of occurrence of a distance measurement error is deleted, and the deleted distance measurement result is “no distance measurement result”. Replaced with the information indicating and output.
  • the distance measurement result is also obtained for a portion that is determined to have a high possibility of causing a distance measurement error by specifying a captured image that causes a failure to obtain a correct distance measurement result. (Including error) is output. Note that the features of the distance measuring device 3 according to the third embodiment may be applied to the distance measuring device 2 according to the second embodiment.
  • ⁇ 3-2 Operation The operation of the image data processing unit 20b of the distance measuring device 3 according to the third embodiment will be described below.
  • the measurement error occurrence location determination unit 221 acquires pixel values P (A1),..., P (F2) and pixel values P (X1),.
  • the measurement error occurrence location determination unit 221 compares the pixel values P (A1) and P (A2) of the target pixel obtained when the two pattern lights A1 and A2 that are in an inverted relationship with each other are sequentially projected. The larger pixel value LA of these is acquired.
  • the measurement error occurrence location determination unit 221 compares the pixel values P (B1) and P (B2) of the target pixel obtained when the two pattern lights B1 and B2 that are in an inverted relationship with each other are sequentially projected. The larger pixel value LB of these is acquired.
  • the measurement error occurrence location determination unit 221 compares the pixel values P (C1) and P (C2) of the target pixel obtained when the two pattern lights C1 and C2 that are in an inverted relationship with each other are sequentially projected. The larger pixel value LC of these is acquired.
  • the measurement error occurrence location determination unit 221 compares the pixel values P (D1) and P (D2) of the target pixel obtained when the two pattern lights D1 and D2 that are in an inverted relationship with each other are sequentially projected. The larger pixel value LD of these is acquired.
  • the measurement error occurrence location determination unit 221 compares the pixel values P (E1) and P (E2) of the target pixel obtained when the two pattern lights E1 and E2 that are in an inverted relationship with each other are sequentially projected. The larger pixel value LE of these is acquired.
  • the measurement error occurrence location determination unit 221 compares the pixel values P (F1) and P (F2) of the target pixel obtained when the two pattern lights F1 and F2 that are in an inverted relationship with each other are sequentially projected. The larger pixel value LF of these is acquired.
  • the measurement error occurrence location determination unit 221 also obtains the pixel value P of the target pixel obtained when sequentially projecting pattern lights X1,..., X16 in which the bright part stripes have the same interval and the bright part stripes have different positions. (X1),..., P (X16) are compared, and the maximum value PMAX2 is obtained.
  • the measurement error occurrence location determination unit 221 stores a predetermined determination threshold ratio K MAX in the storage unit 221a, and compares the acquired pixel value LA with the reference value P MAX2 * K MAX .
  • the measurement error occurrence location determination unit 221 In the case of LA ⁇ P MAX2 * K MAX , the measurement error flag FA is set to 0 (that is, a flag indicating that the target pixel is not a distance measurement error occurrence location), When LA> P MAX2 * K MAX , 1 is set in the measurement error flag FA (that is, a flag indicating that the pixel of interest is a distance measurement error occurrence location).
  • the measurement error occurrence location determination unit 221 compares the acquired pixel value LB with the reference value P MAX2 * K MAX , If LB ⁇ P MAX2 * K MAX , set the measurement error flag FB to 0, When LB> P MAX2 * K MAX , 1 is set to the measurement error flag FB.
  • the measurement error occurrence location determination unit 221 compares the acquired pixel value LC with the reference value P MAX2 * K MAX , If LC ⁇ P MAX2 * K MAX , set the measurement error flag FC to 0, When LC> P MAX2 * K MAX , 1 is set to the measurement error flag FC.
  • the measurement error occurrence location determination unit 221 compares the acquired pixel value LD with the reference value P MAX2 * K MAX , If LD ⁇ P MAX2 * K MAX , set the measurement error flag FD to 0, When LD> P MAX2 * K MAX , 1 is set to the measurement error flag FD.
  • the measurement error occurrence location determination unit 221 compares the acquired pixel value LE with the reference value P MAX2 * K MAX , If LE ⁇ P MAX2 * K MAX , set the measurement error flag FE to 0, When LE> P MAX2 * K MAX , 1 is set to the measurement error flag FE.
  • the measurement error occurrence location determination unit 221 compares the acquired pixel value LF and the reference value P MAX2 * K MAX , If LF ⁇ P MAX2 * K MAX , set the measurement error flag FF to 0, When LF> P MAX2 * K MAX , 1 is set to the measurement error flag FF.
  • the measurement error occurrence location determination unit 221 may perform determination using the difference value between the maximum value and the minimum value, as in the case of the first embodiment.
  • the measurement error occurrence location determination unit 221 sends the values of the measurement error flags FA, ..., FF to the triangulation unit 222.
  • the triangulation unit 222 sequentially performs processing from the higher order bit side when determining the value of the pattern position number S by comparing the pixel values.
  • the triangulation unit 222 determines the bit value bit5 of the pattern position number S based on the relationship between the pixel values P (F1) and P (F2). The triangulation unit 222 If P (F1) + Ts ⁇ P (F2), 1 is assigned to the bit value bit5 of the pattern position number S, If P (F1)> P (F2) + Ts, 0 is assigned to the bit value bit5 of the pattern position number S, If
  • the triangulation unit 222 determines the bit value bit4 of the pattern position number S based on the relationship between the pixel values P (E1) and P (E2). The triangulation unit 222 If P (E1) + Ts ⁇ P (E2), 1 is assigned to the bit value bit4 of the pattern position number S, If P (E1)> P (E2) + Ts, 0 is assigned to the bit value bit4 of the pattern position number S, If
  • the triangulation unit 222 determines the bit value bit3 of the pattern position number S based on the relationship between the pixel values P (D1) and P (D2). The triangulation unit 222 If P (D1) + Ts ⁇ P (D2), 1 is assigned to the bit value bit3 of the pattern position number S, If P (D1)> P (D2) + Ts, 0 is assigned to the bit value bit3 of the pattern position number S, If
  • the triangulation unit 222 determines the bit value bit2 of the pattern position number S based on the relationship between the pixel values P (C1) and P (C2). The triangulation unit 222 If P (C1) + Ts ⁇ P (C2), 1 is assigned to the bit value bit2 of the pattern position number S, If P (C1)> P (C2) + Ts, 0 is assigned to the bit value bit2 of the pattern position number S, If
  • the triangulation unit 222 determines the bit value bit1 of the pattern position number S based on the relationship between the pixel values P (B1) and P (B2). The triangulation unit 222 If P (B1) + Ts ⁇ P (B2), 1 is assigned to the bit value bit1 of the pattern position number S, If P (B1)> P (B2) + Ts, 0 is assigned to the bit value bit1 of the pattern position number S, If
  • the triangulation unit 222 determines the value of the bit value bit0 of the pattern position number S based on the relationship between the pixel values P (A1) and P (A2). The triangulation unit 222 If P (A1) + Ts ⁇ P (A2), 1 is assigned to the bit value bit0 of the pattern position number S, If P (A1)> P (A2) + Ts, 0 is assigned to the bit value bit0 of the pattern position number S, If
  • the triangulation unit 222 uses the calculated pattern position number S as it is for distance calculation. To do.
  • FIG. 13 is a diagram showing a method for calculating the position numbers of the stripes constituting the pattern light at the subject position from the pixel values of the pattern light in the third embodiment. If a censoring occurs in the middle of processing, only the bits in the range where the measurement error is 0 and no error occurs are referred to from the higher-order bits of the pattern position number S, and the corresponding bit that is censored is 1 or less.
  • the pattern position number S is calculated by regarding the bit of 0 as 0. In FIG.
  • the subject distance Z is obtained by the same method as in the first embodiment.
  • the calculated subject distance Z and the error flag information of the corresponding pixel are output together.
  • ⁇ 3-3 Effect According to the distance measuring device 3 according to the third embodiment, although the target pixel is a pixel at a location where it is determined that the possibility of a distance measurement error is high, the accuracy is low. Since the distance measurement result can be obtained, it is possible to grasp the outline of the shape of the subject even in a place where there is a lot of secondary reflected light or transmitted light.
  • the three-dimensional (3D) of the subject is synthesized by combining the distance measurement results from a plurality of viewpoints.
  • FIG. 14 is a hardware configuration diagram showing a modification of the distance measuring devices 1 to 3 according to the first to third embodiments.
  • the control unit 14 and the image data processing units 20, 20a, and 20b of the distance measuring devices 1 to 3 shown in FIGS. 1, 10, and 13 include a memory 91 as a storage device that stores a program as software, and a memory 91. It can implement
  • the distance measurement program causes the projection unit 13 to sequentially project a plurality of pattern lights having a bright part region and a dark part region onto the subject, and the imaging unit 12 captures the subject to cope with the plurality of pattern lights.
  • An imaging step for acquiring a plurality of captured images, a surveying step for measuring a distance from the plurality of captured images to a subject at the target pixel by triangulation, and a comparison result of pixel values of the target pixels of the plurality of captured images.
  • a measurement error occurrence location determination step for determining whether or not the target pixel is a pixel at a location where a possibility of occurrence of a distance measurement error is high is executed by a computer as an information processing unit.
  • the imaging step of sequentially projecting pattern light onto a subject and capturing a plurality of captured images corresponding to the plurality of pattern lights by capturing the subject is automatically performed at a predetermined cycle, A distance measurement error occurs in the target pixel based on a measurement step of measuring the distance from the plurality of captured images to the subject in the target pixel by triangulation and a comparison result of the pixel values of the target pixel in the plurality of captured images.
  • the program may execute a measurement error occurrence location determination step for determining whether or not the pixel is at a location where there is a high possibility of being performed.

Landscapes

  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Measurement Of Optical Distance (AREA)
  • Optical Radar Systems And Details Thereof (AREA)

Abstract

距離計測装置(1)は、明部領域と暗部領域とを有する複数のパターン光を被写体に順次投写する投写部(13)と、被写体を撮像することで、複数のパターン光に対応する複数の撮像画像を取得する撮像部(12)と、複数の撮像画像から、注目画素における被写体までの距離を三角測量によって計測する三角測量部(22)と、複数の撮像画像の注目画素の画素値の比較結果に基づいて、注目画素が、距離計測誤りが発生する可能性が高い箇所の画素であるか否かを判定する計測誤り発生箇所判定部(21)とを備えている。複数のパターン光は、複数の第1パターン光と複数の第2パターン光とを含む。比較結果は、複数の第1パターン光を順次投写したときに取得された複数の撮像画像における注目画素の画素値のうちの最大値と複数の第2パターン光を順次投写したときに取得された複数の撮像画像における注目画素の画素値のうちの最大値との比較結果である。

Description

距離計測装置、距離計測方法、及び距離計測プログラム
 本発明は、被写体までの距離を計測する距離計測装置並びに被写体までの距離を計測するために用いられる距離計測方法及び距離計測プログラムに関する。
 従来、機械部品の加工又は検査に際し、機械部品(被写体)にレーザ光(パターン光)を照射する投光器と、縞状のパターン光の照射によって被写体の表面に形成された縞状の投写パターンを撮影するカメラとを組合せた距離計測装置が用いられている。この装置では、カメラによって取得された撮像画像における注目位置の輝度の明暗から、投光器から注目位置に向かう方向の角度を特定する。そして、投光器から注目位置に向かう方向の角度、カメラから注目位置に向かう方向の角度、及び投光器とカメラの間の距離を用いた三角測量によって、被写体の注目位置までの距離が算出される。この方法は、空間コード化法と呼ばれる。
 空間コード化法は、被写体の表面で拡散反射した光をカメラで撮影することを前提とする。このため、被写体の表面に当たった光が鏡面反射する場合又は透過する場合には、カメラに、被写体の表面で拡散反射した光(空間コード化法による距離計測に使用される光)以外の光である二次反射光又は透過光(距離計測に悪影響を与える光)が入射し、空間コードを正しく読み取ることができない場合がある。
 この対策として、空間コード化法による複数回の距離計測結果を比較することで、距離計測誤りの発生箇所を検出する装置が提案されている(例えば、特許文献1参照)。特許文献1に記載された距離計測装置は、縞の方向が異なる複数のパターン光を用いて複数回の距離計測を行い、複数の距離計測結果である複数の距離の間のずれが所定値より大きい場合に、距離計測結果を不正と判定する。
特開2015-78935号公報
 特許文献1に記載された距離計測装置では、投光器によるパターン光の投写、カメラによる被写体の撮影、撮像画像に基づく距離計測演算、という一連の処理を、複数回繰り返すことによって、距離計測結果が不正であるか否かを判定していた。このため、距離計測結果に対する判定が完了するまでに長時間を要するという課題があった。
 本発明は、距離計測に必要な時間の増加を抑制しつつ、距離計測結果の精度を向上させることができる距離計測装置、距離計測方法、及び距離計測プログラムを提供することを目的とする。
 本発明の一態様に係る距離計測装置は、明部領域と暗部領域とを有する複数のパターン光を被写体に順次投写する投写部と、前記被写体を撮像することで、前記複数のパターン光に対応する複数の撮像画像を取得する撮像部と、前記複数の撮像画像から、注目画素における前記被写体までの距離を三角測量によって計測する三角測量部と、前記複数の撮像画像の前記注目画素の画素値の比較結果に基づいて、前記注目画素が、距離計測誤りが発生する可能性が高い箇所の画素であるか否かを判定する計測誤り発生箇所判定部とを備え、前記投写部によって順次投写される前記複数のパターン光は、1つのパターン光の全面積に対する前記明部領域の面積の割合が第1の割合である複数の第1パターン光と、1つのパターン光の全面積に対する前記明部領域の面積の割合である第2の割合が前記第1の割合より小さい複数の第2パターン光とを含み、前記複数の第2パターン光は、前記複数の第2パターン光の明部領域を全て組み合わせると1つのパターン光の全域が組み合わされた明部領域に一致し、前記複数の撮像画像の前記注目画素の画素値の比較結果は、前記複数の第1パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値のうちの最大値と前記複数の第2パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値のうちの最大値との比較結果である、ことを特徴とする。
 本発明の一態様に係る距離計測方法は、明部領域と暗部領域とを有する複数のパターン光を被写体に順次投写する投写ステップと、前記被写体を撮像することで、前記複数のパターン光に対応する複数の撮像画像を取得する撮像ステップと、前記複数の撮像画像から、注目画素における前記被写体までの距離を三角測量によって計測する測量ステップと、前記複数の撮像画像の前記注目画素の画素値の比較結果に基づいて、前記注目画素が、距離計測誤りが発生する可能性が高い箇所の画素であるか否かを判定する計測誤り発生箇所判定ステップとを備え、前記投写ステップによって順次投写される前記複数のパターン光は、1つのパターン光の全面積に対する前記明部領域の面積の割合が第1の割合である複数の第1パターン光と、1つのパターン光の全面積に対する前記明部領域の面積の割合である第2の割合が前記第1の割合より小さい複数の第2パターン光とを含み、前記複数の第2パターン光は、前記複数の第2パターン光の明部領域を全て組み合わせると1つのパターン光の全域が組み合わされた明部領域に一致し、前記複数の撮像画像の前記注目画素の画素値の比較結果は、前記複数の第1パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値のうちの最大値と前記複数の第2パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値のうちの最大値との比較結果である、ことを特徴とする。
 本発明の一態様に係る距離計測プログラムは、投写部に、明部領域と暗部領域とを有する複数のパターン光を被写体に順次投写させる投写ステップと、撮像部に、被写体を撮像することで、前記複数のパターン光に対応する複数の撮像画像を取得させる撮像ステップと、前記複数の撮像画像から、注目画素における前記被写体までの距離を三角測量によって計測する測量ステップと、前記複数の撮像画像の前記注目画素の画素値の比較結果に基づいて、前記注目画素が、距離計測誤りが発生する可能性が高い箇所の画素であるか否かを判定する計測誤り発生箇所判定ステップと、をコンピュータに実行させ、前記投写ステップによって順次投写される前記複数のパターン光は、1つのパターン光の全面積に対する前記明部領域の面積の割合が第1の割合である複数の第1パターン光と、1つのパターン光の全面積に対する前記明部領域の面積の割合である第2の割合が前記第1の割合より小さい複数の第2パターン光とを含み、前記複数の第2パターン光は、前記複数の第2パターン光の明部領域を全て組み合わせると1つのパターン光の全域が組み合わされた明部領域に一致し、前記複数の撮像画像の前記注目画素の画素値の比較結果は、前記複数の第1パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値のうちの最大値と前記複数の第2パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値のうちの最大値との比較結果である、ことを特徴とする。
 本発明によれば、距離計測に必要な時間の増加を抑制しつつ、距離計測結果の精度を向上させることができる。
本発明の実施の形態1に係る距離計測装置の概略構成を示すブロック図である。 図1に示される光学系、撮像部、及び投写部の配置を概略的に示す図である。 図1に示される投写部によって投写されるパターン光のうち距離計測用に用いられるパターン光の例を示す図である。 図1に示される投写部によって投写されるパターン光のうち距離計測誤りの判定に用いられるパターン光の例を示す図である。 (a)から(c)は、被写体にパターン光を投写した場合における一次反射光の経路の例、二次反射光の経路の例、及び透過光の経路の例を示す図である。 (a)及び(b)は、パターン光が複数方向に投写された場合と単一方向に投写された場合の比較図である。 パターン光の画素値から被写体位置におけるパターン光を構成するストライプの位置番号を算出する方法を示す図である。 パターン光を構成するストライプの位置番号を示す図である。 投写部、撮像部、及び被写体の位置関係に基づいて行う距離計測方法を示す図である。 本発明の実施の形態2に係る距離計測装置の概略構成を示すブロック図である。 本発明の実施の形態2においてパターン光の画素値から被写体位置におけるパターン光を構成するストライプの位置番号を算出する方法を示す図である。 本発明の実施の形態3に係る距離計測装置の概略構成を示すブロック図である。 実施の形態3においてパターン光の画素値から被写体位置におけるパターン光を構成するストライプの位置番号を算出する方法を示す図である。 実施の形態1から3の変形例を示すハードウェア構成図である。
《1》実施の形態1.
《1-1》構成
 図1は、本発明の実施の形態1に係る距離計測装置1の概略構成を示すブロック図である。距離計測装置1は、実施の形態1に係る距離計測方法を実施することができる装置である。図1に示されるように、距離計測装置1は、主要な構成として、撮像空間内にある被写体(物体)を撮影することで撮像画像(画像データ)を取得する画像データ取得部10と、画像データ取得部10で取得された画像データ(例えば、撮像画像における各画素の輝度値、すなわち、画素値)を用いて被写体までの距離(被写体距離)Zを求め、求められた距離Zを示す距離データZout(例えば、画素毎の距離データ)を出力する画像データ処理部20とを備えている。画像データ処理部20は、距離データZoutを数値で表示するための、又は距離データZoutを示すマップを表示するための表示部(例えば、液晶表示部)を備えてもよい。また、画像データ処理部20は、距離計測装置1を操作するためのユーザ指示入力を受け付けるユーザ操作部を備えてもよい。
 図1に示されるように、画像データ取得部10は、レンズ又はレンズ群などの光学部材と焦点距離(焦点位置)を変更する機構とを備えた光学系11と、光学系11を介して(例えば、レンズを介して)被写体を撮影するカメラ等の撮像部12と、撮像空間内に存在する被写体に複数のパターン光を投写(照射)する投光装置である投写部13とを備えている。また、光学系11は、絞りを調節する絞り調節機構を有してもよい。また、画像データ取得部10は、画像データ取得部10全体(光学系11、撮像部12、及び投写部13を含む)を制御する制御部14を備えている。
 制御部14は、予め定められた複数のパターン光から投写対象のパターン光を選択し、投写部13に投写対象のパターン光を順次投写させて、撮像部12に複数のパターン光に対応する複数の撮像画像Gを取得させる。複数のパターン光の例は、後述する図3において、12種類のパターン光(第1パターン光)A1,A2,B1,B2,C1,C2,D1,D2,E1,E2,F1,F2(以下「パターン光A1,…,F2」とも記載する)として示される。また、計測誤り発生箇所の判定に用いられる複数のパターン光の例は、後述する図4において、16種類のパターン光(第2パターン光)X1,…,X16として示される。複数の撮像画像Gのうちのパターン光A1,…,F2の投写時には、撮像部12は、複数の撮像画像(画像データ)GA1,GA2,GB1,GB2,GC1,GC2,GD1,GD2,GE1,GE2,GF1,GF2(以下「撮像画像GA1,…,GF2」とも記載する)をそれぞれ取得する。複数の撮像画像Gのうちの複数のパターン光X1,…,X16の投写時には、撮像部12は、複数の撮像画像GX1,…,GX16をそれぞれ取得する。
 複数のパターン光(第1パターン光)A1,…,F2(図3)は、1つのパターン光の全面積に対する明部領域の面積の割合(第1の割合)、すなわち、被写体上に形成される投写パターンの全面積に対する光投写部分の面積の割合が、互いに異なるパターン光である。実施の形態1においては、複数のパターン光A1,…,F2を用いて、注目画素の被写体距離Zが求められる。また、複数のパターン光(第1パターン光)A1,…,F2は、複数対(例えば、8対)のパターン光であり、各対のパターン光は、互いに明部領域と暗部領域とを逆にしたパターン光である。
 複数のパターン光(第2パターン光)X1,…,X16(図4)は、1つのパターン光の全面積に対する明部領域の面積の割合(第2の割合)が、複数のパターン光(第1パターン光)A1,…,F2の面積(第1の割合)の割合よりも低いパターン光であり、互いに明部領域の位置が異なるパターン光である。また、複数のパターン光(第2パターン光)X1,…,X16の明部領域を全て組み合わせると、1つのパターン光の全体、すなわち、被写体上に形成される投写パターンの全域がカバーされる。すなわち、複数のパターン光(第2パターン光)X1,…,X16は、互いに明部領域の位置が異なるパターン光であり、複数の第2パターン光の明部領域を全て組み合わせると、1つのパターン光の全域が組み合わされた明部領域に一致する。
 図1に示されるように、画像データ処理部20は、計測誤り発生箇所判定部21と、三角測量部22と、計測結果合成部23とを備えている。
 三角測量部22は、撮像部12から受け取った撮像画像GA1,…,GF2を用いて、三角測量によって画素ごとに被写体距離Zを取得する。
 計測誤り発生箇所判定部21は、撮像部12から受け取った複数の撮像画像Gを用いて、すなわち、撮像画像GA1,…,GF2と撮像画像GX1,…,GX16とを用いて、撮像画像間の注目画素の画素値の比率等に基づいて、注目画素が、距離計測誤りが発生する可能性が高い箇所の画素であるか否かを判定する。
 計測結果合成部23は、三角測量部22で画素毎に得られた複数の計測結果である複数の被写体距離のうち、計測誤り発生箇所判定部21において、距離計測誤りが発生する可能性が高いと判定された箇所の計測結果を削除し、削除された箇所を「計測結果なし」に差し替えて、画素毎の被写体距離Zと距離計測誤りが発生する可能性が高いと判定された箇所を示す情報とを含む距離データZoutを出力する。
 図2は、図1の光学系11、撮像部12、及び投写部13の配置を概略的に示す図である。投写部13は、光源と、液晶パネル又はDMD(Digital Micromirror Device)とを組み合わせることによって構成されており、任意のパターン光を投写することが可能なプロジェクタである。図2に示されるように、距離計測装置1の画像データ取得部10は、投写部13により撮像空間JS内の被写体OJ1,OJ2に向けて、交互に並ぶ明部領域(投写部13からの光が投写される領域)のストライプ(以下「明部ストライプ」とも言う)と明部領域よりも暗い暗部領域(投写部13からの光が投写されない領域)のストライプ(以下「暗部ストライプ」とも言う)とから構成されるパターン光13aを投写し、パターン光13aが投写されている被写体OJ1,OJ2を、光学系11を通して撮像部12で撮影する。
 図3における12種類のパターン光A1,…,F2、及び図4における16種類のパターン光X1,…,X16は、図1に示される投写部13によって投写される28種類のパターン光13aの例、すなわち、明部領域(図における白い領域)の明部ストライプと暗部領域(図における網掛け領域)の暗部ストライプとが配列方向(図における横方向)に交互に並ぶパターン光の例である。ただし、パターン光13aの例は、図示の例に限定されず、パターン光13aの種類の数も28種類に限定されない。
 実施の形態1においては、28種類のパターン光のうち、図3に示される12種類のパターン光A1,…,F2は、被写体距離Zの計測に用いられるパターン光である。図3において、パターン光A1,A2は、ストライプ(例えば、S=0)の配列方向の幅が最も狭いパターン光である。図3において、パターン光B1,B2のストライプ(例えば、S=0~1)の配列方向の幅は、パターン光A1,A2のストライプの幅の2倍である。図3において、パターン光C1,C2のストライプ(例えば、S=0~3)の幅は、パターン光B1,B2のストライプの幅の2倍である。図3において、パターン光D1,D2のストライプ(例えば、S=0~7)の幅は、パターン光C1,C2のストライプの幅の2倍である。図3において、パターン光E1,E2のストライプ(例えば、S=0~15)の幅は、パターン光D1,D2のストライプの幅の2倍である。図3において、パターン光F1,F2のストライプ(例えば、S=0~31)の幅は、パターン光E1,E2のストライプの幅の2倍である。
 また、図3において、パターン光A1における明部ストライプと暗部ストライプとを入れ替える(逆にする)ことによって得られたパターン光が、パターン光A2である。図3において、パターン光B1における明部ストライプと暗部ストライプとを入れ替える(逆にする)ことによって得られたパターン光が、パターン光B2である。図3において、パターン光C1における明部ストライプと暗部ストライプとを入れ替える(逆にする)ことによって得られたパターン光が、パターン光C2である。図3において、パターン光D1における明部ストライプと暗部ストライプとを入れ替える(逆にする)ことによって得られたパターン光が、パターン光D2である。図3において、パターン光E1における明部ストライプと暗部ストライプとを入れ替える(逆にする)ことによって得られたパターン光が、パターン光E2である。図3において、パターン光F1における明部ストライプと暗部ストライプとを入れ替える(逆にする)ことによって得られたパターン光が、パターン光F2である。
 実施の形態1においては、28種類のパターン光のうち、図4に示される16種類のパターン光X1,…,X16は、注目画素が、距離計測誤りが発生する可能性が高い箇所(領域)の画像であるか否かの判定に用いられるパターン光である。図4に示されるパターン光X1,…,X16の1周期の幅(パターン光A1における16本のストライプの幅に相当する)は、図3におけるパターン光D1及びD2の1周期の幅(例えば、S=0~15の幅)と同じである。図4に示されるパターン光X1,…,X16の明部ストライプの幅は、パターン光の1周期の幅の1/16である。図4に示されるパターン光X1,…,X16の暗部ストライプの幅は、パターン光の1周期の幅の15/16以下である。16種類のパターン光X1,…,X16は、パターン光X1,X2,…の順に、明部ストライプの幅の分だけ明部ストライプが図4における右側にずれるようなパターンとなっている。このため、パターン光X1,…,X16のいずれかを選んで重ね合わせると、パターン光の投写領域の全ての位置が、いずれかのパターン光の明部ストライプに含まれる。なお、複数のパターン光の組み合わせは、複数のパターン光で、パターン光の投写領域の全体の位置が、複数のパターン光のいずれかのパターン光の明部領域に含まれるように構成されているものであれば、図4の例に限定されず、また、パターン光の数も16種類に限定されない。
《1-2》動作
 制御部14は、投写部13にパターン光を順次投写させて撮像部12に複数のパターン光に対応する複数の撮像画像Gを取得させる。複数のパターン光の一例は、図3に示されるパターン光A1,…,F2、及び図4に示されるパターン光X1,…,X16である。
 計測誤り発生箇所判定部21は、パターン光A1,…,F2、及びパターン光X1,…,X16が順次投写された撮像空間を撮像部12によって撮影することで得られた撮像画像GA1,…,GF2、及び撮像画像GX1,…,GX16を参照して、注目画素が、距離計測誤りが発生する可能性が高い箇所(領域)の画素であるか否かを判定する。
 ここで、計測誤りの判定原理について説明する。図5(a)から(c)は、被写体にパターン光13aを投写した場合の一次反射光11a,11b、二次反射光11c、及び透過光11dの経路の例を示す図である。図5(a)は、投写部13から出射したパターン光13aが被写体15の表面15aで1回拡散反射して一次反射光11aとなり、この一次反射光11aのうちの撮像部12に入射する成分を示している。また、図5(a)は、投写部13から出射したパターン光13aが、被写体15が載置されている載置面18の表面で1回拡散反射して一次反射光11aとなり、この一次反射光11aのうちの撮像部12に入射する成分をも示している。実施の形態1では、図5(a)に示される一次反射光11aの経路が、被写体距離の計測に用いられるべき光経路(本来想定された望ましい光経路)であり、この一次反射光11aを用いて被写体距離Zが計測されることが望ましい。
 図5(b)は、投写部13から出射したパターン光13aが被写体16の表面16aで1回反射して一次反射光11bとなり、載置面18でさらに1回反射して二次反射光11cとなり、この二次反射光11cのうちの撮像部12に入射する成分を示している。図5(b)には、合計反射回数が2回の場合の二次反射光11cの経路の例を示したが、本出願における二次反射光は、合計反射回数が3回以上の反射光をも含む。被写体16の表面16aに光沢がなく、被写体16の表面16aに当たった光が拡散反射する場合には、二次反射光11cは、大きく減衰した光であるため、撮像画像の輝度(すなわち、図5(a)に示される一次反射光11aによる撮像画像の輝度)に大きな影響を与えない。しかし、被写体16の表面16aが金属光沢を持つ場合、すなわち、被写体16が鏡面反射物体である場合には、一次反射光11bの強度は投写部13から出射したパターン光13aの強度と同程度であるので、二次反射光11cの強度も強く、二次反射光11cは撮像画像の輝度(すなわち、図5(a)に示される一次反射光11aによる撮像画像の輝度)に大きな影響を与える。
 図5(c)は、被写体17が光透過性(透明及び半透明を含む)であり、被写体17を透過した透過光11dの一部が撮像部12に入射する場合を示している。この場合には、二次反射光又は透過光11dが撮像部12に入射し、撮像画像に重畳されることで、一次反射光(図5(a)に示される一次反射光11a)の輝度の大小とは異なる撮像画像が得られ、パターン光13aの投写によって被写体17の表面に形成される投写パターンの位置(被写体距離)を正確に算出できない。
 ここで、二次反射光及び透過光は、撮像部12に向かう方向に進む望ましい一次反射光(図6(a)に示される一次反射光11a)を発生させるパターン光(図6(a)に示されるパターン光13a1)とは異なる方向に投写されたパターン光13a2に起因している。図6(a)及び(b)は、パターン光が複数方向に投写された場合と単一方向に投写された場合とをそれぞれ示す図である。図6(a)に示されるように、投写部13からパターン光13a1,13a2が複数方向に投写されると、望ましい一次反射光11aの経路以外の経路を、望ましくない二次反射光11a2が進み、望ましくない二次反射光11a2が望ましい一次反射光11aと同一方向に進んで撮像部12に入射する。
 これに対し、図6(b)に示されるように、パターン光13aが単一方向に投写される場合には、望ましい一次反射光11aを生じさせる経路と異なる経路には、パターン光13aが投写されないため、発生した二次反射光が一次反射光11aに重畳されるという望ましくない事態の発生を抑制することができる。
 なお、図6(a)及び(b)では、二次反射光を例に挙げて説明しているが、図5(c)に示されるような透過光11dが発生している場合でも、一次反射光11aの経路以外の経路を進む光が、一次反射光11aと同一方向に進んで撮像部12に入射することで、一次反射光11aの輝度の大小とは異なる撮像画像が得られ、投写パターンの位置を正確に算出できない理由は同様である。したがって、図6(b)に示されるように、パターン光13aの投写方向が単一方向であれば、発生した透過光11dが一次反射光11aに重畳される事態の発生を抑えることができる。
 上記のように二次反射光11c(図5(b)),11a2(図6(a))及び透過光11d(図5(c))は、一次反射光11aの元になるパターン光13aとは異なる方向に投写されたパターン光13a2(図6(a))によって生じた一次又は二次反射光が、望ましい一次反射光11aに重畳されることで発生し、二次反射光11a2及び透過光11dが一次反射光11aに重畳される事態の発生し易さは、投写されるパターン光全体に占める光投写部分(明部領域)の面積に応じて増加する。すなわち、投写部13から投写されるパターン光13aの光量(すなわち、パターン光の全体に対する明部領域の面積の割合であり、被写体上に形成された投写パターンの全面積に対する光投写部分の面積の割合である)が増えれば、望ましい一次反射光11aと異なる経路で一次反射光11aと同じ方向に進んで撮像部12に入射する望ましくない二次反射光11a2及び透過光11dの発生可能性が高くなる。逆に、投写部13から投写されるパターン光の光量(すなわち、投写パターンの全面積に対する光投写部分の面積の割合)が少ないほど、二次反射光11a2及び透過光11dが発生する経路に光が投写される可能性が低くなり、二次反射光11a2及び透過光11dの影響を小さく抑えることができる。
 これは、撮像画像で言えば、投写部13から投写されるパターン光の光量(すなわち、投写パターンの全面積に対する光投写部分の面積の割合)が減少することで、一次反射光11aに重畳される二次反射光11a2及び透過光11dの発生しうる経路のうち、光が実際に投写される経路が減り、一次反射光11aに重畳される二次反射光11a2及び透過光11dの量が減ることに相当する。実施の形態1においては、一次反射光11aに重畳される二次反射光11a2及び透過光11dの量を減らすことができるパターン光として、パターン光の光量(すなわち、投写パターンの全面積に対する光投写部分の面積の割合)が低い図4のパターン光を用いる。
 計測誤り発生箇所判定部21では、上記のように投写パターン中の光投写部分の面積が異なると、一次反射光11aに重畳される二次反射光11a2及び透過光の強度が変化することを利用し、光量が多いパターン光の投写時(実施の形態1では、図3のパターン光の投写時)における輝度と光量が少ないパターン光の投写時(実施の形態1では、図4のパターン光の投写時)における輝度との違い(輝度変動)が大きい場所を、二次反射光11a2及び透過光11dによる距離計測誤りが発生する可能性が高い箇所と判定する。
 以下に、注目画素が、距離計測誤りが発生する可能性が高い箇所(領域)の画素であるか否かの判定方法について具体的に説明する。図3に示されるパターン光A1,…,F2及び図4に示されるパターン光X1,…,X16が投写されたときの撮像画像における、ある注目画素の画素値をP(A1),P(A2),P(B1),P(B2),P(C1),P(C2),P(D1),P(D2),P(E1),P(E2),P(F1),P(F2)(以下「P(A1),…,P(F2)」とも記載する)、及びP(X1),…,P(X16)とする。
 計測誤り発生箇所判定部21は、画素値P(A1),…,P(F2)のうちの最大値である第1の最大画素値PMAX1を取得し、画素値P(X1),…,P(X16)のうちの最大値である第2の最大画素値PMAX2を取得する。
 計測誤り発生箇所判定部21は、予め定められた判定閾値比率KMAXを記憶部21aに記憶しており、
MAX1>PMAX2*KMAX
を満たす注目画素は、パターン光の光量の変化による二次反射光の光量又は透過光の光量の変化が大きい箇所とみなし、この注目画素は、二次反射光及び透過光による距離計測誤りが発生している可能性が高い箇所の画素であると判定する。この判定結果は、計測結果合成部23に送られる。
 なお、計測誤り発生箇所判定部21は、投写光以外の環境光の影響を差し引くために、注目画素が、距離計測誤りが発生する可能性が高い箇所の画素であるか否かの判定を、第1の最大画素値PMAX1と第2の最大画素値PMAX2との比率に基づいて行う代わりに、最大値と最小値の差分の比率で行ってもよい。例えば、計測誤り発生箇所判定部21は、画素値P(A1),…,P(F2)のうちの最大値PMAX1と最小値PMIN1の差である第1の画素値差分PDIF1(=PMAX1-PMIN1)を取得し、画素値P(X1),…,P(X16)のうちの最大値PMAX2と最小値PMIN2の差である第2の画素値差分PDIF2(=PMAX2-PMIN2)を取得し、予め定められた判定閾値差分KDIFを用いて、
DIF1>PDIF2*KDIF
を満たす注目画素は、パターン光の光量の変化による二次反射光の光量又は透過光の光量の変化が大きい箇所とみなし、この注目画素は、二次反射光及び透過光によって距離計測誤りが発生している可能性が高い箇所の画素であると判定してもよい。
 三角測量部22は、明部ストライプと暗部ストライプとが互いに逆である1対のパターン光に対する撮像画像の差分に基づいて、撮像画像上に投写されているパターン光によって形成される投写パターンの位置を特定し、三角測量の原理で被写体までの距離を計測する。
 図3に示されるパターン光A1,…,F2が投写されたときに撮像空間に形成される投写パターンの撮像画像における、ある注目画素の画素値を、それぞれP(A1),…,P(F2)とする。
 ここで、図7は、パターン光の画素値から被写体位置におけるパターン光を構成するストライプの位置番号Sを算出する方法を示す図である。図8は、パターン光を構成するストライプの位置番号(図3におけるパターン光A1及びA2の明部ストライプと暗部ストライプの位置番号)Sを示す図である。
 三角測量部22は、画素値P(A1)とP(A2)の関係に基づき、パターン位置番号Sのbit0の値を決める。三角測量部22は、パターン位置番号をS(6ビット値)とし、予め定められた閾値Tsを用いて、
P(A1)+Ts<P(A2)であれば、パターン位置番号Sのbit0に1を割り当て、
P(A1)>P(A2)+Tsであれば、パターン位置番号Sのbit0に0を割り当て、
|P(A1)-P(A2)|≦Tsであれば、エラーとしてパターン位置番号Sにエラーを示す値を設定する。三角測量部22は、エラーの場合には、パターン位置番号Sのbit0の値を決める処理を打ち切ることができる。
 同様に、三角測量部22は、画素値P(B1)とP(B2)の関係に基づき、パターン位置番号Sのbit1の値を決める。三角測量部22は、
P(B1)+Ts<P(B2)であれば、パターン位置番号Sのbit1に1を割り当て、
P(B1)>P(B2)+Tsであれば、パターン位置番号Sのbit1に0を割り当て、
|P(B1)-P(B2)|≦Tsであれば、エラーとしてパターン位置番号Sにエラーを示す値を設定する。エラーの場合には、三角測量部22は、パターン位置番号Sのbit1の値を決める処理を打ち切ることができる。
 同様に、三角測量部22は、画素値P(C1)とP(C2)の関係に基づき、パターン位置番号Sのbit2の値を決める。三角測量部22は、
P(C1)+Ts<P(C2)であれば、パターン位置番号Sのbit2に1を割り当て、
P(C1)>P(C2)+Tsであれば、パターン位置番号Sのbit2に0を割り当て、
|P(C1)-P(C2)|≦Tsであれば、エラーとしてパターン位置番号Sにエラーを示す値を設定する。エラーの場合には、三角測量部22は、パターン位置番号Sのbit2の値を決める処理を打ち切ることができる。
 同様に、三角測量部22は、画素値P(D1)とP(D2)の関係に基づき、パターン位置番号Sのbit3の値を決める。三角測量部22は、
P(D1)+Ts<P(D2)であれば、パターン位置番号Sのbit3に1を割り当て、
P(D1)>P(D2)+Tsであれば、パターン位置番号Sのbit3に0を割り当て、
|P(D1)-P(D2)|≦Tsであれば、エラーとしてパターン位置番号Sにエラーを示す値を設定する。エラーの場合には、三角測量部22は、パターン位置番号Sのbit3の値を決める処理を打ち切ることができる。
 同様に、三角測量部22は、画素値P(E1)とP(E2)の関係に基づき、パターン位置番号Sのbit4の値を決める。三角測量部22は、
P(E1)+Ts<P(E2)であれば、パターン位置番号Sのbit4に1を割り当て、
P(E1)>P(E2)+Tsであれば、パターン位置番号Sのbit4に0を割り当て、
|P(E1)-P(E2)|≦Tsであれば、エラーとしてパターン位置番号Sにエラーを示す値を設定する。エラーの場合には、三角測量部22は、パターン位置番号Sのbit4の値を決める処理を打ち切ることができる。
 同様に、三角測量部22は、画素値P(F1)とP(F2)の関係に基づき、パターン位置番号Sのbit5の値を決める。三角測量部22は、
P(F1)+Ts<P(F2)であれば、パターン位置番号Sのbit5に1を割り当て、
P(F1)>P(F2)+Tsであれば、パターン位置番号Sのbit5に0を割り当て、
|P(F1)-P(F2)|≦Tsであれば、エラーとしてパターン位置番号Sにエラーを示す値を設定する。エラーの場合には、三角測量部22は、パターン位置番号Sのbit5の値を決める処理を打ち切ることができる。
 以上の処理により、パターン位置番号Sには、パターン上の位置に対応したユニークな値が設定される。
 図9は、図1に示される三角測量部22が、投写部13、撮像部12、及び被写体の位置関係に基づいて行う距離計測方法を示す図である。図9において、角度θは、先に求めたパターン位置番号Sに基づき算出可能である。具体的には、パターン位置番号Sと角度θを対応付けるためのデータである第1のルックアップテーブル(LUT)を記憶部22aに予め用意しておき、第1のLUTを参照することで角度θを求めることができる。また、図9において、角度φは、撮像部12の撮影によって取得された撮像画像上の位置に基づき算出可能である。画像上の被写体の水平方向座標と角度φを対応付けるための第2のルックアップテーブル(LUT)を記憶部22aに予め用意しておき、参照することで角度φを求める。角度θと角度φ、及び基線長Lの値から被写体までの距離Zを、次式(1)で算出する。
Z=L/(tanθ+tanφ)              (1)
 計測結果合成部23は、注目画素位置毎に計測誤り発生箇所判定部21と三角測量部22の結果を参照し、出力する距離計測結果の補正を行う。すなわち、三角測量部22で得られた画素毎の被写体距離Zのうち、計測誤り発生箇所判定部21において計測誤り発生の可能性が高いと判定された箇所の画素についての計測結果を「計測結果なし」に差し替えて出力する。
《1-3》効果
 従来の三角測量による距離計測では、二次反射光又は透過光が撮像画像に重畳されることで、一次反射光の輝度の大小とは異なる撮像画像が得られ、投写パターンの位置を正しく判定できないことがあった。投写パターンの位置が誤って判定されると、該当箇所では誤った距離計測結果が出力されることとなり、計測対象である被写体の形状を正しく把握することができない。
 これに対し、実施の形態1に係る距離計測装置1によれば、投写されるパターン光の光量が異なる複数種類のパターン光を投写し、撮像画像の画素値の変動が大きい画素を、距離計測誤りが発生する可能性が高い箇所の画素であると判定して、計測結果から排除して出力するので、二次反射光又は透過光が発生している撮影条件であっても、正しい被写体距離を出力することができる。
 また、特許文献1に示す先行技術は、三角測量による距離計測において計測誤り箇所の検出を実現するものである。しかし、特許文献1に示す先行技術では、複数の撮影条件で算出した距離の計測結果を比較し、複数の計測結果の誤差が大きい箇所を計測誤りと判定するため、最終的な結果を得るためには撮影画像から被写体距離を算出する処理を複数回繰り返す必要があり、計測誤りを判定するために必要な演算量の増加が大きくなる課題があった。
 これに対し本実施の形態1に係る距離計測装置1によれば、投写されるパターン光の光量が異なる複数種類のパターン光を投写し、距離計測処理に含める形で計測結果の有効又は無効を判定するため、距離計測処理を複数回繰り返して実行する必要がなく、計測誤りを検出するために必要な演算量の増加を抑えることができる。
《2》実施の形態2.
《2-1》構成
 図10は、本発明の実施の形態2に係る距離計測装置2の概略構成を示すブロック図である。距離計測装置2は、実施の形態2に係る距離計測方法を実施することができる装置である。図10において、図1に示される構成要素と同一又は対応する構成要素には、図1に示される符号と同じ符号が付される。実施の形態2に係る距離計測装置2は、投写部13によって投写されるパターン光の数及び種別の点及び画像データ処理部20aにおいて使用する撮像画像の点において、実施の形態1に係る距離計測装置1と異なる。具体的に言えば、実施の形態2では、実施の形態1の場合よりも、使用するパターン光の種類が少なく、図3及び図4に示されるパターン光のうちのパターン光E1,E2,F1,F2、及びパターン光X1,…,X16を使用する。他の点について、実施の形態2は、実施の形態1と同じである。したがって、実施の形態2の説明に際しては、図2から図9を参照する。
《2-2》動作
 図3に示されるパターン光A1,A2,B1,B2,C1,C2,D1,D2は、図4に示されるパターン光X1,…,X16のいずれかを組合せることによって作ることが可能である。具体的には、パターン光A1は、図4に示されるパターン光X1,X3,X5,X7,X9,X11,X13,X15の組み合わせと同じであり、パターン光A2は、図4に示されるパターン光X2,X4,X6,X8,X10,X12,X14,X16の組み合わせと同じである。また、パターン光B1は、図4に示されるパターン光X1,X2,X5,X6,X9,X10,X13,X14の組み合わせと同じであり、パターン光B2は、図4に示されるパターン光X3,X4,X7,X8,X11,X12,X15,X16の組み合わせと同じである。また、パターン光C1は、図4に示されるパターン光X1,X2,X3,X4,X9,X10,X11,X12の組み合わせと同じであり、パターン光C2は、図4に示されるパターン光X5,X6,X7,X8,X13,X14,X15,X16の組み合わせと同じである。また、パターン光D1は、図4に示されるパターン光X1,X2,X3,X4,X5,X6,X7,X8の組み合わせと同じであり、パターン光D2は、図4に示されるパターン光X9,X10,X11,X12,X13,X14,X15,X16の組み合わせと同じである。よって、パターン光X1,…,X16が投写されたときの撮像画像における、ある注目画素の画素値をP(X1),…,P(X16)とした場合に、例えば、P(X1),P(X3),P(X5),P(X7),P(X9),P(X11),P(X13),P(X15)の最大値をとることでパターン光A1の投写時の撮像画像に相当する画像を得ることができる。
 同様に、各組合せの画像で画素値の最大値をとることにより、計測誤り発生箇所判定部21及び三角測量部22は、パターン光A1,A2,B1,B2,C1,C2,D1,D2の投写時の撮像画像に相当する画像を得ることができる。計測誤り発生箇所判定部21及び三角測量部22においてこれらの画像を用いることにより、パターン光A1,A2,B1,B2,C1,C2,D1,D2の投写を行わなくても、被写体の距離計測及び距離計測誤りが発生する可能性が高いと箇所か否かの判定を行うことが可能である。これにより、距離計測に必要なパターン光の種類を減らすことができ、実施の形態1と比較して1回の距離計測に必要な時間を削減することが可能である。
 このとき、計測誤り発生箇所判定部21では、まずP(E1),P(E2),P(F1),P(F2)の値の最大値をPMAX1とし、P(X1),…,P(X16)の最大値をPMAX2とし、予め定められた判定閾値比率KMAXを用いて、
MAX1>PMAX2*KMAXを満たす注目画素は、パターン光の光量の変化により一次反射光に重畳される二次反射光の光量又は透過光の光量の変化が大きい箇所とみなし、二次光及び透過光による距離計測誤りの発生する可能性が高い箇所の画素であると判定する。この判定結果は、計測結果合成部23に送付される。
 なお、ここでは、実施の形態1の場合と同様に、最大値と最小値の差分値を用いた判定を行ってもよい。
 また、三角測量部22は、前述したように、図3に示されるパターン光A1,A2,B1,B2,C1,C2,D1,D2を、図4に示されるパターン光X1,…,X16のいずれかを組合せることで生成して計測を行うのではなく、パターン光X1,…,X16の各々が投写されたときの撮像画像から直接パターン位置番号Sのbit値を得ることも可能である。その場合の方式を以下に示す。
 実施の形態1では、図7におけるパターン位置番号Sのbit値bit0,…,bit3に、画素値P(A1)とP(A2)の大小関係に基づく値、画素値P(B1)とP(B2)の大小関係に基づく値、画素値P(C1)とP(C2)の大小関係に基づく値、画素値P(D1)とP(D2)の大小関係に基づく値が割り当てられた。
 これに対し、実施の形態2では、画素値P(X1),…,P(X16)のうちの、最も大きい値に対応するビット値を、パターン位置番号Sのbit値bit0,bit1,bit2,bit3に割り当てることでパターン位置番号Sを求める。図11は、実施の形態2においてパターン光の画素値から被写体位置におけるパターン光を構成するストライプの位置番号を算出する方法を示す図である。図11に示されるように、「bit3、bit2、bit1、bit0」で表される4bit値は、P(X1)が最大であれば「0」、P(X2)が最大であれば「1」、P(X3)が最大であれば「2」、P(X4)が最大であれば「3」、P(X5)が最大であれば「4」、P(X6)が最大であれば「5」、P(X7)が最大であれば「6」、P(X8)が最大であれば「7」、P(X9)が最大であれば「8」、P(X10)が最大であれば「9」、P(X11)が最大であれば「10」、P(X12)が最大であれば「11」、P(X13)が最大であれば「12」、P(X14)が最大であれば「13」、P(X15)が最大であれば「14」、P(X16)が最大であれば「15」である。なお、1つのパターン光(パターン画像)で確実に値が最大となっていることを確認するために、画素値P(X1),…,P(X16)の値のうちの最も大きい画素値と2番目に大きい画素値との差分Dを算出し、この差分Dが予め定められた閾値Txよりも小さい場合に、エラーとしてパターン位置番号Sにエラーを示す値を設定してもよい。
 なお、ビット値bit5、bit4の算出方法は、実施の形態1の場合と同じである。
《2-3》効果
 実施の形態2に係る距離計測装置によれば、注目画素が、距離計測誤りが発生する可能性が高い箇所の画素であるか否かの判定に用いるパターン光を、距離計測用のパターン光の一部の代用として使用することができるため、距離計測のみの計測を行う場合に対する、距離計測誤りの判定を同時に行う場合の投写パターン総数の増加を抑えることができ、計測に必要な時間の増加を抑えることが可能である。
《3》実施の形態3.
《3-1》構成
 図12は、本発明の実施の形態3に係る距離計測装置3の概略構成を示すブロック図である。距離計測装置3は、実施の形態3に係る距離計測方法を実施することができる装置である。図12において、図1に示される構成要素と同一又は対応する構成要素には、図1に示される符号と同じ符号が付される。実施の形態3に係る距離計測装置3は、画像データ処理部20bの構成の点において、実施の形態1に係る距離計測装置1と相違する。
 上記実施の形態1に係る距離計測装置1では、距離計測誤りが発生する可能性が高いと判定された箇所についての距離計測結果を削除し、削除された距離計測結果を「距離計測結果なし」を示す情報に差し替えて出力する。
 これに対し、実施の形態3では、正しい距離計測結果を得られない原因となる撮像画像を特定することにより、距離計測誤りが発生する可能性が高いと判定された箇所についても、距離計測結果(誤差を含む)を出力する。なお、実施の形態3に係る距離計測装置3の特徴を、実施の形態2に係る距離計測装置2に適用してもよい。
《3-2》動作
 以下に、実施の形態3に係る距離計測装置3の画像データ処理部20bの動作を説明する。
 まず、画像データ処理部20bの計測誤り発生箇所判定部221の動作について説明する。図3に示されるパターン光A1,…,F2及び図4に示されるパターン光X1,…,X16が投写されたときの撮像画像における、ある注目画素の画素値をP(A1),…,P(F2)及びP(X1),…,P(X16)とする。
 計測誤り発生箇所判定部221は、注目画素の画素値P(A1),…,P(F2)及び画素値P(X1),…,P(X16)を取得する。
 次に、計測誤り発生箇所判定部221は、互いに反転関係にある2つのパターン光A1,A2を順次投写したときに得られる、注目画素の画素値P(A1)とP(A2)を比較し、これらのうちの大きい方の画素値LAを取得する。
 同様に、計測誤り発生箇所判定部221は、互いに反転関係にある2つのパターン光B1,B2を順次投写したときに得られる、注目画素の画素値P(B1)とP(B2)を比較し、これらのうちの大きい方の画素値LBを取得する。
 同様に、計測誤り発生箇所判定部221は、互いに反転関係にある2つのパターン光C1,C2を順次投写したときに得られる、注目画素の画素値P(C1)とP(C2)を比較し、これらのうちの大きい方の画素値LCを取得する。
 同様に、計測誤り発生箇所判定部221は、互いに反転関係にある2つのパターン光D1,D2を順次投写したときに得られる、注目画素の画素値P(D1)とP(D2)を比較し、これらのうちの大きい方の画素値LDを取得する。
 同様に、計測誤り発生箇所判定部221は、互いに反転関係にある2つのパターン光E1,E2を順次投写したときに得られる、注目画素の画素値P(E1)とP(E2)を比較し、これらのうちの大きい方の画素値LEを取得する。
 同様に、計測誤り発生箇所判定部221は、互いに反転関係にある2つのパターン光F1,F2を順次投写したときに得られる、注目画素の画素値P(F1)とP(F2)を比較し、これらのうちの大きい方の画素値LFを取得する。
 また、計測誤り発生箇所判定部221は、明部ストライプの間隔は互いに等しく、明部ストライプの位置が互い異なるパターン光X1,…,X16を順次投写したときに得られる、注目画素の画素値P(X1),…,P(X16)を比較し、これらのうちの最大値PMAX2を取得する。
 計測誤り発生箇所判定部221は、予め定められた判定閾値比率KMAXを記憶部221aに格納しておき、取得された画素値LAと基準値PMAX2*KMAXとを比較する。計測誤り発生箇所判定部221は、
LA≦PMAX2*KMAXの場合は、計測誤りフラグFAに0(すなわち、注目画素が距離計測誤り発生箇所でないことを示すフラグ)を設定し、
LA>PMAX2*KMAXの場合は、計測誤りフラグFAに1(すなわち、注目画素が距離計測誤り発生箇所であることを示すフラグ)を設定する。
 同様に、計測誤り発生箇所判定部221は、取得された画素値LBと基準値PMAX2*KMAXとを比較し、
LB≦PMAX2*KMAXの場合は、計測誤りフラグFBに0を設定し、
LB>PMAX2*KMAXの場合は、計測誤りフラグFBに1を設定する。
 同様に、計測誤り発生箇所判定部221は、取得された画素値LCと基準値PMAX2*KMAXとを比較し、
LC≦PMAX2*KMAXの場合は、計測誤りフラグFCに0を設定し、
LC>PMAX2*KMAXの場合は、計測誤りフラグFCに1を設定する。
 同様に、計測誤り発生箇所判定部221は、取得された画素値LDと基準値PMAX2*KMAXとを比較し、
LD≦PMAX2*KMAXの場合は、計測誤りフラグFDに0を設定し、
LD>PMAX2*KMAXの場合は、計測誤りフラグFDに1を設定する。
 同様に、計測誤り発生箇所判定部221は、取得された画素値LEと基準値PMAX2*KMAXとを比較し、
LE≦PMAX2*KMAXの場合は、計測誤りフラグFEに0を設定し、
LE>PMAX2*KMAXの場合は、計測誤りフラグFEに1を設定する。
 同様に、計測誤り発生箇所判定部221は、取得された画素値LFと基準値PMAX2*KMAXとを比較し、
LF≦PMAX2*KMAXの場合は、計測誤りフラグFFに0を設定し、
LF>PMAX2*KMAXの場合は、計測誤りフラグFFに1を設定する。
 計測誤り発生箇所判定部221は、実施の形態1の場合と同様に、最大値と最小値の差分値を用いた判定を行ってもよい。
 計測誤り発生箇所判定部221は、計測誤りフラグFA,…,FFの値を三角測量部222に送付する。
 三角測量部222は、画素値を比較してパターン位置番号Sの値を決める際に、上位bit側から順次処理を行う。
 三角測量部222は、画素値P(F1)とP(F2)の関係に基づき、パターン位置番号Sのビット値bit5を決める。三角測量部222は、
P(F1)+Ts<P(F2)であれば、パターン位置番号Sのビット値bit5に1を割り当て、
P(F1)>P(F2)+Tsであれば、パターン位置番号Sのビット値bit5に0を割り当て、
|P(F1)-P(F2)|≦Tsであれば、エラーとしてビット値bit5に値を設定せず処理を打ち切る。また、三角測量部222は、比較結果にかかわらず、計測誤りフラグFFが1の場合にも同様に、処理を打ち切る。
 三角測量部222は、画素値P(E1)とP(E2)の関係に基づき、パターン位置番号Sのビット値bit4を決める。三角測量部222は、
P(E1)+Ts<P(E2)であれば、パターン位置番号Sのビット値bit4に1を割り当て、
P(E1)>P(E2)+Tsであれば、パターン位置番号Sのビット値bit4に0を割り当て、
|P(E1)-P(E2)|≦Tsであれば、エラーとしてビット値bit4に値を設定せず処理を打ち切る。また、三角測量部222は、比較結果にかかわらず、計測誤りフラグFEが1の場合に、処理を打ち切る。
 三角測量部222は、画素値P(D1)とP(D2)の関係に基づき、パターン位置番号Sのビット値bit3を決める。三角測量部222は、
P(D1)+Ts<P(D2)であれば、パターン位置番号Sのビット値bit3に1を割り当て、
P(D1)>P(D2)+Tsであれば、パターン位置番号Sのビット値bit3に0を割り当て、
|P(D1)-P(D2)|≦Tsであれば、エラーとしてビット値bit3に値を設定せず、処理を打ち切る。また、三角測量部222は、比較結果にかかわらず、計測誤りフラグFDが1の場合に、処理を打ち切る。
 三角測量部222は、画素値P(C1)とP(C2)の関係に基づき、パターン位置番号Sのビット値bit2を決める。三角測量部222は、
P(C1)+Ts<P(C2)であれば、パターン位置番号Sのビット値bit2に1を割り当て、
P(C1)>P(C2)+Tsであれば、パターン位置番号Sのビット値bit2に0を割り当て、
|P(C1)-P(C2)|≦Tsであれば、エラーとしてビット値bit2に値を設定せず、処理を打ち切る。また、三角測量部222は、比較結果にかかわらず、計測誤りフラグFCが1の場合に、処理を打ち切る。
 三角測量部222は、画素値P(B1)とP(B2)の関係に基づき、パターン位置番号Sのビット値bit1を決める。三角測量部222は、
P(B1)+Ts<P(B2)であれば、パターン位置番号Sのビット値bit1に1を割り当て、
P(B1)>P(B2)+Tsであれば、パターン位置番号Sのビット値bit1に0を割り当て、
|P(B1)-P(B2)|≦Tsであれば、エラーとしてビット値bit1に値を設定せず処理を打ち切る。また、三角測量部222は、比較結果にかかわらず、計測誤りフラグFBが1の場合に、処理を打ち切る。
 三角測量部222は、画素値P(A1)とP(A2)の関係に基づき、パターン位置番号Sのビット値bit0の値を決める。三角測量部222は、
P(A1)+Ts<P(A2)であれば、パターン位置番号Sのビット値bit0に1を割り当て、
P(A1)>P(A2)+Tsであれば、パターン位置番号Sのビット値bit0に0を割り当て、
|P(A1)-P(A2)|≦Tsであれば、エラーとしてビット値bit0に値を設定せず、処理を打ち切る。また、三角測量部222は、比較結果にかかわらず、計測誤りフラグFAが1の場合に、処理を打ち切る。
 処理の途中で打ち切りが発生せず、パターン位置番号Sのビット値bit5,…,bit0が全て算出された場合には、三角測量部222は、算出されたパターン位置番号Sをそのまま距離算出に使用する。
 図13は、実施の形態3においてパターン光の画素値から被写体位置におけるパターン光を構成するストライプの位置番号を算出する方法を示す図である。処理の途中で打ち切りが発生した場合には、パターン位置番号Sの上位側のbitから計測誤りが0かつエラー発生のない範囲のbitのみ参照し、打ち切りとなった該当のbitは1、それ以下のbitは0とみなしてパターン位置番号Sを算出する。図13には、bit5で処理が打ち切られた場合、bit4で処理が打ち切られた場合、bit3で処理が打ち切られた場合、bit2で処理が打ち切られた場合、bit1で処理が打ち切られた場合、処理の途中で打ち切りが発生しなかった場合のパターン位置番号Sの算出方法の例が示されている。処理の打ち切りが発生した画素と打ち切りが発生しなかった画素は、画素毎のエラー発生フラグを設けて識別できるようにされている。
 以上の処理により算出されたパターン位置番号Sの値を用いて、実施の形態1と同様の方法で、被写体距離Zを求める。実施の形態3においては、算出した被写体距離Zと該当画素のエラー発生フラグの情報とが合わせて出力される。
 ここでは、パターン光A1,…,F2及びパターン光X1,…,X16を用いて処理する方法について記載したが、パターン光A1,…,D2までを使用せず、代わりにパターン光X1,…,X16を用いて距離計測を行う実施の形態2に記載の方式と組み合わせて処理を行うことも可能である。
《3-3》効果
 実施の形態3に係る距離計測装置3によれば、注目画素が、距離計測誤りの可能性が高いと判定された箇所の画素であっても、精度は低くなるものの、距離計測結果を得ることができるため、二次反射光又は透過光が多い場所でも被写体の形状の概略を把握することが可能である。
 また、距離計測誤りの可能性がある場所とない場所を画素毎に付加されたエラー発生フラグで知ることができるため、例えば、複数視点での距離計測結果を合成して被写体の3次元(3D)モデルを生成するようなケースでは、距離計測誤りの可能性がない計測結果を優先して参照することによりモデル生成の精度を向上させることが可能である。
《4》変形例.
 図14は、上記実施の形態1から3に係る距離計測装置1から3の変形例を示すハードウェア構成図である。図1、図10及び図13に示される距離計測装置1から3の制御部14及び画像データ処理部20,20a,20bは、ソフトウェアとしてのプログラムを格納する記憶装置としてのメモリ91と、メモリ91に格納された距離計測プログラムを実行する情報処理部としてのプロセッサ92とを用いて(例えば、コンピュータにより)実現することができる。上記距離計測プログラムは、投写部13に、明部領域と暗部領域とを有する複数のパターン光を被写体に順次投写させると共に、撮像部12に、被写体を撮像することで、複数のパターン光に対応する複数の撮像画像を取得させる撮像ステップと、複数の撮像画像から、注目画素における被写体までの距離を三角測量によって計測する測量ステップと、複数の撮像画像の前記注目画素の画素値の比較結果に基づいて、注目画素が、距離計測誤りが発生する可能性が高い箇所の画素であるか否かを判定する計測誤り発生箇所判定ステップとを、情報処理部としてのコンピュータに実行させるものである。
 また、図1、図10及び図13に示される距離計測装置1から3の制御部14及び画像データ処理部20,20a,20bの一部を、図14に示されるメモリ91と、プログラムを実行するプロセッサ92とによって実現してもよい。パターン光を被写体に順次投写すると共に、前記被写体を撮像することで、前記複数のパターン光に対応する複数の撮像画像を取得する撮像ステップとは、予め決められた周期で自動的に行われ、複数の撮像画像から、注目画素における被写体までの距離を三角測量によって計測する測量ステップと、複数の撮像画像の前記注目画素の画素値の比較結果に基づいて、注目画素が、距離計測誤りが発生する可能性が高い箇所の画素であるか否かを判定する計測誤り発生箇所判定ステップとをプログラムが実行してもよい。
 1,2,3 距離計測装置、 10 画像データ取得部、 11 光学系、 11a 反射光、 12 撮像部、 13 投写部、 14 制御部、 20,20a,20b 画像データ処理部、 21,121,221 計測誤り発生箇所判定部、 22,122,222 三角測量部、 23 計測結果合成部。

Claims (8)

  1.  明部領域と暗部領域とを有する複数のパターン光を被写体に順次投写する投写部と、
     前記被写体を撮像することで、前記複数のパターン光に対応する複数の撮像画像を取得する撮像部と、
     前記複数の撮像画像から、注目画素における前記被写体までの距離を三角測量によって計測する三角測量部と、
     前記複数の撮像画像の前記注目画素の画素値の比較結果に基づいて、前記注目画素が、距離計測誤りが発生する可能性が高い箇所の画素であるか否かを判定する計測誤り発生箇所判定部と、
     を備え、
     前記投写部によって順次投写される前記複数のパターン光は、1つのパターン光の全面積に対する前記明部領域の面積の割合が第1の割合である複数の第1パターン光と、1つのパターン光の全面積に対する前記明部領域の面積の割合である第2の割合が前記第1の割合より小さい複数の第2パターン光とを含み、
     前記複数の第2パターン光は、前記複数の第2パターン光の明部領域を全て組み合わせると1つのパターン光の全域が組み合わされた明部領域に一致し、
     前記複数の撮像画像の前記注目画素の画素値の比較結果は、前記複数の第1パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値のうちの最大値と前記複数の第2パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値のうちの最大値との比較結果である、
     ことを特徴とする距離計測装置。
  2.  明部領域と暗部領域とを有する複数のパターン光を被写体に順次投写する投写部と、
     前記被写体を撮像することで、前記複数のパターン光に対応する複数の撮像画像を取得する撮像部と、
     前記複数の撮像画像から、注目画素における前記被写体までの距離を三角測量によって計測する三角測量部と、
     前記複数の撮像画像の前記注目画素の画素値の比較結果に基づいて、前記注目画素が、距離計測誤りが発生する可能性が高い箇所の画素であるか否かを判定する計測誤り発生箇所判定部と、
     を備え、
     前記投写部によって順次投写される前記複数のパターン光は、1つのパターン光の全面積に対する前記明部領域の面積の割合が第1の割合である複数の第1パターン光と、1つのパターン光の全面積に対する前記明部領域の面積の割合である第2の割合が前記第1の割合より小さい複数の第2パターン光とを含み、
     前記複数の第2パターン光は、前記複数の第2パターン光の明部領域を全て組み合わせると1つのパターン光の全域が組み合わされた明部領域に一致し、
     前記複数の撮像画像の前記注目画素の画素値の比較結果は、前記複数の第1パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値のうちの最大値と最小値との差分と前記複数の第2パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値のうちの最大値と最小値との差分との比較結果である、
     ことを特徴とする距離計測装置。
  3.  前記三角測量部は、前記複数の第1パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値に基づいて、前記三角測量による計測を行うことを特徴とする請求項1又は2に記載の距離計測装置。
  4.  前記三角測量部は、前記複数の第1パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値と、前記複数の第2パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値とに基づいて、前記三角測量による計測を行うことを特徴とする請求項1又は2に記載の距離計測装置。
  5.  前記計測誤り発生箇所判定部が、前記注目画素は、距離計測誤りが発生する可能性が高い箇所の画素ではないと判定した場合に、前記注目画素における前記被写体までの距離を示す情報を出力し、前記計測誤り発生箇所判定部が、前記注目画素は、距離計測誤りが発生する可能性が高い箇所の画素であると判定した場合に、前記注目画素における前記被写体までの距離に代えて、距離計測誤りがあることを示す情報を出力する計測結果合成部をさらに備えたことを特徴とする請求項1から4のいずれか1項に記載の距離計測装置。
  6.  前記計測誤り発生箇所判定部は、
     前記注目画素が、距離計測誤りが発生する可能性が高い箇所の画素ではないと判定した場合に、前記三角測量部に前記注目画素における前記被写体までの距離を示す情報を出力し、
     前記注目画素が、距離計測誤りが発生する可能性が高い箇所の画素であると判定した場合に、前記三角測量部に前記注目画素における前記被写体までの距離を示す情報に加えて、距離計測誤りが発生する可能性が高い箇所の画素であることを示す情報を出力する
     ことを特徴とする請求項1から4のいずれか1項に記載の距離計測装置。
  7.  明部領域と暗部領域とを有する複数のパターン光を被写体に順次投写する投写ステップと、
     前記被写体を撮像することで、前記複数のパターン光に対応する複数の撮像画像を取得する撮像ステップと、
     前記複数の撮像画像から、注目画素における前記被写体までの距離を三角測量によって計測する測量ステップと、
     前記複数の撮像画像の前記注目画素の画素値の比較結果に基づいて、前記注目画素が、距離計測誤りが発生する可能性が高い箇所の画素であるか否かを判定する計測誤り発生箇所判定ステップと、
     を備え、
     前記投写ステップによって順次投写される前記複数のパターン光は、1つのパターン光の全面積に対する前記明部領域の面積の割合が第1の割合である複数の第1パターン光と、1つのパターン光の全面積に対する前記明部領域の面積の割合である第2の割合が前記第1の割合より小さい複数の第2パターン光とを含み、
     前記複数の第2パターン光は、前記複数の第2パターン光の明部領域を全て組み合わせると1つのパターン光の全域が組み合わされた明部領域に一致し、
     前記複数の撮像画像の前記注目画素の画素値の比較結果は、前記複数の第1パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値のうちの最大値と前記複数の第2パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値のうちの最大値との比較結果である、
     ことを特徴とする距離計測方法。
  8.  投写部に、明部領域と暗部領域とを有する複数のパターン光を被写体に順次投写させる投写ステップと、
     撮像部に、被写体を撮像することで、前記複数のパターン光に対応する複数の撮像画像を取得させる撮像ステップと、
     前記複数の撮像画像から、注目画素における前記被写体までの距離を三角測量によって計測する測量ステップと、
     前記複数の撮像画像の前記注目画素の画素値の比較結果に基づいて、前記注目画素が、距離計測誤りが発生する可能性が高い箇所の画素であるか否かを判定する計測誤り発生箇所判定ステップと、
     をコンピュータに実行させ、
     前記投写ステップによって順次投写される前記複数のパターン光は、1つのパターン光の全面積に対する前記明部領域の面積の割合が第1の割合である複数の第1パターン光と、1つのパターン光の全面積に対する前記明部領域の面積の割合である第2の割合が前記第1の割合より小さい複数の第2パターン光とを含み、
     前記複数の第2パターン光は、前記複数の第2パターン光の明部領域を全て組み合わせると1つのパターン光の全域が組み合わされた明部領域に一致し、
     前記複数の撮像画像の前記注目画素の画素値の比較結果は、前記複数の第1パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値のうちの最大値と前記複数の第2パターン光を順次投写したときに取得された前記複数の撮像画像における注目画素の画素値のうちの最大値との比較結果である、
     ことを特徴とする距離計測プログラム。
PCT/JP2017/030090 2016-10-27 2017-08-23 距離計測装置、距離計測方法、及び距離計測プログラム WO2018079030A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018547153A JP6567199B2 (ja) 2016-10-27 2017-08-23 距離計測装置、距離計測方法、及び距離計測プログラム

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2016210449 2016-10-27
JP2016-210449 2016-10-27

Publications (1)

Publication Number Publication Date
WO2018079030A1 true WO2018079030A1 (ja) 2018-05-03

Family

ID=62024720

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2017/030090 WO2018079030A1 (ja) 2016-10-27 2017-08-23 距離計測装置、距離計測方法、及び距離計測プログラム

Country Status (2)

Country Link
JP (1) JP6567199B2 (ja)
WO (1) WO2018079030A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200200909A1 (en) * 2018-12-21 2020-06-25 Robert Bosch Gmbh Optoelectronic sensor and method for operating an optoelectronic sensor
WO2023189599A1 (ja) * 2022-03-28 2023-10-05 株式会社小糸製作所 距離画像センサ、および車両用灯具

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003279332A (ja) * 2002-03-25 2003-10-02 Minolta Co Ltd 3次元形状入力装置および位置ずれ検出方法
JP2009047498A (ja) * 2007-08-17 2009-03-05 Fujifilm Corp 立体撮像装置および立体撮像装置の制御方法並びにプログラム
JP2014115108A (ja) * 2012-12-06 2014-06-26 Canon Inc 距離計測装置
JP2015078935A (ja) * 2013-10-17 2015-04-23 株式会社キーエンス 三次元画像処理装置、三次元画像処理方法、三次元画像処理プログラム及びコンピュータで読み取り可能な記録媒体並びに記録した機器

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6444233B2 (ja) * 2015-03-24 2018-12-26 キヤノン株式会社 距離計測装置、距離計測方法、およびプログラム

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003279332A (ja) * 2002-03-25 2003-10-02 Minolta Co Ltd 3次元形状入力装置および位置ずれ検出方法
JP2009047498A (ja) * 2007-08-17 2009-03-05 Fujifilm Corp 立体撮像装置および立体撮像装置の制御方法並びにプログラム
JP2014115108A (ja) * 2012-12-06 2014-06-26 Canon Inc 距離計測装置
JP2015078935A (ja) * 2013-10-17 2015-04-23 株式会社キーエンス 三次元画像処理装置、三次元画像処理方法、三次元画像処理プログラム及びコンピュータで読み取り可能な記録媒体並びに記録した機器

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200200909A1 (en) * 2018-12-21 2020-06-25 Robert Bosch Gmbh Optoelectronic sensor and method for operating an optoelectronic sensor
WO2023189599A1 (ja) * 2022-03-28 2023-10-05 株式会社小糸製作所 距離画像センサ、および車両用灯具

Also Published As

Publication number Publication date
JP6567199B2 (ja) 2019-08-28
JPWO2018079030A1 (ja) 2019-03-28

Similar Documents

Publication Publication Date Title
US9857166B2 (en) Information processing apparatus and method for measuring a target object
JP5576726B2 (ja) 三次元計測装置、三次元計測方法、及びプログラム
JP5016520B2 (ja) 3次元形状計測方法および装置
JP6532325B2 (ja) 被計測物の形状を計測する計測装置
JP6071363B2 (ja) 距離計測装置及び方法
JP6351201B2 (ja) 距離計測装置および方法
JP6161276B2 (ja) 測定装置、測定方法、及びプログラム
US10223575B2 (en) Measurement apparatus for measuring shape of object, system and method for producing article
KR20190104367A (ko) 3차원 형상 계측 장치, 3차원 형상 계측 방법 및 프로그램
US10803623B2 (en) Image processing apparatus
US20220222843A1 (en) Three-dimensional measurement system and three-dimensional measurement method
JP2022505166A (ja) 対向配置チャネルを有する三次元センサ
JP6567199B2 (ja) 距離計測装置、距離計測方法、及び距離計測プログラム
JP2010243438A (ja) 三次元形状測定装置及び三次元形状測定方法
JP2014115108A (ja) 距離計測装置
JP2012093235A (ja) 三次元形状測定装置、三次元形状測定方法、構造物の製造方法および構造物製造システム
JP4797109B2 (ja) 三次元形状計測装置及び三次元形状計測方法
KR102122275B1 (ko) 배광 특성 측정 장치 및 배광 특성 측정 방법
JP2012173243A (ja) 3次元計測装置、および3次元計測方法
JP2012068176A (ja) 三次元形状計測装置
WO2020049965A1 (ja) 3次元計測システム、3次元計測カメラ、3次元計測方法及びプログラム
CN102829956B (zh) 图像检测方法,图像检测装置以及图像检查装置
WO2018207300A1 (ja) 計測装置、計測方法及び計測プログラム
JP5968370B2 (ja) 三次元計測装置、三次元計測方法、及びプログラム
US20190170502A1 (en) Position designation device and position designation method

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2018547153

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17864768

Country of ref document: EP

Kind code of ref document: A1