WO2007116744A1 - 3次元形状検出装置及び3次元形状検出方法 - Google Patents

3次元形状検出装置及び3次元形状検出方法 Download PDF

Info

Publication number
WO2007116744A1
WO2007116744A1 PCT/JP2007/056416 JP2007056416W WO2007116744A1 WO 2007116744 A1 WO2007116744 A1 WO 2007116744A1 JP 2007056416 W JP2007056416 W JP 2007056416W WO 2007116744 A1 WO2007116744 A1 WO 2007116744A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
exposure
pattern
code
subject
Prior art date
Application number
PCT/JP2007/056416
Other languages
English (en)
French (fr)
Inventor
Hiroyuki Sasaki
Original Assignee
Brother Kogyo Kabushiki Kaisha
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 Brother Kogyo Kabushiki Kaisha filed Critical Brother Kogyo Kabushiki Kaisha
Publication of WO2007116744A1 publication Critical patent/WO2007116744A1/ja
Priority to US12/242,554 priority Critical patent/US20090022367A1/en

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/24Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures
    • G01B11/25Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures by projecting a pattern, e.g. one or more lines, moiré fringes on the object
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • 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
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B2210/00Aspects not specifically covered by any group under G01B, e.g. of wheel alignment, caliper-like sensors
    • G01B2210/52Combining or merging partially overlapping images to an overall image

