Image measuring apparatus and non-temporary recording medium on which control program of same apparatus is recorded

An image measuring apparatus according to an embodiment of the present invention comprises: an imaging device that images a workpiece to acquire an image of this workpiece; and a processing device that performs measurement of the workpiece based on this image and outputs a measurement result. Moreover, the processing device, based on the above-described image, generates another image whose number-of-pixels is smaller than that of the image, sets a plurality of regions based on this another image, and calculates the above-described measurement result based on these plurality of regions.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is based upon and claims the benefit of Japanese Patent Application No. 2015-170616, filed on Aug. 31, 2015, the entire contents of which are incorporated herein by reference.

FIELD

The present invention relates to an image measuring apparatus that measures a workpiece by imaging the workpiece, and relates to a non-temporary recording medium on which a control program of the image measuring apparatus is recorded.

BACKGROUND

Description of the Related Art

A measuring apparatus that performs dimensional measurement or form measurement for a workpiece, is known. As an example of such a measuring apparatus, an image measuring apparatus comprising: an imaging device that images the workpiece to acquire an image of this workpiece; and a processing device that performs the likes of dimensional measurement or form measurement of the workpiece based on this image, is known (JP 2001-241941 A). In such measurement, the likes of a central position or a form, contour line, width, and so on, of a measurement target, for example, are calculated.

Sometimes, when, for example, the image measuring apparatus was employed to measure the workpiece, the likes of dimensional measurement or form measurement could not be preferably performed due to an effect of noise included in the image.

The present invention was made in view of such a point, and has an object of providing an image measuring apparatus capable of reducing noise in the image to preferably perform the likes of dimensional measurement or form measurement, and of providing a non-temporary recording medium on which a control program of the image measuring apparatus is recorded.

DETAILED DESCRIPTION

In order to solve the above-mentioned problem, an image measuring apparatus according to an embodiment of the present invention comprises: an imaging device that images a workpiece to acquire an image of this workpiece; and a processing device that performs the likes of dimensional measurement or form measurement of the workpiece based on this image and outputs a measurement result of the likes of a central position or a form, contour line, width, and so on, of a measurement target. Moreover, the processing device, based on the above-described image, generates another image whose number-of-pixels is smaller than that of the above-described image, sets a plurality of regions based on this another image, and calculates the above-described measurement result based on these plurality of regions.

For example, the above-described processing device may perform edge detection along a contour line of the above-described region to acquire an edge point group. In addition, the above-described processing device may exclude some of a plurality of edge points included in this edge point group. Moreover, the above-described processing device may set a plurality of respectively different numbers for the above-described plurality of regions.

A computer-readable non-temporary recording medium according to an embodiment of the present invention records a control program of an image measuring apparatus. The image measuring apparatus comprises: an imaging device that images a workpiece to acquire an image of the workpiece; and a processing device that performs the likes of dimensional measurement or form measurement of the workpiece based on this image and outputs a measurement result of the likes of a central position or a form, contour line, width, and so on, of a measurement target, and this control program controls the image measuring apparatus to perform calculation of the measurement result. Moreover, by this program, the processing device, based on the above-described image, generates another image whose number-of-pixels is smaller than that of the above-described image, sets a plurality of regions based on this another image, and calculates the above-described measurement result based on these plurality of regions.

The present invention makes it possible to provide an image measuring apparatus capable of preferably performing the likes of dimensional measurement or form measurement, and to provide a non-temporary recording medium on which a control program of the image measuring apparatus is recorded.

First Embodiment

First, a schematic configuration of an image measuring apparatus according to the present embodiment will be described with reference toFIG. 1.

As shown inFIG. 1, the image measuring apparatus according to the present embodiment comprises: an image measuring instrument1that comprises mutually orthogonal X, Y, and Z axes, and has a camera141mounted as an imaging device that images a workpiece3, at an extremity of this Z axis; and a computer (hereafter, called “PC”)2connected to this image measuring instrument1.

The image measuring instrument1is configured as follows. That is, a workstage12is mounted on a sample moving means11, so that an upper surface of the workstage12acting as a base surface coincides with a horizontal plane, and an X axis guide13cis supported by upper ends of arm support bodies13aand13berected from edges on both sides of the sample moving means11. The workstage12is driven in a Y axis direction by the sample moving means11. An imaging unit14is supported drivably in an X axis direction, in the X axis guide13c. The camera141is mounted drivably in a Z axis direction, at a lower end of the imaging unit14.

Note that the present embodiment adopts a system where the workpiece3disposed on the workstage12is imaged, but another system is of course possible, for example, a system of the kind where a workpiece disposed on a floor is imaged from a lateral direction, is possible. In addition, various kinds of cameras such as CCD and CMOS are usable as the camera141. Moreover, an image probe attachable/detachable to/from the image measuring instrument1may also be adopted as the camera141.

The PC2comprises: a processing device22; and a display device21and input device23that are connected to this processing device22. The processing device22comprises internally a CPU and a storage device such as a hard disk or the like. The display device21is the likes of a display or projector, for example. The input device23is an operation input device into which an operation of a measurer is inputted, and is, for example, a mouse, a keyboard, a touch panel, or the like.

