1. Technical Field
The present invention relates to a technique of measuring a three-dimensional shape of a surface of a measuring target.
2. Related Art
There is known a technique of measuring a surface shape (three-dimensional shape) of a measuring target by analyzing an image of the measuring target taken by a camera. As to a technique of measuring the surface shape of a mirror surface object, for example, there is a method, in which plural pieces of lighting having different features are used to take images of the mirror surface object with light reflected from the mirror surface and a normal direction of the object surface is calculated from the images (for example, see Japanese Patent No. 3553652). When the normals are obtained at a plurality of points on the object surface, the three-dimensional shape of the object surface can be restored by converting the normals into gradients to integrate the gradients (for example, see Japanese Unexamined Patent Publication No. 3-218407). As to a technique of measuring the surface shape of a diffusing object, there is a method, in which a fringe pattern is projected to the object to analyze a pattern deformation generated according to irregularity of the object surface, thereby analyzing the three-dimensional shape of the object surface. An optical cutting method, a phase shift method, and a fringe analysis method are known as typical examples of the technique of measuring the surface shape of the diffusing object (for example, see Japanese Unexamined Patent Publication Nos. 2002-286433 and 2007-196193).
In the field of an automatic measuring apparatus or an automatic inspection apparatus, there is a need to accurately measure the surface shape of the mirror surface object such as metal. For example, in soldering inspection of a board appearance inspection apparatus, there is a demand to correctly recognize the three-dimensional shape in the soldering portion in order to detect contact failure between a land and a chip or existence of a short circuit without error.
In the methods disclosed in Japanese Patent No. 3553652 and Japanese Unexamined Patent Publication No. 3-218407, since a distance in a depth direction (Z-direction) of a camera (that is, a distance between the camera and the object surface) cannot be measured although the surface shape of the object can be restored, a Z-direction position (height) cannot be specified in a three-dimensional space of the restored surface shape. For example, for the soldering inspection, when the height is unknown in the soldering portion, there is a risk of not correctly inspecting excess or deficiency of a soldering amount or existence of a gap between the soldering and the land. On the other hand, in the methods disclosed in Japanese Unexamined Patent Publication Nos. 2002-286433 and 2007-196193, although the Z-direction position (height) of the object surface can be measured, the methods are not suitable for the measurement of the mirror surface object. This is because, for the object having strong mirror surface reflection, reflected light intensity of the projection pattern varies depending on a reflectance property of the object surface so that the measurement accuracy is not stabilized, and the surface shape cannot be correctly restored.
One or more embodiments of the present invention provides a technique of accurately measuring a three-dimensional shape and a spatial position of a mirror surface object.
According to one or more embodiments of the present invention, the three-dimensional shape and spatial position of the measuring target are determined by combining the three-dimensional shape of the object surface, which is restored by normal calculation, and information on height (a distance from a reference position) of the object surface, which is obtained by a ranging function.
Specifically, one or more embodiments of the present invention provides a shape measuring apparatus that measures a three-dimensional shape of a measuring target, the apparatus including: a lighting device that irradiates the measuring target placed on a stage with light; an imaging device that takes an image of the measuring target; a shape calculating device that calculates orientations of normals at a plurality of points on a surface of the measuring target from an image, the image being obtained by performing imaging with the imaging device while the lighting device irradiates the measuring target with the light, the shape calculating device calculating the three-dimensional shape of the surface of the measuring target from the calculation result of the orientations of the normals; a ranging device that measures a distance from a predetermined reference position with respect to at least one point on the surface of the measuring target; and a determination device that determines a spatial position of the three-dimensional shape of the surface of the measuring target, the three-dimensional shape being obtained by the shape calculating device using information on the distance obtained by the ranging device.
According to such a configuration, the three-dimensional shape of the mirror surface object surface can be accurately restored by the normal calculation. Moreover, the spatial position of the restored three-dimensional shape can be determined by using the distance information obtained with the ranging device, so that not only the three-dimensional shape of the measuring target but also the spatial position of the measuring target can be easily and accurately measured.
According to one or more embodiments of the present invention, the ranging device includes a projection device that projects a fringe pattern or a lattice pattern to the measuring target, and the ranging device calculates the distance of the point on the surface of the measuring target by analyzing the image of the measuring target, the image of the measuring target being taken while the fringe pattern or the lattice pattern is projected. In one or more embodiments of the present invention, since the three-dimensional shape is measured by the image analysis, the image analysis technique is also adopted for the ranging, which allows the effects such as simplification and miniaturization of the apparatus configuration to be obtained by the sharing of the hardware.
According to one or more embodiments of the present invention, the imaging device also acts as a device with which the ranging device takes an image for ranging. That is, the observation system (imaging device) is shared by the shape measurement and the ranging. Therefore, the alignment between image coordinates of the shape measurement result and the ranging result can be eliminated to simplify processing and improve accuracy.
According to one or more embodiments of the present invention, the lighting device is a surface light source including a light emission region having a predetermined size, and pieces of light emitted from positions in the light emission region differ from each other in a spectral distribution. By using such a lighting device, the three-dimensional shape of the measuring target can be determined by only one-time measurement (lighting and image taking), and therefore the measuring time can be shortened.
According to one or more embodiments of the present invention, the lighting device is the surface light source that emits light in which a plurality of different lighting patterns are overlapped with each other or sequentially emits the plurality of lighting patterns, and each of the lighting patterns is set such that emission intensity changes linearly with respect to an angle around a central axis, a specific straight line that is parallel to the stage to pass through a point at which the measuring target is placed being defined as the central axis. By using such a lighting device, accurate measurement can be performed even if the object has the uneven reflectance property or rough surface. Occasionally the exact linearity is hardly realized due to a structural design factor. In such cases, the linearity may substantially be realized. That is, in one or more embodiments of the invention, “emission intensity changes linearly” means a concept including “emission intensity changes substantially linearly”.
One or more embodiments of the invention can be recognized as a shape measuring apparatus including at least part of the device. One or more embodiments of the invention can be recognized as a shape measuring method including at least part of the processing or a program realizing the method. One or more embodiments of the invention can be made by combining the devices and the pieces of processing as much as possible.
According to one or more embodiments of the invention, the three-dimensional shape and the spatial position of the mirror surface object can be accurately measured. Further, the three-dimensional shape and the spatial position can be accurately measured for only the mirror surface object, only the diffusing object, or the object in which the mirror surface object and diffusing object are mixed.
In embodiments of the invention, numerous specific details are set forth in order to provide a more thorough understanding of the invention. However, it will be apparent to one of ordinary skill in the art that the invention may be practiced without these specific details. In other instances, well-known features have not been described in detail to avoid obscuring the invention. Embodiments of the present invention will be described below with reference to the drawings. A shape measuring apparatus according to an embodiment of the invention performs three-dimensional measurement of a mirror surface object by means of image analysis. The shape measuring apparatus according to one or more embodiments of the present invention can be applied to object recognition in various fields such as an automatic measuring apparatus, an automatic inspection apparatus, and robot vision. For example, the shape measuring apparatus can be applied to a soldering inspection in a board appearance inspection apparatus (AOI system) and an irregularity inspection of a surface of a metal-working product.
<Entire Configuration of Measuring Apparatus>
An entire configuration of the shape measuring apparatus according to one or more embodiments of the present invention will be described with reference to
The shape measuring apparatus roughly includes a measurement stage 5, an inspection head H, and an information processing device 6. A lighting device 3, a projector 2, and a camera (image sensor) 1 are attached to the inspection head H. The lighting device 3 irradiates a measuring target 4 placed on the measurement stage 5 with measuring light. The projector 2 projects a specific fringe pattern to a surface of the measuring target 4. The camera 1 takes an image of the measuring target 4 from vertically above. The information processing device 6 includes a CPU (Central Processing Unit) 60, a memory 61, a storage device 62, an inspection head control unit 63, an image input unit 64, a projector control unit 65, a lighting device control unit 66, a stage control unit 67, a user I/F 68, and a display unit 69. The inspection head control unit 63 has a function of controlling movement of the inspection head H in a Z-direction (a direction perpendicular to the measurement stage 5), and the stage control unit 67 has a function of controlling movement of the measurement stage 5 in an XY-direction. The projector control unit 65 has a function of controlling lighting and lights-out or a change of a projection pattern of the projector 2. The lighting device control unit 66 has a function of controlling the lighting and lights-out of the lighting device 3 (and a change of a lighting pattern as the need arises). The image input unit 64 has a function of capturing a digital image from the camera 1. The user I/F 68 is an input device that is operated by a user. Examples of the user I/F 68 include a pointing device, a touch panel, and a keyboard. Measurement result is displayed on a screen of the display unit 69. For example, the display unit 69 is formed by a liquid crystal display.
The shape measuring apparatus according to one or more embodiments of the present invention has two measuring functions, that is, “shape measurement” and “ranging”. One of the features of the shape measuring apparatus according to one or more embodiments of the present invention is that the three-dimensional shape and spatial position of the measuring target 4 are simply and accurately determined by combining the three-dimensional shape of the object surface, which is obtained by the shape measuring function, and the distance (height) information on the object surface, which is obtained by the ranging function. In this case, the shape measuring function is formed by the lighting device 3, the camera 1, and the information processing device 6, and the ranging function is formed by the projector 2, the camera 1, and the information processing device 6. That is, in the two measuring functions, although the different light sources are used, the identical observation system (camera 1) is used to measure the light reflected from the measuring target 4.
During the measurement, the inspection head H and the measurement stage 5 move relatively, and the measuring target 4 is positioned at a predetermined measurement position (in the example of
<Shape Measurement>
The shape measuring function is a function of measuring the three-dimensional shape of the measuring target surface. In this case, the following method of measuring a normal of the object surface using structured lighting to restore a surface shape is adopted, because a mirror surface object such as metal becomes the measuring target.
(Lighting Device)
The lighting device 3 is a surface light source having a dome shape as shown in
According to one or more embodiments of the present invention, the light emission region of the lighting device 3 is formed into the hemispherical dome shape such that the measuring target 4 is irradiated with light from all directions. Therefore, the normals in all directions can be measured. However, the light emission region may be formed into any shape as long as the measuring target 4 is irradiated with light from a position corresponding to a normal direction of the measuring target. For example, when the orientation of the normal to the surface is substantially limited to a vertical direction, it is not necessary to irradiate the measuring target 4 with light from a horizontal direction (a shallow angle direction).
The light emission is set such that pieces of light having different spectral distributions are emitted at all positions in the light emission region of the lighting device 3. For example, when the light emission is realized by combining three color light components of red light (R), green light (G), and blue light (B), emission intensity of each RGB component is changed in a different direction on the dome as shown in
The surface shape (the orientation of the normal) of the measuring target can be measured from only one image by utilizing the lighting device having the above-described light source distribution (lighting pattern). This will be described with reference to
(Normal Calculation and Shape Restoration)
A function and a processing flow, which are related to the shape measurement, will be described below with reference to
The CPU 60 captures the image for shape measurement through the image input unit 64 and calculates a feature quantity related to a spectral component of the reflected light from the image for shape measurement in each pixel of the measuring target portion (step S10). In one or more embodiments of the present invention, a ratio of the RGB components is used as the feature quantity because the lighting device 3 projects light in which three pieces of component light of the red light (R), green light (G), and blue light (B) are combined. For example, the maximum luminance is normalized by 1 in each of the RGB components, and the combination of (R, G, B) can be used as the feature quantity. Alternatively, a ratio of a certain color (in this case, G) to another color, for example, R/(R+G) or B/(B+G) may be used as the feature quantity.
As described above, the color of the measuring target 4, that is, the feature quantity calculated in step S10 and the orientation of the normal are correlated with each other one-to-one. A table describing a correlation of the orientation of the normal and a value of the feature quantity is stored in the storage device 62 of the information processing device 6. An image of an object such as a sphere whose shape is already known is taken by the lighting device 3 and the camera 1 to previously check the correlation of the normal and the feature quantity, which allows the table to be produced. For example, when a spherical object is used, the position from the center of the pixel of interest can be checked to determine the orientation of the normal by calculation. Then the correlation of the orientation of the normal and the feature quantity can be checked by computing the feature quantity at the position.
A correlation of the normal and the RGB values, a correlation of the direction (the zenith angle and the azimuth angle) of the incident light and the feature quantity value, or a correlation of the direction of the incident light and the RGB values may be described in the table instead of the correlation of the normal and the feature quantity. Alternatively, when the relationship between the orientation of the normal and the spectral distribution taken by the camera 1 can be formulated from a geometric disposition or the like, the normal may be calculated using the formulated equation.
The CPU 60 calculates the orientation of the normal at each point on the surface of the measuring target 4 from the table and the feature quantity calculated from the input image (step S11). A part (a) of
The CPU 60 converts the normals of the points obtained in step S11 into gradients and connects the gradients to restore the three-dimensional shape (step S12). The processing in steps S10 to S12 are referred to as “integration”. A part (b) of
<Ranging>
The ranging function is used to measure the height (the distance from a predetermined reference position) of the measuring target surface. In this case, the height information on the point on the measuring target surface is obtained by utilizing the phase shift method.
The phase shift method is one of techniques, in which the fringe pattern is projected to the measuring target surface to analyze a pattern deformation caused by irregularity of the surface, thereby performing the three-dimensional measurement of the surface. Specifically, in the phase shift method, the processing of taking the image of the object surface while projecting the fringe pattern whose luminance changes in a sine-wave manner to the object surface is repeated a plurality of times while a phase of a change in luminance changes, thereby obtaining a plurality of images that differ from one another in brightness. Because the brightness (density value) of the identical pixel of each image changes similarly in a period identical to that of the change of the fringe pattern, the phase of each pixel can be obtained by applying the sine wave to the change in brightness of each pixel. The distance (height) can be calculated from a reference position by determining a phase difference with a phase of a predetermined reference position (such as a measurement table surface and a board surface).
As described above, the phase shift method is not suitable to the three-dimensional measurement of the mirror surface object in principle. However, in the actual mirror surface object, a diffuse reflection component is slightly included in the reflected light, or a surface oriented toward a regular reflection direction exists. Therefore, few points at which the height can be accurately measured exist. In one or more embodiments of the present invention, because the three-dimensional shape of the measuring target 4 is obtained by the normal integration, it is only necessary to accurately obtain the height information on at least one point (preferably a plurality of points) on the object surface in the ranging. For such a purpose, the phase shift method can be sufficiently used practically.
A function related to the ranging and a processing flow will be described below with reference to
The CPU 60 captures the image for ranging through the image input unit 64 (step S20). In this case, four images are obtained while the phase of the fringe pattern is deviated by π/2. The CPU 60 determines the phase of each pixel by applying the sine wave to the change in brightness of each pixel (step S21). A part (c) of
<Determination of Spatial Position>
When the restored shape of the measuring target 4 and the ranging result are obtained through the processing described above, a spatial position (height) of the restored shape is determined by combining the restored shape and the ranging results. Specifically, the CPU 60 performs processing of selecting the ranging result (height information) having high reliability from the ranging results of all the pixels (step S30). A score indicating a degree of matching between a curve of the change in brightness of the pixel and the sine wave can be used as an evaluation index of the reliability. The score is a value determined when the sine wave that is best matched with the change in brightness of the pixel is searched in step S21. In this case, only the ranging result of the pixel whose reliability value is higher than a predetermined threshold is selected. A part (e) of
The CPU 60 positions the restored shape of the measuring target 4 using the ranging result (height information) obtained in step S30 (step S31). In this case, a Z-direction position of the restored shape that best fits the ranging result is determined by the least square method. Therefore, as shown in a part (f) of
In one or more embodiments of the present invention, the ranging result (height information) is selected based on reliability. However, the selection is not necessary when the practically trouble-free accuracy is obtained even if the positioning of the three-dimensional shape is performed based on all the ranging results, or when the ranging result has the low score. When the selection is performed, the evaluation index is not limited to those described above, but any evaluation index may be used.
According to shape measuring apparatus according to one or more embodiments of the present invention, the height information determined by the ranging is combined with the restored shape determined by the shape measurement, which allows the three-dimensional shape and spatial position of the mirror surface object surface to be accurately measured. The observation system (camera) is shared by the ranging and the shape measurement, so that the positioning of an XY coordinate (image coordinate) between the shape measurement result and the ranging result can be advantageously eliminated. When different observation systems are used in the ranging and the shape measurement, it is necessary to specify that the height information obtained by the ranging expresses the height at which point of the surface shape obtained by the shape measurement, and it is difficult to accurately perform the position identifying processing. Accordingly, one or more embodiments of the present invention, the alignment between the shape measurement result and the ranging result can be eliminated from the standpoints of simplifying the processing and improving the accuracy. Further, the sharing of the observation system also contributes to the miniaturization and cost reduction of the apparatus.
The lighting device 3 in which the pieces of light having the different spectral distributions are incident in all the incidence angle directions is used as the lighting of the shape measurement, so that the orientation of the normal to the measuring target 4 can be determined from only one image with respect to the zenith angle component and the azimuth angle component. The image is taken only once, and the orientation of the normal is calculated by checking the table in which the correlation between the normal and the feature quantity is stored, so that the surface shape of the measuring target 4 can be simply measured (at high speed).
When an image of a diffusing object (object whose reflectance property has a Lambertian property) is taken, the pieces of incident light from various directions are mixed in the image. In one or more embodiments of the present invention, in the light emission region of the lighting device 3, the three pieces of RGB component light are changed in equal directions (120 degrees with respect to one another) as shown in
The measurement is accurately performed by utilizing the lighting device 3 even if the target has the uneven reflectance property. This will be described below. As shown in
Due to the spread of the mirror surface lobe, the luminance value in the taken image is influenced by not only the light from the light emission region (the region R in
In such cases, if the lighting is performed such that the light from the surrounding region is just canceled to keep the spectral property similarly to that of the perfect mirror surface, the object having the uneven reflectance property or the object having the rough surface can be measured similarly to the object having the perfect mirror surface. In order to realize the measurement of the object having the uneven reflectance property or the object having the rough surface, in principle a light source distribution (lighting pattern) of the lighting device 3 is set as follows.
Specifically, as shown in
∫∫ΩLi(p,θi,φi)·f(p,θi,φi,θr,φr)sin θidθidφi=kfLi(p,θr,φr) [Equation 1]
where p is the measuring point on the object surface, (θi, φi) is the incident direction of the light source (θ is the zenith angle component and φ is the azimuth angle component, hereinafter the same), (θr, φr) is the reflection direction of the light of the light source (a visual-line direction of the camera), f is the reflectance property of the point p, Ω is a prospect solid angle of the mirror surface lobe in the reflectance property f, and kf is an attenuation ratio of the radiance (depending on the reflectance property of the object surface).
In the lighting device 3 according to one or more embodiments of the present invention, the emission intensity of each of the pieces of RGB component light is set so as to change linearly with respect to the angle (longitude) (see
The influence of the mirror surface lobe can be canceled by using such a lighting pattern, and this will be described from another standpoint with reference to
The above description is made in the direction in which the ideal effect is obtained. Although the linearity collapses in other directions not to be able to exactly cancel the influence of the diffusion reflection, the influence of the diffusion reflection can be removed within the practically trouble-free range.
<Modifications of Lighting Device>
The patterns, in which the emission intensity of each of the three RGB colors changes in each of the directions different by 120 degrees with respect to one another according to the angle are overlapped, is used in the lighting device according to one or more embodiments of the present invention. However, the lighting pattern is not limited thereto. For example, like the patterns in which the three colors change in the downward, rightward, and leftward directions as shown in
In one or more embodiments of the present invention, the three-dimensional shape of the target can be restored only by one-time measurement (lighting and image taking) using the lighting device in which the lighting patterns having the different color channels are overlapped. Alternatively, although the measuring time is lengthened compared with one or more embodiments of the present invention, the images are taken by sequentially lighting at least two kinds of the lighting patterns, and the three-dimensional shape may be restored using the obtained plurality of images. The same restoration result can also be obtained by this method. When the images are taken while the lighting patterns are switched, a plurality of monochrome lighting patterns having different luminance distributions can also be used as shown in
The lighting pattern in which the emission intensity changes linearly with respect to the angle in the longitude direction is used in one or more embodiments of the present invention. However, the lighting pattern is not limited thereto. For example, the lighting pattern in which the emission intensity changes linearly in the latitude direction is used as shown in
The shape of the lighting device 3 is not limited to the dome shape (hemispherical shape), but a plate shape as shown in
<Other Modification>
In one or more embodiments of the present invention, the ranging is performed by the phase shift method. Alternatively, any ranging method may be used as long as the height information on the object surface is obtained. Among others, a ranging method in which the height information is obtained by projecting the fringe or lattice pattern to the object to perform the image analysis of the pattern deformation is adopted from the standpoint of the sharing of the observation system (camera). This kind of ranging method includes, for example, an optical cutting method, a fringe analysis method, and the like. Needless to say, a ranging method other than the image analysis may be adopted. For example, a ranging sensor in which an X-ray, an infrared ray, or an ultrasonic wave is used may be used. In any method, when the height in at least one point can be specified on the object surface, the three-dimensional shape and position can be determined by combining the height information and the restored shape obtained by the normal integration.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this disclosure, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as disclosed herein. Accordingly, the scope of the invention should be limited only by the attached claims.
Number | Name | Date | Kind |
---|---|---|---|
5305092 | Mimura et al. | Apr 1994 | A |
5627771 | Makino | May 1997 | A |
6621921 | Matsugu et al. | Sep 2003 | B1 |
7106432 | Mapoles et al. | Sep 2006 | B1 |
7453456 | Petrov et al. | Nov 2008 | B2 |
7561164 | Baumberg | Jul 2009 | B2 |
7724379 | Kawasaki et al. | May 2010 | B2 |
20070150228 | Fukumoto et al. | Jun 2007 | A1 |
20080008399 | Marugame et al. | Jan 2008 | A1 |
20090116023 | Wadman | May 2009 | A1 |
20090262989 | Kozakaya | Oct 2009 | A1 |
20100182595 | Jang | Jul 2010 | A1 |
20110169948 | Ohtomo et al. | Jul 2011 | A1 |
Number | Date | Country |
---|---|---|
3218407 | Sep 1991 | JP |
3553652 | Mar 1996 | JP |
2002 286 433 | Oct 2002 | JP |
2007196193 | Aug 2007 | JP |
10-0585270 | May 2006 | KR |
Number | Date | Country | |
---|---|---|---|
20120086950 A1 | Apr 2012 | US |