Definitions

  • the present invention relates to a three-dimensional shape detection device and a three-dimensional shape detection method. Specifically, a 3D shape detection device and a 3D shape detection method for detecting a 3D shape of a subject in an imaging area by extracting a pattern light trajectory from an image captured by projecting pattern light onto the subject. About.
  • a pattern light such as slit light or spot light is projected from a projection unit onto a subject that is a target object, and the subject on which the pattern light is projected is picked up by an imaging means such as a CCD camera.
  • an imaging means such as a CCD camera.
  • a three-dimensional shape detection device that detects the three-dimensional shape of a subject based on the locus of pattern light in which the imaged image force is also detected is known.
  • the three-dimensional shape detection apparatus there are an active measurement method and a passive measurement method as the three-dimensional shape detection method.
  • a typical example of the active measurement method is a spatial code method using a plurality of pattern light projections.
  • a subject that can be measured is highly dependent on the surface reflection characteristics of the subject.
  • the reflection component of the pattern light projected on the surface of the object such as a low reflection surface, fine structure surface, specular reflection surface, or a surface having a color complementary to the projected light color, cannot be expected to have sufficient intensity for observation. If a surface or a surface whose reflection component is too strong exists in the area on the surface of the subject, it may be difficult to detect the 3D shape.
  • the light amount of the light source for projecting the pattern light is adjusted based on the surface reflection characteristics of the subject, or the exposure when imaging is performed by the imaging means. Countermeasures were taken by making adjustments (for example, see Patent Document 1).
  • Patent Document 1 Japanese Patent Laid-Open No. 8-35828
  • the aperture of the imaging means is opened or the exposure time is increased in order to detect a low-reflection area on the subject surface, the three-dimensional shape is detected in the high-reflection area on the subject surface. It becomes difficult.
  • the aperture of the imaging means is reduced or the exposure time is shortened in order to detect a high-reflection area on the subject surface, the three-dimensional shape is detected in the low-reflection area on the subject surface. It becomes difficult. In other words, 3D shape detection is possible in one area, but 3D shape detection is difficult in another area.
  • an imaging means with a wide dynamic range for this three-dimensional shape detection it is conceivable to use an imaging means with a wide dynamic range for this three-dimensional shape detection. That is, an imaging means having a dynamic range that can cover a wide range of reflection distribution of the subject is employed.
  • the imaging means with such a wide dynamic range is expensive, which increases the manufacturing cost of the three-dimensional shape detection device.
  • an object of the present invention is to provide a three-dimensional shape detection apparatus that can detect a three-dimensional shape of a subject even when an imaging means having a narrow dynamic range is used. .
  • imaging is performed based on image information obtained by projecting pattern light, which is an array of light and dark alternately, onto a subject.
  • a three-dimensional shape detection apparatus that detects a three-dimensional shape of a subject in an area, the projection unit projecting each of the pattern light onto a subject, and the pattern light is projected from the projection unit.
  • An imaging unit that images a subject in a state under a plurality of different exposure conditions, and a pattern light locus extraction unit that extracts a locus of pattern light from a captured image captured by the imaging unit for each of the exposure conditions;
  • Pattern trajectory integration means for determining one pattern trajectory position for calculating the three-dimensional shape of the subject based on the pattern trajectory position for each exposure condition extracted by the pattern light trajectory extraction means; and the pattern trajectory 3D shape calculation means for calculating the 3D shape of the subject based on the pattern locus position determined by the integration means.
  • the pattern light is a plurality of types of pattern light in which light and dark are alternately arranged
  • the projection unit converts each of the plurality of types of the pattern light.
  • the image is projected onto the subject in time series, and the image pickup unit images the subject in a state in which each pattern light is projected from the projection unit under a plurality of different exposure conditions
  • the pattern light locus extraction unit Is a luminance image generation means for generating a plurality of luminance images obtained by calculating the luminance of each pixel from each captured image captured by the imaging unit for each of the exposure conditions, and a predetermined value for the plurality of luminance images.
  • Code image generating means for generating a code image for each of the exposure conditions, wherein the spatial code is assigned to each pixel by performing threshold processing based on the threshold value of the pixel, and extracting the code boundary position of the spatial code from the code image
  • Code boundary extraction means for performing processing on each code image of each exposure condition
  • the pattern trajectory integration means is arranged at the code boundary position for each exposure condition extracted by the code boundary extraction means.
  • code boundaries can be extracted from images captured under each exposure condition, and these code boundary position forces can be selected, so that the reflection distribution on the surface is reduced.
  • the three-dimensional shape of the subject can be detected even when an imaging unit with a narrow dynamic range is used. In other words, regardless of the dynamic range of the imaging unit, the three-dimensional shape of the subject having various reflection distributions can be accurately detected.
  • an exposure condition information storage unit that stores information on a plurality of different exposure conditions, and brightness of an imaging region in the imaging unit are detected, and based on the brightness.
  • Exposure determining means for determining one exposure condition from the setting information storage unit, the multiple exposure imaging processing means, the exposure condition determined by the exposure determining means, the determined exposure condition and exposure
  • a plurality of exposure conditions composed of front and rear exposure conditions having similar degrees may be used as the plurality of different exposure conditions.
  • the code boundary integration means detects the luminance of the pixel corresponding to each coordinate for each coordinate of the code boundary position in each exposure condition. To determine whether or not the luminance falls within the effective luminance range in the exposure condition, and uses the coordinates of the code boundary position corresponding to the pixel determined to be within the effective luminance range.
  • One code for calculating the dimensional shape It may be configured to determine the boundary position.
  • the luminance of the pixel corresponding to each coordinate may be the average luminance of the pixel and the surrounding pixels.
  • the detection of the three-dimensional shape of the subject can be performed with higher accuracy.
  • the brightness of the pixels at some coordinates may be different from the original brightness. Therefore, it is possible to select an appropriate code boundary position among the code boundary positions of each exposure condition, and therefore, it is possible to improve the detection accuracy of the three-dimensional shape. For example, even if the brightness of the pixel at that coordinate is within the effective brightness range, if the brightness of the surrounding pixels that are abnormally high compared to the surrounding brightness is out of the effective brightness range, Assuming that the brightness is different from the brightness that should be acquired, the code boundary position of the exposure condition corresponding to the pixel is not used, and this enables more accurate detection of the three-dimensional shape.
  • a maximum luminance value is detected by detecting the maximum luminance value of each pixel from the captured image power captured by the imaging unit, and generating a maximum luminance image.
  • the maximum brightness image generating means for detecting the brightness of the pixel corresponding to each coordinate may be used to detect the brightness of the pixel corresponding to each coordinate.
  • the exposure condition can be an exposure time.
  • pattern light formed by alternately arranging light and dark is projected.
  • a three-dimensional shape detection method for detecting a three-dimensional shape of a subject in an imaging region based on image information projected and imaged on a body, wherein the pattern light is projected onto a subject by a projection unit; and The step of imaging the subject in a state where each pattern light is projected from the projection unit under a plurality of different exposure conditions, and imaging by the imaging unit for each of the exposure conditions Extracting a pattern light locus from a captured image; determining a pattern locus position for calculating a three-dimensional shape of the subject based on the extracted pattern locus position for each of the extracted exposure conditions; And calculating a three-dimensional shape of the subject based on the determined pattern locus position.
  • code boundaries can be extracted from images captured under each exposure condition, and these code boundary position forces can be selected, so that the reflection distribution on the surface is reduced.
  • the three-dimensional shape of the subject can be detected even when an imaging unit with a narrow dynamic range is used. In other words, regardless of the dynamic range of the imaging unit, the three-dimensional shape of the subject having various reflection distributions can be accurately detected.
  • pattern trace positions can be extracted from images captured under each exposure condition, and these pattern trace position forces can be selected, so that the reflection distribution on the surface is low.
  • the three-dimensional shape of the subject can be detected.
  • FIG. 1 is a perspective view showing an appearance of a three-dimensional shape detection apparatus according to a first embodiment of the present invention.
  • FIG. 2 is a side view and a rear view showing the three-dimensional shape detection apparatus shown in FIG. 1.
  • FIG. 3 is a partial cross-sectional rear view for explaining the mounting structure with the measurement head holder in FIG. 1.
  • FIG. 4 is a rear sectional view showing the rotary table portion in FIG. 1.
  • FIG. 5 is a plan sectional view showing the internal configuration of the measuring head in FIG. 1.
  • FIG. 6 is an enlarged plan view showing a projection unit in FIG. 1.
  • FIG. 7 is a block diagram conceptually showing the electrical configuration of the three-dimensional shape detection apparatus shown in FIG. 1.
  • FIG. 6 is a front view showing the projection mechanism in FIG.
  • FIG. 9 is a partial side sectional view showing the projection mechanism shown in FIG.
  • FIG. 10 is a front view showing the mask in FIG. 8 partially enlarged.
  • FIG. 11 is a front view partially showing the mask in FIG. 8 and a side view showing the position sensor and the first to third ID sensors in FIG. 7 together with the mask.
  • FIG. 12 is a timing chart for explaining the PD signal of the position sensor and the signals of the first to third ID sensors in FIG. 11.
  • FIG. 13 is a flowchart conceptually showing main processing executed in the camera control program in FIG.
  • FIG. 14 is a flowchart conceptually showing the stereoscopic image processing in FIG.
  • FIG. 15 is a flowchart conceptually showing the three-dimensional color shape detection processing in FIG. 14 as a three-dimensional color shape detection processing routine.
  • FIG. 16 is a flowchart conceptually representing the imaging processing program in FIG.
  • FIG. 17 is a flowchart conceptually showing the mask motor control program in FIG.
  • FIG. 18 is a flowchart conceptually showing the projection processing in FIG. 16 as a projection processing subroutine.
  • FIG. 19 is a diagram for explaining the exposure condition of the imaging unit in FIG.
  • FIG. 20 is a conceptual diagram of a parameter table by exposure in the parameter table storage unit by exposure shown in FIG.
  • FIG. 21 is a flowchart conceptually showing the patterned light image pickup processing in FIG. 16 as a patterned light image pickup processing subroutine.
  • FIG.22 Flowchart conceptually shown as 3D measurement processing subroutine in Fig. 15 Is.
  • FIG. 23 is a flowchart conceptually showing the code image generation program in FIG.
  • FIG. 24 is a flowchart conceptually showing the code boundary integration program in FIG.
  • FIG. 25 is a flowchart conceptually showing a code boundary selection program in FIG. 24.
  • FIG. 26 is a conceptual diagram of an integrated code boundary coordinate storage area in the code boundary coordinate storage unit shown in FIG.
  • FIG. 27 is a flowchart conceptually showing the 3D color shape detection result generation routine in FIG.
  • three-dimensional shape detection using a spatial coding method will be described as an example.
  • a light cutting method using simple parallel line (slit-like) pattern light or some regularity is used.
  • it can also be applied to three-dimensional shapes using spotlights with a pattern, pattern light with brightness and darkness arranged in a mesh shape, and the like.
  • FIG. 1 is a perspective view of the appearance of the three-dimensional shape detection apparatus 10 according to the first embodiment of the present invention. It is shown.
  • This three-dimensional shape detection apparatus 10 includes a projection unit 12 (to be described later) that projects each of a plurality of types of pattern light in which light and dark are alternately arranged onto the subject S in time series, and each pattern light from the projection unit 12. And an imaging unit 14 (to be described later) that images the subject on which the image is projected under a plurality of different exposure conditions. Based on the imaging result of the imaging unit 14, the three-dimensional information and surface color information of the subject S are calculated by a computer. It is designed to perform signal processing acquired by.
  • FIGS. 1 to 4 show the external configuration of the three-dimensional shape detection apparatus 10, while FIGS. 5 and 11 show the internal configuration of the three-dimensional shape detection apparatus 10.
  • the external configuration will be described first, and then the internal configuration will be described.
  • the three-dimensional shape detection apparatus 10 is configured to include a measurement head MH and a pedestal part HD.
  • the measurement head MH is provided for optically imaging the subject S and measuring the three-dimensional shape and surface color of the subject S based on the imaging result!
  • the pedestal portion HD is configured to be able to place the measurement head MH and the subject S, and is provided with a measurement head mounting portion for mounting the measurement head MH in one region and a mounting table for mounting the subject S on the other end.
  • a rotary table section RT is provided. The rotary table RT allows the subject S to be imaged by the measuring head MH every time the subject S is indexed and rotated with respect to the measuring head MH, thereby making the entire area of the outer surface of the subject S into a plurality of partial areas. It is provided to enable divisional imaging.
  • a plurality of partial images are acquired by imaging for each partial region.
  • a 3D shape can be obtained by processing the acquired partial images.
  • Each partial image force The obtained 3D shape is combined into one 3D stitch shape.
  • the surface color information acquired for the same subject S is mapped to the three-dimensional stitch shape, whereby a stitch texture image for the subject S is generated.
  • the measurement head MH includes a projection unit 12 for projecting pattern light onto the subject S, an imaging unit 14 for imaging the subject S, and the three-dimensional information and surface of the subject S. And a processing unit 16 that performs signal processing in order to obtain color information.
  • the projection unit 12, the imaging unit 14, and the processing unit 16 are a case having a substantially rectangular parallelepiped shape of the measuring head MH. It is attached to the ring 20.
  • the casing 20 is mounted in such a posture that each of the lens barrel 24, the flash 26, and the force is partially exposed on the front surface of the casing 20.
  • an imaging optical system 30 that is a part of the imaging unit 14 is attached to the casing 20 in such a manner that a part of the lens is exposed in front of the casing 20.
  • the imaging optical system 30 receives image light representing the subject S at the exposed portion thereof.
  • the lens barrel 24 also projects the front force of the casing 20, and inside it, as shown in FIG. 5, a projection optical system 32 that is a part of the projection unit 12 is provided. Contained.
  • the projection optical system 32 is configured to include a plurality of projection lenses 34 and a diaphragm 36.
  • the lens barrel 24 holds the projection optical system 32 in a state where the projection optical system 32 can be moved as a whole for focus adjustment. Further, the lens barrel 24 protects the projection optical system 32 from damage. ing. From the exposed end face of the lens barrel 24, the outermost one of the plurality of projection lenses 34 is exposed. The projection optical system 32 projects the non-turn light toward the subject S with the outermost projection lens 34.
  • the flash 26 is a light source that emits light to supplement the insufficient light amount, and is configured using, for example, a discharge tube filled with xenon gas. Therefore, the flash 26 can be repeatedly used by discharging a capacitor (not shown) built in the casing 20.
  • the release button 40 is attached to the casing 20 on the upper surface thereof. Further, as shown in FIG. 2 (b), the casing 20 further has a mode switching switch 42 (in the example shown in FIG. 2 (b), two button forces are also provided) on the back side thereof.
  • the four-way cursor key (cross key) 43 and the monitor LCD 44 are attached. Each of these mode switch 42 and four-way cursor key 43 constitutes an example of a function button.
  • the release button 40 is operated by the user to operate the three-dimensional shape detection apparatus 10.
  • the release button 40 is composed of a two-stage push button switch that can issue different commands depending on whether the user's operation state (pressed state) is “half-pressed” or “full-pressed”. Has been.
  • the operating state of the release button 40 is Therefore, it is monitored. If the processing unit 16 detects a “half-pressed state”, the well-known autofocus (AF) and automatic exposure (AE) functions are activated and the focus, aperture, and shutter speed are automatically adjusted. Is done. On the other hand, if the processing unit 16 detects the “fully pressed state”, imaging or the like is performed.
  • the mode switching switch 42 indicates the operation mode of the three-dimensional shape detection apparatus 10 in a later-described three-dimensional measurement mode (shown as "3D” in FIG. 2 (b)) and off mode (see FIG. 2). 2 (b) is operated by the user in order to set as a shift among multiple types of modes including “! FFJ”! /, And “0 FFJ.” The operation status of this mode switch 42 is processed. When the operation state of the mode switching switch 42 is detected by the processing unit 16 and is monitored by the unit 16, processing in a mode corresponding to the detected operation state is performed in the three-dimensional shape detection apparatus 10.
  • the monitor LCD 44 is configured using a liquid crystal display, receives an image signal from the processing unit 16, and displays an image to the user.
  • the monitor LCD 44 displays, for example, an image (stereoscopic image) representing the detection result of the three-dimensional shape of the subject S.
  • the casing 20 is further provided with an antenna 50 as an RF (wireless) interface.
  • the antenna 50 is connected to the RF driver 52 as shown in FIG.
  • the antenna 50 wirelessly transmits data representing the subject S as a stereoscopic image to the external interface (not shown) via the RF dryer 52.
  • FIG. 1 and FIG. 3 a structure in which the measuring head MH is detachably attached to the base portion HD will be described.
  • the measurement head MH is attached to the pedestal portion HD by mechanically engaging the upper surface of one end of the pedestal portion HD.
  • the measurement head MH has a head settling portion 150 formed at the lower end portion that is the engagement portion with the pedestal portion HD.
  • the head seating portion 150 includes first and second engaging claws 152 and 154 as a pair of male engaging portions.
  • the first and second engaging claws 152, 154 are arranged at a pair of positions separated from each other in the lateral direction of the measuring head MH, that is, in the width direction of the pedestal HD.
  • Each measuring head MH is formed to extend in the longitudinal direction of the measuring head MH, that is, in the length direction of the pedestal portion HD.
  • the distance between the first and second engaging claws 152 and 154 is as long as possible in order to fix the measuring head MH as firmly as possible to the pedestal portion HD. In this manner, the positions of the first and second engaging claws 152 and 154 are selected.
  • the pedestal portion HD is formed with a head receiving portion 160 that fixedly receives the head settling portion 150 by mechanical engagement with the head settling portion 150.
  • the head receiving portion 160 includes a head base settling space 162 into which the head settling portion 150 fits, and further engages with the first and second engaging claws 152 and 154 of the measuring head MH, respectively.
  • the first and second claw abutting portions 164 and 166 are provided as a pair of female side engaging portions.
  • the first claw abutment portion 164 engages with the corresponding first engagement claw 152 to prevent the measurement head MH from being detached from the base portion HD in a direction perpendicular to the upper surface thereof. This is the fixed nail abutting part.
  • the second claw abutment portion 166 (a) engages with the corresponding second engagement claw 154, and the measurement head MH is detached from the base portion HD in a direction perpendicular to the upper surface thereof. (B) release from the corresponding second engagement pawl 154, allowing the measurement head MH to leave the pedestal HD in a direction perpendicular to its upper surface. This is a movable claw abutting portion that can be displaced to the release position.
  • One example of the second claw abutting portion 166 is the length direction of the pedestal portion HD (the direction perpendicular to the rotation plane on which the measurement head MH rotates when the measurement head MH is attached to or detached from the pedestal portion HD). ) Including a pivot member 170 pivotable about a pivot axis.
  • the pivot member 170 is pivotally attached to the pedestal portion HD by a joint 172 having an axis coaxial with the pivot axis.
  • the pivot member 170 includes a movable engagement portion 174 that mechanically engages the corresponding second engagement claw 154 and prevents the second engagement claw 154 from being detached.
  • the pivot member 170 is always biased by a spring 176 as an elastic member so that the movable engagement portion 174 engages the second engagement claw 154 from above.
  • the pivot member 170 is further movable by expanding the elastic force of the operating portion 178 pressed by the user to release the engagement by the movable engaging portion 174 and the spring 176. Leverage 180 transmitted to the engaging portion 174 Yes.
  • the user piles the operating portion 178 of the pivot member 170 on the elastic force of the spring 176, and the movable engaging portion 174 is released from the engaging position. Press in the release direction to force the position. In this pressed state, the user moves the first engaging claw 152 into the first claw abutting portion 164 and comes into contact therewith while the head settling portion 150 enters the head base settling space 162. The measuring head MH is lowered while rotating in a generally vertical plane. Thereafter, the user releases the pressing of the operation portion 178, whereby the pivot member 170 is rotated to the engagement position by the elastic recovery force of the spring 176, and the movable engagement portion 174 is moved to the second position.
  • the user moves the operation portion 178 of the pivot member 170 against the elastic force of the spring 176 in the same manner as described above. Press in the release direction. In the pressed state, the user moves the measurement head MH so that the first engaging claw 152 is retracted from the first claw abutting portion 164 while the head retracting portion 150 is retracted from the head base retracting space 162. As a result, the measuring head MH is lifted while rotating in the vertical plane, and the pedestal part HD force is also released. Thereafter, the user releases the pressing of the operation unit 178, whereby the pivot member 170 is restored from the released position to the engaged position by the elastic recovery force of the spring 176.
  • the turntable section RT includes a turntable 184 on which the subject S is to be placed, and a support frame 186 that supports the turntable 184 in a rotatable manner.
  • the support frame 186 has a thin hollow box shape so as to include an upper plate portion 188 and a lower plate portion 189, and the upper surface of the rotary table 184 is exposed from the opening of the upper plate portion 188.
  • the lower plate portion 189 of the support frame 186 also functions as a table base.
  • the upper surface of the rotary table 184 is a placement surface 190 on which the subject S to be imaged is placed.
  • a rotary shaft 191 extends coaxially from the lower surface of the rotary table 184, and the rotary shaft 191 is rotatably supported by a support frame 186 via a bearing 192.
  • the bearing 192 is held by a bearing holder 193 formed on the support frame 186.
  • a table motor 194 that rotates the rotary table 184 is attached to the support frame 186.
  • a motor box 195 that accommodates the table motor 194 is formed on the support frame 186.
  • the motor box 195 is formed on the upper surface of the upper plate portion 188 of the support frame 186 so as to protrude upward from the upper surface.
  • the upper surface of the motor box 195 is set higher than the upper surface of the rotary table 184.
  • the motor box 195 not only functions as a housing portion for the table motor 194 but also functions as a position restricting portion 196 that restricts the position where the subject S is positioned on the rotary table 184.
  • the motor gear 197 is coaxially fixed to the rotary shaft of the table motor 194, and the table gear 198 engaged with the motor gear 197 is coaxial with the rotary table 184. It is fixed to. Since the motor gear 197 has a smaller diameter than the table gear 198, the rotational speed of the table gear 198 is reduced and transmitted to the rotary table 184.
  • the table motor 194 can be attached to the support frame 186 so as not to protrude from the upper surface of the upper plate portion 188 of the support frame 186.
  • the table motor Even if 194 is arranged, there is no problem, but it is advantageous for thinning the support frame 186.
  • the support frame 186 by arranging the table motor 194 so that the upper surface force of the upper plate portion 188 protrudes, in addition to the function as the position restricting portion 196 described above, the support frame 186 If the thickness is made thinner, the function is realized.
  • the three-dimensional shape detection apparatus 10 operates according to a mode selected by the user from among a plurality of types of modes. These modes include a three-dimensional measurement mode (hereinafter referred to as “3D mode”) and an off mode.
  • the 3D mode is a mode in which the subject S is imaged and the three-dimensional shape of the subject S is detected.
  • the off mode is a mode in which the operation of the three-dimensional shape detection apparatus 10 is stopped.
  • the imaging unit 14 is configured to capture an image of the subject S and extract the image.
  • the projection unit 12 is a unit for projecting pattern light onto the subject S.
  • the projection unit 12 includes a substrate 60, an LED 62 (for example, an LED that outputs light with a wide output surface force by a single LED element), an illumination diaphragm 63, and a light source lens 64.
  • a projection mechanism 66 having a mask motor (for example, a pulse motor) 65 for sending the mask 200 as a drive source and a projection optical system 32 are provided in series along the projection direction.
  • FIG. 6 shows in detail the hardware configuration of the projection unit 12, the substrate 60, the LED 62, the illumination stop 63, the light source lens 64, the mask 200, and the projection optical system 32.
  • FIG. 7 shows in detail the software configuration and the electrical connection relationship of the entire three-dimensional shape detection apparatus 10 including the projection unit 12.
  • FIGS. 8 to 11 show the projection mechanism 66 in detail in the hard door configuration of the projection unit 12.
  • the imaging unit 14 is an imaging module for imaging the subject S. As shown in FIG. 5, the imaging unit 14 includes an imaging optical system 30 and a CCD (Charge Coupled Device) 70 in series along the incident direction of image light. The CCD 70 is configured to perform progressive scanning by an interline transfer method. The imaging unit 14 is provided with a CCD driver 88 for controlling the CCD 70.
  • CCD Charge Coupled Device
  • the imaging optical system 30 is configured using a plurality of lenses as shown in FIG. This The imaging optical system 30 of the above system automatically adjusts the focal length and the aperture by using a well-known autofocus function to form an image of light from the outside on the CCD 70.
  • the CCD 70 is configured by arranging photoelectric conversion elements such as photodiode elements in a matrix.
  • the CCD 70 generates a signal corresponding to the color and intensity of light of an image formed on the surface of the CCD 70 via the imaging optical system 30 for each pixel.
  • the generated signal is converted into digital data and output to the processing unit 16.
  • the processing unit 16 is electrically connected to the flash 26, the release button 40, and the mode switching switch 42, respectively.
  • the processing unit 16 is further electrically connected to the monitor LCD 44 via the monitor LCD driver 72, to the antenna 50 via the RF driver 52, and to the battery 74 via the power interface 76. .
  • These flashes 26 and the like are controlled by the processing unit 16.
  • the processing unit 16 is further electrically connected to the external memory 78, the cache memory 80, and the imaging unit 14 that is an imaging module.
  • the processing unit 16 is electrically connected to the LED 62 via the light source driver 84 and electrically connected to the mask motor 65 of the projection mechanism 66 via the mask motor driver 86.
  • the LEDs 62 and the like are controlled by the processing unit 16.
  • the external memory 78 is a detachable flash ROM, and can store captured images and 3D information (including the above-mentioned stitch texture image and 3D stitch shape) captured in the stereoscopic image mode. It is.
  • an SD card, a Compact Flash (registered trademark) card, or the like can be used.
  • the cache memory 80 is a storage device that can read and write data at high speed.
  • the cache memory 80 is used, for example, to transfer a captured image captured in the digital camera mode to the cache memory 80 at a high speed, to perform image processing in the processing unit 16 and to store the force in the external memory 78 as well. Is done.
  • SDRAM, DDRRAM or the like can be used.
  • the power supply interface 76, the light source dryer 84, the mask motor driver 86, and the CCD driver 88 are respectively connected to the battery 74, the LED 62, the mask motor 65 of the projection mechanism 66, and various ICOntegrated circuits that control the CCD 70). It is configured.
  • the measuring head MH is provided with an AC adapter terminal 90, a USB terminal 91, and a table motor terminal 92.
  • the AC adapter terminal 90 is electrically connected to the notch 74, so that the three-dimensional shape detection device 10 can use an external AC power source as a power source. It has become.
  • the USB terminal 91 is connected to the processing unit 16 via the USB driver 93 as shown in FIG.
  • the table motor terminal 92 is connected to the processing unit 16 via a table motor driver 94 as shown in FIG.
  • a harness 95 as an electric line extends from the table motor 194 of the rotary table portion RT.
  • This harness 95 is connected to the table motor terminal 92 at an L-shaped plug 96 connected to the tip of the harness 95 as shown in FIG.
  • the harness 95 functions as an electric line that supplies a control signal and power from the measuring head MH to the table motor 194. Therefore, the table motor 194 is connected to the processing unit 16 via the table motor driver 94 as shown in FIG.
  • the harness 95 is defined by harness stops 97, 98, 98 on the surface of the base portion HD.
  • the projection unit 12 uses the substrate 60, the LED 62, the illumination stop 63, the light source lens 64, the projection mechanism 66, and the projection optical system 32 as pattern light as shown in FIG. In series along the projection direction.
  • the substrate 60 is electrically connected to the mounted LED 62 by mounting the LED 62 on the substrate 60.
  • the substrate 60 for example, an insulating synthetic resin is applied to an aluminum substrate and a pattern is formed by force electroless plating, or a substrate having a single layer or a multilayer structure having a glass epoxy substrate as a core is used. Can be produced.
  • the LED 62 is a light source that emits radial amber light toward the projection mechanism 66 in a wide area, and is housed in the LED casing 100.
  • the illumination stop 63 is provided to guide only the necessary portion to the light source lens 64 by shielding unnecessary portions of the light output from the LED 62.
  • the light source lens 64 is a lens that condenses the light emitted radially from the LED 62.
  • the material is an optical resin represented by acrylic.
  • the radial light power emitted from the LED 62 is efficiently condensed by the light source lens 64, and the emitted light from the LED 62 is incident on the entrance surface 106 of the projection mechanism 66.
  • the light is incident at a substantially right angle, and is emitted from the emission surface 108 of the projection mechanism 66 as radiation having high directivity.
  • the light source lens 64 functions as a collimator lens.
  • the directivity characteristics of two attention points A and B separated from each other on the emission surface 108 are represented by a graph of illuminance distribution ( ⁇ : half-value spread half-angle).
  • the projection optical system 32 includes a plurality of projection lenses 34 for projecting the light that has passed through the projection mechanism 66 onto the subject S.
  • These projection lenses 34 are constituted by a telecentric lens that is a combination of a glass lens and a synthetic resin lens. Telecentric means a configuration in which the chief ray passing through the projection optical system 32 is parallel to the optical axis in the incident side space, and the position of the entrance pupil is infinite.
  • the projection optical system 32 Since the projection optical system 32 has telecentric characteristics as described above and its incident NA is about 0.1, only light within a vertical ⁇ 5 ° is allowed to pass through the aperture 36 inside the projection optical system 32. The optical path of the projection optical system 32 is restricted so that it can pass through. Therefore, in the present embodiment, due to the telecentricity of the projection optical system 32, coupled with a configuration in which only light passing through the projection mechanism 66 at a vertical angle of ⁇ 5 ° can be projected onto the projection optical system 32, the image quality can be improved. Improvements can be made easily.
  • This projection mechanism 66 is provided for sequentially projecting the plurality of types of pattern light onto the subject S by selectively converting the incident light from the LED 62 as a light source into a plurality of types of pattern light. Yes.
  • Figure 8 shows the projection mechanism 66 in front view, and Figure 9 shows it.
  • the projection mechanism 66 is shown in a partial cross-sectional side view.
  • the projection mechanism 66 is a mask 2 that forms a sheet and extends in the length direction.
  • the mask 200 is sent in the length direction of the mask 200 by the mask motor 65.
  • FIG. 10 a part of the mask 200 in the length direction is enlarged and shown in a front view.
  • a plurality of frames 202 respectively corresponding to the plurality of types of pattern light are assigned to the mask 200 side by side in the longitudinal direction of the mask 200! /. As shown in FIG. 8, the frames 202 are selectively positioned in the incident light irradiation region.
  • FIG. 10 shows a frame 202 (shown with “code 5” in FIG. 10) for forming a pattern light having a pattern number PN of 5, and a pattern light having a pattern number PN of 6.
  • the frame 202 for forming (shown with “Code 6” in FIG. 10) and the frame 202 for forming the pattern light whose pattern number PN is 7 (! / 7 ”is shown as a representative! /
  • the mask 200 has a through hole (air opening) 204 that passes through the mask 200 in the thickness direction of each frame 202, and has a shape corresponding to the shape of the pattern light corresponding to each frame 202. It is equipped with. As shown in FIG. 10, in any frame 202, each through hole 204 has a slit shape extending linearly. Among the plurality of frames 202, those having a plurality of through holes 204 are arranged so as to form a plurality of through holes 204 with an S stripe shape.
  • each through hole 204 is arranged so as to extend in parallel to the length direction of the mask 200.
  • the mask 200 can be bent in a plane parallel to both the length direction and the thickness direction.
  • This mask 200 is constituted by a thin sheet made of metal.
  • the metal constituting the mask 200 is an example of an opaque elastic material, and an example of such a material is stainless steel.
  • An example of the thickness of the mask 200 is 0.1 mm.
  • wet etching is performed on a stainless steel plate having a thickness of 0.1 mm, whereby a plurality of through holes 204 are formed in the stainless steel plate with micron accuracy.
  • Mask 200 has been produced.
  • This mask 200 has elastic flexibility, and even if it is wound and accommodated on a roller as will be described later, if it is released from the roller, it will have an original shape that forms a straight plane. Restore It has the property to do.
  • the projection mechanism 66 includes a housing 210 for sending the mask 200 while holding it in a rollable manner.
  • a supply roller 220 as a supply tool a guide roller 222 as a guide tool, a feed roller 224 as a feed tool, and a take-up roller 226 as a take-up tool are parallel to each other. It is supported in a posture with an axis. The axes of the supply roller 220, the guide roller 222, the feed roller 224, and the take-up opening 226 are parallel to the width direction of the mask 200.
  • the mask 200 is coupled to the supply roller 220 and the take-up roller 226 at both ends in the length direction thereof.
  • the mask 200 is further supported between the supply roller 220 and the take-up roller 226 by a guide roller 222 near the supply roller 220 and a feed roller 224 near the scraping roller 226 !!
  • the mask 200 is mainly wound around the supply roller 220 out of the supply roller 220 and the take-up roller 226, and the mask 200 is 3 in this state. It is accommodated in the dimensional shape detection apparatus 10. That is, the unused portion of the mask 200 is wound around the supply roller 220 and accommodated, and the supply roller 220 is a roller that accommodates the unused portion of the mask 200 in a bent state.
  • unused portions of the mask 200 are peeled off from the supply roller 220 by the normal rotation of the mask motor 65 and supplied toward the take-up roller 226.
  • the unused portion is used for imaging of the subject S, the unused portion is wound and accommodated as a used portion by the winding roller 226. That is, the winding roller 226 is a roller that accommodates a used portion of the mask 200 in a bent state.
  • the mask 200 is mainly wound around the take-up roller 226 of the supply roller 220 and the take-up roller 226, and the mask 200 is in this state in a three-dimensional shape. It is accommodated in the detection device 10. After that, in preparation for the next imaging, the mask 200 is wound around the supply roller 220 mainly by the supply roller 220 and the take-up roller 226 by the reverse rotation of the mask motor 65, whereby the mask 200 is supplied. In the state of being wound around the roller 220, it is accommodated in the three-dimensional shape detection apparatus 10. As shown in FIG.
  • an irradiation position 228 where the incident light from the LED 62 is irradiated onto the mask 200 is set between the guide roller 222 and the feed roller 224.
  • the portions of the mask 200 that are supported at both ends by the guide roller 222 and the feed roller 224 form a linear portion 230 that passes through the set irradiation position 228 in a direction perpendicular to the incident light.
  • a portion 232 (a portion on the left side of the straight portion in FIG. 9) of the mask 200 that is supported at both ends by the supply roller 220 and the guide roller 222, A portion 234 (a portion to the right of the straight portion in FIG. 9) supported at both ends by the feed roller 224 and the take-up roller 226 is inclined to the same side with respect to the straight portion 230.
  • the larger the inclination angle the more desirable for miniaturizing the projection mechanism 66 in the length direction of the mask 200.
  • the mask 200 is coupled to the supply roller 220 and the take-up roller 226 at both ends in the length direction thereof.
  • the supply roller 220 is configured to include a shaft 240 fixed to the housing 210 and a roller portion 242 that coaxially surrounds the shaft 240.
  • the roller portion 242 is supported so as to be rotatable relative to the shaft 240 coaxially.
  • One end portion of the mask 200 is fixed to the roller portion 242, and the mask 200 is wound around the outer peripheral surface of the roller portion 242 by the rotation of the roller portion 242.
  • the rotational direction in which the mask 200 is wound around the roller part 242 is the return rotational direction
  • the rotational direction in which the mask 200 is peeled off from the roller part 242 is the feed rotational direction.
  • a spring 246 as an urging member is engaged with the roller portion 242, whereby the roller portion 242 is always urged in the return rotation direction.
  • the spring 246 is engaged with the roller portion 242 as a movable member and the shaft 240 as a stationary member in a radial clearance between the roller portion 242 and the shaft 240. Used to be allowed.
  • the spring 246 is configured as a leaf spring wound around the outer peripheral surface of the shaft 240. That spring 246 Due to the elastic force, tension is applied to the mask 200 in the length direction of the mask 200.
  • perforation regions 252 each including a plurality of feed holes 250 arranged in the longitudinal direction of the mask 200 are formed on both side edges of the mask 200.
  • the guide roller 222 and the feed roller 224 include teeth 254 and 256 that penetrate the feed holes 250 and engage with the feed holes.
  • both the guide roller 222 and the feed roller 224 are provided with a plurality of teeth 254, 256 arranged at equal intervals on each outer peripheral surface.
  • the guide roller 222 is a free roller
  • the feed roller 224 is a drive roller that is driven by a mask motor 65.
  • the mask motor 65 is coaxially connected to the feed roller 224, and the feed roller 224 is driven to rotate by the mask motor 65.
  • the rotation direction in which the mask 200 is peeled off from the supply roller 220 is the feed rotation direction
  • the rotation direction in which the mask 200 is wound around the supply roller 220 is the return rotation direction.
  • the mask motor 65 has a function of rotating the feed roller 224 and a function of rotating the take-up roller 226 in synchronization therewith. For this reason, the mask motor 65 selectively performs forward rotation that is taken up by the take-up roller 226 while feeding the mask 200, and reverse rotation that is supplied to the supply roller 220 while peeling the mask 200 from the take-up roller 226. It is done.
  • the drive pulley 260 as a rotating body that is coaxially and integrally rotated with the feed roller 224 and the mask motor 65 and the winding roller 226 and coaxially and integrally.
  • a belt 264 serving as a power transmission body is wound around a driven pulley 262 serving as a rotating body that is rotated in a rotating manner.
  • the rotational force of the mask motor 65 is transmitted to the take-up roller 226 by the transmission mechanism 266 thus configured.
  • the projection mechanism 66 includes a mask guide 270 at the irradiation position 228.
  • the mask guide 270 is provided to plan the feeding of the straight rod 230 of the mask 200.
  • the mask guide 270 force mask 200 and the straight portion 230 of the mask 200 Specifically, it includes a pair of guide plates 272 and 272 facing each other across the straight line portion 230 of the mask 200.
  • the mask guide 270 holds the mask 200 so as to be slidable in its length direction, while keeping the mask 200 as far as possible in the width direction thereof.
  • Each guide plate 272 is formed with a window 276 that passes through the guide plate 272 in the thickness direction.
  • This window 276 is also formed as an air opening, like the through hole 204. Only the portion of the incident light from the LED 62 that passes through the window 276 is irradiated onto the force mask 200.
  • the mask 200 is formed side by side in the width direction of the position reference hole 280, the ID hole region 282, and the force mask 200 for each frame 202.
  • Both the position reference hole 280 and the ID hole region 282 are formed in the mask 200 as through holes (air openings).
  • the position reference hole 280 is provided for optically detecting that any frame is located at the irradiation position 228.
  • the ID hole region 282 is located at the irradiation position 228 and is provided for optically specifying the ID of the frame, that is, the pattern number PN.
  • the ID hole area 282 force 8 bits 202, that is, 8 types of pattern lights are identified by information of 3 bits. Therefore, a maximum of three ID holes 290, 292, and 294 are formed in the ID hole region 282 for each frame 202.
  • the projection mechanism 66 moves the position sensor 300 to a position that coincides with the position reference hole 280 with respect to the position in the width direction of the mask 200. I have.
  • the position sensor 300 irradiates the focused beam to the mask 200 in order to detect the position reference hole 280 with high positional accuracy, and squeezes and receives the reflected light from the mask 200.
  • the position sensor 300 includes an LED 302 as a light emitting element, a photodiode (hereinafter referred to as “PD”) 304 as a light receiving element, and a LED lens 306 as a condensing element for the LED 302. And a PD lens 308 as a condensing element for PD304.
  • the position sensor 300 is electrically connected to the processing unit 16 as shown in FIG.
  • PD 304 outputs a PD signal that changes depending on whether or not the reflected light from mask 200 is received. Specifically, as shown in the timing chart of FIG. Since the position reference hole 280 does not face the position sensor 300, the light from the position sensor 300 is reflected by the mask 200 and is incident on the position sensor 300. On the other hand, either one of the position reference holes 280 is indicated. When the light from the position sensor 300 passes through the position reference hole 280 and does not enter the position sensor 300 because the light is opposed to the position sensor 300, it changes to indicate a low level.
  • the LED lens 306 has a condensing function of condensing the light from the LED 302 and irradiating the mask 200 with it.
  • the PD lens 308 has a condensing function that condenses the reflected light from the mask 200 and irradiates the PD 304.
  • the LED lens 306 and the PD lens 308 make it possible to detect the position of the position reference hole 280 and thus the position of the frame 202 with high accuracy!
  • the projection mechanism 66 further includes first to third ID sensors 310, 312, 314 for optically detecting the ID holes 290, 292, 294. .
  • These first and third ID sensors 310, 312, and 314 are respectively arranged at positions corresponding to the three ID holes 290, 292, and 294 with respect to the position in the width direction of the mask 200.
  • Each of the ID sensors 310, 312, and 314 includes a light emitting element that emits light toward the ID hole region 282 and a light receiving element that receives reflected light from the ID hole region 282.
  • the three light receiving elements of the first to third ID sensors 310, 312, and 314 respectively output signals indicating the presence or absence of reflected light from the ID hole region 282 as signals S1 to S3. These signals S1 to S3 change in the same manner as the PD signal described above.
  • These first to third ID sensors are also electrically connected to the processing section 16 as shown in FIG.
  • FIG. 12 is a timing chart showing an example of how the PD signal and the S1 to S3 signals change in synchronization with each other.
  • the PD signal is changed from the high level to the low level because one of the position reference holes 280 faces the position sensor 300 while the mask 200 is being sent by driving the force mask motor 65 described in detail later.
  • S1 to S3 signals are sampled from the first to third ID sensors 310, 312, and 314, respectively, using the changed event as a trigger.
  • the first and third ID sensors 310 and 314 are provided. Since the S1 signal and S3 signal each change from high level to low level because they face ID holes 290 and 294, respectively, the second ID sensor 312 does not face ID hole 292. The signal is kept high.
  • the ID of the frame 202 detected by the position sensor 300, that is, the pattern number PN is detected by the combination of the levels of the sampled S1 to S3 signals.
  • FIG. 7 is a block diagram showing the electrical configuration of the three-dimensional shape detection apparatus 10.
  • the processing unit 16 is mainly configured by a computer 400, and the computer 400 is configured to include a CPU 402, a ROM 404, a RAM 406, and a nose 408! /.
  • the CPU 402 executes the program stored in the ROM 404 while using the RAM 406, thereby detecting the operation state of the release button 40, capturing the image data from the imaging unit 14, and capturing the captured image data.
  • Various processing such as transfer and storage of data and detection of the operation status of the mode switch 42 are performed.
  • the ROM 404 includes a camera control program 404a, an imaging processing program 404b, a luminance image generation program 404c, a code image generation program 404d, a code boundary extraction program 404e, a maximum luminance image generation program 404f, and a code.
  • Boundary integration program 4 04g, code boundary selection program 404h, lens aberration correction program 404i, triangulation calculation program 404j, mask motor control program 404k, table motor control program 4041 are stored !, The
  • the camera control program 404a is executed to execute control of the entire three-dimensional shape detection apparatus 10, and the control includes main processing conceptually shown in the flowchart of FIG.
  • the imaging processing program 404b projects each of a plurality of types of pattern light onto the subject S in time series in order to detect the three-dimensional shape of the subject S, and the subject in a state where each pattern light is projected. This is executed to capture S with multiple different exposure conditions to obtain an image with pattern light, and then to project pattern light, and to capture the subject S to obtain an image without pattern light. .
  • the luminance image generation program 404c generates a plurality of pattern-lighted images based on the RGB value of each pixel acquired for the object S by execution of the imaging processing program 404b. Executed to generate a plurality of corresponding brightness images for each exposure condition
  • a plurality of types of pattern light are sequentially projected onto the same subject S in time series, and the subject S is sequentially changed while changing the exposure condition of the imaging unit 14 each time each pattern light is projected.
  • the RGB values of each pixel are obtained for each of the multiple patterned light-images that were captured in this way under a plurality of different exposure conditions, and as a result, the same number of luminance images as the type of non-turned light were obtained for each exposure condition. Generated every time.
  • the code image generation program 404d assigns a spatial code to each pixel from a binarized image generated by threshold processing for each of a plurality of luminance images generated by the execution of the luminance image generation program 404c. This is executed to generate a code image for each exposure condition. That is, by executing the code image generation program 404d by the CPU 402, as a code image generation means, a threshold process is performed on a plurality of luminance images with a predetermined threshold value, and a spatial code is assigned to each pixel. A code image for each exposure condition is generated.
  • variable window whose size changes according to the acquired periodic distribution is set locally in the luminance image for each pattern light, whereby the variable window
  • the threshold value is locally calculated and set for the entire luminance image by the filter processing using.
  • a binarized image is generated for each pattern light from the relationship between the threshold image representing the threshold distribution thus set and the luminance image for each pattern light. This binarized image is generated for each exposure condition.
  • the threshold value is calculated locally for the entire luminance image by filtering using a variable window. This technique is disclosed in detail in Japanese Patent Application No. 2004-285736 of the present applicant, the contents of which are incorporated herein by reference.
  • the code boundary extraction program 404e includes each code image for each exposure condition generated by the execution of the code image generation program 404d and each of the exposure conditions generated by the execution of the luminance image generation program 404c. By using the luminance image, it is executed to extract the boundary coordinates of the code, which is the boundary position of the spatial code, for each code image with subpixel accuracy. That is, when the CPU 402 executes the code boundary extraction program 404e, the code boundary extraction unit performs processing for extracting the code boundary position of the spatial code from the code image for each code image of each exposure condition.
  • the maximum luminance image generation program 404f detects the maximum luminance value of each pixel for each exposure condition from the plurality of luminance image forces generated by the execution of the luminance image generation program 404c. It is executed to generate an image. That is, when the CPU 402 executes the maximum brightness image generation program 404f, each captured image force captured by the imaging unit 14 also detects the maximum brightness value of each pixel for each exposure condition as a maximum brightness image generation means. Thus, the maximum brightness image is generated.
  • pattern light locus extraction means for extracting a pattern light locus from the pattern light projection image picked up by the image pickup unit 14 by the above-described luminance image generation means, code image generation means, and code boundary extraction means. Configured.
  • the code boundary integration program 404g and the code boundary selection program 404h execute a plurality of code boundary positions and the maximum luminance image generation program 404f for each exposure condition extracted by the execution of the code boundary extraction program 404e. This is executed to determine one code boundary position for calculating the three-dimensional shape of the subject S based on the maximum luminance image generated by. That is, when the CPU 402 executes the code boundary integration program 404g and the code boundary selection program 404h, as the code boundary integration means (pattern trajectory integration means), the code boundary position (pattern trajectory position) for each exposure condition is set. Based on this, one code boundary position (pattern trajectory position) for calculating the three-dimensional shape of the subject S is determined.
  • the code boundary integration program 404g and the code boundary selection program 404h are conceptually represented in the flowcharts of FIGS. [0138]
  • the lens aberration correction program 404i is used to correct aberrations of the imaging optical system 30 with respect to the code boundary position obtained by executing the code boundary integration program 404g and the code boundary selection program 404h. Executed.
  • the triangulation calculation program 404j is executed to calculate the three-dimensional coordinates of the real space related to the boundary coordinates from the boundary coordinates of the code subjected to aberration correction by the execution of the lens aberration correction program 404i.
  • the mask motor control program 404k is executed to control the mask motor 65 so as to sequentially project a plurality of types of pattern light onto the subject S.
  • This mask motor control program 404k is conceptually represented in the flowchart in Figure 17! /
  • the table motor control program 4041 is executed to control the table motor 194 that indexes and rotates the rotary table 184 together with the subject S.
  • This table motor control program 4041 is conceptually represented by a flowchart in FIG. 15 together with other processes.
  • the above-described series of pattern light projection onto the subject S and imaging of the subject S are performed each time the rotation position of the subject S is determined at equal intervals.
  • the rotation position of the subject S is intermittently determined by 90 degrees, and a series of pattern light projections and imaging of the subject S are performed for a plurality of different exposure conditions at each index position. .
  • the entire area of the outer surface of the subject S is divided into four partial areas, and 3D shape information is acquired for each partial area.
  • the 3D shape information is processed to remove the overlapping parts and combined (stitched) with each other to generate one 3D shape information corresponding to the subject S as a 3D stitch shape. It is done.
  • a stitch texture image is generated by mapping surface color information measured for the same object S to the generated three-dimensional stitch shape. Thereby, a series of three-dimensional input processes for the subject S is completed.
  • the RAM 406 has a pattern light existence image storage unit 406a, a pattern light no image storage unit 406b, a luminance image storage unit 406c, a code image storage unit 406d, Boundary coordinate storage unit 406e, aberration correction coordinate storage unit 406g, 3D coordinate storage unit 406h, periodic distribution storage unit 406p, threshold image storage unit 406q, binarized image storage unit 406r, 3D stitch shape A storage unit 406s, a stitch texture image storage unit 406t, a system parameter storage unit 406u, a maximum luminance image storage unit 406v, an exposure-specific parameter table storage unit 406w, and a working area 410 are allocated as storage areas. ing
  • the pattern light present image storage unit 406a stores pattern light present image data representing a pattern light present image captured by the execution of the image capturing processing program 404b.
  • the pattern light no-image storage unit 406b stores pattern light no-image data representing the pattern light no-image captured by the execution of the imaging processing program 404b.
  • the luminance image storage unit 406c stores data representing the luminance image generated by the execution of the luminance image generation program 404c.
  • the code image storage unit 406d stores data representing a code image generated by executing the code image generation program 404d.
  • the code boundary coordinate storage unit 406e stores data representing the boundary coordinates of each code extracted with sub-pixel accuracy by executing the code boundary extraction program 404e.
  • the aberration correction coordinate storage unit 406g stores data representing the boundary coordinates of the code on which the convergence correction has been performed by the execution of the lens aberration correction program 404i.
  • the three-dimensional coordinate storage unit 40 06h stores data representing the three-dimensional coordinates in the real space calculated by executing the triangulation calculation program 404j.
  • the periodic distribution storage unit 406p, the threshold image storage unit 406q, and the binary image storage unit 406r represent the periodic distribution, threshold image, and binarized image acquired by executing the code image generation program 404d. Store each data.
  • the three-dimensional stitch shape storage unit 406s stores the above-described three-dimensional stitch shape
  • the stitch texture image storage unit 406t stores the above-described stitch texture image
  • the maximum luminance image storage unit 406v stores the maximum luminance image described above.
  • the system parameter storage unit 406u stores the above-described system parameters.
  • the exposure-specific parameter table storage unit 406w serves as an exposure condition information storage unit that stores information on a plurality of different exposure conditions for setting the exposure of the CCD 70 in the imaging unit 14 by exposure. Store as a parameter table.
  • This parameter table for each exposure has a plurality of exposure time parameters for switching the exposure time of the CCD 70 of the imaging unit 14, and the plurality of exposure time parameters are sequentially captured as the imaging processing program 404b is executed.
  • the exposure time of the CCD 70 can be switched.
  • the exposure time of the CCD 70 is an exposure condition, and the power for explaining a configuration in which the exposure condition can be switched according to the exposure time.
  • the exposure of the imaging unit 14 is not limited to this, and is set by an optical system member. In some cases, the exposure condition may be switched by changing the degree of aperture of the shutter.
  • the working area 410 stores data temporarily used by the CPU 402 for its operation.
  • system parameters stored in system parameter storage section 406u will be described.
  • the three-dimensional shape detection apparatus 10 in the present embodiment uses an active three-dimensional image measurement method that determines one point in the three-dimensional space as an intersection of a plane and a straight line and an intersection of two straight lines. That is, the pattern light projected from the projection unit at a predetermined position and the line of sight of the imaging unit force at the predetermined position are regarded as a plane and a straight line, respectively, and the imaging optical system by the projection unit and the imaging unit is Model with system parameters including position and orientation, and measure 3D shape using these system parameters.
  • the system parameter is a nomometer composed of camera parameters and projector parameters, which will be described in detail below.
  • the camera parameters are represented by the following 3 X 4 parameters.
  • This parameter includes data such as the position, orientation, and angle of view of the imaging unit. In other words, it represents the line of sight from the imaging unit.
  • the projector parameters are expressed by the following 2 X 4 parameters.
  • This parameter includes data such as the position and orientation of the projection unit. In other words, it represents the plane of the pattern light.
  • the system parameters as described above, that is, camera parameters and projector parameters are stored in the system parameter storage unit 406u.
  • the camera control program 404a will be described with reference to FIG.
  • the camera control program 404a is executed by the computer 400, the above-described main processing is executed.
  • step S101 (hereinafter simply expressed as “S101”; the same applies to other steps), the power source including the teller 74 is turned on.
  • step S102 the processing unit 16, peripheral interfaces, etc. are initialized.
  • S103 a key scan is performed to determine the operation state of the mode switching switch 42.
  • S104 the 3D mode is selected by the operation of the mode switching switch 42. Is determined.
  • S106 the stereoscopic image processing in S106, which will be described in detail, is executed, and then the process returns to S103.
  • the mode switching switch 42 is operated to turn off the mode. It is determined whether or not the selected force has been selected. This time, if it is assumed that the off mode is selected by operating the mode switch 42, the judgment is YES and the main processing immediately ends this time. This time, the off mode is selected by operating the mode switch 42. Assuming that the power Return.
  • FIG. 14 conceptually shows a flowchart of S106 in FIG. 13 as a stereoscopic image processing routine.
  • the stereoscopic image processing for detecting and displaying the three-dimensional shape of the subject S as a stereoscopic image is executed.
  • the surface color of the same subject S is also detected.
  • the three-dimensional image detection result and the surface color detection result combined in association with the position are the three-dimensional color shape detection result.
  • the finder image that is, the same image as the image in the range visible through the imaging optical system 30 is displayed on the monitor LCD 44. Therefore, the user can confirm the captured image (imaging range) before actual imaging by viewing the image displayed on the monitor LCD 44.
  • the operation state of the release button 40 is scanned, and then in S1003, it is determined based on the scan result whether or not the release button 40 is in a half-pressed state. If it is in the half-pressed state, the judgment force is SYES.
  • the auto focus (AF) and automatic exposure (AE) functions are activated, and the focus, aperture, and shirt speed are adjusted accordingly. If the release button 40 is not pressed halfway, the determination in S10 03 is NO and the process proceeds to S1011. Note that the exposure condition adjusted by the automatic exposure (AE) function activated in S1004 is temporarily set in the working area 410, and is used when a pattern light non-image to be described later is captured.
  • a 3D color shape detection result for the subject S is generated by the 3D color shape detection process.
  • the 3D color shape detection result is the spatial code described later.
  • a set of vertex coordinates that are obtained, with color shape information and polygon information associated with each vertex. means.
  • the color shape information is information representing a combination of real space coordinates and RGB values.
  • the polygon information is information representing a combination of a plurality of vertices to be connected to each other in order to form a solid that three-dimensionally faces the subject S among the plurality of vertices.
  • the three-dimensional color shape detection result is stored in the external memory 78.
  • the three-dimensional color shape detection result is displayed on the monitor LCD 44 as a three-dimensional computer graphic image. Is displayed.
  • S1010 After that, in S1010, a key scan is performed in the same manner as S103 in FIG. Subsequently, in S 1011, it is determined whether or not the operation state of the mode switching switch 42 has changed. If there is no change, the judgment power of S1011 is YES, and the process returns to S1001, but if there is a change, the judgment of S1011 is NO and the current stereoscopic image processing ends.
  • the three-dimensional shape of the subject S is detected using a spatial encoding method.
  • S1007 in FIG. 14 is conceptually represented by a flow chart as a three-dimensional color shape detection processing routine.
  • a table motor control program 4041 is incorporated, and this table motor control program 4041 is configured to include S1201 and S1221 to S1223 in FIG.
  • the rotation phase PH of the rotation table 184 is initialized to 0 in S1201.
  • the rotating table 184 is stopped four times during one rotation, four rotating phases PH are set discretely on the rotating table 184.
  • the rotational phase PH is “0” representing the initial rotational phase PH, “1” representing the next rotational phase PH, “2” representing the next rotational phase PH, and the last rotational phase. It can be changed discretely to “3” representing PH.
  • the imaging process program 404b is executed, whereby the imaging process is executed for the current rotational phase PH.
  • the projection unit 12 The striped pattern light is projected onto the subject s in time series.
  • the subject s on which multiple types of pattern light is projected is imaged under different exposure conditions, and multiple images with pattern light for each exposure condition and the pattern light are projected. A single pattern light no image obtained by imaging S is acquired. This S1210 will be described in detail later with reference to FIG.
  • a three-dimensional measurement process is executed for the current rotational phase PH.
  • this three-dimensional measurement process is executed, a plurality of pattern light-present images and one pattern light no-image for each exposure condition acquired by the above-described imaging process are used to actually A three-dimensional shape is measured.
  • This S1220 will be described in detail later with reference to FIG.
  • the rotational phase PH is incremented by 1 in S1221 in preparation for the next imaging. Subsequently, in S1222, it is determined whether or not the force is larger than the current value of the rotation phase PH, that is, whether or not the power of the series of imaging on the subject S has already been completed.
  • S1210 in FIG. 15 will be described in detail with reference to FIG. Figure 16 shows S1210 is conceptually represented in the flowchart as the imaging processing program 404b.
  • the pattern number PN representing the number of the mask pattern used to form the pattern light is initialized to 0.
  • the maximum value PNmax is determined according to the total number of mask patterns used. For example, when 8 types of mask patterns are used, the maximum value PNmax is set to 8.
  • this mask motor control program 404k as shown in FIG. 17, first, in S2201, a signal for rotationally driving the mask motor 65 at a constant speed is supplied to the mask motor driver 86. Thereby, the mask 200 is sent in the direction in which the mask 200 is supplied from the supply roller 220 to the irradiation position 228.
  • step S2203 it is determined whether or not the read PD signal indicates a low level. That is, it is determined whether or not the position sensor 300 has detected any position reference hole 280 (this time, the first position reference hole 280).
  • the S1 to S3 signals are read from the first to third ID sensors 310 to 314, respectively.
  • the combination of the read S 1 signal and S3 signal level (3-bit information) represents the current value of the pattern number PN. That is, among the plurality of frames 202 in the mask 200, they are currently located at the irradiation position 228 !, that is, the pattern number PN of the current frame 202 It is determined whether or not it matches the current value of the force and pattern number PN.
  • the determination power of S2205 is YES.
  • the pattern number PN is incremented by 1 in the same order as the order in which the plurality of frames 202 are arranged in the mask 200. That is, the mask 200 is sent sequentially, and therefore the determination in S2205 is YES unless there is an abnormality in the three-dimensional shape detection apparatus 10.
  • the mask motor is arranged such that the plurality of frames 202 are sequentially positioned at the irradiation position 228 by the intermittent feed of the mask 200 by the intermittent drive of the mask motor 65. 65 is controlled.
  • the present invention is applied in such a manner that the mask motor 65 is controlled so that the plurality of frames 202 are sequentially positioned at the irradiation position 228 by the continuous feeding of the mask 200 by the continuous driving of the mask motor 65. It can be implemented.
  • the length direction of each through hole 204 is made to coincide with the feed direction of the mask 200. Therefore, even when the mask 200 is moving, it is easy to secure time for the same pattern light to be generated by the same frame 202 and projected onto the subject S when any frame 202 passes the irradiation position 228. is there.
  • FIG. 18 conceptually shows the details of S2004 in a flowchart as a projection processing subroutine.
  • Projection processing for projecting the pattern light having the PN-th mask pattern from the projection unit 12 onto the subject S is executed in cooperation with the projection mechanism 66.
  • the light source dryer 84 is driven in S3004, and then the LED 62 emits light in response to an electrical signal from the light source dryer 84 in S3005. This is the end of the current projection process.
  • the light emitted from the LED 62 reaches the projection mechanism 66 through the light source lens 64.
  • the projection mechanism 66 spatial modulation according to the opening pattern of the current frame 202 of the mask 200 is performed, and as a result, incident light to the projection mechanism 66 is converted into pattern light and output.
  • the pattern light output from the projection mechanism 66 is projected as a projection image onto the subject S via the projection optical system 32.
  • the PN-th pattern light formed by the PN-th mask pattern is projected onto the object S, the PN-th pattern light is then transmitted in S2005 in FIG.
  • the projected subject S is imaged by the imaging unit 14.
  • a PN-th pattern light existence image obtained by imaging the subject S on which the PN-th pattern light is projected is acquired for each of a plurality of different exposure conditions.
  • the acquired pattern light present image is stored in the pattern light present image storage unit 406a in association with the corresponding pattern number PN.
  • the graph shown in FIG. 19 shows the relationship between the output luminance of the image signal output from the imaging unit 14 and the actual luminance of the surface of the subject S, and these relationships are the exposure conditions in the imaging unit 14, respectively. These characteristics are shown.
  • the graph in FIG. 19 shows the horizontal axis (subject S The surface luminance is schematically expressed as a logarithm.
  • the exposure condition of the imaging unit 14 has seven exposure conditions of exposure condition [0] to exposure condition [i EvNumMax-1].
  • the exposure condition [0] is the lowest and the exposure is the lowest (minimum exposure), and the exposure condition increases in the order of exposure conditions [1], [2],..., [IEvNumMax—1].
  • Exposure condition [iEvNumMax- ⁇ ] is the highest exposure (maximum exposure).
  • the dynamic range of one exposure condition is a narrow range as shown in Fig. 19.
  • the surface brightness of the subject S that can be imaged by the imaging unit 14 by switching these seven exposure conditions is a wide range. Become.
  • the surface brightness of the subject S that can be detected under each exposure condition is such that the dynamic range overlaps between adjacent exposure conditions.
  • the dynamic range of the exposure condition [3] (the range of bl to b2 in Fig. 19)
  • the dynamic range of the exposure condition [4] the range of cl to c2 in Fig. 19
  • Overlapping range (range dl to d2 in Fig. 19).
  • the surface brightness (al to a2 in FIG. 19) of the subject S within a predetermined range is within the dynamic range of any exposure condition between the lowest exposure and the highest exposure.
  • the range (cMinO [iEvNum] to cMax [iEvNum]) is set to an effective luminance range for selecting a code boundary coordinate described later, which is narrower than the respective dynamic range. .
  • the setting of the exposure condition of the imaging unit 14 is performed by setting one exposure time parameter among the plurality of exposure time parameters stored in the exposure-specific parameter table storage unit 406 w in the imaging unit 14. . That is, the CPU 402 extracts the exposure time parameter from the exposure-specific parameter table storage unit 406w, transmits the exposure time parameter to the imaging unit 14, and performs imaging with the exposure time corresponding to the exposure time parameter by being sent to the imaging unit 14 side. Then! / As shown in FIG. 20, the exposure condition and exposure setting index iEvNum are stored in the parameter table storage unit 406w for each exposure corresponding to each of the exposure conditions [0] to exposure conditions [iEvNumMax-1]. The exposure time parameters Ev [0] to Ev [iEvNum Max-1] correspond to each.
  • the exposure time of the imaging unit 14 can be changed under the seven exposure conditions of exposure condition [0] to exposure condition [iEvNumMax-1]. In the case of the imaging unit 14 having a large, it is not necessary to have seven exposure conditions.
  • S2005 is conceptually represented by a flowchart as a pattern light image capturing processing subroutine. This subroutine is processing by execution of the imaging processing program 400b by the CPU 402.
  • the exposure setting index iEvNum is “0”
  • the exposure time parameter Ev [0] is retrieved.
  • the exposure time parameter Ev [0] extracted in this way is set in the imaging unit 14.
  • the imaging unit 14 can perform imaging under the exposure condition [0].
  • the imaging unit 14 captures an image with an exposure time corresponding to the subject S force exposure time parameter onto which the first pattern light is projected.
  • the image with the pattern light captured in this way is stored in the pattern light with image storage unit 406a.
  • the exposure setting index iEvNum is incremented by 1 in S2024. Subsequently, returning to S2021, it is determined whether or not the exposure setting index iEvNum force S is smaller than “iEvNumMax”. If it is assumed that the exposure setting index iEv Num is smaller than “iEvNumMax” this time, the determination in S2021 is YES, and the process proceeds to S2022.
  • the determination is YES.
  • S2009 the power to flash the flash 26 is determined. If the flash mode is not selected, the determination in S2008 is NO and the S2009 force is skipped. In any case, the subject S is then imaged in S2010.
  • This imaging is performed without projecting pattern light from the projection unit 12 onto the subject S for the purpose of measuring the surface color of the subject S.
  • one pattern light no image is obtained for the subject S.
  • the acquired pattern light no-image is stored in the pattern light no-image storage unit 406b.
  • the exposure condition in the imaging unit 14 at this time is the exposure condition acquired by the automatic exposure function in S1004, but may be an exposure condition among the plurality of exposure conditions.
  • the mask motor 65 is driven to initialize the length direction position of the mask 200 so that the head portion of the mask 200 in the length direction is positioned at the irradiation position 228.
  • a signal reflecting the exposure is taken out from the CCD 70.
  • One exposure corresponds to one exposure, and the exposure and signal extraction together constitute one individual image processing.
  • acquisition of 3D shape information and surface color information for the same subject S Acquisition of information is performed continuously and in the order.
  • FIG. 22 conceptually shows the S 1220 as a three-dimensional measurement processing subroutine in a flowchart.
  • the exposure setting index iEvNum is reset to “0” by the CPU 402 executing the camera control program 404a.
  • the luminance value is defined as the Y value in the YCbCr space. From the RGB value of each pixel,
  • a threshold value for each pixel By obtaining a threshold value for each pixel, a plurality of luminance images respectively corresponding to the plurality of pattern light-present images with the exposure condition [iEvNum] corresponding to the exposure setting index iEvNum are generated.
  • the generated luminance images are stored in the luminance image storage unit 406c in association with the exposure setting index iEvNum and the pattern number PN.
  • the formula used for calculating the luminance value is limited to the above formula. It is not a thing and it can change suitably to other formulas.
  • the CPU 402 executes the maximum luminance image generation program 404f.
  • a maximum luminance image is generated from a plurality of luminance images with the exposure condition [iEvNum] corresponding to the exposure setting index iEvNum stored in the luminance image storage unit 406c.
  • the generated maximum luminance image is associated with the exposure setting index iEvNum and stored in the maximum luminance image storage unit 406v.
  • the generation of the maximum luminance image is performed by collecting the maximum luminance value for each pixel of the plurality of luminance images under the exposure condition corresponding to the exposure setting index iEvNum. That is, for each coordinate position of the CCD coordinate system cc dx—ccdy, which is a two-dimensional coordinate system set on the image plane of the CCD 70, multiple brightnesses under the exposure condition [iE vNum] corresponding to the exposure setting index iEvNum The maximum brightness image is generated by extracting the highest brightness value from the image.
  • the CPU 402 executes the code image generation program 404d.
  • this code image generation program 404d is executed, a code image in which a spatial code is assigned to each pixel is generated by combining a plurality of luminance images with the exposure condition [iEvNum] corresponding to the exposure setting index iE vNum. Is done.
  • the code image is assigned a luminance threshold value for each pixel with respect to the luminance image related to a plurality of types of pattern-lighted images in the exposure condition [iEvNum] corresponding to the exposure setting index iEvNum stored in the luminance image storage unit 406c. It is generated using the result image (binarized image) of binary image processing (threshold processing) by comparison with the threshold image.
  • the generated code image is stored in the code image storage unit 406d in association with the exposure setting index iEvNum.
  • FIG. 23 conceptually shows the details of the code image generation program 404d in a flowchart.
  • a plurality of luminance images are generated on the same subject S (three-dimensional object) and based on a plurality of types of pattern light.
  • Each of the pattern lights is formed such that a bright part, that is, a bright pattern line having a width, and a dark part, that is, a pattern line having a width, are alternately repeated at a constant cycle.
  • These pattern lights are different from each other with respect to their periods, and are each referred to as a pattern light having a pattern number PN.
  • the pattern light having the shortest period and the light pattern number PN is 0, and the pattern light having the longest period is the pattern light having the pattern number PN (PNmax ⁇ 1).
  • any luminance image is acquired under the corresponding pattern light, a pattern image in which brightness and pattern lines as bright portions and dark and dark portions as pattern portions are alternately arranged. Formed as. Since the interval or period between pattern lines depends on the relative geometric relationship (relationship between position and orientation) between the 3D shape detection device 10 and the subject S, It is not necessarily constant at the position.
  • a plurality of luminance images respectively acquired under a plurality of types of pattern light are specified using the corresponding pattern light pattern number PN.
  • any one of the plurality of luminance images is selected as the representative pattern image.
  • a typical example of the representative pattern image is a luminance image corresponding to an image having a minimum pattern line period among a plurality of types of pattern light, and this is a luminance image having a pattern number PN of zero.
  • the luminance value changes spatially and periodically in the direction of the pixel column.
  • This envelope represents a spatial change in the luminance value in the luminance image obtained by imaging the same subject S without irradiation, that is, the luminance value of the background light of the subject S.
  • the threshold value is adaptively changed by tracking the actual luminance value change of the luminance image. Is desirable.
  • a filter window for calculating a threshold value by performing filter processing on the luminance image is set locally, and is suitable for the position by performing the filter processing.
  • Threshold force Set locally for the luminance image. If a window is set at a certain local position in the luminance image, the luminance value of the pixel existing in the window is extracted and referred to among the plurality of pattern lines constituting the luminance image. A threshold value corresponding to the local position is set.
  • the window used in the present embodiment is a rectangular window.
  • this rectangular window is adopted, the luminance values of the pixels constituting the plurality of pattern lines existing in the rectangular window are extracted, and the threshold value is calculated by using the same weighting coefficient for these luminance values. Is done.
  • the window function of the rectangular window is defined by the weight coefficient.
  • the number of pixels existing in the rectangular window is determined according to the size of the rectangular window in the line direction in which the pattern line extends. It can be variable.
  • the number of pattern lines and the number of pixels existing in the column direction in the rectangular window are variable according to the column direction size in the column direction in which the plurality of pattern lines are arranged in rows. It can be.
  • the threshold value for calculating the luminance image force changes by setting the window in the luminance image according to the column-direction size of the rectangular window. Therefore, if it is necessary to adaptively change the threshold value, change the column size of the rectangular window adaptively.
  • the size of a window configured as a rectangular window is such that the number of pattern lines existing in the window is the interval between the pattern lines, that is, the period (for example, the period in which bright non-turn lines are repeated). Desirably, set to be an integer multiple of. That is, it is desirable to set the window size so that the same number of bright pattern lines and dark pattern lines exist in the window. By setting in this way, it is possible to obtain a desired threshold with high accuracy by calculating the average value of the luminance values of a plurality of pattern lines existing in the window.
  • an image captured under the pattern light having the minimum cycle of the no-turn line that is, a luminance image having a pattern number PN of 0 is obtained. Selected as a representative pattern image.
  • the window VW force set locally with respect to the representative pattern image is configured as a variable window whose size is variable. As a result, the size of the variable window VW can be changed in accordance with the actual no-turn line period of the representative pattern image.
  • the threshold value TH is acquired for each local position where the variable window VW is set for the representative pattern image. The threshold value TH for each local position is accurately obtained based on the variable window VW having the optimum size for each local position.
  • variable window VW in which the number of pattern lines in the bright part and the dark part is kept constant is minimum in the luminance image having the pattern number PN of 0. Therefore, by selecting the luminance image whose pattern number PN is 0 as the representative pattern image, the size of the smallest variable window VW becomes possible, and the calculation burden of filter processing after using the variable window VW is suppressed. It becomes possible.
  • variable window VW is configured as a rectangular window having a variable size.
  • the size of the variable window VW is set to be fixed in the direction of the force line, which is variable in the column direction of the representative pattern image.
  • the size of the variable window VW that is, the size in the column direction of the representative pattern image is set so as to appropriately reflect the actual pattern line period of the representative pattern image. . Therefore, in order to set the size of the variable window VW, it is necessary that the actual pattern line period distribution of the representative pattern image is known in advance. Accordingly, in the present embodiment, prior to setting the size of the variable window VW, a fixed window with a fixed size is set for the representative pattern image. A plurality of continuous pixels captured by the set fixed window are selected as a plurality of target pixels, and based on the luminance values of the selected target pixels, the actual pattern line period of the representative pattern image is selected. Distribution is acquired.
  • FFT Fast Fourier Transform
  • Intensity eg, power spectrum
  • the “frequency component” means the number of repetitions in which the change in luminance value is repeated when a plurality of target pixels captured by one fixed window are arranged in the column direction.
  • each of a plurality of continuous pixels continuously arranged in the column direction is sequentially selected as a target pixel in the representative pattern image, and each selected target image is selected.
  • the pattern line period is obtained for each element based on the luminance value distribution of the representative pattern image. With reference to the acquired pattern line period, the size of the variable window VW used in the filter processing for threshold image generation is determined.
  • this code image generation program 404d first, in S5001, pattern light having a pattern number PN of 0 is projected from the luminance image of the exposure condition [iEvNum] corresponding to the exposure setting index iEvNum. A luminance image obtained by imaging the subject S is read from the luminance image storage unit 406c as a representative pattern image.
  • the representative pattern image is patterned for each pixel continuously arranged in the column direction in the representative pattern image based on the read luminance image by the above-described FFT conversion approach.
  • the line period is calculated.
  • the calculated plurality of pattern line periods are stored in the period distribution storage unit 406p in association with each pixel (pixel position in each column).
  • Window VW characteristics are set locally.
  • the size of the variable window VW in the line direction is set so as not to change regardless of the position on the representative pattern image where the variable window VW is set.
  • the column direction size is set to correspond to an integral multiple of the pattern line period calculated in association with each column direction pixel position.
  • variable window VW force is set on the representative pattern image in a plane along the line direction and the column direction and in association with each pixel. Thereby, for each pixel, the average value of the luminance values of a plurality of pixels existing in the variable window VW is calculated as a local threshold value.
  • a threshold image in which the calculated threshold value is assigned to each pixel is further generated. The generated threshold image is associated with the exposure setting index iEvNum and stored in the threshold image storage unit 406q.
  • the pattern number PN is initialized to 0, and then S5006! Whether or not the current value of the pattern number PN is smaller than the maximum value PNmax is determined. This time, because the current value of the pattern number PN is 0, the judgment is NO and the process moves to S5007.
  • the pattern number PN is assigned, and the brightness image of the exposure condition [iEvNum] corresponding to the exposure setting index iEvNum And the threshold value of the threshold image of the exposure condition [iEvNum] corresponding to the generated exposure setting index iEvNum are compared with each other for each pixel.
  • the comparison result is reflected in the binarized image for each pixel. Specifically, when the luminance value of the luminance image is larger than the threshold value, data representing “1” is stored in the binarized image storage unit 406r in association with the corresponding pixel position in the binarized image. On the other hand, if the luminance value of the luminance image is not larger than the threshold value, data representing “0” is stored in the binarized image storage unit 406r in association with the corresponding pixel position in the binarized image. Is done.
  • a spatial code image corresponding to the current subject S is generated.
  • the generated spatial code is stored in the spatial code storage unit 116d in association with each pixel position and the exposure setting index iEvNum. For example, if the maximum value PNmax is 8, the generated spatial code has a value in the range 0-255.
  • the code boundary coordinate detection process is performed by executing the code boundary extraction program 404e. Since the code encoding by the above-described spatial encoding method is performed for each pixel, the code image in the exposure condition [iEvNum] corresponding to the light / dark boundary line in the actual pattern light and the generated exposure setting index iEvNum An error in subpixel accuracy occurs between the boundary line of the spatial code in the image (the boundary line between the area assigned with one spatial code and the area assigned with another spatial code). Therefore, this code boundary coordinate detection process is performed for the purpose of detecting the boundary coordinate value of the spatial code with sub-pixel accuracy. Details of the processing for detecting the boundary coordinate value of the spatial code with subpixel accuracy are disclosed in detail in the specification of Japanese Patent Application No. 2004-1054261 of the present applicant.
  • This code boundary coordinate detection process refers to a luminance image in the vicinity of the boundary coordinate value detected by referring to the code image (can only be detected at the pixel boundary! Approximate with a polynomial, and at the same time, calculate the average value of threshold values near the boundary coordinate values. So Then, the boundary coordinate value of the spatial code is detected with subpixel accuracy by calculating the intersection of the polynomial that approximates the change in luminance and the average value of the nearby threshold (decimal accuracy: subpixel accuracy). .
  • the maximum value PNmax is 8 (the boundary is 255 because it has 256 spatial codes)
  • the detected code boundary coordinate value is stored in the code boundary coordinate storage unit 406e.
  • the code boundary coordinate values are defined in the CCD coordinate system ccdx-ccdy, which is a two-dimensional coordinate system set on the image plane of the CCD 70.
  • the exposure setting index iEvNum is incremented by one. Subsequently, returning to S4002, it is determined whether or not the exposure setting index iEvNum is smaller than “iEvNumMax”. If it is assumed that the exposure setting index iEvNum is greater than or equal to “iEvNumMax” this time, the S4002's half IJ constant will be YES and the process proceeds to S4003.
  • S4008 in FIG. 22 will be described in detail with reference to FIG. Figure 24 conceptually shows the S4008 as a code boundary integration subroutine in a flowchart. It is.
  • integrated code boundary coordinate storage area an area for storing code boundary coordinates (hereinafter referred to as "integrated code boundary coordinates") integrated by this code boundary integration processing (hereinafter referred to as “integrated code boundary coordinate storage area").
  • integrated code boundary coordinate storage area As shown in FIG. 26, this integrated code boundary coordinate storage area is configured so that each code boundary position (Icodejccdx) can be stored for each code boundary position.
  • the first boundary position index Icode is set to “0” and initialized. Subsequently, in S5102, it is determined whether the first boundary position index Icode is smaller than “IcodeMax”. This time, since the first boundary position index Icode is “0” which is smaller than “Icode Max”, the determination in S5102 is YES, and in S5103, the second boundary position index Iccdx is set to “0” and is initialized. It becomes. That is, the second boundary position index Iccdx is set to “0”.
  • the first boundary position index Icode and the second boundary position index Iccdx set in this way are stored in the working area 410. When incremented in S5107 or S5108 described later, the first boundary position index Icode and the second boundary position index Iccdx stored in the working area 410 are updated each time.
  • the second boundary position index Iccdx is incremented by one. Subsequently, returning to S5104, it is determined whether or not the second boundary position index Iccdx is a value smaller than “IccdxMax”. If it is assumed that the second boundary position index Iccdx is not smaller than “Iccd xMax” this time, the determination in S5104 is NO, and the process proceeds to S5108.
  • the first boundary position index Icode is only 1 in S5108. Incremented. Subsequently, returning to S5102, it is determined whether or not the first boundary position index Icode is a value smaller than “IcodeMax”. In this case, if it is assumed that the first boundary position index Icode is smaller than “IcodeMax” and is not a value !, the determination of S5102 is NO, and the code boundary integration processing is terminated.
  • S5105 in FIG. 24 will be described in detail.
  • the S1105 is conceptually represented by a flowchart as a code boundary selection program 404h.
  • the exposure setting index iEvNum value is initialized. That is, the exposure setting index iEvNum is set to “0”.
  • the exposure setting index iEvNum—1 processed immediately before the exposure setting index iEvNum being processed in this flowchart is set as the previous exposure setting index iEvNumB, and this previous exposure setting index iEvNumB is set to “ ⁇ 1”.
  • the determination of S5201 is YES, and the code boundary coordinates (ccdx, ccdy) of the imaging condition corresponding to the exposure setting index iEvNum in S5202 ) Is obtained.
  • the code boundary coordinates acquired here are code boundary coordinates determined from the first boundary position index Icode and the second boundary position index Iccdx stored in the working area 410.
  • step S5203 it is determined whether or not the obtained code boundary coordinates (ccdx, ccdy) are indefinite, in step S5203.
  • the fact that the code boundary coordinates (ccdx, ccdy) are indefinite means that the code boundary coordinates cannot be detected in the code boundary extraction process of S4006.
  • S5203 Trowel if the acquired code boundary coordinates (ccdx, ccdy) are determined to be indefinite, the determination of S5203 is NO, and in S5204, the acquired code boundary coordinates (ccdx, ccdy) Get the average luminance value (AveY).
  • the average luminance value (AveY) near the code boundary coordinates (ccdx, ccdy) is calculated in S5204 based on the maximum luminance image generated in S4004.
  • the determination power of S5203 is YES, and in S5220, the exposure setting index iEvNum is set to "iEvNumMax-l". It is determined whether or not. Assuming that the exposure setting index i EvNum is “iEvNumMax-1” this time, the judgment power SYES of S5220 is obtained, and the previous exposure setting index iEvNumB force S is “1” in S5221. It is determined whether or not it is power.
  • the code boundary selection processing ends after any of the following processing of S5250 to S5252 is performed.
  • the previous code boundary coordinates (ccdxB, ccdyB) are determined as the determined data of the code boundary position (Icode, Iccdx) and stored in the integrated code boundary coordinate storage area of the code boundary coordinate storage unit 406e. That is, when the previous average luminance value AveB force ⁇ MinODEvNumB] is equal to or greater than cMaxDEvNumB], the previous code boundary coordinates (ccdxB, ccdyB) are determined as determined data of the code boundary position (Icodejccdx).
  • the code boundary position (Icode, Iccdx) is made undefined and stored in the integrated code boundary coordinate storage area of the code boundary coordinate storage unit 406e.
  • the code boundary coordinates (ccdx, ccdy) are determined as determined data of the code boundary position (Icode, Iccdx) and stored in the integrated code boundary coordinate storage area of the code boundary coordinate storage unit 406e.
  • the code boundary selection process is the process of selecting one code boundary position (Icode, Iccdx) from the code boundary positions (Icode.lccdx) under multiple exposure conditions. This is performed for each position (Icode, Iccdx), and the code boundaries of multiple exposure conditions are integrated into one code boundary.
  • the code boundary coordinate force of the minimum exposure condition [0] is applied to the code boundary coordinate of the maximum exposure condition [iEvNumMax-1]. It decides whether it is within the effective luminance range and selects the code boundary coordinates of the first exposure condition that falls within the effective luminance range. This makes it possible to detect the code boundary position using the captured image under appropriate exposure conditions for each code boundary position (Icodejccdx).
  • the code boundary coordinates of the first exposure condition that falls within the effective luminance range are selected, but the code boundary coordinates of the exposure condition that falls within the effective luminance range are selected as the code boundary coordinates.
  • the code boundary coordinate of the exposure condition whose corresponding luminance value is closest to the center of each effective luminance range may be selected. This makes it possible to detect the code boundary position using the captured image under a more appropriate exposure condition.
  • the lens aberration correction process is performed by executing the lens aberration correction program 404i.
  • the actual imaging position of the light flux incident on the imaging optical system 30 that is affected by the aberration of the imaging optical system 30 is converted into an ideal lens. This process corrects the image so that it approaches the ideal image formation position that should be imaged.
  • the code boundary coordinate values integrated in S4008 are corrected so that errors due to distortion of the imaging optical system 30 and the like are removed.
  • the code boundary coordinates corrected in this way are stored in the aberration correction coordinate storage unit 406g.
  • a two-dimensional code image is displayed in the line direction of each pattern light. Reference is made spatially with respect to a plurality of discrete reference lines that intersect. As a result, not only a plurality of three- dimensional vertices corresponding to a plurality of discrete points on the outer boundary of the code image are obtained, but also a plurality of discrete points (S40 03) inside the code image. A plurality of 3D vertices corresponding to the code's detected boundary coordinate points) are obtained.
  • S1230 in FIG. 15 will be described in detail.
  • S1230 is conceptually represented in a flow chart as a 3D color shape detection result generation subroutine.
  • this three-dimensional color shape detection result generation subroutine first, in S5501, a plurality of three-dimensional coordinate values are loaded from the three-dimensional coordinate storage unit 406h in association with each of the rotation phases PHO to 3.
  • the in the present embodiment the entire outer surface of the subject S is divided into four partial surfaces (front, right side, left side, and back), and three-dimensional shape information is generated for each partial surface.
  • a plurality of three-dimensional coordinate values belonging to each of the four partial surfaces are loaded from the three-dimensional coordinate storage unit 406h for all the four partial surfaces.
  • the plurality of loaded three-dimensional coordinate values (vertex coordinate values) are subjected to rotational transformation according to the rotational phase PH of each partial surface to which each three-dimensional coordinate value belongs.
  • a plurality of three-dimensional coordinate forces belonging to the four partial surfaces are combined in anticipation of the rotational phase PH of each partial surface.
  • the four partial surfaces that are three-dimensionally expressed by a plurality of three-dimensional coordinate values are integrated, and the three-dimensional shape information representing the entire outer surface of the subject S is synthesized.
  • a spatially overlapping portion is extracted from the generated composite image. Furthermore, two overlapping portions in each region in the length direction of the composite image are obtained by averaging a plurality of three-dimensional coordinate values belonging to the two portions. It is combined (stitched) into one part by means of leveling. As a result, spatial overlap is removed from the 3D shape information, thereby completing the 3D stitch shape. Data representing the 3D stitch shape is stored in the 3D stitch shape storage unit 406s.
  • the relationship between the real space coordinate system and the plane coordinate system that defines the surface color image is geometrically associated with each other by the triangulation calculation described above.
  • a code image that is, a plane coordinate system that defines a shape image that is a two-dimensional image for measuring the three-dimensional shape of the subject S
  • a real space three-dimensional coordinate system By using the inverse transform, the real space 3D coordinate system can be mapped by calculation to the planar coordinate system that defines the surface color image. Therefore, in this S6001, it is possible to extract the corresponding surface color value, that is, the RGB value, for each three-dimensional vertex from the two-dimensional surface color image.
  • the surface color value corresponding to each 3D vertex and the surface color value corresponding to the 3D spatial position between each 3D vertex are extracted and rearranged on the image plane.
  • the image generated by the rearrangement is stored in the stitch texture image storage unit 406t as a stitch texture image.
  • the force obtained by performing the image capturing process on all the exposure time parameters stored in the exposure-specific parameter table storage unit 406w A part of the exposure time parameter stored in the table storage unit 406w can be used to shorten the imaging process time.
  • the execution of the automatic exposure (AE) function may be performed by pattern light-with-image imaging processing that is not performed in S1004.
  • the automatic exposure (AE) function detects the brightness of the imaging area in the imaging unit 14 and determines the exposure condition based on the brightness.
  • the force described in the example of the three exposure conditions is not limited to this. Good.
  • the number of exposure conditions may be changed by setting.
  • the force described for the three-dimensional shape detection using the pattern light in the spatial code method may be a three-dimensional shape detection using other pattern light.
  • the force described for the three-dimensional shape detection using the pattern light in the spatial code method may be a three-dimensional shape detection using other pattern light.
  • 3D shape detection Is also applicable.

Landscapes

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

Abstract

 ダイナミックレンジが狭い撮像部を用いた場合であっても、被写体の3次元形状を検出することができる3次元形状検出装置を提供すること。  明と暗とを交互に並べてなる複数種類のパターン光の各々を時系列に被写体に投影されている状態の被写体を複数の異なる露出条件で撮像し、それぞれ各露出条件毎に複数の輝度画像を生成する。さらに、複数の輝度画像に基づいて、各露出条件毎のコード画像を生成し、空間コードのコード境界位置を各露出条件ごとに求める。このように求められた各露出条件毎の複数のコード境界位置に基づいて、被写体の3次元形状を算出するための一つのコード境界位置を決定し、被写体の3次元形状を算出する。

Description

明 細 書
3次元形状検出装置及び 3次元形状検出方法
技術分野
[0001] 本発明は、 3次元形状検出装置及び 3次元形状検出方法に関する。詳細には、パ ターン光を被写体に投影して撮像した画像からパターン光の軌跡を抽出して撮像領 域内にある被写体の 3次元形状を検出する 3次元形状検出装置及び 3次元形状検 出方法に関する。
背景技術
[0002] 従来より、対象物体である被写体に投影部からスリット光やスポット光などのパター ン光を投光して、そのパターン光が投光された被写体を CCDカメラなどの撮像手段 によって撮像し、その撮像された画像力も検出されるパターン光の軌跡に基づいて、 被写体の 3次元形状を検出する 3次元形状検出装置が知られている。
[0003] このような 3次元形状検出装置においては、その 3次元形状検出方法として、能動 型測定方法と受動型測定方法がある。能動型測定方法としては、複数のパターン光 の投影による空間コードィ匕方法が代表的である。
[0004] パターン光を投影する能動型測定方法の場合、被写体の表面反射特性への依存 度が高ぐ測定可能な被写体が限定される。すなわち、低反射面、微細構造面、鏡 面反射面、投影光色と補色関係にある色を有する面など、対象物の表面に投影した パターン光の反射成分が観測に充分な強度を望めない面やその反射成分の強度が 強すぎたりする面が被写体表面上の領域に存在する場合、 3次元形状の検出が困 難となることがある。
[0005] そこで、従来の 3次元形状検出装置においては、被写体の表面反射特性に基づい て、パターン光を投光するための光源の光量を調整したり、撮像手段によって撮像す る時の露出を調整したりすることによって、その対策を行っていた (たとえば、特許文 献 1参照)。
特許文献 1:特開平 8— 35828号公報
発明の開示 発明が解決しょうとする課題
[0006] し力しながら、被写体によっては、その被写体表面に低反射領域や高反射領域な ど様々な反射特性を持つ領域が分布しているものがあり、上記対策を施した場合で あっても、被写体の 3次元形状の検出を充分に行うことができないことがあった。
[0007] すなわち、被写体表面の反射分布が低反射力 高反射まで広範囲に及んでいると きには、パターン光を投光するための光源の光量を調整したとしても、或いは撮像手 段によって撮像する時の露出を調整したとしても、上記広範囲の反射分布をカバー できないことがあった。
[0008] たとえば、被写体表面の低反射領域を 3次元形状検出するために、撮像手段の絞 りを開く或いは露出時間を長くすると、逆に被写体表面の高反射領域において 3次 元形状の検出が困難となる。また、その逆、すなわち、被写体表面の高反射領域を 3 次元形状検出するために、撮像手段の絞りを絞る或いは露出時間を短くすると、逆 に被写体表面の低反射領域において 3次元形状の検出が困難となる。すなわち、あ る領域では 3次元形状検出が可能となるが、別の領域では 3次元形状検出が困難と なるのである。
[0009] そこで、ダイナミックレンジの広い撮像手段をこの 3次元形状検出に用いることが考 えられる。すなわち、被写体の広範囲の反射分布をカバーできるダイナミックレンジの 撮像手段を採用するのである。
[0010] しかし、このようにダイナミックレンジの広い撮像手段は高価であるため、 3次元形状 検出装置の製造コストを押し上げてしまうことになる。
[0011] そこで、本発明は、ダイナミックレンジが狭い撮像手段を用いた場合であっても、被 写体の 3次元形状を検出することができる 3次元形状検出装置を提供することを目的 とする。
課題を解決するための手段
[0012] かかる目的を達成するために、本発明の一つの観点によれば、明と暗とを交互に並 ベてなるパターン光を被写体に投影して撮像した画像情報を基に、その撮像領域内 にある被写体の 3次元形状を検出する 3次元形状検出装置であって、前記パターン 光の各々を被写体に投影する投影部と、前記投影部から前記パターン光が投影され て 、る状態の被写体を複数の異なる露出条件で撮像する撮像部と、前記各露出条 件毎に、前記撮像部で撮像した撮像画像からパターン光の軌跡を抽出するパターン 光軌跡抽出手段と、前記パターン光軌跡抽出手段によって抽出された各露出条件 毎のパターン軌跡位置に基づいて、前記被写体の 3次元形状を算出するための一 つのパターン軌跡位置を決定するパターン軌跡統合手段と、前記パターン軌跡統合 手段によって決定されたパターン軌跡位置に基づいて被写体の 3次元形状を算出 する 3次元形状算出手段とを備える。
[0013] このようにすることで、各露出条件で撮像した画像からそれぞれパターン跡位置を 抽出し、これらのパターン軌跡位置から適切なパターン軌跡位置を選択することがで きるため、表面の反射分布が低反射力 高反射まで広範囲に及んでいる被写体に ついて、ダイナミックレンジが狭い撮像部を用いた場合であっても、被写体の 3次元 形状を検出することができる。すなわち、ダイナミックレンジが狭い撮像部を用いた場 合であっても、種々の反射分布を有する被写体の 3次元形状の検出を精度よく行うこ とがでさる。
[0014] また、本発明の 3次元形状検出装置において、前記パターン光を、明と暗とを交互 に並べてなる複数種類のパターン光とし、前記投影部は、複数種類の前記パターン 光の各々を時系列に被写体に投影し、前記撮像部は、前記投影部から前記各バタ ーン光が投影されて 、る状態の被写体を複数の異なる露出条件で撮像し、前記バタ ーン光軌跡抽出手段は、前記各露出条件毎に、前記撮像部によって撮像される各 撮像画像から各画素の輝度を算出した複数の輝度画像を生成する輝度画像生成手 段と、前記複数の輝度画像に対して所定の閾値による閾値処理を行って各画素毎 に前記空間コードを割り当てた、前記各露出条件毎のコード画像を生成するコード 画像生成手段と、前記空間コードのコード境界位置を前記コード画像から抽出する 処理を前記各露出条件の前記コード画像それぞれに対して行うコード境界抽出手段 とを有し、前記パターン軌跡統合手段は、前記コード境界抽出手段によって抽出さ れた各露出条件毎のコード境界位置に基づいて、前記被写体の 3次元形状を算出 するための一つのコード境界位置を決定するコード境界統合手段を有し、前記 3次 元形状算出手段は、前記コード境界統合手段によって決定されたコード境界位置に 基づ ヽて被写体の 3次元形状を算出する構成にしてもょ 、。
[0015] このようにすることで、各露出条件で撮像した画像からそれぞれコード境界を抽出し 、これらのコード境界位置力 適切なコード境界位置を選択することができるため、表 面の反射分布が低反射から高反射まで広範囲に及んでいる被写体について、ダイ ナミックレンジが狭い撮像部を用いた場合であっても、被写体の 3次元形状を検出す ることができる。すなわち、どのようなダイナミックレンジの撮像部を用いた場合であつ ても、種々の反射分布を有する被写体の 3次元形状の検出を精度よく行うことができ るのである。
[0016] また、本発明の 3次元形状検出装置において、異なる複数の露出条件の情報を格 納する露出条件情報格納部と、前記撮像部における撮像領域の輝度を検出し、当 該輝度に基づいて、前記設定情報格納部から一の露出条件を決定する露出決定手 段と、を備え、前記複数露出撮像処理手段は、前記露出決定手段によって決定した 露出条件と、当該決定した露出条件と露出度合いが近い前後の露出条件とからなる 複数の露出条件を、前記複数の異なる露出条件とする構成にしてもよい。
[0017] このようにすることで、被写体を撮像するための露出条件が多数ある場合において も、全ての露出条件で輝度画像の生成、コード画像の生成及びコード境界の抽出を 行うことがないため、それらの演算処理の負荷が軽減され、し力も、 3次元形状の検 出時間も必要以上に力かることがない。
[0018] また、本発明の 3次元形状検出装置において、前記コード境界統合手段は、前記 各露出条件における前記コード境界位置の各座標毎に、当該各座標に対応する画 素の輝度の検出を行い、当該輝度が前記露出条件における有効輝度範囲内となる か否かを判定し、当該有効輝度範囲内であると判定した画素に対応する前記コード 境界位置の座標を用いて、前記被写体の 3次元形状を算出するための一つのコード 境界位置を決定する構成にしてもょ ヽ。
[0019] このようにすることにより、各露出条件で撮像した画像からそれぞれコード境界位置 を抽出し、当該コード境界毎に有効輝度範囲内にあるコード境界位置を選択するこ とができるため、種々の反射分布を有する被写体の 3次元形状の検出をより精度よく 行うことができる。すなわち、被写体の表面反射特性に適した露出条件で撮影した画 像を用いるようにしているため、精度よくコード境界位置を検出することができるので ある。
[0020] また、本発明の 3次元形状検出装置の前記コード境界統合手段では、前記各座標 に対応する画素の輝度を、当該画素とその周囲の画素との平均輝度としてもよい。
[0021] このようにすることで、被写体の 3次元形状の検出をより精度よく行うことができる。
すなわち、撮像部の状態やその撮像状態によっては、一部の座標の画素の輝度が 本来の輝度とは異なったものとなることがある力 座標に対応する画素の輝度だけで なくその画素の周囲の画素の輝度をも参酌しているため、各露光条件のコード境界 位置のうち適正なコード境界位置を選択することができ、したがって 3次元形状の検 出精度を向上させることができるのである。たとえば、その座標の画素の輝度が有効 輝度範囲にある場合でも、周囲の輝度に比べて異常に高ぐ周囲の画素の輝度で平 均化すると有効輝度範囲外となる場合には、その画素の輝度が本来の取得されるべ き輝度とは異なるものであるとして、その画素に対応する露出条件のコード境界位置 を使用しないようにし、これによりより精度よく 3次元形状の検出を行うのである。
[0022] また、本発明の 3次元形状検出装置において、前記各露出条件毎に、前記撮像部 によって撮像される各撮像画像力ゝら各画素の最大輝度値を検出して最大輝度画像 を生成する最大輝度画像生成手段を備え、前記各座標に対応する画素の輝度の検 出を前記最大輝度画像を用いて行う構成にしてもよい。
[0023] このようにすることで、最大輝度画像を別個に撮像することがなく、撮像枚数の増加 を抑えることができる。し力も、光源力 被写体の全面に投光することができるようなマ スクを投影部に設ける必要がないから、表面の反射分布が低反射から高反射まで広 範囲に及んでいる被写体の 3次元形状を検出する場合であっても、投影部を変更す る必要がない。
[0024] また、本発明の 3次元形状検出装置において、前記露出条件を露光時間とすること ができる。
[0025] このようにすることで、撮像部において機械的な絞り機構を備える必要が無ぐ安価 な撮像部を採用することが可能となる。
[0026] また、本発明の他の観点によれば、明と暗とを交互に並べてなるパターン光を被写 体に投影して撮像した画像情報を基に、その撮像領域内にある被写体の 3次元形状 を検出する 3次元形状検出方法であって、前記パターン光を被写体に投影部により 投影するステップと、前記投影部から前記各パターン光が投影されて!ヽる状態の被 写体を、撮像部により複数の異なる露出条件で撮像するステップと、前記各露出条 件毎に、前記撮像部で撮像した撮像画像からパターン光の軌跡を抽出するステップ と、前記抽出された各露出条件毎のパターン軌跡位置に基づいて、前記被写体の 3 次元形状を算出するための一つのパターン軌跡位置を決定するステップと、前記決 定されたパターン軌跡位置に基づいて被写体の 3次元形状を算出するステップとを 有する。
[0027] このようにすることで、各露出条件で撮像した画像からそれぞれコード境界を抽出し 、これらのコード境界位置力 適切なコード境界位置を選択することができるため、表 面の反射分布が低反射から高反射まで広範囲に及んでいる被写体について、ダイ ナミックレンジが狭い撮像部を用いた場合であっても、被写体の 3次元形状を検出す ることができる。すなわち、どのようなダイナミックレンジの撮像部を用いた場合であつ ても、種々の反射分布を有する被写体の 3次元形状の検出を精度よく行うことができ るのである。
発明の効果
[0028] 本発明によれば、各露出条件で撮像した画像からそれぞれパターン跡位置を抽出 し、これらのパターン軌跡位置力 適切なパターン軌跡位置を選択することができる ため、表面の反射分布が低反射力も高反射まで広範囲に及んでいる被写体につい て、ダイナミックレンジが狭い撮像部を用いた場合であっても、被写体の 3次元形状を 検出することができる。
図面の簡単な説明
[0029] [図 1]本発明の第 1実施形態に従う 3次元形状検出装置の外観を示す斜視図である
[図 2]図 1に示す 3次元形状検出装置を示す側面図および背面図である。
[図 3]図 1における測定ヘッドホルダとの取付構造を説明するための部分断面背面図 である。 [図 4]図 1における回転テーブル部を示す背面断面図である。
[図 5]図 1における測定ヘッドの内部構成を示す平面断面図である。
[図 6]図 1における投影部を拡大して示す平面図である。
圆 7]図 1に示す 3次元形状検出装置の電気的構成を概念的に表すブロック図である 圆 8]図 5における投影機構を示す正面図である。
圆 9]図 8に示す投影機構を示す部分側面断面図である。
[図 10]図 8におけるマスクを部分的に拡大して示す正面図である。
[図 11]図 8におけるマスクを部分的に示す正面図および図 7における位置センサおよ び第 1ないし第 3の IDセンサをマスクと共に示す側面図である。
[図 12]図 11における位置センサの PD信号および第 1ないし第 3の IDセンサの信号 を説明するためのタイミングチャートである。
[図 13]図 7におけるカメラ制御プログラムにお ヽて実行されるメイン処理を概念的に表 すフローチャートである。
[図 14]図 13における立体画像処理を概念的に表すフローチャートである。
[図 15]図 14における 3次元色形状検出処理を 3次元色形状検出処理ルーチンとして 概念的に表すフローチャートである。
[図 16]図 15における撮像処理プログラムとして概念的に表すフローチャートである。
[図 17]図 16におけるマスクモータ制御プログラムとして概念的に表すフローチャート である。
[図 18]図 16における投影処理を投影処理サブルーチンとして概念的に表すフロー チャートである。
[図 19]図 8における撮像部の露出条件を説明するための図である。
[図 20]図 7に示す露出別パラメータテーブル格納部における露出別パラメータテー ブノレの概念図である。
[図 21]図 16におけるパターン光有画像撮像処理をパターン光有画像撮像処理サブ ルーチンとして概念的に表すフローチャートである。
[図 22]図 15における 3次元計測処理サブルーチンとして概念的に表すフローチヤ一 トである。
[図 23]図 22におけるコード画像生成プログラムを概念的に表すフローチャートである
[図 24]図 22におけるコード境界の統合プログラムを概念的に表すフローチャートであ る。
[図 25]図 24におけるコード境界の選択プログラムを概念的に表すフローチャートであ る。
[図 26]図 7に示すコード境界座標格納部における統合コード境界座標格納領域の概 念図である。
[図 27]図 15における 3次元色形状検出結果生成ルーチンとして概念的に表すフロー チャートである。
符号の説明
[0030] MH 測定ヘッド
RT 回転テーブル
HD ホルダ
S 被写体
10 3次元形状検出装置
12 投影部
14 撮像部
16 処理部
184 回転テーブル
発明を実施するための最良の形態
[0031] 以下、本発明のさらに具体的な実施の形態のうちのいくつかを図面に基づいて詳 細に説明する。なお、本実施形態においては、空間コード化法を用いた 3次元形状 検出を例に挙げて説明するが、単純な平行線 (スリット状)パターン光を用いた光切 断法や、何らかの規則性を持たせたスポット光群、明暗をメッシュ状に配したパターン 光等を用いた 3次元形状に適用することも当然に可能である。
[0032] 図 1には、本発明の第 1実施形態に従う 3次元形状検出装置 10の外観が斜視図で 示されている。この 3次元形状検出装置 10は、明と暗とを交互に並べてなる複数種 類のパターン光の各々を時系列に被写体 Sに投影する後述の投影部 12と、投影部 1 2から各パターン光が投影されている状態の被写体を複数の異なる露出条件で撮像 する後述の撮像部 14とを有しており、撮像部 14による撮像結果に基づき、被写体 S の 3次元情報および表面色情報をコンピュータによって取得する信号処理を行うよう に設計されている。
[0033] 図 1ないし図 4には、 3次元形状検出装置 10の外部構成が示される一方、図 5ない し図 11には、 3次元形状検出装置 10の内部構成が示されている。以下、まず、外部 構成を説明し、次に、内部構成を説明する。
[0034] 図 1に示すように、 3次元形状検出装置 10は、測定ヘッド MHと、台座部 HDとを含 むように構成されている。
[0035] 測定ヘッド MHは、被写体 Sを光学的に撮像し、その撮像結果に基づ!/、て被写体 S の 3次元形状および表面色を測定するために設けられている。台座部 HDは、測定 ヘッド MH及び被写体 Sを載置可能に構成されており、一端の領域に測定ヘッド MH を装着する測定ヘッド装着部を設けると共に、他端に被写体 Sを載置する載置台とし ての回転テーブル部 RTを設けている。回転テーブル部 RTは、測定ヘッド MHに対 して被写体 Sを割り出し回転させるごとに測定ヘッド MHによる被写体 Sの撮像を可 能にし、それにより、被写体 Sの外面の全体領域を複数の部分領域に分割して撮像 することを可能にするために設けられて 、る。
[0036] 被写体 Sについては、各部分領域ごとの撮像によって複数の部分画像が取得され る。それら取得された複数の部分画像を処理することにより 3次元形状が得られる。 各部分画像力 得られた 3次元形状は 1つの 3次元ステッチ形状に結合される。同じ 被写体 Sについて取得された表面色情報がその 3次元ステッチ形状にマッピングされ 、それにより、その被写体 Sについてのステッチテクスチャ画像が生成される。
[0037] 図 1に示すように、測定ヘッド MHは、被写体 Sにパターン光を投影するための投影 部 12と、被写体 Sを撮像するための撮像部 14と、被写体 Sの 3次元情報および表面 色情報の取得とを行うために信号処理を行う処理部 16とを備えている。それら投影 部 12、撮像部 14および処理部 16は、測定ヘッド MHの、略直方体状を成すケーシ ング 20に装着されている。
[0038] 図 1に示すように、そのケーシング 20には、鏡筒 24とフラッシュ 26と力 それぞれが 部分的にケーシング 20の正面において露出する姿勢で装着されている。このケーシ ング 20には、さらに、撮像部 14の一部である撮像光学系 30が、それのレンズの一部 がケーシング 20の正面において露出する姿勢で装着されている。その撮像光学系 3 0は、それの露出部分において、被写体 Sを表す画像光を受光する。
[0039] 鏡筒 24は、図 1に示すように、ケーシング 20の正面力も突出しており、その内部に おいて、図 5に示すように、投影部 12の一部である投影光学系 32を収容している。 投影光学系 32は、複数枚の投影レンズ 34と絞り 36とを含むように構成されている。
[0040] 鏡筒 24は、投影光学系 32を、焦点調節のために全体的に移動可能である状態で 保持し、さらに、この鏡筒 24は、投影光学系 32を損傷カゝら保護している。鏡筒 24の 露出端面から、複数枚の投影レンズ 34のうち最も外側に位置するものが露出してい る。投影光学系 32は、その最も外側の投影レンズ 34において、被写体 Sに向カゝつて ノターン光を投影する。
[0041] フラッシュ 26は、不足光量を補充するために発光する光源であり、例えば、キセノン ガスが充填された放電管を用いて構成されている。したがって、このフラッシュ 26は、 ケーシング 20に内蔵されているコンデンサ(図示しない)の放電により繰り返し使用す ることがでさる。
[0042] 図 1に示すように、ケーシング 20には、それの上面において、レリーズボタン 40が 装着されている。また、図 2 (b)に示すように、ケーシング 20には、さらに、それの背面 において、モード切替スィッチ 42 (図 2 (b)に示す例においては、 2個のボタン力も成 る。)と、 4方向カーソルキー(十字キー) 43と、モニタ LCD44とが装着されている。そ れらモード切替スィッチ 42および 4方向カーソルキー 43はそれぞれ、ファンクション ボタンの一例を構成する。
[0043] レリーズボタン 40は、 3次元形状検出装置 10を作動させるためにユーザによって操 作される。このレリーズボタン 40は、ユーザの操作状態 (押下状態)が「半押し状態」 である場合と「全押し状態」である場合とで異なる指令を発令できる 2段階の押しボタ ン式のスィッチによって構成されている。レリーズボタン 40の操作状態は処理部 16に よって監視される。処理部 16によって「半押し状態」が検出されれば、よく知られたォ 一トフォーカス (AF)および自動露出 (AE)の機能が起動し、ピント、絞りおよびシャツ タスピードが自動的に調節される。これに対し、処理部 16によって「全押し状態」が検 出されれば、撮像等が行われる。
[0044] モード切替スィッチ 42は、 3次元形状検出装置 10の作動モードを、後述の三次元 測定モード(図 2 (b)にお!/、て「3D」で示す。)およびオフモード(図 2 (b)にお!/、て「0 FFJで示す。 )を含む複数種類のモードの 、ずれかとして設定するためにユーザによ つて操作される。このモード切替スィッチ 42の操作状態は処理部 16によって監視さ れており、モード切替スィッチ 42の操作状態が処理部 16によって検出されると、その 検出された操作状態に対応するモードでの処理が 3次元形状検出装置 10において 行われる。
[0045] モニタ LCD44は、液晶ディスプレイ(Liquid Crystal Display)を用いて構成されて おり、処理部 16から画像信号を受けて、画像をユーザに表示する。このモニタ LCD4 4は、例えば、被写体 Sの 3次元形状の検出結果を表す画像 (立体画像)等を表示す る。
[0046] 図 2に示すように、ケーシング 20には、さらに、 RF (無線)インタフェイスとしてのアン テナ 50が装着されている。アンテナ 50は、図 5に示すように、 RFドライバ 52に接続さ れている。このアンテナ 50は、被写体 Sを立体画像として表すデータ等を、 RFドライ ノ 52を介して、図示しな 、外部インタフェイスに無線によって送信する。
[0047] ここで、図 1および図 3を参照することにより、測定ヘッド MHを台座部 HDに着脱可 能に装着する構造を説明する。
[0048] 測定ヘッド MHは、台座部 HDの一端の上面に機械的に係合することにより、その 台座部 HDに装着される。その係合を実現するために、測定ヘッド MHは、図 3に示 すように、台座部 HDとの係合部である下端部にヘッド沈座部 150が形成されて 、る 。このヘッド沈座部 150は、第 1および第 2の係合爪 152, 154を一対の雄側係合部 として有している。
[0049] 図 3に示すように、それら第 1および第 2の係合爪 152, 154は、測定ヘッド MHの 横方向、すなわち、台座部 HDの幅方向に互いに隔たる一対の位置において、それ ぞれ測定ヘッド MHの前後方向、すなわち、台座部 HDの長さ方向に延びるように形 成されている。本実施形態においては、測定ヘッド MHが台座部 HDにできる限り強 固に固定されるようにするために、それら第 1および第 2の係合爪 152, 154間の距 離ができる限り長くなるようにそれら第 1および第 2の係合爪 152, 154の各位置が選 定されている。
[0050] 図 3に示すように、台座部 HDには、ヘッド沈座部 150との機械的係合によってその ヘッド沈座部 150を固定的に受容するヘッド受容部 160が形成されて 、る。このへッ ド受容部 160は、ヘッド沈座部 150が嵌り入るヘッドベース沈座空隙 162を備え、さら に、測定ヘッド MHの第 1および第 2の係合爪 152, 154にそれぞれ係合する第 1お よび第 2の爪突き当て部 164, 166を一対の雌側係合部として備えている。
[0051] 第 1の爪突き当て部 164は、対応する第 1の係合爪 152に係合して、測定ヘッド M Hが台座部 HDから、それの上面に直角な方向に離脱することを阻止する固定爪突 き当て部である。一方、第 2の爪突き当て部 166は、(a)対応する第 2の係合爪 154 に係合して、測定ヘッド MHが台座部 HDから、それの上面に直角な方向に離脱す ることを阻止する係合位置と、(b)対応する第 2の係合爪 154から離脱して、測定へッ ド MHが台座部 HDから、それの上面に直角な方向に離脱することを許可する解放 位置とに変位可能な可動爪突き当て部である。
[0052] 第 2の爪突き当て部 166の一例は、台座部 HDの長さ方向(台座部 HDに対する測 定ヘッド MHの装着 ·離脱時にその測定ヘッド MHが回転する回転平面に直角な方 向)に延びるピボット軸線まわりにピボット可能なピボット部材 170を含んで 、る。
[0053] そのピボット部材 170は、そのピボット軸線と同軸な軸線を有するジョイント 172によ つて台座部 HDにピボット可能に装着される。このピボット部材 170は、対応する第 2 の係合爪 154に機械的に係合してその第 2の係合爪 154が離脱することを阻止する 可動係合部 174を含んで 、る。その可動係合部 174が第 2の係合爪 154を上方から 係合する向きにピボット部材 170が常時、弾性部材としてのスプリング 176によって付 勢される。本実施形態においては、そのピボット部材 170が、さらに、可動係合部 17 4による係合を解除するためにユーザによって押圧操作される操作部 178と、スプリ ング 176の弾性力を拡大して可動係合部 174に伝達するレバレツジ 180とを含んで いる。
[0054] 次に、図 3を参照することにより、台座部 HDに対する測定ヘッド MHの着脱作業を 説明する。
[0055] 測定ヘッド MHを台座部 HDに装着するためには、ユーザは、ピボット部材 170の 操作部 178を、スプリング 176の弾性力に杭して、可動係合部 174が係合位置から 解放位置に向力う解放方向に押圧する。その押圧状態で、ユーザは、ヘッド沈座部 150がヘッドベース沈座空隙 162内に進入しつつ第 1の係合爪 152が第 1の爪突き 当て部 164内に進入して当接するように、測定ヘッド MHを概して垂直面内において 回転させつつ下降させる。その後、ユーザは、操作部 178の押圧を解除し、それによ り、ピボット部材 170がスプリング 176の弾性回復力によって解放位置力も係合位置 に回動して、可動係合部 174が第 2の係合爪 154に上方から係合して突き当たる。そ の結果、第 1の係合爪 152が第 1の爪突き当て部 164から上方に離脱することが阻 止されるとともに、第 2の係合爪 154が第 2の爪突き当て部 166から上方に離脱する ことも阻止される。それにより、測定ヘッド MHが台座部 HD力も離脱することが阻止さ れる。
[0056] これに対し、測定ヘッド MHを台座部 HD力 離脱するためには、ユーザは、上記 の場合と同様にして、ピボット部材 170の操作部 178をスプリング 176の弾性力に抗 して、解放方向に押圧する。その押圧状態で、ユーザは、ヘッド沈座部 150がヘッド ベース沈座空隙 162から退避しつつ第 1の係合爪 152が第 1の爪突き当て部 164か ら退避するように、測定ヘッド MHを概して垂直面内において回転させつつ上昇させ て、測定ヘッド MHを台座部 HD力も離脱させる。その後、ユーザは、操作部 178の 押圧を解除し、それにより、ピボット部材 170がスプリング 176の弾性回復力によって 解放位置から係合位置に復元する。
[0057] 次に、図 4を参照することにより、回転テーブル部 RTを詳細に説明する。
[0058] この回転テーブル部 RTは、被写体 Sが載置されるべき回転テーブル 184と、その 回転テーブル 184を回転可能に支持する支持フレーム 186とを含んでいる。その支 持フレーム 186は、上板部 188と下板部 189とを含むように薄い中空箱状を成してお り、上板部 188の開口から回転テーブル 184の上面が露出している。本実施形態に おいては、その支持フレーム 186のうちの下板部 189がテーブルベースとしても機能 する。
[0059] 回転テーブル 184の上面は、撮像されるべき被写体 Sが載置される載置面 190で ある。一方、回転テーブル 184の下面から、回転シャフト 191が同軸に延び出してお り、この回転シャフト 191は、軸受け 192を介して支持フレーム 186に回転可能に支 持されている。その軸受け 192は、支持フレーム 186に形成された軸受けホルダ 193 によって保持されている。
[0060] 回転テーブル 184を回転させるテーブルモータ 194が支持フレーム 186に装着さ れている。このテーブルモータ 194を収容するモータボックス 195が支持フレーム 18 6に形成されている。
[0061] このモータボックス 195は、支持フレーム 186の上板部 188の上面に、その上面か ら上方に突出する姿勢で形成されている。このモータボックス 195の上面は、回転テ 一ブル 184の上面より高く設定されている。それにより、被写体 Sが回転テーブル 18 4と共に回転させられる際にその被写体 Sが、回転テーブル 184を同軸に投影した投 影空間から外側にはみ出していると、モータボックス 195のうち回転テーブル 184の 上面より上方に位置する部分が被写体 Sに当接してその被写体 Sの向きを変化させ る。
[0062] したがって、モータボックス 195は、テーブルモータ 194の収容部として機能するの みならず、被写体 Sが回転テーブル 184に位置決めされる位置を規制する位置規制 部 196としても機能する。
[0063] テーブルモータ 194の回転を回転テーブル 184に伝達するために、テーブルモー タ 194の回転シャフトにモータギヤ 197が同軸に固定され、このモータギヤ 197にか み合うテーブルギヤ 198が回転テーブル 184に同軸に固定されている。モータギヤ 1 97は、テーブルギヤ 198より小径であるため、テーブルギヤ 198の回転速度が減速 されて回転テーブル 184に伝達される。
[0064] ところで、テーブルモータ 194は、支持フレーム 186の上板部 188の上面から突出 しないように支持フレーム 186に装着することが可能である。一方、上板部 188の上 面のうち回転テーブル 184が露出する部分を除く部分の上方空間にテーブルモータ 194を配置しても、何ら支障がなぐむしろ、支持フレーム 186の薄型化に有利である
[0065] したがって、本実施形態によれば、テーブルモータ 194を上板部 188の上面力も突 出するように配置することにより、上述の位置規制部 196としての機能に加えて、支 持フレーム 186の薄型化を容易にすると 、う機能も実現される。
[0066] この 3次元形状検出装置 10は、複数種類のモードのうちユーザによって選択され たものに従って作動する。それらモードは、三次元計測モード (以下「3Dモード」とす る。)と、オフモードとを含んでいる。 3Dモードは、被写体 Sを撮像し、被写体 Sの立体 形状を検出するモードである。オフモードは、この 3次元形状検出装置 10の動作を 停止させるモードである。
[0067] 撮像部 14は、被写体 Sを撮像し、その画像を取り出すことが可能であるように構成 されている。
[0068] 投影部 12は、被写体 Sにパターン光を投影するためのユニットである。この投影部 12は、図 5および図 6に示すように、基板 60と、 LED62 (例えば、単一の LED素子 によって広い出射面力も光を出力する LED)と、照明絞り 63と、光源レンズ 64と、マ スク 200を送るためのマスクモータ(例えば、パルスモータ) 65を駆動源とする投影機 構 66と、投影光学系 32とを、投影方向に沿って直列に備えている。
[0069] 図 6には、この投影部 12のハードウェア構成のうち、基板 60と、 LED62と、照明絞 り 63と、光源レンズ 64と、マスク 200と、投影光学系 32とが詳細に示されている。図 7 には、この投影部 12を含む 3次元形状検出装置 10全体のソフトウェア構成および電 気的接続関係が詳細に示されている。図 8ないし図 11には、投影部 12のハードゥエ ァ構成のうち、投影機構 66が詳細に示されている。
[0070] 撮像部 14は、被写体 Sを撮像するための撮像モジュールである。この撮像部 14は 、図 5に示すように、撮像光学系 30と、 CCD (Charge Coupled Device) 70とを、画像 光の入射方向に沿って直列に備えている。この CCD70は、インターライントランスフ ァー方式でプログレッシブ走査を行うように構成されている。また、撮像部 14には、 C CD70を制御するための CCDドライバ 88を備えている。
[0071] 撮像光学系 30は、図 5に示すように、複数枚のレンズを用いて構成されている。こ の撮像光学系 30は、よく知られたオートフォーカス機能により、焦点距離および絞り を自動調整して外部からの光を CCD70上に結像する。
[0072] CCD70は、フォトダイオード素子などの光電変換素子をマトリクス状に配列して構 成されている。この CCD70は、撮像光学系 30を介してこの CCD70の表面に結像さ れる画像の光の色および強さに応じた信号を各画素ごとに生成する。その生成され た信号は、デジタルデータに変換されて処理部 16に出力される。
[0073] 図 7にブロック図で表すように、処理部 16は、フラッシュ 26、レリーズボタン 40およ びモード切替スィッチ 42にそれぞれ電気的に接続されている。処理部 16は、さらに 、モニタ LCD44にはモニタ LCDドライバ 72を介して、アンテナ 50には RFドライバ 52 を介して、ノ ッテリ 74には電源インタフェイス 76を介してそれぞれ電気的に接続され ている。それらフラッシュ 26等は、処理部 16によって制御される。
[0074] 処理部 16は、さらに、外部メモリ 78、キャッシュメモリ 80及び撮像モジュールである 撮像部 14にそれぞれ電気的に接続されている。処理部 16は、さら〖こ、 LED62には 光源ドライバ 84を介して、投影機構 66のマスクモータ 65にはマスクモータドライバ 86 を介して、それぞれ電気的に接続されている。それら LED62等は、処理部 16によつ て制御される。
[0075] 外部メモリ 78は、着脱可能なフラッシュ ROMであり、立体画像モードにおいて撮像 された撮像画像や 3次元情報 (前述のステッチテクスチャ画像、 3次元ステッチ形状を 含む。)を記憶することが可能である。外部メモリ 78を構成するために、例えば、 SD カード、コンパクトフラッシュ (登録商標)カード等を使用することができる。
[0076] キャッシュメモリ 80は、データの読み書きを高速で行い得る記憶装置である。キヤッ シュメモリ 80は、例えば、デジカメモードにおいて撮像された撮像画像を高速でキヤ ッシュメモリ 80に転送し、処理部 16で画像処理を行って力も外部メモリ 78に格納す ることを可能にするために使用される。キャッシュメモリ 80を構成するために、例えば 、 SDRAM, DDRRAM等を使用することができる。
[0077] 電源インタフェイス 76、光源ドライノく 84、マスクモータドライバ 86および CCDドライ ノ 88はそれぞれ、バッテリ 74、 LED62、投景機構 66のマスクモータ 65および CCD 70を制御する各種の ICOntegrated Circuit)によって構成されている。 [0078] 図 2 (a)に示すように、測定ヘッド MHには、 ACアダプタ端子 90と、 USB端子 91と 、テーブルモータ端子 92とが設けられている。 ACアダプタ端子 90は、図 5にも示す ように、ノ ッテリ 74に電気的に接続されており、それにより、 3次元形状検出装置 10 が外部の交流電源を電力源として利用することが可能となっている。 USB端子 91は 、図 5に示すように、 USBドライバ 93を介して処理部 16に接続されている。テーブル モータ端子 92は、図 5に示すように、テーブルモータドライバ 94を介して処理部 16に 接続されている。
[0079] 図 1に示すように、回転テーブル部 RTのテーブルモータ 194から電気ラインとして のハーネス 95が延び出している。このハーネス 95は、図 2 (a)〖こ示すように、そのハ 一ネス 95の先端に接続された L字プラグ 96においてテーブルモータ端子 92に接続 されている。そのハーネス 95は、測定ヘッド MHからテーブルモータ 194に制御信号 および電力を供給する電気ラインとして機能する。したがって、図 7に示すように、テ 一ブルモータ 194がテーブルモータドライバ 94を介して処理部 16に接続されること になる。
[0080] 図 1に示すように、ハーネス 95は、台座部 HDの表面上でハーネス止め 97, 98, 9 8によって規定される。
[0081] 前述のように、投影部 12は、図 6に示すように、基板 60と、 LED62と、照明絞り 63 と、光源レンズ 64と、投影機構 66と、投影光学系 32とをパターン光の投影方向に沿 つて直列に備えている。
[0082] 基板 60は、それに LED62が装着されることにより、その装着された LED62との間 において電気的な配線を行う。基板 60は、例えば、アルミニウム製基板に絶縁性合 成榭脂を塗布して力 無電解メツキによってパターンを形成したものや、ガラスェポキ シ基材をコアとする単層または多層構造の基板を使用して製作することができる。 LE D62は、投影機構 66に向けて放射状のアンバー色の光を広い面積で発光する光源 であり、 LEDケーシング 100内に収容されている。
[0083] 図 6に示すように、照明絞り 63は、 LED62から出力された光のうち不要な部分を遮 蔽することにより、必要な部分のみを光源レンズ 64に誘導するために設けられている 。光源レンズ 64は、 LED62から放射状に発光される光を集光するレンズであり、そ の材質はアクリルに代表される光学榭脂である。
[0084] 本実施形態においては、図 6に示すように、 LED62から発光される放射状の光力 光源レンズ 64によって効率良く集光され、 LED62からの出射光が投影機構 66の入 射面 106に略直角に入射するとともに、指向性の高い放射光として投影機構 66の出 射面 108から出射する。この意味において、光源レンズ 64は、コリメータレンズとして 機能する。図 6には、その出射面 108上において互いに隔たった 2個の注目点 A, B にっき、それぞれの指向性特性が照度分布のグラフ( Θ:半値拡がり半角)で表され ている。
[0085] 投影光学系 32は、投影機構 66を通過した光を被写体 Sに向力つて投影するため の複数枚の投影レンズ 34を含んでいる。それら投影レンズ 34は、ガラス製レンズと合 成榭脂製レンズとの組合せカゝら成るテレセントリックレンズによって構成されている。 テレセントリックとは、投影光学系 32を通過する主光線が、入射側の空間では光軸に 平行になり、入射瞳の位置が無限になる構成をいう。
[0086] 投影光学系 32は、上述のようにテレセントリック特性を持ち、その入射 NAが 0. 1程 度であるため、垂直 ± 5° 以内の光のみが投影光学系 32の内部の絞り 36を通過で きるように、投影光学系 32の光路が規制されている。したがって、本実施形態におい ては、投影光学系 32のテレセントリック性により、投影機構 66を垂直 ± 5° で通過す る光のみを投影光学系 32に投影し得る構成と相俟って、画質の向上を容易に図り得 る。
[0087] ここで、図 8ないし図 11を参照することにより、投影部 12のハードウェア構成のうち 投影機構 66を詳細に説明する。
[0088] この投影機構 66は、光源としての LED62からの入射光を複数種類のパターン光 に選択的に変換することにより、それら複数種類のパターン光を順次被写体 Sに投影 するために設けられている。図 8には、この投影機構 66が正面図で示され、図 9には
、この投影機構 66が部分断面側面図で示されている。
[0089] 図 8に示すように、この投影機構 66は、シート状を成して長さ方向に延びるマスク 2
00を備えており、そのマスク 200はマスクモータ 65によってそのマスク 200の長さ方 向に送られる。 [0090] 図 10には、そのマスク 200の長さ方向における一部が拡大されて正面図で示され ている。このマスク 200には、前記複数種類のパターン光にそれぞれ対応する複数 のフレーム 202がマスク 200の長さ方向に並んで割り当てられて!/、る。図 8に示すよう に、それらフレーム 202は、選択的に前記入射光の照射領域に位置させられる。
[0091] 本実施形態においては、 3Dモードの際、被写体 Sを撮像するために 8種類のパタ ーン光が順次被写体 Sに投影される。図 10には、パターン番号 PNが 5であるパター ン光を形成するためのフレーム 202 (図 10において「コード 5」を付して示す。)と、パ ターン番号 PNが 6であるパターン光を形成するためのフレーム 202 (図 10において「 コード 6」を付して示す。)と、パターン番号 PNが 7であるパターン光を形成するため のフレーム 202 (図 10にお!/、て「コード 7」を付して示す。)とが代表的に示されて!/、る
[0092] マスク 200は、各フレーム 202ごとに、マスク 200をそれの厚さ方向に貫通する貫通 穴(空気開口) 204を、各フレーム 202に対応するパターン光の形状に対応する形状 を有する状態で備えている。図 10に示すように、いずれのフレーム 202においても、 個々の貫通穴 204が直線的に延びるスリット状を成している。複数個のフレーム 202 のうち、複数個の貫通穴 204を有するものにおいては、それら複数個の貫通穴 204 力 Sストライプ状を成すように配列されて 、る。
[0093] さらに、本実施形態においては、いずれのフレーム 202においても、各貫通穴 204 がマスク 200の長さ方向に平行に延びるように配置されて 、る。
[0094] そのマスク 200は、長さ方向と厚さ方向との双方に平行な平面内において屈曲可 能である。このマスク 200は、金属製の薄いシートによって構成されている。マスク 20 0を構成する金属は、不透明弾性材料の一例であり、そのような材料の一例はステン レスである。このマスク 200の板厚の一例は、 0. 1mmである。
[0095] 本実施形態においては、厚さ 0. 1mmのステンレス板に対してウエットエッチングが 施されることにより、そのステンレス板に複数個の貫通穴 204がミクロン精度で形成さ れ、それにより、マスク 200が製作されている。
[0096] このマスク 200は、弾性屈曲性を有しており、後述のようにローラに巻き取られて収 容されていても、そのローラから解放されれば、真っ直ぐな平面を成す原形状に復元 する性質を有する。
[0097] 図 8に示すように、投影機構 66は、マスク 200を巻き取り可能に保持しつつ送るた めに、ハウジング 210を備えている。このハウジング 210に、供給具としての供給ロー ラ 220と、案内具としてのガイドローラ 222と、送り具としての送りローラ 224と、巻き取 り具としての巻き取りローラ 226とが、互いに平行な各軸線を有する姿勢で支持され ている。それら供給ローラ 220,ガイドローラ 222,送りローラ 224および巻き取り口一 ラ 226の軸線は!、ずれも、マスク 200の幅方向に平行に延びて!/、る。
[0098] 図 9に示すように、マスク 200は、それの長さ方向における両端部においてそれぞ れ、供給ローラ 220と巻き取りローラ 226とに結合されている。マスク 200は、さらに、 それら供給ローラ 220と巻き取りローラ 226との間において、供給ローラ 220寄りのガ イドローラ 222と、卷き取りローラ 226寄りの送りローラ 224とに支持されて!、る。
[0099] 3次元形状検出装置 10の不使用状態においては、マスク 200は、供給ローラ 220 と巻き取りローラ 226とのうち主に供給ローラ 220に巻き付けられており、マスク 200 は、この状態で 3次元形状検出装置 10内において収容される。すなわち、マスク 200 のうちの未使用部分は、供給ローラ 220に巻き付けられて収容されるのであり、供給 ローラ 220は、マスク 200のうちの未使用部分を屈曲状態において収容するローラな のである。
[0100] 被写体 Sの撮像が開始されると、マスク 200のうちの未使用部分は、マスクモータ 6 5の正回転により、供給ローラ 220から剥がされて巻き取りローラ 226に向かって供給 される。その未使用部分が被写体 Sの撮像に使用されると、使用済部分として、巻き 取りローラ 226に巻き取られて収容される。すなわち、巻き取りローラ 226は、マスク 2 00のうちの使用済部分を屈曲状態にぉ 、て収容するローラなのである。
[0101] 被写体 Sの撮像が終了した時点においては、マスク 200は、供給ローラ 220と巻き 取りローラ 226とのうち主に巻き取りローラ 226に巻き付けられ、マスク 200は、この状 態で 3次元形状検出装置 10内において収容される。その後、次回の撮像に備えて、 マスクモータ 65の逆回転により、マスク 200は、供給ローラ 220と巻き取りローラ 226 とのうち主に供給ローラ 220に巻き取られ、それにより、マスク 200は、供給ローラ 22 0に巻き付けられた状態で、 3次元形状検出装置 10内にぉ 、て収容される。 [0102] 図 9に示すように、それらガイドローラ 222と送りローラ 224との間に、 LED62からの 入射光がマスク 200に照射される照射位置 228が設定されて 、る。マスク 200のうち それらガイドローラ 222と送りローラ 224とによって両端を支持される部分が、前記設 定された照射位置 228を前記入射光に直角な方向に通過する直線部 230を形成し ている。
[0103] 図 9に示すように、本実施形態においては、マスク 200のうち供給ローラ 220とガイ ドローラ 222とによって両端を支持される部分 232 (図 9において直線部より左側の部 分)と、送りローラ 224と巻き取りローラ 226とによって両端を支持される部分 234 (図 9において直線部より右の部分)とがそれぞれ、直線部 230に対して同じ側に傾斜さ せられている。その傾斜角度は、小さいほど、直線部 230に対する部分 232, 234の 弾性曲げに起因する直線部 230の反りを軽減するために望ましい。一方、その傾斜 角度は、大きいほど、マスク 200の長さ方向においてこの投影機構 66を小型化する ために望ましい。
[0104] 図 9に示すように、マスク 200は、それの長さ方向における両端部においてそれぞ れ、供給ローラ 220と巻き取りローラ 226とに結合されて 、る。
[0105] 供給ローラ 220は、ハウジング 210に固定されたシャフト 240と、そのシャフト 240を 同軸に取り囲むローラ部 242とを含むように構成されている。ローラ部 242は、シャフ ト 240に対して同軸に相対回転可能に支持されている。このローラ部 242にマスク 20 0の一端部が固定され、そのローラ部 242の回転によってそのローラ部 242の外周面 にマスク 200が巻き付けられる。ローラ部 242の両回転方向のうち、ローラ部 242にマ スク 200が巻き付けられる回転方向が戻り回転方向であり、ローラ部 242からマスク 2 00が剥がされる回転方向が送り回転方向である。
[0106] ローラ部 242には、付勢部材としてのスプリング 246が係合させられており、それに より、ローラ部 242は、戻り回転方向に常時付勢されている。そのスプリング 246は、 例えば、図 9に示すように、ローラ部 242とシャフト 240との間の半径方向隙間内にお いて、可動部材としてのローラ部 242と静止部材としてのシャフト 240とに係合させら れるように使用される。そのスプリング 246は、例えば、図 9に示すように、シャフト 240 の外周面に巻き付けられるリーフスプリングとして構成される。そのスプリング 246の 弾性力により、マスク 200にテンションがそのマスク 200の長さ方向に作用させられる
[0107] 図 8および図 10に示すように、マスク 200の両側縁部にはそれぞれ、マスク 200の 長さ方向に並んだ複数個の送り穴 250から成るパーフォレーシヨン領域 252が形成さ れている。ガイドローラ 222および送りローラ 224は、それら送り穴 250に貫通してそ れら送り穴に係合する歯 254, 256を備えている。本実施形態においては、図 9に示 すように、ガイドローラ 222も送りローラ 224も、複数個の歯 254, 256を、各外周面上 において等間隔に並んで備えている。
[0108] ガイドローラ 222はフリーローラであるのに対し、送りローラ 224は、マスクモータ 65 によって駆動される駆動ローラである。図 8に示すように、本実施形態においては、マ スクモータ 65が送りローラ 224に同軸に連結されており、送りローラ 224がマスクモー タ 65によって回転駆動される。送りローラ 224の両回転方向のうち、マスク 200が供 給ローラ 220から剥がされる回転方向が送り回転方向であり、マスク 200が供給ロー ラ 220に巻き付けられる回転方向が戻り回転方向である。
[0109] 図 9に示すように、そのマスクモータ 65は、送りローラ 224を回転させる機能と、それ と同期して巻き取りローラ 226を回転させる機能とを有している。そのため、マスクモ ータ 65は、マスク 200を送りつつ巻き取りローラ 226によって巻き取られる正回転と、 マスク 200を巻き取りローラ 226から剥がしつつ供給ローラ 220に供給する逆回転と を選択的に行わせられる。
[0110] 図 8に示すように、本実施形態においては、送りローラ 224およびマスクモータ 65と 同軸かつ一体的に回転させられる回転体としての駆動プーリ 260と、巻き取りローラ 2 26と同軸かつ一体的に回転させられる回転体としての被動プーリ 262とに、動力伝 達体としてのベルト 264が巻き掛けられて ヽる。このように構成された伝動機構 266 により、マスクモータ 65の回転力が巻き取りローラ 226に伝達される。
[0111] 図 8および図 9に示すように、投影機構 66は、照射位置 228においてマスクガイド 2 70を備えている。そのマスクガイド 270は、マスク 200のうちの直線咅 230の送りを案 内するために設けられて 、る。
[0112] 本実施形態においては、マスクガイド 270力 マスク 200の直線部 230をそれの厚 さ方向における両側から挟む構造を有しており、具体的には、マスク 200の直線部 2 30を隔てて互いに対向する一対のガイド板 272, 272を備えている。このマスクガイ ド 270は、マスク 200をそれの長さ方向にスライド可能に保持する一方、マスク 200を それの幅方向にはできる限り変位しな 、ように保持する。
[0113] 各ガイド板 272には、それを厚さ方向に貫通する窓 276が形成されている。この窓 2 76も、貫通穴 204と同様に、空気開口として形成されている。 LED62からの入射光 のうち窓 276を通過する部分のみ力 マスク 200に照射される。
[0114] 図 10に示すように、マスク 200には、各フレーム 202ごとに、位置基準穴 280と ID 穴領域 282と力 マスク 200の幅方向に並んで形成されている。それら位置基準穴 2 80および ID穴領域 282は、いずれも貫通穴(空気開口)としてマスク 200に形成され ている。位置基準穴 280は、いずれかのフレームが照射位置 228に位置していること を光学的に検出するために設けられている。一方、 ID穴領域 282は、照射位置 228 に位置して 、るフレームの IDすなわちパターン番号 PNを光学的に特定するために 設けられている。
[0115] 本実施形態においては、 ID穴領域 282力 3ビットの情報によって 8個のフレーム 2 02すなわち 8種類のパターン光をそれぞれ識別する。そのため、各フレーム 202ごと の ID穴領域 282には、最大で 3個の ID穴 290, 292, 294が形成される。
[0116] 図 11に示すように、投影機構 66は、位置基準穴 280を光学的に検出するために、 位置センサ 300を、マスク 200の幅方向位置に関して位置基準穴 280と一致する位 置に備えている。本実施形態においては、その位置センサ 300は、位置基準穴 280 を高い位置精度で検出するために、絞ったビームをマスク 200に照射するとともに、 マスク 200からの反射光を絞って受光する。
[0117] そのため、位置センサ 300は、発光素子としての LED302と、受光素子としてのフ オトダイオード(以下、「PD」という。) 304と、 LED302のための集光素子としての LE Dレンズ 306と、 PD304のための集光素子としての PDレンズ 308とを含んでいる。こ の位置センサ 300は、図 7に示すように、処理部 16に電気的に接続されている。
[0118] PD304は、マスク 200からの反射光の受光の有無に応じて変化する PD信号を出 力する。具体的には、 PD信号は、図 12にタイミングチャートで表すように、いずれの 位置基準穴 280も位置センサ 300に対向しないために位置センサ 300からの光がマ スク 200で反射して位置センサ 300に入射する場合に、ハイレベルを示す一方、い ずれかの位置基準穴 280が位置センサ 300に対向するために位置センサ 300から の光がその位置基準穴 280を透過して位置センサ 300に入射しな 、場合に、ローレ ベルを示すように変化する。
[0119] LEDレンズ 306は、 LED302からの光を集光してマスク 200に照射する集光機能 を有する。 PDレンズ 308は、マスク 200からの反射光を集光して PD304に照射する 集光機能を有する。それら LEDレンズ 306および PDレンズ 308により、位置基準穴 280の位置ひ 、てはフレーム 202の位置を高精度に検出することが可能となって!/ヽ る。
[0120] 図 11に示すように、投影機構 66は、さらに、 ID穴 290, 292, 294を光学的に検出 するために、第 1ないし第 3の IDセンサ 310, 312, 314を備えている。それら第 1な いし第 3の IDセンサ 310, 312, 314はそれぞれ、マスク 200の幅方向位置に関して 3個の ID穴 290, 292, 294と一致する位置に配置されている。いずれの IDセンサ 3 10, 312, 314も、 ID穴領域 282に向けて光を照射する発光素子と、 ID穴領域 282 からの反射光を受光する受光素子とを含んで 、る。
[0121] 第 1ないし第 3の IDセンサ 310, 312, 314の 3個の受光素子はそれぞれ、 ID穴領 域 282からの反射光の有無を表す信号を、信号 S1ないし S3として出力する。それら 信号 S1ないし S3は、前述の PD信号と同様に変化する。それら第 1ないし第 3の ID センサも、位置センサ 300と同様に、図 7に示すように、処理部 16に電気的に接続さ れている。
[0122] 図 12には、 PD信号および S1ないし S3信号が互いに同期して変化する様子の一 例がタイミングチャートで表されている。処理部 16においては、後に詳述する力 マ スクモータ 65の駆動によってマスク 200が送られている間にいずれかの位置基準穴 280が位置センサ 300に対向したために PD信号がハイレベルからローレベルに変 化した事象をトリガとして、第 1ないし第 3の IDセンサ 310, 312, 314からそれぞれ S 1ないし S3信号がサンプリングされる。
[0123] 図 11に示すマスク 200の例においては、第 1および第 3の IDセンサ 310, 314がそ れぞれ、 ID穴 290, 294に対向するため、 S1信号および S3信号がそれぞれ、ハイレ ベルからローレベルに変化する一方、第 2の IDセンサ 312は、 ID穴 292に対向しな いため、 S2信号がハイレベルに維持される。それらサンプリングされた S1ないし S3 信号のレベルの組合せにより、位置センサ 300によって検出されたフレーム 202の I Dすなわちパターン番号 PNが検出される。
[0124] 図 7には、 3次元形状検出装置 10の電気的な構成がブロック図で表されている。処 理部 16はコンピュータ 400を主体として構成されており、そのコンピュータ 400は、 C PU402と、 ROM404と、 RAM406と、ノ ス 408とを含むように構成されて!/、る。
[0125] CPU402は、 ROM404に記憶されたプログラムを RAM406を利用しつつ実行す ることにより、レリーズボタン 40の操作状態の検出、撮像部 14からの画像データの取 込み、その取り込まれた画像データの転送および格納、モード切替スィッチ 42の操 作状態の検出等の各種処理を行う。
[0126] ROM404には、カメラ制御プログラム 404aと、撮像処理プログラム 404bと、輝度 画像生成プログラム 404cと、コード画像生成プログラム 404dと、コード境界抽出プロ グラム 404eと、最大輝度画像生成プログラム 404fと、コード境界の統合プログラム 4 04gと、コード境界の選択プログラム 404hと、レンズ収差補正プログラム 404iと、三 角測量演算プログラム 404jと、マスクモータ制御プログラム 404kと、テーブルモータ 制御プログラム 4041とが格納されて!、る。
[0127] カメラ制御プログラム 404aは、 3次元形状検出装置 10全体の制御を実行するため に実行され、その制御には、図 13にフローチャートで概念的に表されているメイン処 理が含まれる。
[0128] 撮像処理プログラム 404bは、被写体 Sの 3次元形状を検出するために複数種類の ノ ターン光の各々を時系列に被写体 Sに投影し、各パターン光が投影されている状 態の被写体 Sを複数の異なる露出条件で撮像してパターン光有画像を取得し、さら に、パターン光が投影されて 、な 、被写体 Sを撮像してパターン光無画像を取得す るために実行される。
[0129] 輝度画像生成プログラム 404cは、撮像処理プログラム 404bの実行によって被写 体 Sにつ 、て取得された各画素の RGB値に基づき、複数枚のパターン光有画像に それぞれ対応する複数枚の輝度画像を各露出条件毎に生成するために実行される
。すなわち、 CPU402が輝度画像生成プログラム 404cを実行することによって、輝 度画像生成手段として、撮像部 14によって撮像される各パターン光有画像力ゝら各画 素の輝度を算出した複数の輝度画像を複数の異なる露出条件に対してそれぞれ生 成するのである。
[0130] 本実施形態においては、同じ被写体 Sに対して複数種類のパターン光が時系列に 順次投影され、各パターン光が投影されるごとに撮像部 14の露出条件を変えながら 被写体 Sが順次撮像される。そのようにして撮像された複数の異なる露出条件での複 数枚のパターン光有画像の各々について各画素の RGB値が取得され、その結果、 ノターン光の種類と同数の輝度画像が各露出条件毎に生成される。
[0131] コード画像生成プログラム 404dは、輝度画像生成プログラム 404cの実行によって 生成された複数枚の輝度画像それぞれに対する閾値処理により生成される 2値化画 像から、各画素毎に空間コードが割り当てられたコード画像を各露出条件毎に生成 するために実行される。すなわち、 CPU402がコード画像生成プログラム 404dを実 行すること〖こよって、コード画像生成手段として、複数の輝度画像に対して所定の閾 値による閾値処理を行って各画素毎に空間コードを割り当てた、各露出条件毎のコ ード画像を生成するのである。
[0132] 概略的に説明するに、このコード画像生成プログラム 404dが実行されると、複数種 類のパターン光のうちノターンライン間の間隔が最も狭いものが投影された被写体 S の輝度画像におけるパターンライン間の間隔が周期として取得され、その周期の輝 度画像全体における分布が周期分布として取得される。
[0133] このコード画像生成プログラム 404dが実行されると、さらに、その取得された周期 分布に従ってサイズが変化する可変窓が各パターン光ごとの輝度画像にローカルに 設定されることにより、前記可変窓を用いたフィルタ処理により輝度画像全体に対し て閾値がローカルに算出されて設定される。そのようにして設定された閾値の分布を 表す閾値画像と各パターン光ごとの輝度画像との関係から、各パターン光ごとに 2値 化画像が生成される。この 2値化画像は各露出条件ごとに生成される。
[0134] 可変窓を用いたフィルタ処理により輝度画像全体に対して閾値をローカルに算出 する技術は、本出願人の特願 2004— 285736号明細書に詳細に開示されており、 その明細書を参照することによってその明細書の内容を本明細書に引用する。
[0135] コード境界抽出プログラム 404eは、コード画像生成プログラム 404dの実行によつ て生成された露出条件毎の各コード画像と、輝度画像生成プログラム 404cの実行に よって生成された露出条件毎の各輝度画像とを利用することにより、空間コードの境 界位置であるコードの境界座標をサブピクセル精度で各コード画像毎に抽出するた めに実行される。すなわち、 CPU402がコード境界抽出プログラム 404eを実行する ことによって、コード境界抽出手段として、空間コードのコード境界位置をコード画像 から抽出する処理を各露出条件のコード画像それぞれに対して行うのである。
[0136] 最大輝度画像生成プログラム 404fは、輝度画像生成プログラム 404cの実行によつ て生成された複数の輝度画像力ゝら各露出条件ごとにそれぞれ各画素の最大輝度値 を検出して最大輝度画像を生成するために実行される。すなわち、 CPU402が最大 輝度画像生成プログラム 404fを実行することによって、最大輝度画像生成手段とし て、各露出条件毎に、撮像部 14によって撮像される各撮像画像力も各画素の最大 輝度値を検出して最大輝度画像を生成するのである。なお、上述の輝度画像生成手 段と、コード画像生成手段と、コード境界抽出手段とにより、撮像部 14で撮像したパ ターン光投光画像からパターン光の軌跡を抽出するパターン光軌跡抽出手段が構 成される。
[0137] コード境界の統合プログラム 404g及びコード境界の選択プログラム 404hは、コー ド境界抽出プログラム 404eの実行により抽出された各露出条件毎の複数のコード境 界位置と最大輝度画像生成プログラム 404fの実行により生成された最大輝度画像と に基づいて、被写体 Sの 3次元形状を算出するための一つのコード境界位置を決定 するために実行される。すなわち、 CPU402がコード境界の統合プログラム 404g及 びコード境界の選択プログラム 404hを実行することによって、コード境界統合手段( パターン軌跡統合手段)として、各露出条件毎のコード境界位置 (パターン軌跡位置 )に基づいて、被写体 Sの 3次元形状を算出するための一つのコード境界位置 (パタ ーン軌跡位置)を決定する。このコード境界の統合プログラム 404g及びコード境界の 選択プログラム 404hは、図 24,図 25のフローチャートで概念的に表されている。 [0138] レンズ収差補正プログラム 404iは、コード境界の統合プログラム 404g及びコード境 界の選択プログラム 404hの実行によって求められたコードの境界位置に対して、撮 像光学系 30の収差補正を行うために実行される。
[0139] 三角測量演算プログラム 404jは、レンズ収差補正プログラム 404iの実行によって 収差補正が行われたコードの境界座標から、その境界座標に関する実空間の 3次元 座標を演算するために実行される。
[0140] マスクモータ制御プログラム 404kは、複数種類のパターン光を順次被写体 Sに投 影すべくマスクモータ 65を制御するために実行される。このマスクモータ制御プログ ラム 404kは、図 17にフローチャートで概念的に表されて!/、る。
[0141] テーブルモータ制御プログラム 4041は、回転テーブル 184を被写体 Sと共に割り出 し回転させるベくテーブルモータ 194を制御するために実行される。このテーブルモ ータ制御プログラム 4041は、他の処理と共に図 15にフローチャートで概念的に表さ れている。
[0142] 本実施形態においては、前述の一連のパターン光の被写体 Sへの投影および被 写体 Sの撮像が、被写体 Sの回転位置が等間隔で割り出されるごとに行われる。具体 的には、被写体 Sの回転位置が 90度ずつ間欠的に割り出され、各割り出し位置にお いて、一連のパターン光の投影および被写体 Sの撮像が複数の異なる露出条件に 対して行われる。その結果、被写体 Sの外面の全体領域が 4つの部分領域に分割さ れ、各部分領域ごとに 3次元形状情報が取得される。それら 3次元形状情報につい て、互いに重複する部分を除去する処理が施されて互 、に結合 (ステッチ)されること により、被写体 Sに対応する 1つの 3次元形状情報が 3次元ステッチ形状として生成さ れる。
[0143] さらに、本実施形態においては、その生成された 3次元ステッチ形状に、同じ被写 体 Sについて計測された表面色情報がマッピングされることにより、ステッチテクスチ ャ画像が生成される。これにより、被写体 Sについての一連の 3次元入力処理が終了 する。
[0144] 図 7に示すように、 RAM406〖こは、パターン光有画像格納部 406aと、パターン光 無画像格納部 406bと、輝度画像格納部 406cと、コード画像格納部 406dと、コード 境界座標格納部 406eと、収差補正座標格納部 406gと、 3次元座標格納部 406hと 、周期分布格納部 406pと、閾値画像格納部 406qと、 2値化画像格納部 406rと、 3 次元ステッチ形状格納部 406sと、ステッチテクスチャ画像格納部 406tと、システムパ ラメータ格納部 406uと、最大輝度画像格納部 406vと、露出別パラメータテーブル格 納部 406wと、ワーキングエリア 410とがそれぞれ記憶領域として割り当てられている
[0145] パターン光有画像格納部 406aは、撮像処理プログラム 404bの実行によって撮像 されたパターン光有画像を表すパターン光有画像データを格納する。パターン光無 画像格納部 406bは、撮像処理プログラム 404bの実行によって撮像されたパターン 光無画像を表すパターン光無画像データを格納する。
[0146] 輝度画像格納部 406cは、輝度画像生成プログラム 404cの実行によって生成され た輝度画像を表すデータを格納する。コード画像格納部 406dは、コード画像生成プ ログラム 404dの実行によって生成されたコード画像を表すデータを格納する。コード 境界座標格納部 406eは、コード境界抽出プログラム 404eの実行によってサブピク セル精度で抽出された各コードの境界座標を表すデータを格納する。
[0147] 収差補正座標格納部 406gは、レンズ収差補正プログラム 404iの実行によって収 差補正が行われたコードの境界座標を表すデータを格納する。 3次元座標格納部 4 06hは、三角測量演算プログラム 404jの実行によって演算された実空間の 3次元座 標を表すデータを格納する。
[0148] 周期分布格納部 406p、閾値画像格納部 406qおよび 2値ィ匕画像格納部 406rは、 コード画像生成プログラム 404dの実行によって取得された周期分布、閾値画像およ び 2値化画像を表すデータをそれぞれ格納する。
[0149] 3次元ステッチ形状格納部 406sは、前述の 3次元ステッチ形状を格納し、ステッチ テクスチャ画像格納部 406tは、前述のステッチテクスチャ画像を格納する。また、最 大輝度画像格納部 406vは、前述の最大輝度画像を格納する。また、システムパラメ ータ格納部 406uは、前述のシステムパラメータを格納する。
[0150] 露出別パラメータテーブル格納部 406wは、露出条件情報格納部として、撮像部 1 4における CCD70の露出を設定するための異なる複数の露出条件の情報を露出別 ノ ラメータテーブルとして格納する。この露出別パラメータテーブルには、撮像部 14 の CCD70の露光時間を切り替えるための複数の露光時間パラメータを有しており、 撮像処理プログラム 404bの実行に伴って、これら複数の露光時間パラメータが順次 撮像部 14に設定され、 CCD70の露光時間が切り替えられる。本実施形態において は、 CCD70の露光時間が露出条件となり、露光時間によって露出条件を切り替えら れる構成について説明する力 これに限られるものではなぐ撮像部 14の露出が光 学系部材によって設定されるものにおいては、シャッターの絞りの度合いを変更する ことによって、露出条件を切り替えるようにしてもよい。
[0151] ワーキングエリア 410は、 CPU402がその動作のために一時的に使用するデータ を格納する。
[0152] ここで、システムパラメータ格納部 406uに格納するシステムパラメータについて説 明する。
[0153] 本実施形態における 3次元形状検出装置 10では、 3次元空間の 1点を、平面と直 線の交点、 2本の直線の交点として決定するアクティブ型 3次元画像計測法を用いる 。すなわち、所定の位置にある投影部から投影されるパターン光と、所定の位置にあ る撮像部力もの視線とを、それぞれ平面と直線として捉え、投影部及び撮像部による 結像光学系をその位置及び姿勢などを含むシステムパラメータによってモデルィ匕し、 このシステムパラメータを用いて 3次元形状を計測する。システムパラメータは、カメラ ノ ラメータ及びプロジェクタパラメータとから構成されるノメラメータであり、以下具体 的に説明する。
[0154] カメラパラメータは、以下の 3 X 4のパラメータで表される。このパラメータには、撮像 部に関して、その位置、姿勢、画角などのデータが含まれることになる。言い換えれ ば、撮像部からの視線を表す。
[0155] [数 1]
Figure imgf000032_0001
二のカメラパラメータにより、実空間 3次元座標 (X, Υ, Z)と撮像部における歪曲収 差補正後の撮像座標系の座標(ccdcx, ccdcy)との関係は、以下の式のように表す: とがでさる。
[0156] [数 2]
X
C1 1 C12 C13 C14
Y
C21 C22 C23 C24
Figure imgf000033_0001
C31 C32 C33 C34 また、プロジェクタパラメータは、以下の 2 X 4のパラメータで表される。このパラメ一 タには、投影部に関して、その位置、姿勢などのデータが含まれることになる。言い換 えれば、パターン光の平面を表す。
[0157] [数 3]
Ρ1 1 Ρ12 Ρ13 Ρ14
Ρ =
Ρ21 Ρ22 Ρ23 Ρ24 このプロジェクタパラメータにより、実空間 3次元座標 (X, Υ, Ζ)と空間コード境界値 codeとの関係は、以下の式にように表すことができる。
[0158] [数 4]
X
P1 1 P12 P13 P14 Y
Figure imgf000033_0002
P21 P22 P23 P24
以上のカメラパラメータ及びプロジェクタパラメータを元に、以下の式によって被写 体 Sの実空間 3次元座標 V= (X, Y, Z)を求めることができる。
[0159] [数 5] F=Q X V
V=Q— 1 F
C34 ccdcx-C14
C34*ccdcy-C24
P24*code-P14
C1 1 -C31 *ccdcx C12-C32*ccdcx C13-C33*ccdcx
Q = C21 -C31 *ccdcy C22-C32*ccdcy G23— G33 ccdcy
P1 1 -P21 *code P12-P22*code P13-P23*ccdcxソ
x
v= Y
以上のようなシステムパラメータ、すなわちカメラパラメータ及びプロジェクタパラメ タがシステムパラメータ格納部 406uに格納されることになる。
[0160] ここで、図 13を参照することにより、カメラ制御プログラム 404aを説明する。このカメ ラ制御プログラム 404aがコンピュータ 400によって実行されることにより、前述のメイ ン処理が実行される。
[0161] このメイン処理においては、まず、ステップ S101 (以下、単に「S101」で表す。他の ステップについても同じとする。 )において、 テリ 74を含む電源が ONされる。次に S102において、処理部 16、周辺インタフェイス等が初期化される。
[0162] 続いて、 S 103において、モード切替スィッチ 42の操作状態を判別するためにキー スキャンが行われ、その後、 S104において、モード切替スィッチ 42の操作によって 3 Dモードが選択されたカゝ否かが判定される。その後、詳述する S 106の立体画像処理 が実行され、続いて、 S 103〖こ戻る。
[0163] これに対し、今回は、モード切替スィッチ 42の操作によって 3Dモードが選択されな 力つたと仮定すれば、 S104の判定力 NOとなり、 S107において、モード切替スイツ チ 42の操作によってオフモードが選択された力否かが判定される。今回は、モード 切替スィッチ 42の操作によってオフモードが選択されたと仮定すれば、判定が YES となり、直ちに今回のメイン処理が終了する力 今回は、モード切替スィッチ 42の操 作によってオフモードが選択されな力つたと仮定すれば、判定が NOとなり、 S103に 戻る。
[0164] 図 14には、図 13における S106が立体画像処理ルーチンとしてフローチャートで 概念的に表されている。この立体画像処理ルーチンの実行により、被写体 Sの 3次元 形状を立体画像として検出し、表示する立体画像処理が実行される。この立体画像 処理においては、さらに、同じ被写体 Sの表面色も検出される。それら立体画像の検 出結果と表面色の検出結果とが位置に関連付けて組み合わされたものが 3次元色形 状検出結果である。
[0165] この立体画像処理においては、まず、 S1001において、ファインダ画像、すなわち 、撮像光学系 30を通して見える範囲の画像と同じ画像がモニタ LCD44に表示され る。よって、ユーザは、モニタ LCD44に表示された画像を見ることにより、実際の撮 像前に、撮像画像 (撮像範囲)を確認することができる。
[0166] 次に、 S1002において、レリーズボタン 40の操作状態がスキャンされ、その後、 S1 003において、そのスキャン結果に基づき、レリーズボタン 40が半押し状態にあるか 否かが判定される。半押し状態にあれば、判定力 SYESとなり、 S1004において、ォ 一トフォーカス (AF)および自動露出 (AE)機能が起動し、それにより、ピント、絞りお よびシャツタスピードが調節される。レリーズボタン 40が半押し状態になければ、 S10 03の判定が NOとなり、 S1011に移行する。なお、 S1004において起動した自動露 出 (AE)機能によって調整された露出条件は、ワーキングエリア 410に一時的に設定 され、後述するパターン光無画像を撮像する際に用いられる。
[0167] S1004の実行後、 S1005において、再度、レリーズボタン 40の操作状態がスキヤ ンされ、その後、 S1006において、そのスキャン結果に基づき、レリーズボタン 40が 全押し状態にあるカゝ否かが判定される。レリーズボタン 40が全押し状態になければ、 この S1006の判定が NOとなって S1002に戻る。
[0168] レリーズボタン 40が半押し状態力ゝら全押し状態に移行すれば、 S1006の判定が Y ESとなり、 S1007において、後述の 3次元色形状検出処理が実行され、それにより、 被写体 Sの 3次元形状および表面色が検出される。
[0169] 概略的に説明するに、その 3次元色形状検出処理により、被写体 Sについて 3次元 色形状検出結果が生成される。ここに、 3次元色形状検出結果とは、後述の空間コー ド画像において検出される複数の空間コード境界座標を 3次元座標に変換した結果 取得される頂点座標の集合体であって、各頂点ごとに色形状情報とポリゴン情報とが 互いに関連付けられたものを意味する。色形状情報は、実空間座標と RGB値との組 合せを表す情報である。ポリゴン情報は、複数個の頂点のうち、被写体 Sを 3次元的 に表面する立体を構成するために互いに連結されるべき複数の頂点の組合せを表 す情報である。
[0170] その後、 S1008において、その 3次元色形状検出結果が外部メモリ 78に格納され 、続いて、 S1009〖こおいて、その 3次元色形状検出結果が 3次元コンピュータグラフ イツク画像としてモニタ LCD44に表示される。
[0171] その後、 S1010において、図 13における S103と同様にしてキースキャンが行われ る。続いて、 S 1011において、モード切替スィッチ 42の操作状態に変化が無いか否 かが判定される。変化が無ければ、 S1011の判定力YESとなり、 S1001に戻るが、 変化が有れば、 S1011の判定が NOとなり、今回の立体画像処理が終了する。
[0172] 図 14の S 1007において実行される 3次元色形状検出処理においては、空間コード 化法を用 、て被写体 Sの 3次元形状が検出される。
[0173] 図 15には、図 14における S1007が 3次元色形状検出処理ルーチンとしてフローチ ヤートで概念的に表されている。この 3次元色形状検出処理ルーチンには、テーブル モータ制御プログラム 4041が組み込まれており、このテーブルモータ制御プログラム 4041は、図 15における S1201および S1221ないし S1223を含むように構成されて いる。
[0174] この 3次元色形状検出処理ルーチンにおいては、まず、 S1201において、回転テ 一ブル 184の回転位相 PHが 0に初期化される。本実施形態においては、回転テー ブル 184が 1回転する間に 4回停止させられるため、回転テーブル 184には 4つの回 転位相 PHが離散的に設定される。具体的には、回転位相 PHは、初期の回転位相 PHを表す「0」と、次の回転位相 PHを表す「1」と、次の回転位相 PHを表す「2」と、 最後の回転位相 PHを表す「3」とに離散的に変化させられる。
[0175] 次に、 S1210において、撮像処理プログラム 404bが実行されることにより、今回の 回転位相 PHについて撮像処理が実行される。この撮像処理においては、投影部 12 からストライプ状のパターン光が時系列的に被写体 sに投影される。さらに、複数種 類のパターン光が投影されている被写体 sをそれぞれ複数の異なる露出条件で撮像 した各露出条件毎の複数枚のパターン光有画像と、パターン光が投影されて 、な ヽ 同じ被写体 Sを撮像した 1枚のパターン光無画像とが取得される。この S1210は、後 に図 16を参照して詳述する。
[0176] 撮像処理が終了すると、 S1220において、今回の回転位相 PHについて 3次元計 測処理が実行される。この 3次元計測処理が実行されると、上述の撮像処理によって 取得された各露出条件毎の複数枚のパターン光有画像と 1枚のパターン光無画像と が利用されて、実際に被写体 Sの 3次元形状が計測される。この S1220は、後に図 2 2を参照して詳述する。
[0177] この 3次元計測処理が終了すると、 S1221において、次回の撮像に備えて、回転 位相 PHが 1だけインクリメントされる。続いて、 S1222において、回転位相 PHの現在 値力 より大きいか否力、すなわち、被写体 Sについての一連の撮像が既に終了して いる力否かが判定される。
[0178] 今回は、回転位相 PHの現在値力 より大きくはないと仮定すれば、その S1222の 判定が NOとなり、 S1223において、回転テーブル 184を時計方向に 90度回転させ るのに必要な駆動信号がテーブルモータ 194に対して出力される。その結果、回転 テーブル 184が時計方向に 90度回転させられ、それにより、被写体 Sが、前回の撮 像時とは異なる部分領域において測定ヘッド MHに対向させられる。その後、 S121 0および S1220が実行され、それにより、次の回転位相 PHについて前述の撮像処 理および 3次元計測処理が行われる。
[0179] S1210ないし S1223のループが必要回数実行された結果、 S1222の判定力
Sとなれば、その後、 S 1230において、被写体 Sについて計測された 3次元形状と表 面色とを組み合わせることにより、 3次元色形状検出結果が生成される。この S1230 は、後に図 27を参照して詳述する。
[0180] この 3次元色形状検出結果が生成されると、今回の 3次元色形状検出処理が終了 する。
[0181] ここで、図 16を参照することにより、図 15における S1210を詳述する。図 16には、 その S1210が撮像処理プログラム 404bとしてフローチャートで概念的に表されてい る。
[0182] この撮像処理プログラム 404bにおいては、まず、 S2001において、パターン光を 形成するために使用されるマスクパターンの番号を表すパターン番号 PNが 0に初期 化される。続いて、 S2002において、そのパターン番号 PNの現在値が最大値 PNm axより小さいか否かが判定される。その最大値 PNmaxは、使用されるマスクパターン の合計数に応じて決定される。例えば、 8種類のマスクパターンが使用される場合に は、最大値 PNmaxが 8に設定される。
[0183] 今回は、パターン番号 PNの現在値が最大値 PNmaxより小さいと仮定すれば、 S2 002の判定力 SYESとなり、続いて、 S2002aにおいて、マスクモータ制御プログラム 4 04kが実行される。
[0184] このマスクモータ制御プログラム 404kにおいては、図 17に示すように、まず、 S220 1において、マスクモータ 65を一定速度で回転駆動するための信号がマスクモータド ライバ 86に供給される。これにより、マスク 200が供給ローラ 220から照射位置 228に 供給される向きにマスク 200が送られる。
[0185] 次に、 S2202にお!/、て、位置センサ 300から PD信号が読み取られる。続!、て、 S2 203において、その読み取られた PD信号がローレベルを示すか否かが判定される。 すなわち、位置センサ 300がいずれかの位置基準穴 280 (今回は、先頭の位置基準 穴 280)が検出されたか否かが判定されるのである。
[0186] 今回は、 PD信号がハイレベルを示すと仮定すれば、 S2203の判定力 SNOとなり、 S 2201に戻り、マスクモータ 65の駆動および PD信号の読み取りが繰り返される。 S22 01ないし S2203の実行が何回か繰り返された結果、 PD信号がハイレベルからロー レベルに変化したと仮定すれば、 S2203の判定力YESとなる。
[0187] その後、 S2204において、第 1ないし第 3の IDセンサ 310ないし 314から S1ないし S3信号がそれぞれ読み取られる。続いて、 S 2205〖こおいて、それら読み取られた S 1な!、し S3信号のレベルの組合せ(3ビットの情報)がパターン番号 PNの現在値を表 すか否かが判定される。すなわち、マスク 200における複数のフレーム 202のうち現 在、照射位置 228に位置して!/、るものすなわち現在フレーム 202のパターン番号 PN 力、パターン番号 PNの現在値と一致するか否かが判定されるのである。
[0188] 今回は、現在フレーム 202のパターン番号 PNがパターン番号 PNの現在値と一致 しないと仮定すると、 S2205の判定力 SNOとなり、 S2201に戻る。これに対し、今回は 、現在フレーム 202のパターン番号 PNがパターン番号 PNの現在値と一致すると仮 定すると、 S2205の判定力YESとなる。本実施形態においては、マスク 200におい て複数のフレーム 202が並ぶ順序と同じ順序に、パターン番号 PNが 1ずつ増加させ られるようになっている。すなわち、マスク 200がシーケンシャルに送られるようになつ ているのであり、よって、 S2205の判定は、 3次元形状検出装置 10に異常が存在し ない限り、 YESとなる。
[0189] S2205の判定が YESとなると、その後、 S2206において、マスクモータ 65が停止 させられ、それにより、現在フレーム 202が照射位置 228に停止させられる。その結 果、現在フレーム 202の位置決めが完了する。
[0190] 以上で、このマスクモータ制御プログラム 404kの一回の実行が終了する。
[0191] なお付言するに、本実施形態においては、マスクモータ 65の間欠的駆動によるマ スク 200の間欠的送りにより、複数のフレーム 202が順次、照射位置 228に位置決め されるように、マスクモータ 65が制御される。これに対し、マスクモータ 65の連続的駆 動によるマスク 200の連続的送りにより、複数のフレーム 202が順次、照射位置 228 に位置決めされるように、マスクモータ 65が制御される態様で本発明を実施すること が可能である。
[0192] ところで、前述のように、本実施形態においては、マスク 200において各貫通穴 20 4の長さ方向がマスク 200の送り方向に一致させられている。よって、マスク 200の移 動中でも、いずれかのフレーム 202が照射位置 228を通過する際に、同じフレーム 2 02によって同じパターン光が生成されて被写体 Sに投影される時間を確保することが 容易である。
[0193] したがって、マスク 200が一時的に停止しないにもかかわらず、同じパターン光を事 実上、静止画像として被写体 Sに投影することが容易である。このことは、マスク 200 の連続的送りにより、複数のフレーム 202を順次、照射位置 228に確実に位置決め するために好都合である。 [0194] 本実施形態においては、マスクモータ制御プログラム 404kの一回の実行が終了す ると、図 16における S2003において、使用される複数種類のマスクパターンのうち、 パターン番号 PNの現在値と等しい番号が付された PN番目のマスクパターンの投影 が開始される。
[0195] 続いて、 S2004において、 PN番目のマスクパターンを被写体 Sに投景するための 投影処理が行われる。図 18には、この S2004の詳細が投影処理サブルーチンとし てフローチャートで概念的に表されている。この投影処理サブルーチンの実行により
、 PN番目のマスクパターンを有するパターン光を投影部 12から被写体 Sに投影する 投影処理が投影機構 66との共同作用によって実行される。
[0196] この投影処理においては、まず、 S3004において、光源ドライノ 84が駆動され、続 いて、 S3005において、その光源ドライノく 84からの電気信号によって LED62が発 光する。以上で、今回の投影処理が終了する。
[0197] LED62から発光した光は、光源レンズ 64を経て投影機構 66に到達する。その投 影機構 66においては、マスク 200の現在フレーム 202の開口パターンに応じた空間 変調が施され、その結果、投影機構 66への入射光がパターン光に変換されて出力 される。その投影機構 66から出力されるパターン光は、投影光学系 32を経て被写体 Sに投影画像として投影される。
[0198] 以上のようにして、 PN番目のマスクパターンによって形成される PN番目のパター ン光が被写体 Sに投影されると、続いて、図 16における S2005において、その PN番 目のパターン光が投影されている被写体 Sが撮像部 14によって撮像される。
[0199] その撮像により、 PN番目のパターン光が投影されている被写体 Sを撮像した PN番 目のパターン光有画像が複数の異なる露出条件それぞれについて取得される。その 取得されたパターン光有画像は、対応するパターン番号 PNに関連付けてパターン 光有画像格納部 406aに格納される。
[0200] ここで、撮像部 14における露出条件について、図 19を参照して詳説する。図 19に 示すグラフは、撮像部 14から出力される画像信号の出力輝度と被写体 S表面の実際 の輝度との関係を示したものであり、これらの関係が撮像部 14における露出条件そ れぞれの特性が示されている。なお、この図 19におけるグラフは、横軸 (被写体 Sの 表面輝度)を対数として模式的に表したものである。
[0201] 本実施形態においては、撮像部 14の露出条件として、露出条件 [0]〜露出条件 [i EvNumMax-1]の 7つの露出条件を有して 、る。露出条件 [0]が最も低 、露出(最低 露出)であり、露出条件 [1] , [2] , · · , [iEvNumMax— 1]の順に露出が大きくなる。 露出条件 [iEvNumMax-Ι]が最も高い露出(最高露出)である。一つの露出条件のダ イナミックレンジは、図 19に示すように狭い範囲となっている力 これら 7つの露出条 件を切り替えることによって撮像部 14で撮像できる被写体 Sの表面輝度は広い範囲 のものとなる。
[0202] また、各露出条件において検出することができる被写体 Sの表面輝度は、隣接する 露出条件同士でそのダイナミックレンジが重複するようにしている。たとえば、露出条 件 [3]のダイナミックレンジ(図 19における bl〜b2の範囲)となり、露出条件 [4]のダ イナミックレンジ(図 19における cl〜c2の範囲)や露出条件 [2]のダイナミックレンジ (図 19における dl〜d2の範囲)と重複する。したがって、被写体 Sの所定範囲の表 面輝度(図 19における al〜a2)は、最低露出と最高露出の間におけるいずれかの 露出条件のダイナミックレンジ内となる。なお、ここでは、各撮像条件に関し、それぞ れのダイナミックレンジよりも狭 、範囲(cMinO[iEvNum]〜cMax[iEvNum])を後述のコ ード境界座標を選択するための有効輝度範囲とする。
[0203] ところで、撮像部 14の露出条件の設定は、露出別パラメータテーブル格納部 406 wに格納された複数の露光時間パラメータのうち一つの露光時間パラメータを撮像 部 14に設定することによって行われる。すなわち、 CPU402が露出別パラメータテー ブル格納部 406wから露光時間パラメータを取り出し、撮像部 14に送信し、撮像部 1 4側にぉ 、て露光時間パラメータに応じた露光時間で撮像を行うように構成して!/、る 。なお、図 20に示すように、露出別パラメータテーブル格納部 406wには、露出条件 、露出設定インデックス iEvNumがそれぞれ対応して格納されており、露出条件 [0]〜 露出条件 [iEvNumMax- 1]に対してそれぞれ露出時間パラメータ Ev[0]〜Ev[iEvNum Max- 1]が対応する。
[0204] なお、本実施形態においては、露出条件 [0]〜露出条件 [iEvNumMax-1]の 7つの 露出条件で撮像部 14の露光時間を変更できることとして 、るが、ダイナミックレンジ が大きい撮像部 14である場合には、この露出条件が 7つ有る必要はない。
[0205] ここで、図 21を参照することにより、図 16における S2005の処理を詳述する。図 21 には、その S2005がパターン光画像撮像処理サブルーチンとしてフローチャートで 概念的に表されている。このサブルーチンは、 CPU402による撮像処理プログラム 4 04bの実行による処理である。
[0206] このサブルーチンにおいては、まず、 S2020において、露出設定インデックス iEvN umが「0」〖こリセットされる。
[0207] 次に、 S2021において、露出設定インデックス iEvNumが「iEvNumMax」よりも小さい か否かが判定される。今回は、露出設定インデックス iEvNumが「iEvNumMax」よりも小 さ ヽ「0」であるので、その S2021の半 IJ定カYESとなり、 S2022にお!/、て、撮像咅 14 に対して露出設定インデックス iEvNumに対応する露出条件 [iEvNum]を設定する。
[0208] たとえば、露出設定インデックス iEvNumが「0」であるとき、露出別パラメータテープ ル格納部 406wから複数の露出条件に対応する露出時間パラメータ Ev[0]〜Ev[iEvN umMax-1]のうち、露出時間パラメータ Ev[0]が取り出される。このように取り出された露 出時間パラメータ Ev[0]は、撮像部 14に設定される。露出時間パラメータ Ev[0]が撮像 部 14に設定されると、撮像部 14は露出条件 [0]による撮像が可能となる。
[0209] 次に、 S2023において、 Ν番目のパターン光が投影されている被写体 S力 露出時 間パラメータに応じた露出時間で撮像部 14によって撮像される。このように撮像され たパターン光有画像は、パターン光有画像格納部 406aに格納される。
[0210] 撮像部 14による撮像が終了すると、 S2024において、露出設定インデックス iEvNu mが 1だけインクリメントされる。続いて、 S2021に戻り、露出設定インデックス iEvNum 力 S「iEvNumMax」よりも小さいか否かが判定される。今回は、露出設定インデックス iEv Numが「iEvNumMax」よりも小さいと仮定すれば、その S2021の判定が YESとなり、 S 2022に移行する。
[0211] S2023における撮像処理の実行が露出設定インデックス iEvNumMaxの ¾i直と同数 回繰り返された結果、露出設定インデックス iEvNum値が「iEvNumMax」以上になると、 S 2021の判定が NOとなり、撮像処理プログラム 404bによるパターン光画像撮像処 理が終了する。 [0212] 以上の撮像が終了すると、 S2006において、 PN番目のパターン光の投影が終了 し、続いて、 S2007において、次のパターン光を投影すベぐパターン番号 PNが 1 だけインクリメントされ、その後、 S2002に戻る。
[0213] S2002¾V、し S2007の実行がパターン光の種類の数と同数回繰り返された結果、 パターン番号 PNの現在値が最大値 PNmaxより小さくはない値になると、 S2002の 判定が NOとなり、今回の撮像処理が終了する。したがって、一回の撮像処理により、 各露出条件に対して最大値 PNmaxと同数枚のパターン光有画像が取得されること になる。
[0214] 続いて、 S2008において、フラッシュモードが選択されているか否かが判定される。
フラッシュモードが選択されていれば、その判定が YESとなり、 S2009において、フ ラッシュ 26が発光させられる力 フラッシュモードが選択されていなければ、 S2008 の判定が NOとなり、 S2009力スキップされる。いずれにしても、その後、 S2010にお いて、被写体 Sが撮像される。
[0215] この撮像は、被写体 Sの表面色を計測することを目的として、投影部 12からパター ン光を被写体 Sに投影することなぐ行われる。その結果、被写体 Sについて 1枚のパ ターン光無画像が取得される。その取得されたパターン光無画像はパターン光無画 像格納部 406bに格納される。なお、このときの撮像部 14における露出条件は、 S10 04にて自動露出機能により取得した露出条件とするが、複数の露出条件のうちの中 間の露出条件としてもよい。
[0216] 続いて、 S2011において、マスク 200のうちの長さ方向における先頭部分が照射位 置 228に位置するようにマスク 200の長さ方向位置を初期化すべくマスクモータ 65が 駆動される。
[0217] 以上で、この撮像処理プログラム 404bの一回の実行が終了する。
[0218] 本実施形態においては、被写体 Sからの入射光による CCD70の露光後に、その 露光を反映した信号の CCD70からの取り出しが行われる。 1回の露光に 1回の信号 取り出しが対応しており、それら露光と信号取り出しとが互いに共同して 1回の個別撮 像処理を構成する。
[0219] 本実施形態においては、同じ被写体 Sについて 3次元形状情報の取得と表面色情 報の取得とが連続的に、かつ、それらの順で行われる。
[0220] 被写体 Sの 3次元形状情報を取得するために、まず、露出別パラメータテーブル格 納部 406w力 複数の露出条件 [0]〜[iEvNumMax- 1]のうち最低露出条件 [0]の露出 時間パラメータが順次取り出されて、それぞれの露出条件での撮像が行われる。この ような複数の露出条件に対する撮像処理は、順次被写体 Sに投影される 8種類のパ ターン光 (パターン番号 PN = 0〜7)ごとに行われる。すなわち、被写体 Sの 3次元形 状情報を取得するために、その被写体 Sに対する個別撮像処理が順次、各露出条 件毎に 8回、合計 8 X iEvNumMax回行われるのである。
[0221] ここで、図 22を参照することにより、図 15における S1220を詳述する。図 22には、 その S 1220が 3次元計測処理サブルーチンとしてフローチャートで概念的に表され ている。
[0222] この 3次元計測処理サブルーチンにお!/、ては、まず、 S4001にお!/、て、 CPU402 によるカメラ制御プログラム 404aの実行により、露出設定インデックス iEvNumが「0」 にリセットされる。
[0223] 次に、 S4002において、露出設定インデックス iEvNumが「iEvNumMax」よりも小さい か否かが判定される。今回は、露出設定インデックス iEvNumが「iEvNumMax」よりも小 さ ヽ「0」であるので、その S4002の半 IJ定カYESとなり、 S4003にお!/ヽて、輝度画像 生成プログラム 404cの実行により、露出設定インデックス iEvNumに対応する露出条 件 [iEvNum]で撮像された複数枚のパターン光有画像に基づき、露出設定インデック ス iEvNumに対応する露出条件 [iEvNum]での輝度画像が生成される。
[0224] この S4003においては、輝度値が、 YCbCr空間における Y値として定義されてお り、各画素の RGB値より、
Y=0. 2989 -R+O. 5866 -G + O. 1145 -B
なる式を用いて計算される。各画素について Υ値を求めることにより、露出設定イン デッタス iEvNumに対応する露出条件 [iEvNum]での複数枚のパターン光有画像にそ れぞれ対応する複数枚の輝度画像が生成される。それら生成された輝度画像は、露 出設定インデックス iEvNum及びパターン番号 PNに関連付けされて輝度画像格納部 406cに格納される。ただし、輝度値の算出に用いられる式は、上記式に限定される ものではなく、他の式に適宜変更することが可能である。
[0225] 次に、 S4004において、 CPU402によって最大輝度画像生成プログラム 404fが 実行される。この最大輝度画像生成プログラム 404fが実行されると、輝度画像格納 部 406cに格納された露出設定インデックス iEvNumに対応する露出条件 [iEvNum]で の複数枚の輝度画像から最大輝度画像が生成される。その生成された最大輝度画 像は露出設定インデックス iEvNumに関連付けされて最大輝度画像格納部 406vに格 納される。
[0226] この最大輝度画像の生成は、露出設定インデックス iEvNumに対応する露出条件で の複数枚の輝度画像の各画素毎に最大輝度値を集めることによって行われるもので ある。すなわち、 CCD70の結像面に設定された 2次元座標系である CCD座標系 cc dx— ccdyの各座標位置毎に、露出設定インデックス iEvNumに対応する露出条件 [iE vNum]での複数枚の輝度画像のうち最も高い輝度値を抽出することによって最大輝 度画像を生成するのである。
[0227] 次に、 S4005において、 CPU402によってコード画像生成プログラム 404dが実行 される。このコード画像生成プログラム 404dが実行されると、露出設定インデックス iE vNumに対応する露出条件 [iEvNum]での複数枚の輝度画像の組み合わせにより、各 画素ごとに空間コードが割り当てられたコード画像が生成される。そのコード画像は、 輝度画像格納部 406cに格納された露出設定インデックス iEvNumに対応する露出条 件 [iEvNum]での複数種類のパターン光有画像に関する輝度画像に対する各画素ご とに輝度閾値が割り当てられた閾値画像との比較による 2値ィ匕処理(閾値処理)の結 果画像 (2値化画像)を使って生成される。その生成されたコード画像は露出設定ィ ンデッタス iEvNumに関連付けされてコード画像格納部 406dに格納される。
[0228] 図 23には、このコード画像生成プログラム 404dの詳細がフローチャートで概念的 に表されて 、る。このコード画像生成プログラム 404dにお 、て採用されて 、る技術、 特に S5001から S5004にわたる閾値画像の生成技術は、本出願人の特願 2004— 2 85736号明細書に詳細に記載されているため、その特許出願を参照することにより、 その特許出願の内容を本明細書に引用する。
[0229] 以下、このコード画像生成プログラム 404dを時系列的に説明する力 それに先立 ち、原理的に説明する。
[0230] 本実施形態においては、同じ被写体 S (3次元対象物)にっき、複数種類のパター ン光のもとにそれぞれ複数枚の輝度画像が生成される。それらパターン光はいずれ も、明部、すなわち、幅を有する明るいパターンラインと、暗部、すなわち、幅を有す る喑 、パターンラインとが交互に一定の周期で繰り返すように形成される。それらバタ ーン光は、その周期に関して互いに異なっており、それぞれ、パターン番号 PNを有 するパターン光と称される。それらパターン光のうち最も短 、周期を有するパターン 光力 パターン番号 PNが 0であるパターン光であり、最も長い周期を有するパターン 光力 パターン番号 PNが(PNmax— 1)であるパターン光である。
[0231] いずれの輝度画像も、対応するパターン光のもとに取得されるため、明部としての 明る 、パターンラインと、暗部としての喑 、パターンラインとが交互に並んで成るパタ ーン画像として形成される。パターンライン間の間隔すなわち周期は、 3次元形状検 出装置 10と被写体 Sとの間における相対的な幾何学的関係 (位置および向きに関す る関係)に依存するため、各輝度画像内のすべての位置において一定であるとは限 らない。複数種類のパターン光のもとにそれぞれ取得される複数枚の輝度画像は、 対応するパターン光のパターン番号 PNを用いて特定される。
[0232] 本実施形態においては、それら複数枚の輝度画像のうちのいずれかが代表パター ン画像に選択される。その代表パターン画像の一典型例は、複数種類のパターン光 のうちパターンライン周期が最小であるものに対応する輝度画像であり、これは、パタ ーン番号 PNが 0である輝度画像である。
[0233] ノターン光が投影された被写体 Sを撮像した輝度画像にぉ 、ては、輝度値が画素 列の方向において空間的にかつ周期的に変化する。その周期的変化を表すグラフ にそれの複数個の下ピーク点(最低輝度点)において接する包絡線が存在する。こ の包絡線は、同じ被写体 Sを無照射状態で撮像した輝度画像における輝度値、すな わち、被写体 Sの背景光の輝度値の空間的変化を表している。このような包絡線が存 在する輝度画像にっ 、ては、各画素の輝度値を閾値処理によって正確に 2値ィ匕する ためには、閾値を画素位置に応じて変化させることが望ましい。すなわち、輝度画像 の実際の輝度値変化をトラッキングすることによって閾値を適応的に変化させること が望ましいのである。
[0234] このような知見に基づき、本実施形態においては、輝度画像に対してフィルタ処理 を行うことによって閾値を算出するフィルタ窓がローカルに設定され、フィルタ処理さ れることによりその位置に適した閾値力 輝度画像に対してローカルに設定される。 輝度画像のうちのあるローカル位置に窓が設定されれば、輝度画像を構成する複数 本のパターンラインのうちその窓内に存在する画素の輝度値が取り出されて参照さ れることにより、そのあるローカル位置に対応する閾値が設定される。
[0235] 本実施形態において使用される窓は、方形窓である。この方形窓を採用する場合 には、その方形窓内に存在する複数本のパターンラインを構成する画素の輝度値が 取り出され、それら輝度値に対して同一の重み係数が用いられて閾値が算出される 。その重み係数により、方形窓の窓関数が定義される。
[0236] さらに、方形窓を採用する場合には、その方形窓の、パターンラインが延びるライン 方向におけるライン方向サイズに応じて、その方形窓内にぉ 、てライン方向に存在 する画素の数を可変とすることができる。一方、その方形窓の、複数本のパターンライ ンが列を成して並ぶ列方向における列方向サイズに応じて、その方形窓内において 列方向に存在するパターンラインの数も画素の数も可変とすることができる。
[0237] したがって、方形窓を採用する場合には、その方形窓の列方向サイズにより、輝度 画像に窓を設定することによってその輝度画像力 算出される閾値が変化することに なる。よって、その閾値を適応的に変化させることが必要である場合には、方形窓の 列方向サイズを適応的に変化させればょ 、。
[0238] 本実施形態においては、方形窓として構成される窓のサイズが、その窓内に存在 するパターンラインの数がそれらパターンラインの間隔すなわち周期(例えば、明るい ノターンラインが繰り返される周期)の整数倍であるように設定することが望ま 、。 すなわち、窓内に、明るいパターンラインと暗いパターンラインとが同数ずつ存在する ように窓のサイズを設定することが望ましいのである。このように設定すれば、窓内に 存在する複数本のパターンラインの輝度値の平均値を算出することにより、望ましい 閾値を高精度取得することができる。
[0239] しかしながら、同じ輝度画像上であっても、パターンラインの周期は場所によって異 なる可能性がある。そのため、窓のサイズを固定した場合には、窓内に存在するパタ ーンラインの数が場所によって変動してしま 、、閾値の設定精度が低下してしまう。
[0240] 本実施形態においては、複数枚の輝度画像のうち、ノターンラインの周期が最小 であるパターン光のもとに撮像されたもの、すなわち、パターン番号 PNが 0である輝 度画像が代表パターン画像として選択される。さらに、本実施形態においては、その 代表パターン画像に対してローカルに設定される窓 VW力 それのサイズが可変で ある可変窓として構成されている。それにより、その可変窓 VWのサイズが、代表パタ ーン画像の実際のノターンライン周期に適応して変化させられる。
[0241] したがって、本実施形態によれば、代表パターン画像におけるパターンライン周期 が列方向位置に応じて変動しても、それに追従するように可変窓 VWのサイズが変更 され、その結果、パターンライン周期の変動にもかかわらず、可変窓 VW内に存在す る明部と暗部のパターンラインの数が一定に維持される。本実施形態においては、代 表パターン画像に対して可変窓 VWが設定される各ローカル位置ごとに閾値 THが 取得される。各ローカル位置ごとの閾値 THは、各ローカル位置に最適なサイズを有 する可変窓 VWのもとに精度よく取得されることになる。
[0242] また、明部と暗部のパターンラインの数が一定に維持されるような可変窓 VWのサイ ズは、パターン番号 PNが 0である輝度画像において最小となる。したがって、パター ン番号 PNが 0である輝度画像を代表パターン画像として選択することにより、最小の 可変窓 VWのサイズが可能になり、可変窓 VWを用いた後のフィルタ処理の計算負 担を抑えることが可能になる。
[0243] 本実施形態においては、その可変窓 VWが、サイズが可変である方形窓として構成 されている。その可変窓 VWのサイズは、代表パターン画像の列方向には可変であ る力 ライン方向には固定であるように設定されて 、る。
[0244] 本実施形態においては、その可変窓 VWのサイズ、すなわち、代表パターン画像の 列方向におけるサイズが、その代表パターン画像の実際のパターンライン周期を適 応的に反映するように設定される。そのため、可変窓 VWのサイズを設定するために 、代表パターン画像の実際のパターンライン周期分布が事前に判明していることが必 要である。 [0245] よって、本実施形態においては、可変窓 VWのサイズの設定に先立ち、サイズが固 定された固定窓が代表パターン画像に対して設定される。その設定された固定窓に よって捕捉される複数個の連続画素が複数個の注目画素として選択され、それら選 択された注目画素の輝度値に基づき、代表パターン画像の実際のノターンライン周 期分布が取得される。
[0246] 本実施形態においては、さらに、代表パターン画像における複数個の注目画素の 輝度値に対して FFT(Fast Fourier Transform :高速フーリエ変換)処理が施され、そ れにより、代表パターン画像の列方向において輝度値変化の周波数成分のそれぞ れについて強度 (例えば、パワースペクトル)が取得される。ここに、「周波数成分」は 、 1個の固定窓によって捕捉される複数個の注目画素を列方向に迪つた場合に、輝 度値の変化が反復される反復回数を意味する。
[0247] 本実施形態にぉ 、ては、代表パターン画像にぉ 、て列方向に連続的に並んだ複 数個の連続画素のそれぞれが順次注目画素に選定され、その選定された各注目画 素ごとにパターンライン周期が、代表パターン画像の輝度値分布に基づいて取得さ れる。取得されたパターンライン周期を参照して、閾値画像生成のためのフィルタ処 理で用いる可変窓 VWのサイズを決定する。
[0248] 以上、このコード画像生成プログラム 404dを原理的に説明した力 以下、図 23を 参照することにより、時系列的に説明する。
[0249] このコード画像生成プログラム 404dにおいては、まず、 S5001において、露出設 定インデックス iEvNumに対応する露出条件 [iEvNum]の輝度画像のうち、パターン番 号 PNが 0であるパターン光が投影された被写体 Sが撮像された輝度画像が輝度画 像格納部 406cから、代表パターン画像として読み込まれる。
[0250] 次に、 S5002において、その代表パターン画像につき、前記読み込まれた輝度画 像に基づき、前述の FFT変換によるアプローチにより、代表パターン画像において 列方向に連続的に並んだ各画素ごとにパターンライン周期が演算される。演算され た複数個のパターンライン周期は各画素 (各列方向画素位置)に関連付けて周期分 布格納部 406pに格納される。
[0251] 続いて、 S5003において、演算された複数個のパターンライン周期に基づき、可変 窓 VWの特性がローカルに設定される。本実施形態においては、可変窓 VWのライ ン方向サイズは、その可変窓 VWが設定される代表パターン画像上の位置にかかわ らず、変化しないように設定されるのに対し、可変窓 VWの列方向サイズは、各列方 向画素位置に関連付けて演算されたパターンライン周期の整数倍に相当するように 設定される。
[0252] その後、 S5004において、代表パターン画像に対して可変窓 VW力 ライン方向と 列方向とに沿って平面的に、かつ、各画素に関連付けて設定される。それにより、各 画素ごとに、可変窓 VW内に存在する複数個の画素の輝度値の平均値がローカル な閾値として演算される。この S5004においては、さらに、演算された閾値が各画素 に割り当てられた閾値画像が生成される。生成された閾値画像は露出設定インデッ タス iEvNumに関連付けされて閾値画像格納部 406qに格納される。
[0253] 続いて、 S5005において、パターン番号 PNが 0に初期化され、その後、 S5006に お!、て、パターン番号 PNの現在値が最大値 PNmaxより小さ!/、か否かが判定される 。今回は、パターン番号 PNの現在値が 0であるため、判定が NOとなり、 S5007に移 行する。
[0254] この S5007にお!/、ては、パターン番号 PNの現在値と等し!/、パターン番号 PNが割 り当てられ、かつ露出設定インデックス iEvNumに対応する露出条件 [iEvNum]の輝度 画像の輝度値と、前記生成された露出設定インデックス iEvNumに対応する露出条件 [iEvNum]の閾値画像の閾値とが、各画素ごとに互いに比較される。その比較結果は 、各画素ごとに 2値化画像に反映される。具体的には、輝度画像の輝度値が閾値より 大きい場合には、「1」を表すデータが、 2値化画像のうち対応する画素位置に関連 付けて 2値化画像格納部 406rに格納され、一方、輝度画像の輝度値が閾値より大き くはない場合には、「0」を表すデータが、 2値化画像のうち対応する画素位置に関連 付けて 2値化画像格納部 406rに格納される。
[0255] その後、 S5008において、パターン番号 PNが 1だけインクリメントされる。続いて、 S 5006に戻り、パターン番号 PNの現在値が最大値 PNmaxより小さいか否かが判定 される。今回も、最大値 PNmaxより小さい場合には、判定が NOとなり、 S5007に移 行する。 [0256] S5006¾V、し S5008の実行がパターン光の種類の数と同数回繰り返された結果、 パターン番号 PNの現在値が最大値 PNmaxより小さくはない値になると、 S5006の 半 IJ定カ SYESとなり、 S5009に移行する。
[0257] この S5009においては、各画素ごとに、最大値 PNmaxと同数枚の 2値化画像から 画素値(「1」または「0」 ) 1S 露出設定インデックス iEvNumに対応する露出条件 [iEvN um]で、かつパターン番号 PNが 0である輝度画像に対応する 2値化画像から、パター ン番号 PNが(PNmax— 1)である輝度画像に対応する 2値ィ匕画像に至る順序に従 つて抽出され、最下位ビット LSM力も最上位ビット MSBに至る順序に従って並んだ 空間コードが生成される。各画素ごとの空間コードのビット数は、最大値 PNmaxと同 数である。各画素ごとに空間コードが生成されることにより、今回の被写体 Sに対応す る空間コード画像が生成される。生成された空間コードは、各画素位置及び露出設 定インデックス iEvNumに関連付けられて空間コード格納部 116dに格納される。例え ば、最大値 PNmaxが 8である場合には、生成される空間コードは 0から 255までの範 囲内の値を有する。
[0258] 以上で、このコード画像生成プログラム 404dの一回の実行が終了する。
[0259] その後、図 22における S4006において、コード境界抽出プログラム 404eの実行に より、コード境界座標検出処理が実施される。前述の空間コード化法によるコードィ匕 は、各画素単位で行われるため、実際のパターン光における明暗の境界線と、前記 生成された露出設定インデックス iEvNumに対応する露出条件 [iEvNum]でのコード画 像における空間コードの境界線 (ある空間コードが割り当てられた領域と別の空間コ ードが割り当てられた領域との間の境界線)との間にサブピクセル精度の誤差が生ず る。そのため、このコード境界座標検出処理は、空間コードの境界座標値をサブピク セル精度で検出することを目的として実施される。空間コードの境界座標値をサブピ クセル精度で検出する処理の詳細については、本出願人の特願 2004— 1054261 号明細書に詳細に開示されている。
[0260] このコード境界座標検出処理は、コード画像を参照することにより検出した境界座 標値 (画素境界でしか検出できな!、ので整数精度)付近の輝度画像を参照して輝度 の変化を多項式で近似し、同時に境界座標値付近の閾値の平均値を算出する。そ して、輝度の変化を近似した多項式と、付近の閾値の平均値の交点を算出 (小数精 度:サブピクセル精度)することにより、空間コードの境界座標値をサブピクセル精度 で検出するのである。
[0261] ここで、各パターン光のライン方向と交差する離散的な基準線の位置を CCD座標 系において 255本設定すると、最大値 PNmaxが 8 (空間コードを 256有するため、境 界は 255)である場合には、図 22における S4003 (コード境界抽出プログラム 404e の実行)により、最大約 6万 5千の空間コードの境界座標値が検出される。すなわち、 空間コードのコード境界数 255は第 1境界位置インデックス Icodeで定義され、第 1境 界位置インデックス Icode=0〜254が割り当てられる。また、第 1境界位置インデックス I code=0〜254ごとの各コード境界を構成する画素単位を第 2境界位置インデックス Ice dxと定義し、第 2境界位置インデックス Iccdx=0〜254が割り当てられる。したがって、 空間コードのコード境界座標の数は、第丄境界位置インデックス数に第 2境界位置ィ ンデッタス数を積算した値であり、約 6万 5千となる。
[0262] 検出されたコード境界座標値はコード境界座標格納部 406eに格納される。このコ ード境界座標値は、 CCD70の結像面に設定された 2次元座標系である CCD座標 系 ccdx— ccdyにおいて定義される。
[0263] その後、 S4007において、露出設定インデックス iEvNumが 1だけインクリメントされ る。続いて、 S4002に戻り、露出設定インデックス iEvNumが「iEvNumMax」よりも小さ いか否かが判定される。今回は、露出設定インデックス iEvNumが「iEvNumMax」以上 であると仮定すれば、、その S4002の半 IJ定カ ^YESとなり、 S4003に移行する。
[0264] S4003¾V、し S4006の実行が露出設定インデックス iEvNumの数と同数回繰り返さ れた結果、露出設定インデックス iEvNum値力 EvNumMax以上の値となると、 S4002 の判定が NOとなり、 S4008に移行する。
[0265] 以上で、このコード境界抽出プログラム 404eの一回の実行が終了する。
[0266] その後、図 24における S4008において、 CPU402によるコード境界の統合プログ ラム 404gの実行により、コード境界位置の統合処理が実施される。
[0267] ここで、図 24を参照することにより、図 22における S4008を詳述する。図 24には、 その S4008がコード境界の統合サブルーチンとしてフローチャートで概念的に表さ れている。
[0268] まず、 S5100において、このコード境界の統合処理によって統合されるコード境界 座標 (以下、「統合コード境界座標」とする。)を保存する領域 (以下、「統合コード境 界座標格納領域」とする。)をコード境界座標格納部 406eに確保する。この統合コー ド境界座標格納領域は、図 26に示すように、各コード境界位置 (Icodejccdx)がそれ ぞれのコード境界位置毎に格納可能に構成されて 、る。
[0269] 次に、 S5101において、第 1境界位置インデックス Icodeが「0」に設定されて初期化 される。続いて、 S5102において、第 1境界位置インデックス Icodeが「IcodeMax」より も小さくなつているかが判定される。今回は、第 1境界位置インデックス Icodeが「Icode Max」よりも小さい「0」であるので、その S5102の判定が YESとなり、 S5103において 、第 2境界位置インデックス Iccdxが「0」に設定されて初期化される。すなわち、第 2境 界位置インデックス Iccdxが「0」に設定される。このように設定される第 1境界位置イン デッタス Icode及び第 2境界位置インデックス Iccdxはワーキングエリア 410に記憶され る。後述する S5107や S5108においてインクリメントされた場合には、その都度ヮー キングエリア 410に記憶した第 1境界位置インデックス Icode及び第 2境界位置インデ ックス Iccdxが更新される。
[0270] その後、 S5104において、第 2境界位置インデックス Iccdxが「IccdxMax」よりも小さ い値となっているかが判定される。今回は、第 2境界位置インデックス Iccdxが「IccdxM ax」よりも小さい「0」であるので、その S5104の判定が YESとなり、 S5105において、 後述で詳説するコード境界の選択処理が行われる。コード境界の選択処理によって 選択されたコード境界座標は、 S5106において、上述の統合コード境界座標格納領 域に格納される。
[0271] その後、 S5107において、第 2境界位置インデックス Iccdxが 1だけインクリメントされ る。続いて、 S5104に戻り、第 2境界位置インデックス Iccdxが「IccdxMax」よりも小さい 値となっているか否かが判定される。今回は、第 2境界位置インデックス Iccdxが「Iccd xMax」よりも小さい値でないと仮定すれば、その S5104の判定が NOとなり、 S5108 に移行する。
[0272] S5108に移行すると、 S5108において、第 1境界位置インデックス Icodeが 1だけィ ンクリメントされる。続いて、 S5102に戻り、第 1境界位置インデックス Icodeが「IcodeM ax」よりも小さい値となっている力否かが判定される。今回は、第 1境界位置インデック ス Icodeが「IcodeMax」よりも小さ 、値でな!、と仮定すれば、その S5102の判定が NO となり、コード境界の統合処理を終了する。
[0273] ここで、図 25を参照することにより、図 24における S5105を詳述する。図 25には、 その S1105がコード境界の選択プログラム 404hとしてフローチャートで概念的に表 されている。
[0274] まず、 S5200において、露出設定インデックス iEvNum値を初期化する。すなわち、 露出設定インデックス iEvNumを「0」に設定する。本フローチャートで処理中の露出設 定インデックス iEvNumの直前で処理されたの露出設定インデックス iEvNum— 1を前 回露出設定インデックス iEvNumBとし、この前回露出設定インデックス iEvNumBを「― 1」に設定する。
[0275] 次に、 S5201において、露出設定インデックス iEvNumが「iEvNumMax」よりも小さい 値となっているか否かが判定される。今回は、露出設定インデックス iEvNumが「iEvNu mMax」よりも小さい「0」であるので、その S5201の判定が YESとなり、 S5202におい て露出設定インデックス iEvNumに対応する撮像条件のコード境界座標(ccdx、 ccdy) が取得される。ここで取得されるコード境界座標は、ワーキングエリア 410に記憶した 第 1境界位置インデックス Icode及び第 2境界位置インデックス Iccdxから決定されるコ ード境界座標である。
[0276] 続いて、 S5203〖こて、取得したコード境界座標(ccdx、 ccdy)が不定であるか否かが 判定される。ここで、コード境界座標(ccdx、 ccdy)が不定であるとは、 S4006のコード 境界抽出処理にて、コード境界座標の検出ができな力つたことを意味する。
[0277] S5203〖こて、取得したコード境界座標(ccdx、 ccdy)が不定ではないと判定されると 、その S5203の判定が NOとなり、 S5204において、取得したコード境界座標(ccdx 、 ccdy)付近の平均輝度値 (AveY)を取得する。ここで、コード境界座標(ccdx、 ccdy) 付近の平均輝度値 (AveY)とは、 S4004にて生成した最大輝度画像に基づき、この S5204において算出されるものである。たとえば、コード境界座標(ccdx、 ccdy)と、こ のコード境界座標(ccdx、 ccdy)の周囲の 8つの座標(ccdx- 1、 ccdy- 1) , (ccdx- 1、 cc dy) , (ccdx-l、 ccdy+1), (ccdx、 ccdy- 1), (ccdx-l、 ccdy+1), (ccdx+K ccdy+1) , (c cdx+l、 ccdy+1) , (ccdx-l、 ccdy+1)にそれぞれ対応する輝度値を最大輝度画像から 取り出し、これらの輝度値の平均を平均輝度値 (AveY)として取得する。
[0278] 次に、 S5205において、露出設定インデックス iEvNumが「iEvNumMax-l」となって いるか否かが判定される。今回は、露出設定インデックス iEvNumが「0」であるので、 その S5205の判定が NOとなり、 S5206において、さらに露出設定インデックス iEvN umが「0」となっているか否かが判定される。今回は、露出設定インデックス iEvNumが 「0」であるので、その S5206の判定力YESとなり、 S5214において、平均輝度値 (A veY)が cMinl[0]以上かつ cMax[0]以下であるか否かが判定される。ここで、 cMinl[0] 以上かつ CMax[0]以下とは、露出条件 [0]における有効輝度範囲である(図 19参照)
[0279] 平均輝度値 (AveY)が cMinl[0]以上かつ cMax[0]以下であるとき、 S5214の判定力 S YESとなり、後述する S5252の処理に移行する。これに対して、平均輝度値 (AveY) 力 ScMinl[0]以上かつ cMax[0]以下ではないとき、 S5214の判定力 SNOとなり、さらに、 S5215において、平均輝度値 (AveY)力 SCMax[0]よりも大きいか否かが判定される。
[0280] 平均輝度値 (AveY)力 ¾Max[0]よりも大きいとき、 S5215の判定力 SYESとなり、後述 する S5251の処理に移行する。これに対して、平均輝度値 (AveY)力 ¾Max[0]よりも 大きくないとき、 S5215の判定力 NOとなり、 S5230にて、露出設定インデックス iEvN umを前回露出設定インデックス iEvNumB、平均輝度値 (AveY)を前回平均輝度値 (A veYB)、コード境界座標(ccdx、 ccdy)を前回コード境界座標(ccdxB、 ccdyB)としてそ れぞれワーキングエリア 410に一時保存データとして記憶し、保存する。その後、 S5 231において、露出設定インデックス iEvNumを 1だけインクリメントして、 S5201力 の処理を繰り返す。
[0281] また、 S5206において、露出設定インデックス iEvNumが「0」となっていないとすると 、その S5206の判定が NOとなり、 S5207において、平均輝度値 (AveY)が cMinl[iE vNum]以上かつ cMaxDEvNum]以下であるか否かが判定される。今回、平均輝度値( AveY)力 ScMinl[iEvNum]以上かつ cMaxDEvNum]以下であると仮定すると、その S520 7の判定が YESとなり、後述する S5252の処理に移行する。 [0282] これに対して、平均輝度値 (AveY)力 cMinl[iEvNum]以上かつ cMax[iEvNum]以下 ではないとき、その S5207の判定が NOとなり、 S5216において、平均輝度値 (AveY )力 cMax[iEvNum]より大きいか否かが判定される。今回、平均輝度値 (AveY)が cMax [iEvNum]より大きくないと仮定すると、その S5216の判定が NOとなり、その後、上述 の S5230及び S5231の処理力 S行われた後、 S5201力らの処理を繰り返す。一方、 平均輝度値 (AveY)力 ScMax[iEvNum]より大きいとき、その S5216の判定が YESとなり 、後述する S5212の処理に移行する。
[0283] また、 S5205にお!/、て、露出設定インデックス iEvNumが「iEvNumMax-l」となって ヽると仮定すると、その S5205の半 IJ定カ ^YESとなり、 S5210にお!/、て、平均輝度値( AveY)力 cMinO[iEvNum]以上かつ cMax[iEvNum]以下であるか否かが判定される。今 回、平均輝度値(AveY)力 ¾MinO[iEvNum]以上かつ cMax[iEvNum]以下であると仮定 すると、その S5210の半 IJ定カ ^YESとなり、後述の S5252に移行する。
[0284] S5210にお!/、て、平均輝度値 (AveY)力 ¾MinO[iEvNum]以上かつ cMax[iEvNum]以 下ではな ヽと仮定すると、 S5210の半 IJ定カ ^ΝΟとなり、さらに、 S5211にお!/ヽて、平 均輝度値 (AveY)力 cMax[iEvNum]よりも大きぐかつ露出設定インデックス iEvNumが 「0」でないか否かが判定される。今回、平均輝度値 (AveY)力 cMax[iEvNum]よりも大 きぐかつ露出設定インデックス iEvNumが「0」であるとき、 S5211の判定力YESとな り、さらに、 S5212において、前回露出設定インデックス iEvNumB力 「一 1」でないか 否かが判定される。今回、前回露出設定インデックス iEvNumBが「ー1」でないと仮定 すると、 S5212の半 IJ定カ ^YESとなり、さらに、 S5213において、前回平均輝度値 (Av eYB)力 cMinO[iEvNumB]以上かつ cMax[iEvNumB]以下であるか否かが判定される。
[0285] S5213において前回平均輝度値(AveYB)力 ScMinO[iEvNumB]以上かつ cMax[iEvN umB]以下であると仮定すると S5213の判定が YESとなり、後述する S5250の処理 に移行する。これに対して、前回平均輝度値 (AveYB)力 cMinO[iEvNumB]以上かつ c MaxDEvNumB]以下ではないと仮定すると S5213の判定が NOとなり、後述する S52 51の処理に移行する。
[0286] また、 S5211にお!/、て、平均輝度値 (AveY)力 cMax[iEvNum]よりも大きくな!/ヽ、或 Vヽは露出設定インデックス iEvNumが「0」であると仮定すると S 5211の判定が NOとな り、後述する S5251の処理に移行する。また、 S5212において、前回露出設定イン デッタス iEvNumBが「一 1」であると仮定すると S5212の判定が NOとなり、後述する S 5251の処理に移行する。
[0287] S5203において、コード境界座標(ccdx、 ccdy)が不定であると判定されると、その S5203の判定力YESとなり、さらに、 S5220において、露出設定インデックス iEvNu mが「iEvNumMax-l」となっているか否かが判定される。今回、露出設定インデックス i EvNumが「iEvNumMax- 1」となっていると仮定すると、 S5220の判定力 SYESとなり、さ らに、 S5221において、前回露出設定インデックス iEvNumB力 S「一 1」となっている力 否かが判定される。
[0288] また、 S5220にお!/、て、露出設定インデックス iEvNumが「iEvNumMax-l」となって いないと仮定すると、 S5220の判定力 NOとなり、上述の S5231の処理が行われて、 S5201からの処理が繰り返される。
[0289] また、 S5221において、前回露出設定インデックス iEvNumB力 「一 1」となっていな いと仮定すると、その S5221の判定力 SYESとなり、後述する S5250の処理に移行す る。これに対して、前回露出設定インデックス iEvNumBが「― 1」となっていると仮定す ると、その S5221の判定が NOとなり、後述する S5251の処理に移行する。
[0290] このコード境界の選択処理は、次の S5250〜S5252のいずれ力の処理を行って から終了する。
[0291] S5250においては、前回コード境界座標(ccdxB、 ccdyB)をコード境界位置(Icode, Iccdx)の確定データとして決定し、コード境界座標格納部 406eの統合コード境界座 標格納領域に格納する。すなわち、前回平均輝度値 AveB力 ^MinODEvNumB]以上か つ cMaxDEvNumB]以下であるときには、前回のコード境界座標(ccdxB、 ccdyB)をコ ード境界位置(Icodejccdx)の確定データとして決定する。
[0292] S5251においては、コード境界位置(Icode,Iccdx)を不定として、コード境界座標格 納部 406eの統合コード境界座標格納領域に格納する。
[0293] S5252においては、コード境界座標(ccdx、 ccdy)をコード境界位置(Icode,Iccdx) の確定データとして決定し、コード境界座標格納部 406eの統合コード境界座標格納 領域に格納する。 [0294] 以上のように、コード境界の選択処理は、複数の露出条件におけるコード境界位置 (Icode.lccdx)の中から一つのコード境界位置(Icode,Iccdx)を選択する処理を、コー ド境界位置(Icode,Iccdx)ごとに行い、複数の露出条件のコード境界を一つのコード 境界に統合するものである。より具体的には、コード境界位置 (Icodejccdx)ごとに、 最低露出条件 [0]のコード境界座標力 最高露出条件 [iEvNumMax-1]のコード境界 座標にかけて、順次コード境界座標に対応する輝度値が有効輝度範囲に入って ヽ るかを判定していき、有効輝度範囲に入る最初の露出条件のコード境界座標を選択 するようにしている。そのためコード境界位置 (Icodejccdx)ごとに、適切な露出条件 での撮像画像を用いたコード境界位置の検出が可能となるのである。
[0295] なお、本実施形態においては、有効輝度範囲に入る最初の露出条件のコード境界 座標を選択するようにしたが、有効輝度範囲に入る露出条件のコード境界座標のうち 、コード境界座標に対応する輝度値がそれぞれの有効輝度範囲の中心に最も近い 露出条件のコード境界座標を選択するようにしてもよい。このようにすれば、さらに適 切な露出条件での撮像画像を用いたコード境界位置の検出が可能となる。
[0296] 続いて、 S4009において、レンズ収差補正プログラム 404iの実行により、レンズ収 差補正処理が実施される。このレンズ収差補正処理は、撮像光学系 30に入射した光 束の実際の結像位置であってその撮像光学系 30の収差の影響を受けたものを、そ の撮像光学系 30が理想レンズであったならば結像されるはずである理想結像位置 に近づくように補正する処理である。
[0297] このレンズ収差補正処理により、 S4008において統合されたコード境界座標値が、 撮像光学系 30の歪みなどに起因した誤差が除去されるように補正される。そのように して補正されたコード境界座標は収差補正座標格納部 406gに格納される。
[0298] その後、 S4010において、三角測量演算プログラム 404jの実行により、三角測量 の原理による実空間変換処理が実施される。この実空間変換処理が実施されれば、 三角測量の原理により、前述の、 CCD座標系 ccdx— ccdy上のコード境界座標値で あって収差補正が施されたものが、実空間に設定された 3次元座標系である実空間 座標系 X— Y— Z上の 3次元座標値に変換され、その結果、 3次元色形状検出結果と しての 3次元座標値が取得される。その取得された 3次元座標値は、対応する部分画 像の回転位相 PHに関連付けて、 3次元座標格納部 406hに格納される。
[0299] この S4010においては、被写体 Sの 3次元形状を複数個の 3次元頂点の集まりとし て空間離散的に計測するために、 2次元的なコード画像が、各パターン光のライン方 向と交差する離散的な複数本の基準線に関して空間離散的に参照される。これによ り、そのコード画像の外周境界上の複数個の離散点にそれぞれ対応する複数個の 3 次元頂点が取得されるのみならず、そのコード画像の内部の複数個の離散点(S40 03において検出されたコードの境界座標点)にそれぞれ対応する複数個の 3次元頂 点が取得される。
[0300] ここで、図 27を参照することにより、図 15における S1230を詳述する。図 27には、 その S1230が 3次元色形状検出結果生成サブルーチンとして概念的にフローチヤ ートで表されている。
[0301] この 3次元色形状検出結果生成サブルーチンにおいては、まず、 S5501において 、 3次元座標格納部 406hから、回転位相 PHOないし 3のそれぞれに関連付けて、複 数個の 3次元座標値がロードされる。本実施形態においては、被写体 Sの外面全体 力 つの部分面 (正面、右側面、左側面および背面)に分割され、各部分面ごとに 3 次元形状情報が生成される。この S5501においては、それら 4つの部分面のすべて につ ヽて、各部分面に属する複数個の 3次元座標値が 3次元座標格納部 406hから ロードされる。
[0302] 次に、 S5502において、それらロードされた複数個の 3次元座標値 (頂点座標値) に対し、各 3次元座標値が属する各部分面の回転位相 PHに応じた回転変換が行わ れ、それにより、 4つの部分面に属する複数個の 3次元座標値力 各部分面の回転 位相 PHを見込んで組み合わされる。その結果、複数個の 3次元座標値によって 3次 元的に表現される 4つの部分面が一体ィ匕されて、被写体 Sの外面全体を現す 3次元 形状情報が合成される。ただし、この段階においては、その 3次元形状情報に、測定 ヘッド MHの分割撮像手法に起因して空間的にオーバラップする部分が存在する。
[0303] 続いて、 S5503において、その生成された合成画像において空間的にオーバラッ プする部分が抽出される。さらに、その合成画像の長さ方向における各領域におい てオーバラップする 2つの部分が、それら 2部分に属する複数個の 3次元座標値の平 均化等の手法により、 1つの部分に結合 (ステッチ)される。その結果、 3次元形状情 報において空間的なオーバラップが除去され、それにより、 3次元ステッチ形状が完 成する。その 3次元ステッチ形状を表すデータが 3次元ステッチ形状格納部 406sに 格納される。
[0304] その後、 S6001において、前述の実空間 3次元座標系に座標変換された 3次元頂 点群の各実座標空間座標値に対応する RGB値 (R輝度値、 G輝度値および B輝度 値)が前述の表面色画像から抽出される。
[0305] 実空間座標系と、表面色画像を定義する平面座標系との関係は、前述の三角測量 計算によって幾何学的に互いに対応付けられている。すなわち、コード画像、すなわ ち、被写体 Sの 3次元形状を計測するための 2次元画像である形状画像を定義する 平面座標系を実空間 3次元座標系に計算によってマッピングさせるために用いられ る変換の逆変換を用いることにより、実空間 3次元座標系を、表面色画像を定義する 平面座標系に計算によってマッピングさせることが可能なのである。したがって、この S6001においては、 2次元的な表面色画像から、各 3次元頂点ごとに、それに対応 する表面色値すなわち RGB値を抽出することが可能である。各 3次元頂点ごとに対 応する表面色値および、各 3次元頂点の間の 3次元空間位置に対応する表面色値 を抽出し、新たに画像平面上に再配置する。再配置により生成された画像をステッチ テクスチャ画像としてステッチテクスチャ画像格納部 406tに格納する。
[0306] 以上で、この 3次元色形状検出結果生成サブルーチンの一回の実行が終了し、そ れに伴い、図 27に示す 3次元色形状検出処理ルーチンの一回の実行が終了する。
[0307] ところで、 S2005におけるパターン光有画像撮像処理にお!、ては、露出別パラメ一 タテーブル格納部 406wに格納された全ての露出時間パラメータに対して撮像処理 を行った力 露出別パラメータテーブル格納部 406wに格納された露出時間パラメ一 タのうち一部を使用するようにして、撮像処理の時間を短縮するようにもできる。
[0308] たとえば、 S1004において撮像部 14での自動露出 (AE)機能の実行 (露出決定手 段)により、選択された露出条件 [iEvNum]に近い 3つの露出条件 [iEvNum-1], [iEvNu m], [iEvNum+1]の露出時間パラメータを露出別パラメータテーブル格納部 406wから 取り出し、 S2023の撮像処理を行うようにするのである。すなわち、自動露出機能に よって最も適切と判定された露出時間パラメータと、その露出時間が近い前後の露出 時間パラメータとにより撮像するのである。このようにすることによって、自動露出機能 によって決定される 1つの露出条件では、被写体 sの輝度分布に充分に対応できな い場合であっても、その前後の露出条件での撮像画像を用いることで、被写体 Sの輝 度分布に対するカバー範囲を的確に広げることができる。
[0309] また、被写体 Sを撮像するための露出条件が多数ある場合においても、全ての露出 条件で輝度画像の生成、コード画像の生成及びコード境界の抽出を行うことがな ヽ ため、それらの演算処理の負荷が軽減され、し力も、 3次元形状の検出時間も必要以 上にかかることがない。
[0310] なお、自動露出 (AE)機能の実行は、 S1004において行うのではなぐパターン光 有画像撮像処理で行うようにしてもよい。また、この自動露出 (AE)機能は、撮像部 1 4における撮像領域の輝度を検出し、当該輝度に基づいて露出条件を決定するもの である。
[0311] また、上述では複数の露出条件のうち一部を用いる例として、 3つの露出条件の例 について説明した力 Sこれに限られず、 2つであってもよぐ 4以上であってもよい。また 、この露出条件の数は、設定により変更することができるようにしてもよい。
[0312] 以上、本発明の実施の形態のうちのいくつかを図面に基づいて詳細に説明したが 、これらは例示であり、前記 [発明の開示]の欄に記載の態様を始めとして、当業者の 知識に基づいて種々の変形、改良を施した他の形態で本発明を実施することが可能 である。
[0313] たとえば、本実施形態においては、空間コード法におけるパターン光での 3次元形 状検出について説明した力 その他のパターン光による 3次元形状検出であってもよ い。たとえば、単純な平行線 (スリット状)パターン光を用いた光切断法や、何らかの 規則性を持たせたスポット光群、明暗をメッシュ状に配したパターン光等を用いた 3次 元形状検出にも適用可能である。