Next, a picture displayed on a screen of the display device21will be described with reference toFIG. 2.

As shown inFIG. 2, an image of the workpiece3acquired by the camera141(hereafter, notated as image i3in the drawings) is displayed on the screen of the display device21. In the example shown inFIG. 2, the workpiece3includes a measurement target31.

Next, a configuration of the processing device22according to the present embodiment will be described in more detail with reference toFIG. 3.

As shown inFIG. 3, in the image measuring apparatus according to the present embodiment, the camera141images the workpiece3and acquires an image of the workpiece3. Moreover, this image is transferred to the display device21via the processing device22. Moreover, the processing device22receives an operation of the measurer via the input device23, and performs measurement (dimensional measurement or form measurement, and so on) of the workpiece3based on operation. For example, the processing device22extracts a portion representing a measurement target from within the image, and calculates a value related to position such as a centroid, or a value related to form such as a contour line, width, and so on, for this measurement target.

As shown inFIG. 3, the processing device22achieves a function described below by a CPU, a memory and a program stored in the likes of a hard disk (a storage device24). That is, a segmentation unit221performs segmentation processing on the image of the workpiece3. For example, as shown inFIG. 7, the segmentation unit221performs segmentation processing in the image to segment this image into a plurality of regions (segments), and outputs these plurality of regions. An edge detection unit222, as shown inFIGS. 8 and 9, for example, performs edge detection on a contour line of the outputted region, and acquires an edge point group including a plurality of edge points. An outlier removing unit223, as shown inFIG. 10, for example, removes some of the plurality of edge points judging them to be outliers, and acquires the remainder as a selected edge point group. A measurement result acquiring unit224acquires the measurement result, based on this selected edge point group.

Next, an operation of the image measuring apparatus according to the present embodiment will be described with reference toFIGS. 4 to 11.

As shown inFIGS. 4 to 7, in step S101, segmentation processing is performed on the image of the workpiece3. The segmentation processing may be performed in a variety of modes, but, hereafter, a method employing an image pyramid will be exemplified. Note that the image pyramid refers to a set of identical images whose resolutions (numbers-of-pixels) are different, like that shown inFIG. 5, for example.

As shown inFIG. 5, in step S101, for example, the image pyramid is generated based on the image of the workpiece3. For example, as shown inFIG. 5, when the image of the workpiece3is an image of n pixels, tones of pixels adjacent in an up-and-down and right-and-left manner, for example, are averaged to generate an image whose number-of-pixels is smaller than that of a first image. Next, a similar processing is performed also on this generated image, and an image whose number-of-pixels is even smaller is generated. Similarly thereafter, images are sequentially generated so that a newly generated image becomes one whose number-of-pixels is smaller than that of its predecessor image, and the image pyramid is generated. Next, an image of k (<n) pixels is selected from the plurality of images included in this image pyramid.

In addition, as shown inFIGS. 6 and 7, in step S101, for example, a plurality of regions are set in this selected image of k pixels. Setting of the regions may be performed in a variety of modes, but in the example shown inFIG. 6, setting of the regions is performed such that one portion including pixels whose density levels (tone) are higher than a threshold value Th and another portion including pixels whose density levels (tone) are lower than the threshold value Th are segmented to different regions. Note that when setting the regions according to the density level (tone) of each pixel, it is also possible for a plurality of threshold values Th to be set. Moreover, it is also possible to determine the likes of a rough position of each region based on the above-described image of k pixels, and determine in detail a boundary of each region based on the image of n pixels acquired by the camera141.

As shown inFIGS. 4, 8, and 9, in step S102, edge detection is performed on at least one of the plurality of regions acquired in step S101, and a plurality of edge points are acquired. The edge detection may be performed in a variety of modes, but in the example shown inFIG. 8, an edge detection-dedicated tool t is used. The edge detection-dedicated tool t exemplified inFIG. 8includes four boxes b, and each box b has a rectangular form extending along a contour line of the region corresponding to the measurement target31. Moreover, in each box b, a plurality of line segments1each extending in a transverse direction of the box b are provided along a longitudinal direction of the box b. In the edge detection, as shown inFIG. 8, each box b is superimposed on the contour of the measurement target31, and a pixel having a largest change (gradient) of density level along the line segment1in the box b is acquired as the edge point.

As shown inFIGS. 4 and 10, in step S103, outlier detection is performed to remove outliers from the plurality of edge points shown inFIG. 9, and acquire selected edge points. The outlier detection may be performed in a variety of modes, but, for example, it is possible to set an approximate straight line (approximate curve) in the plurality of edge points acquired in step S102, calculate a distance from this approximate straight line (approximate curve) to each edge point, and judge the outliers based on a mean value and a variance of the calculated distances.

