Abstract:
An object dimension measuring apparatus consists of: a CCD camera mounted on an X- and a Y-axis table with its optical axis aligned with a Z-axis; a specimen table containing a light source and having its specimen mounting surface formed transparent; a light diffusion plate mounted on the specimen; and a computer. Using the CAD data, the computer moves the CCD camera. From the measured values obtained from the photographed images of the end portions of the specimen and from the distance traveled by the CCD camera, the computer calculates the dimensions of the specimen.

Description:
This application is a continuation of application Ser. No. 08/115,801, filed on Sep. 3, 1993, now abandoned, which is a continuation application of Ser. No. 07/839,556 filed Feb. 24, 1992, now abandoned. 
    
    
     FIELD OF THE INVENTION 
     This invention relates to an apparatus for measuring the dimensions of objects and more specifically to a high-precision object dimension measuring apparatus using CCD camera and CAD data. 
     BACKGROUND OF THE INVENTION 
     Long objects with certain cross-sectional shapes, such as square pipes and L-shaped materials of aluminum or aluminum alloy, are generally formed by extrusion. The quality of the extruded products depends on the quality of a die and particularly on the dimensions of an opening or gap in the die. 
     The dimensions of the opening in the die have conventionally been measured indirectly by measuring the cross-sectional dimensions of an extruded products. 
     However, indirect measurement of the dimensions of the die opening is not efficient and thus there is a demand for directly measuring the dimensions of the die opening. 
     Regardless whether the measurement is made directly of the die opening or alternatively of the extruded product, it is difficult to attain a high precision within a tolerance on the order of one-hundredth of a millimeter where the maximum cross-sectional dimension of the die opening or the extruded product exceeds about 600 mm. 
     Another known means of measuring the dimensions of an object is a CCD camera. If, for example, an image of an object 10 mm long is taken by a CCD camera and processed at the resolution of 256 picture elements or pixels, then the measuring precision of 10/256=0.039 mm per pixel is possible. When the same image is processed with 512 pixels, the accuracy improves to 0.019 mm per pixel. In this way, the use of the CCD camera and appropriate lens system assures high precision with which the dimensions of small objects can be measured. This, however, gives rise to a problem that if this high level of accuracy is maintained, objects longer than 10 mm cannot be measured accurately. For example, in measuring the dimensions of the cross section of a square pipe 300 mm on each side, if the entire image of the object being measured is displayed on one field of view of camera, the above level of measuring precision cannot be obtained. 
     SUMMARY OF THE INVENTION 
     The object of this invention is to provide an object dimension measuring apparatus which can measure with an accuracy of 1/100 mm the dimensions of an object too large to be taken in a single field of view of the CCD camera. 
     The object dimension measuring apparatus that achieves the above objective consists of: a CCD camera mounted to an X- and a Y-axis table with its optical axis aligned with a Z-axis; a specimen table incorporating a light source and having its specimen mounting surface formed of a transparent member; a light diffusion plate mounted on the specimen; and a computer. The computer further comprising: a control device for moving a field of view of the CCD camera by using CAD data; a coordinate detecting device for detecting coordinates of the CCD camera&#39;s field of view on the X- and Y-axis table; an image processing device for processing output signals from the CCD camera; an intensity reversing point detecting device for detecting intensity reversing points on the image produced by the image processing device; a coordinate calculation device for calculating the coordinates of the intensity reversing points on the image; and a calculation device for calculating the dimensions of the specimen from a distance traveled by the CCD camera and x, y coordinates of the image. 
     This configuration makes it possible to measure with an accuracy of 1/100 mm the dimensions of an object too large to be taken in a single field of view of the CCD camera. 
     Since an optical measurement is made, this configuration allows highly precise and efficient measurement of the dimensions of the interior of an object that can be seen from outside. Furthermore, since CAD data is used, the measurement can be done automatically. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a side view of the object dimension measuring apparatus according to this invention; 
     FIG. 2 is a diagram showing the process of making measurement of the dimensions of an object by the object dimension measuring apparatus of the invention; 
     FIG. 3 is a diagram showing the relationship between sample data and ρ and θ; 
     FIG. 4 is a diagram describing one sample data in the ρ-θ space; 
     FIG. 5 is a diagram describing all sample data in the ρ-θ space; and 
     FIG. 6 is a diagram describing in the x-y coordinates a straight line estimated from the graph of FIG. 5. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     One embodiment of the invention will be described by referring to the attached drawings. 
     Referring to FIG. 1, reference numeral 1 represents a dimension measuring apparatus, which has an L-shaped frame 6 erected on a base 4 on which a specimen table 2 is mounted. Under the upper portion of the frame 6 are arranged an X-axis table 12 and a Y-axis table 14. On the Y-axis table 14 is mounted a CCD camera 18 that has a lens 16 whose optical axis 10 is aligned with a Z-axis. 
     The specimen table 2 has a light source 20 installed therein and also a transparent plate 22 at the top, on which a specimen 24 is supported by a clamp not shown. A light diffusion plate 26 of semi-transparent material is placed on the specimen 24. The specimen 24 is a sample taken from aluminum extrusion products. When the light source 20 is turned on, a shadow 24&#39; of the cross section of the specimen 24 is projected onto the light diffusion plate 26. 
     Denoted 30 is a computer, which consists of: a control means 41 using CAD data for moving the field of view of the CCD camera; a coordinate detection means 41 for detecting the coordinates of the CCD camera&#39;s field of view on the X- and Y-axis table; an image processing means 42 for processing output signals from the CCD camera; a intensity reversing point detecting means 43 for detecting intensity reversing points on the image produced by the image processing means 42; a coordinate calculation means 44 for calculating the coordinates of the intensity reversing points on the image; and a calculation means 45 for determining the dimensions of the specimen from the distance traveled by the CCD camera and from the x and y coordinates of the image. 
     Next, the process of measuring the width L of the shadow 24&#39; of the specimen will be explained. If the pixel data from the CCD camera 18 in this embodiment is processed at the 480×512-pixel resolution, the accuracy of the measurement will be 5/480=0.0104 mm and 5/512=0.0098 mm per pixel. Numeral 41 represents a control means for shifting the view-field of CCD camera 18, and a detecting means for detecting the coordinate position of the view field of the CCD camera on an X-Y axis table. Numeral 42 is an image processing means for processing the output signal from CCD camera 18 to an image. Numeral 43 denotes detecting means for detecting intensity reversing points in the images obtained through the image processing means 42. Coordinate calculating means 44 is provided for calculating the coordinates of the intensity reversing points on the image, and calculating means 45 is provided for calculating the dimensions of a specimen based on the distance of movement of CCD camera 18 and the X-Y coordinates of the image. 
     As shown in FIG. 2, the field of view 28 of the CCD camera 18 is moved, according to the CAD data, until the upper left corner of the viewing field comes to a point O a  (X a , Y a ) on the X- and Y-axis table 12, 14. Then the left side portion of the shadow 24&#39; of the specimen is photographed. The photographed image is bright in the left part. Similarly, the upper left corner of the field of view 28 of the CCD camera 18 is moved to a point O b  (X b , Y b ) on the X- and Y-axis table 12, 14 to take a picture of the right side portion of the specimen&#39;s shadow 24&#39;. The photographed image is dark in the left part. 
     A means for detecting the distance traveled by the origins O a , O b  may employ various kinds of methods, such as one for converting the rotation of a ball screw into a distance signal by a rotary encoder, one for magnetically detecting the movement of a magnetic scale and converting it into pulse signals, or one for moving the X- and Y-axis table at a constant speed and reading the time traveled with a timer. This embodiment adopts the method of converting the rotation of the ball screw of X-Y table into the distance signal by the rotary encoder. That is, the coordinates of the origin O a  (X a , Y a ) and the origin O b  (X b , Y b ) are read and the coordinate detection circuit in the computer 30 calculates the distance traveled by the CCD camera 18, i.e., the distance L&#39; between the origins O a , O b . 
     The intensity level detection circuit sorts the intensity output from each image-processed pixel into one of 256 levels (0-255) and produces a binary output--a &#34;0&#34; (representing a dark point) when the intensity falls in the 0-99 range and a &#34;1&#34; when it falls in the 100-255 range--to identify the intensity of each image. This circuit also scans each pixel to output their coordinate signals of (x a , y a ) and (x b , y b ) along with the binary signals. (In the following, suffix is omitted when general explanations are given.) 
     The intensity reversing point detecting circuit, which employs, for example, the Hough transform technique, samples a plurality of x, y coordinate data for the intensity reversing points (in this embodiment 17 samples) and calculates the distance ρ of each sampled value from the origin O and its angle θ with respect to the x-axis according to a predetermined sequence. The principle of this process is explained by referring to FIG. 3. The y-axis in FIG. 3 is shown inverted with respect to the x-axis to present the ordinary x, y coordinates for better understanding. 
     It is easily seen from FIG. 2 and FIG. 3 that the relationship between ρ and θ is expressed as 
     
         ρ=x cos θ+y sin θ                          (1) 
    
     The plotted points in FIG. 3 represent the sample data of the intensity reversing points (or edge) on the specimen shadow 24&#39; and the broken line represents an edge line estimated from these data by the Hough transform technique. All the straight lines passing through the points (x i , y i ) (i=1-17) plotted in FIG. 3 each form a curve as shown in FIG. 4, when mapped in the θ-ρ space. When the locus is described for all candidate points (intensity reversing point data), FIG. 5 is obtained Then calculating the point (θ o , ρ o ) through which the greatest number of loci pass results in one straight line being determined, which is shown in FIG. 6 and given by 
     
         ρ.sub.o =x cos θ.sub.o +y sin θ.sub.o      (2) 
    
     Using this equation, it is possible to determine ρ a , ρ b  for the first coordinates (X a , Y a ) and the second coordinates (X b , Y b ) . That is, 
     
         ρ.sub.a =x.sub.a cos θ.sub.a +y.sub.a sin θ.sub.a (3) 
    
     
         ρ.sub.b =x.sub.b cos θ.sub.b +y.sub.b sin θ.sub.b (4) 
    
     Since the specimen 24 is rectangular in shape, θ a  =θ b . If we let L (see FIG. 2) stand for the distance the two straight lines (edges) and L&#39; for the distance between the origins O a  and O b , the width L of the specimen 24 can be obtained from the following equation (5). 
     
         L=L&#39;+ρ.sub.b -ρ.sub.a                              (5) 
    
     While the above description concerns the case of determining the distance between the parallel sides of the rectangular cross section of the specimen, it is possible to measure the dimensions of objects of complex shape by defining and programming an adequate calculation equation according to the shape of the specimen being measured. The minimum square method may also be used.