Claims

請求の範囲
[1] 明と暗とを交互に並べてなるパターン光を被写体に投影して撮像した画像情報を 基に、その撮像領域内にある被写体の 3次元形状を検出する 3次元形状検出装置で あって、
前記パターン光の各々を被写体に投影する投影部と、
前記投影部力 前記パターン光が投影されている状態の被写体を複数の異なる露 出条件で撮像する撮像部と、
前記各露出条件毎に、前記撮像部で撮像した撮像画像からパターン光の軌跡を 抽出するパターン光軌跡抽出手段と、
前記パターン光軌跡抽出手段によって抽出された各露出条件毎のパターン軌跡 位置に基づいて、前記被写体の 3次元形状を算出するための一つのパターン軌跡 位置を決定するパターン軌跡統合手段と、
前記パターン軌跡統合手段によって決定されたパターン軌跡位置に基づいて被写 体の 3次元形状を算出する 3次元形状算出手段と、
を備えた 3次元形状検出装置。
[2] 前記パターン光は、明と暗とを交互に並べてなる複数種類のパターン光であり、 前記投影部は、
複数種類の前記パターン光の各々を時系列に被写体に投影し、
前記撮像部は、
前記投影部から前記各パターン光が投影されている状態の被写体を複数の異なる 露出条件で撮像し、
前記パターン光軌跡抽出手段は、
前記各露出条件毎に、前記撮像部によって撮像される各撮像画像力 各画素の輝 度を算出した複数の輝度画像を生成する輝度画像生成手段と、
前記複数の輝度画像に対して所定の閾値による閾値処理を行って各画素毎に前 記空間コードを割り当てた、前記各露出条件毎のコード画像を生成するコード画像 生成手段と、
前記空間コードのコード境界位置を前記コード画像から抽出する処理を前記各露 出条件の前記コード画像それぞれに対して行うコード境界抽出手段と、を有し、 前記パターン軌跡統合手段は、
前記コード境界抽出手段によって抽出された各露出条件毎のコード境界位置に基 づいて、前記被写体の 3次元形状を算出するための一つのコード境界位置を決定す るコード境界統合手段を有し、
前記 3次元形状算出手段は、
前記コード境界統合手段によって決定されたコード境界位置に基づいて被写体の 3次元形状を算出すること
を特徴とする請求項 1に記載の 3次元形状検出装置。
[3] 異なる複数の露出条件の情報を格納する露出条件情報格納部と、
前記撮像部における撮像領域の輝度を検出し、当該輝度に基づいて、前記設定 情報格納部から一の露出条件を決定する露出決定手段と、を備え、
前記複数露出撮像処理手段は、
前記露出決定手段によって決定した露出条件と、当該決定した露出条件と露出度 合!、が近!、前後の露出条件とからなる複数の露出条件を、前記複数の異なる露出 条件とする
ことを特徴とする請求項 2に記載の 3次元形状検出装置。
[4] 前記コード境界統合手段は、
前記各露出条件における前記コード境界位置の各座標毎に、当該各座標に対応 する画素の輝度の検出を行い、当該輝度が前記露出条件における有効輝度範囲内 となるか否かを判定し、当該有効輝度範囲内であると判定した画素に対応する前記 コード境界位置の座標を用いて、前記被写体の 3次元形状を算出するための一つの コード境界位置を決定することを特徴とする請求項 2に記載の 3次元形状検出装置。
[5] 前記コード境界統合手段は、
前記各座標に対応する画素の輝度を、当該画素とその周囲の画素との平均輝度と したことを特徴とする請求項 4に記載の 3次元形状検出装置。
[6] 前記各露出条件毎に、前記撮像部によって撮像される各撮像画像力 各画素の最 大輝度値を検出して最大輝度画像を生成する最大輝度画像生成手段を備え、 前記各座標に対応する画素の輝度の検出を前記最大輝度画像を用いて行うことを 特徴とする請求項 4に記載の 3次元形状検出装置。
[7] 前記露出条件は露光時間である
ことを特徴とする請求項 1に記載の 3次元形状検出装置。
[8] 明と暗とを交互に並べてなるパターン光を被写体に投影して撮像した画像情報を 基に、その撮像領域内にある被写体の 3次元形状を検出する 3次元形状検出方法で あって、
前記パターン光を被写体に投影部により投影するステップと、
前記投影部から前記各パターン光が投影されている状態の被写体を、撮像部によ り複数の異なる露出条件で撮像するステップと、
前記各露出条件毎に、前記撮像部で撮像した撮像画像からパターン光の軌跡を 抽出するステップと、
前記抽出された各露出条件毎のパターン軌跡位置に基づいて、前記被写体の 3次 元形状を算出するための一つのパターン軌跡位置を決定するステップと、
前記決定されたパターン軌跡位置に基づいて被写体の 3次元形状を算出するステ ップと、
を有する 3次元形状検出方法。
PCT/JP2007/056416 2006-03-31 2007-03-27 3次元形状検出装置及び3次元形状検出方法 WO2007116744A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US12/242,554 US20090022367A1 (en) 2006-03-31 2008-09-30 Three-dimensional shape detecting device and three-dimensional shape detecting method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2006099555A JP2007271530A (ja) 2006-03-31 2006-03-31 3次元形状検出装置及び3次元形状検出方法
JP2006-099555 2006-03-31

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US12/242,554 Continuation-In-Part US20090022367A1 (en) 2006-03-31 2008-09-30 Three-dimensional shape detecting device and three-dimensional shape detecting method