As shown inFIGS. 4 and 11, in step S104, a result of measurement is acquired based on the plurality of selected edge points acquired in step S103, for example. In step S104, a variety of values, such as a centroid or a contour line, a width, and so on, of a measurement target (for example, the measurement target31), can be calculated.

Now, in a conventional image measuring apparatus, when edge detection was performed directly on the image acquired by the camera141, sometimes, as shown inFIG. 12, many points distant from the contour of the measurement target31ended up being calculated as edge points, due to an effect of noise included in the image. When outlier detection was performed on such an image, sometimes, as shown inFIG. 13, many edge points ended up being removed and precision of measurement was affected.

In view of such a point, in the conventional image measuring apparatus, sometimes, image processing such as filtering was performed beforehand on the image acquired by the camera141, and noise in the image was reduced, after which edge detection was performed. Sometimes employed in such filtering was, for example, an image filter, such as a median filter, an averaging filter, a Gaussian filter, or a morphology filter. However, even when image processing such as filtering was performed in this way, sometimes, as shown inFIG. 14, many points distant from the contour of the measurement target31ended up being calculated as edge points. Therefore, even when outlier detection was performed on such an image, sometimes, as shown inFIG. 15, many edge points ended up being removed and precision of measurement was affected.

In contrast with such cases, in the first embodiment, segmentation processing is performed on the image acquired by the camera141to segment the image into a plurality of regions (refer toFIG. 7), edge detection is performed on at least some of these plurality of regions (refer toFIG. 8), outlier detection is performed on the plurality of edge points acquired by this edge detection (refer toFIG. 10), and the measurement result is acquired based on a result of the outlier detection (refer toFIG. 11). Therefore, it is possible to preferably reduce noise close to the contour of the measurement target31as shown inFIG. 7, and to preferably acquire a large number of edge points on the contour of the measurement target31as shown inFIG. 9. Moreover, it is possible to further reduce the number of edge points removed in the outlier detection, compared to in the above-mentioned cases.

Note that in the example described with reference toFIGS. 4 to 11, segmentation processing was performed using the image pyramid. That is, a rough position, and so on, of each region was determined based on an image whose number-of-pixels was smaller than that of the image acquired by the camera141. Now, in the image whose number-of-pixels is small, noise included in its predecessor image is significantly reduced. Therefore, by determining the rough position, and so on, of each region based on this image, it is possible to determine a contour of each region while reducing an effect of noise close to the contour of the measurement target31.

Moreover, as mentioned above, in the above-described segmentation processing, it is also possible to determine the likes of the rough position of each region based on the above-described image of k pixels, and determine in detail the boundary of each region based on the image of n pixels acquired by the camera141. In such a case, the contour of the above-described region can be determined based on the image of n pixels, hence a detailed measurement can be performed while reducing noise. Note that it is also possible to perform a high speed rough processing by calculating the measurement result based on the image of k pixels.

Second Embodiment

Next, an image measuring apparatus according to a second embodiment of the present invention will be described with reference toFIGS. 16 and 17. Note that in the description below, portions similar to those of the first embodiment will be assigned with identical reference symbols to those assigned in the first embodiment, and descriptions thereof will be omitted.

The image measuring apparatus according to the present embodiment is basically configured similarly to that of the first embodiment, but in the present embodiment, as shown inFIG. 16, after performing the segmentation processing, different numbers are assigned to each region. For example, a region R1inFIG. 16is assigned with the number “1”, and a region R2inFIG. 16is assigned with the number “2”. Moreover, subsequently, as shown inFIG. 17, a region R3corresponding to the measurement target31is extracted, and the measurement result is acquired based on this extracted region.

In the present embodiment, as shown inFIG. 16, regions R6and R7corresponding to noise portions are assigned with different numbers from the region R3corresponding to the measurement target31. Therefore, at a time point when the region R3corresponding to the measurement target31is extracted, noise close to the contour of the measurement target31can be preferably reduced.

Note that in the present embodiment, it is also possible for the extracted region R3to undergo processing of the likes of edge detection and outlier detection similarly to in the first embodiment and for the measurement result to be acquired based on a result of that processing. Moreover, the measurement result may also be acquired by performing another processing.

In addition, sometimes, as shown inFIG. 16, the regions R6and R7corresponding to noise portions have smaller areas compared to another region. Therefore, it is also possible that when, for example, after a threshold value has been set beforehand for area of a region and different numbers have been assigned to each region, there exist regions R6and R7of the kind where area is less than or equal to the threshold value, these regions R6and R7are judged to be regions corresponding to noise components and are excluded during calculation of the measurement result.

Other Embodiments

In the first embodiment, the likes of edge detection or outlier detection were performed, but it is also possible for these processings to be omitted or replaced by another processing. Moreover, it is also possible for these processings to be performed in combination with the above-described image processing such as filtering.

Moreover, the present invention, in addition to being able to be applied in the case of using the three-dimensional image measuring instrument in which the camera141is configured to be drivable in the Z axis direction and which is capable of measuring a coordinate in the Z axis direction, may be applied also in the case of using a two-dimensional image measuring instrument or a microscope having an image measuring function.