Publications (1)

Publication Number Publication Date
WO2007116744A1 true WO2007116744A1 (ja) 2007-10-18

Family

ID=38581042

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2007/056416 WO2007116744A1 (ja) 2006-03-31 2007-03-27 3次元形状検出装置及び3次元形状検出方法

Country Status (3)

Country Link
US (1) US20090022367A1 (ja)
JP (1) JP2007271530A (ja)
WO (1) WO2007116744A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11313676B2 (en) * 2018-02-07 2022-04-26 Omron Corporation Three-dimensional measurement apparatus, three-dimensional measurement method, and three-dimensional measurement non-transitory computer readable medium

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7957007B2 (en) * 2006-05-17 2011-06-07 Mitsubishi Electric Research Laboratories, Inc. Apparatus and method for illuminating a scene with multiplexed illumination for motion capture
KR20100084718A (ko) * 2009-01-19 2010-07-28 삼성전자주식회사 3차원 이미지를 생성하는 휴대 단말기
EP2249286A1 (en) * 2009-05-08 2010-11-10 Honda Research Institute Europe GmbH Robot with vision-based 3D shape recognition
JP5662046B2 (ja) * 2010-03-31 2015-01-28 パナソニック デバイスSunx株式会社 変位センサ
JP5440363B2 (ja) * 2010-04-27 2014-03-12 カシオ計算機株式会社 情報処理装置及び方法、並びにプログラム
DE102010037621A1 (de) * 2010-09-17 2012-03-22 V&M Deutschland Gmbh Verfahren zur Messung der Profilgeometrie von gekrümmten, insbesondere zylindrischen Körpern
JP5815940B2 (ja) 2010-12-15 2015-11-17 キヤノン株式会社 距離計測装置、距離計測方法、およびプログラム
KR101289595B1 (ko) * 2011-02-28 2013-07-24 이경자 격자패턴투영장치
US8646692B2 (en) * 2011-09-30 2014-02-11 Hand Held Products, Inc. Devices and methods employing dual target auto exposure
TW201331547A (zh) * 2011-11-01 2013-08-01 尼康股份有限公司 形狀測定裝置、構造物製造系統、形狀測定方法、構造物製造方法、程式及記錄媒體
JP6029394B2 (ja) * 2012-09-11 2016-11-24 株式会社キーエンス 形状測定装置
US11509880B2 (en) 2012-11-14 2022-11-22 Qualcomm Incorporated Dynamic adjustment of light source power in structured light active depth sensing systems
US9948920B2 (en) 2015-02-27 2018-04-17 Qualcomm Incorporated Systems and methods for error correction in structured light
US10068338B2 (en) * 2015-03-12 2018-09-04 Qualcomm Incorporated Active sensing spatial resolution improvement through multiple receivers and code reuse
JP2017003469A (ja) 2015-06-11 2017-01-05 キヤノン株式会社 三次元計測装置、三次元計測装置の制御方法及びプログラム
US9846943B2 (en) * 2015-08-31 2017-12-19 Qualcomm Incorporated Code domain power control for structured light
KR20170096420A (ko) * 2016-02-16 2017-08-24 삼성전자주식회사 대화형 3차원 디스플레이 장치 및 방법
KR101842141B1 (ko) * 2016-05-13 2018-03-26 (주)칼리온 3차원 스캐닝 장치 및 방법
GB2584907A (en) * 2019-06-21 2020-12-23 Zivid As Method for determining one or more groups of exposure settings to use in a 3D image acquisition process
CN111692992A (zh) * 2020-06-22 2020-09-22 征图智能科技(江苏)有限公司 基于多图分时曝光的高精度2d尺寸测量方法
CN112291459B (zh) * 2020-10-23 2022-02-11 杭州思锐迪科技有限公司 一种摄影装置和三维扫描设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002131031A (ja) * 2000-10-27 2002-05-09 Ricoh Co Ltd 三次元形状計測方法および三次元形状計測装置
WO2005096126A1 (ja) * 2004-03-31 2005-10-13 Brother Kogyo Kabushiki Kaisha 画像入出力装置
JP2006300531A (ja) * 2005-04-15 2006-11-02 Brother Ind Ltd 3次元形状測定装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6876392B1 (en) * 1998-12-22 2005-04-05 Matsushita Electric Industrial Co., Ltd. Rangefinder for obtaining information from a three-dimensional object
JP2004212385A (ja) * 2002-12-19 2004-07-29 Olympus Corp 撮影装置とその撮影装置の撮影方法及び制御方法
WO2005031253A1 (ja) * 2003-09-29 2005-04-07 Brother Kogyo Kabushiki Kaisha 3次元形状検出装置、撮像装置、及び、3次元形状検出プログラム

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002131031A (ja) * 2000-10-27 2002-05-09 Ricoh Co Ltd 三次元形状計測方法および三次元形状計測装置
WO2005096126A1 (ja) * 2004-03-31 2005-10-13 Brother Kogyo Kabushiki Kaisha 画像入出力装置
JP2006300531A (ja) * 2005-04-15 2006-11-02 Brother Ind Ltd 3次元形状測定装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11313676B2 (en) * 2018-02-07 2022-04-26 Omron Corporation Three-dimensional measurement apparatus, three-dimensional measurement method, and three-dimensional measurement non-transitory computer readable medium

Also Published As

Publication number Publication date
JP2007271530A (ja) 2007-10-18
US20090022367A1 (en) 2009-01-22

Similar Documents

Publication Publication Date Title
WO2007116744A1 (ja) 3次元形状検出装置及び3次元形状検出方法
US7812969B2 (en) Three-dimensional shape measuring apparatus
US7751066B2 (en) Projector and three-dimensional input apparatus using the same
WO2006112297A1 (ja) 3次元形状測定装置
US7627196B2 (en) Image processing device and image capturing device
JP2007256116A (ja) 3次元形状検出装置
JP6691837B2 (ja) 測定装置
JP6822230B2 (ja) 撮像装置および撮像方法
US6741279B1 (en) System and method for capturing document orientation information with a digital camera
JP6691838B2 (ja) 測定装置
JP2003078725A (ja) 画像入力装置
CA2654455A1 (en) Apparatus and method for determining characteristics of a light source
WO2005095887A1 (ja) 投影装置および3次元形状検出装置
JP2006267031A (ja) 3次元入力装置および3次元入力方法
JP7363068B2 (ja) 3次元情報取得システム
JP5850648B2 (ja) 撮像装置
JP4552485B2 (ja) 画像入出力装置
WO2007119396A1 (ja) 三次元情報測定装置
CN109741384B (zh) 深度相机的多距离检测装置及方法
WO2005122553A1 (ja) 画像入出力装置
JP2007212159A (ja) 3次元形状検出装置のキャリブレーションに用いる校正用治具及びそのキャリブレーション方法
JP2005352835A (ja) 画像入出力装置
JP4552484B2 (ja) 画像入出力装置
JP3554264B2 (ja) 3次元画像生成装置及び同方法
JP2006266957A (ja) 3次元入力装置

Legal Events

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

Ref document number: 07739854

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

Country of ref document: EP

Kind code of ref document: A1