WO2018042580A1 - Image measurement method, image measurement program, image measurement device, and article production method - Google Patents

Image measurement method, image measurement program, image measurement device, and article production method Download PDF

Info

Publication number
WO2018042580A1
WO2018042580A1 PCT/JP2016/075580 JP2016075580W WO2018042580A1 WO 2018042580 A1 WO2018042580 A1 WO 2018042580A1 JP 2016075580 W JP2016075580 W JP 2016075580W WO 2018042580 A1 WO2018042580 A1 WO 2018042580A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
measurement
coordinate system
article
correction
Prior art date
Application number
PCT/JP2016/075580
Other languages
French (fr)
Japanese (ja)
Inventor
窪田純一
Original Assignee
株式会社ニコン
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社ニコン filed Critical 株式会社ニコン
Priority to PCT/JP2016/075580 priority Critical patent/WO2018042580A1/en
Priority to JP2018536604A priority patent/JP6822478B2/en
Publication of WO2018042580A1 publication Critical patent/WO2018042580A1/en

Links

Images

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

Definitions

  • the present invention relates to an image measurement method, an image measurement program, an image measurement device, and an article manufacturing method.
  • Patent Document 1 it is difficult to measure the image of the workpiece, and the measurement may fail or may not be performed accurately.
  • the present invention has been made in view of the above problems, and an image measurement method, an image measurement program, an image measurement apparatus, and an article capable of appropriately determining the quality of an article that can be easily measured. It aims at providing the manufacturing method of.
  • the image measurement method of the present invention includes selecting an image from images of different parts of the first article based on characteristics relating to the image, the selected image, and the selection of the second article. And positioning the second article based on the image of the portion corresponding to the image obtained, and measuring the image of the second article.
  • the method for manufacturing an article of the present invention includes: manufacturing an article; and performing image measurement using the image measurement method of the present invention with the article manufactured in the manufacturing as the second article. And determining the quality of the article based on the result of the image measurement.
  • the image measurement program of the present invention selects, on a computer, an image based on characteristics relating to the image from images of different parts of the first article, the selected image, and the second article. Is a program that executes alignment of the second article and image measurement of the second article based on the image of the portion corresponding to the selected image in the above.
  • the image measurement device of the present invention includes an image selection unit that selects an image from images of different parts of the first article based on characteristics relating to the image, the selected image, and the second article.
  • An alignment unit that performs alignment on the second article based on an image of a portion corresponding to the selected image, and an image measurement unit that measures an image of the second article.
  • the image measurement method, the image measurement program, and the image measurement apparatus according to the present invention have an effect that image measurement can be easily performed.
  • the method for manufacturing an article of the present invention has an effect that the quality of the article can be determined appropriately.
  • FIG. 1 is a diagram schematically illustrating a configuration of an image measurement device according to a first embodiment. It is a figure which shows a measurement item list. It is a block diagram (hardware structure) of a control unit. It is a detailed block diagram of CPU190.
  • FIG. 5A is a diagram showing the coordinate system DB
  • FIG. 5B is a diagram showing the image information DB. It is a figure for demonstrating a reference coordinate system, a measurement location, and the image for correction
  • FIGS. 7A and 7B are diagrams for explaining a rotation error between the reference coordinate system and the measurement coordinate system.
  • FIG. 8A and FIG. 8B are diagrams for explaining the correction of the measurement coordinate system. It is a flowchart which shows the process sequence of a control unit.
  • FIG. 19A and FIG. 19B are diagrams for explaining the coordinate system setting image DB. It is a flowchart which shows the flow of the specific process of the repeated measurement process concerning 2nd Embodiment.
  • FIG. 21A and FIG. 21B are diagrams for explaining step S414 in FIG.
  • FIG. 1 schematically shows the configuration of an image measuring apparatus 100 according to the first embodiment.
  • the image measurement device 100 includes a measurement device main body 1, a control unit 2, a display device 193, and an input device 195.
  • the measuring apparatus main body 1 includes a support 3, an XY stage 5 provided on the base 3 a of the support 3, and an imaging supported by the support 3 of the support 3 so as to be positioned above the XY stage 5. Part 6.
  • the XY stage 5 is a stage that moves in two orthogonal directions (X-axis and Y-axis directions) in a horizontal plane.
  • an article 7 (hereinafter referred to as a measurement object 7) such as an automobile part or a machine part is placed.
  • the measurement object 7 is illuminated by the transmission illumination optical system 8 provided on the base 3 a of the support 3 or the epi-illumination optical system 9 provided on the imaging unit 6.
  • a reference article used for creating a measurement program (described later) is placed on the upper surface of the XY stage 5 before the measurement object 7 is measured.
  • the XY stage 5 detects the coordinates of the XY stage 5 and moves the XY stage 5 in a two-dimensional direction based on a stage movement instruction from the control unit 2, and controls a signal representing the stage coordinate value.
  • a stage position detector (not shown) for outputting to the unit 2 is provided.
  • the XY stage drive unit 10 includes an X-axis motor and a Y-axis motor that drive the XY stage 5 in the X-axis and Y-axis directions, respectively.
  • the stage position detection unit includes an X-axis encoder and a Y-axis encoder that detect the positions of the XY stage 5 in the X-axis and Y-axis directions, respectively.
  • the imaging unit 6 includes an objective lens (not shown) that forms an image of light from the measurement object 7, an imaging optical system 12, and a measurement imaged by the imaging optical system 12. It has a CCD (Charge-Coupled Device) camera 13 that captures (receives) an image of the object 7 and outputs an electrical signal corresponding to the light intensity distribution of the captured image.
  • the imaging optical system 12 of the first embodiment is a variable magnification optical system.
  • the imaging optical system may not be a variable magnification optical system, but may be an optical system with a fixed magnification.
  • an autofocus mechanism (not shown) is provided in the vicinity of the imaging unit 6.
  • the autofocus mechanism is for automatically focusing on the measurement object 7 during image measurement.
  • This autofocus method a plurality of images are acquired by changing the relative distance between the imaging optical system 12 and the measuring object 7 in the Z-axis direction, and the position where the contrast of the image is maximized is determined as the in-focus position.
  • a passive method that calculates as the active method that irradiates the measurement object 7 with auxiliary light such as a laser diode or LED (Light Emitting Diode) light and knows the in-focus position from the displacement of the light spot position of the reflected light, etc. There is something called.
  • the autofocus mechanism can also measure the height of the measurement object 7 (measurement of the Z position) based on information obtained during autofocus.
  • the control unit 2 controls the operation of the measurement apparatus main body 1, captures an image of the measurement object 7, acquires the image, and displays the acquired image on the display device 193. Moreover, the control unit 2 measures each article using, for example, a plurality of articles manufactured in the same lot as a measurement object, and determines the quality of each article based on the measurement result (hereinafter referred to as repeated measurement). Execute. Note that the measurement object may not be an article manufactured in the same lot. For example, the measurement object may be an article that is manufactured in different lots and has a part of the same shape.
  • the control unit 2 determines the geometric shape included in the image of the measurement object 7 placed on the upper surface of the XY stage 5 (in other words, the contour of the measurement object 7 in the image).
  • the measurement is performed based on the contrast of the image, the measurement regarding the specified geometric shape is performed, and the information regarding the measured geometric shape is displayed on the display device 193.
  • the geometric shape means a geometric basic shape, and includes a circle, a straight line, a point, an arc, and the like.
  • the measurement related to the geometric shape means that the measurement related to the contour of the shape that approximates the geometric shape specified from the image of the measurement object 7 is performed.
  • FIG. 2 is a measurement item list exemplifying specific measurement items when measuring a geometric shape.
  • an outline in other words, a straight line
  • the angle of the specified outline from the X axis) Angle
  • straightness unit vector
  • unit vector start point coordinates
  • end point coordinates and the like.
  • the geometric shape in the image is specified by the following method.
  • the geometric shape in the image may not be specified by the following method, and may be specified by another existing method.
  • An average value of luminance values around a location (for example, a point) selected via the input device 195 on the image displayed on the display device 193 by the user is calculated, and an image is displayed using the calculated average value. Binarize.
  • the contrast based on the luminance value (signal intensity) of the pixel in the image of the measurement object 7 is calculated along a plurality of directions centering on the start point at the location selected by the user, Of the contrasts calculated for the direction, the direction with the highest contrast is determined as the scan direction, and the coordinates of the part where the contrast is the highest in that direction are detected and a part of the geometric shape (in other words, the measurement object in the image) 7).
  • contrast is calculated again along the scan direction of (2) at a position separated by a predetermined pitch in a direction different from the determined scan direction (for example, in a direction orthogonal to the scan direction).
  • the coordinates of the place where the maximum is detected is detected and specified as a part of the geometric shape (point on the contour).
  • (4) (3) is repeated until a part of the geometric shape (point on the contour) is not found, and a point sequence on the contour of the measurement object 7 is acquired. And based on the kind of geometric shape selected by the user, a geometric shape is specified from the acquired point sequence on the contour.
  • the control unit 2 uses, for example, a first article that is one of the measurement objects as a reference article, and repeatedly measures the measurement object 7 that is the second article using the reference article.
  • the measurement program refers to information on a reference coordinate system used for setting a coordinate system (referred to as a measurement coordinate system) to be used as a measurement reference in repeated measurement, and a location (measurement location) to be measured in repeated measurement.
  • a measurement coordinate system used for setting a coordinate system
  • a location measurement location
  • This is a program for storing information necessary for repeated measurement, such as an appropriate value of a measurement location (a reference value used for pass / fail judgment).
  • the reference coordinate system is an arbitrary coordinate system set by the user in an image obtained by imaging the reference article placed on the XY stage 5.
  • the reference coordinate system is a coordinate system that defines the position of each part of the reference article.
  • the reference coordinate system can be rephrased as a coordinate system that defines the position of a location (measurement location) where image measurement is performed by repeated measurement in the reference article.
  • the measurement coordinate system set when the measurement object 7 is placed on the XY stage 5 is a coordinate system that defines the position of each location of the measurement object 7 (that is, the measurement coordinate system is
  • the measurement object 7 can also be referred to as a coordinate system that defines the position of the location where the image is measured by repeated measurement).
  • the positional relationship between the measurement coordinate system and the measurement object 7 is the relationship between the reference coordinate system and the reference article. Corresponds to the positional relationship. Therefore, the reference coordinate system and the measurement coordinate system can be said to be coordinate systems having the same properties, but in this embodiment, for convenience of explanation, each coordinate system is referred to as a “reference coordinate system” and a “measurement coordinate system”. It shall be called with a different name.
  • the information on the reference coordinate system included in the measurement program includes the position coordinates of the origin of the reference coordinate system in the coordinate system of the XY stage 5 (so-called machine coordinate system, hereinafter referred to as the stage coordinate system), the reference coordinate system The rotation angle with respect to the stage coordinate system is included.
  • the control unit 2 sets the position and orientation of the measurement coordinate system so as to match the positional relationship between the reference coordinate system and the reference article and the positional relationship between the measurement coordinate system and the measurement object 7, and then repeatedly performs measurement. To do. In this way, the positional relationship between the reference coordinate system and the reference article and the positional relationship between the measurement coordinate system and the measurement object 7 are matched with the position coordinates in the reference coordinate system of the measurement location set using the reference article. This is to match the position coordinates in the measurement coordinate system of the image measurement target portion in the measurement object 7. Then, by combining these positional relationships, it is possible to perform image measurement of a desired location in the measurement object 7.
  • matching the positional relationship between the reference coordinate system and the reference article and the positional relationship between the measurement coordinate system and the measurement object 7 is not limited to a perfect match, but within an allowable error range (for example, This is a concept that includes a case where the maximum value of measurement errors that occur in repeated measurement is slightly inconsistent within a predetermined range.
  • the measurement location is measured using a measurement coordinate system set for each measurement object 7.
  • the reference article can be one of a plurality of articles manufactured in the same lot, but is not limited thereto.
  • the reference article may be an article manufactured in the same lot and confirmed to be a non-defective product.
  • the reference article may not be an article manufactured in the same lot.
  • the reference article is an article similar to a plurality of articles manufactured in the same lot, and the size, shape, and position of the geometric shape to be measured are the same. Or it may be a similar article.
  • FIG. 3 shows a block diagram (hardware configuration) of the control unit 2.
  • the control unit 2 includes a CPU (Central Processing Unit) 190, a ROM (Read Only Memory) 192, a RAM (Random Access Memory) 194, a storage unit (here HDD (Hard Disk Drive)) 196, And a portable storage medium drive 199 and the like.
  • Each component of the control unit 2 is connected to the bus 198.
  • the display device 193 includes a liquid crystal display and the like, and the input device 195 includes a controller, a keyboard, a mouse, and the like. Note that the input device 195 may be a touch panel display provided integrally with the display device 193.
  • the display device 193 and the input device 195 are connected to the bus 198 in FIG. 3 via an input / output interface (not shown).
  • FIG. 4 shows a detailed block diagram of the CPU 190.
  • the entire image DB 38, the coordinate system DB 40, the image information DB 42, and the measurement program DB 44 stored in the HDD 196 are also illustrated for convenience of illustration and description.
  • the control unit 2 includes a measurement program creation unit 20 and a repeated measurement unit 30. 4 functions as a program (including an image measurement program) stored in the ROM 192 or the HDD 196 by the CPU 190 or a program (image measurement) read from the portable storage medium 191 by the portable storage medium drive 199. (Including programs).
  • the measurement program creation unit 20 creates a measurement program using the reference article and stores it in the measurement program DB 44. As shown in FIG. 4, the measurement program creation unit 20 includes an entire image acquisition unit 22, a coordinate system setting unit 24, a preliminary measurement unit 26, and a measurement program storage unit 28.
  • the whole image acquisition unit 22 joins the images obtained by repeating the movement of the XY stage 5 and the imaging by the imaging unit 6 in a state where the reference article is placed on the XY stage 5, and the whole reference article is obtained. (Hereinafter referred to as an entire image).
  • the whole image created by joining together is also called a stitching image.
  • the entire image may not be an image obtained by connecting a plurality of images.
  • the entire image acquisition unit 22 acquires the position coordinates of the connected images on the stage coordinate system and stores them in the entire image DB 38 stored in the storage unit such as the HDD 196. Suppose you are. By referring to the entire image DB 38, the position coordinates of each point of the connected images can be specified.
  • the coordinate system setting unit 24 sets a coordinate system designated on the entire image by the user via the input device 195 as a reference coordinate system for image measurement.
  • the reference coordinate system is set for the entire image (reference article) on the stage coordinate system.
  • the user selects a position to be set as the origin of the reference coordinate system on the entire image, and sets the directions of two axes (X axis and Y axis) of the reference coordinate system (rotation angle in the stage coordinate system). input.
  • FIG. 6 is a diagram schematically showing a state in which the reference article is placed on the XY stage 5. In the first embodiment, as an example, it is assumed that the user sets the reference coordinate system at the lower left corner of the reference article shown in FIG.
  • the coordinate system setting unit 24 stores the position coordinates of the origin of the reference coordinate system (the coordinates of the stage coordinate system) and the rotation angle of the reference coordinate system (the rotation angle with respect to the stage coordinate system) in the coordinate system DB 40.
  • FIG. 5A shows an example of the data structure of the coordinate system DB 40.
  • coordinate values (a, b) in the stage coordinate system are stored as the coordinates of the origin of the reference coordinate system, and ⁇ ° is stored as the rotation angle of the reference coordinate system (rotation angle in the stage coordinate system).
  • ⁇ ° is stored as the rotation angle of the reference coordinate system (rotation angle in the stage coordinate system).
  • the reference coordinate system may be specified on the image of a part of the reference article obtained by connecting the images of the articles, or an image captured by the imaging unit 6 in a specific field of view, that is, an image captured of a part of the reference article.
  • the reference coordinate system may be designated.
  • the user issues an instruction to the XY stage driving unit 10 via the input device 195, moves the XY stage 5 to a desired position, and designates the reference coordinate system on the image captured by the imaging unit 6 at the position. It is good to do.
  • the preliminary measurement unit 26 sets the entire measurement point (that is, the geometric shape of the measurement target in the reference article) that the user wants to perform image measurement by repeated measurement in a state where the reference article is placed on the XY stage 5.
  • the measurement item at the specified measurement location is measured.
  • the measurement at the measurement location in the reference article is referred to as preliminary measurement.
  • an image capturing condition is set by the user.
  • the image capturing condition includes, for example, an illumination condition and a magnification condition.
  • the illumination condition means whether the above-described transmission illumination method using the transmission illumination optical system 8 or the epi-illumination method using the epi-illumination optical system 9 is used.
  • the magnification condition means the imaging magnification of the imaging optical system 12 included in the imaging unit 6, that is, the imaging magnification.
  • the magnification condition may be the lens magnification of the objective lens of the imaging unit 6, the magnification of the imaging optical system 12, and the lens magnification of the objective lens.
  • the user may select a measurement location not on the entire image but on an image obtained by capturing a part of the reference article.
  • the preliminary measurement unit 26 performs measurement of the geometric shape using a reference coordinate system stored in the coordinate system DB 40. That is, the preliminary measurement unit 26 performs the preliminary measurement with the coordinates of the origin of the reference coordinate system in FIG. 6 as (0, 0).
  • the preliminary measurement unit 26 uses the information of the preliminarily measured measurement locations, the measurement items, and the information of the measurement results as part of the measurement program.
  • the preliminary measurement unit 26 after performing the preliminary measurement of the measurement location on the reference article, captures an image including the measurement location (referred to as a correction image) while maintaining the illumination condition and the magnification condition at the time of the preliminary measurement.
  • the corrected image is stored in the image information DB 42 (see FIG. 5B).
  • the correction image is an image used in the repeated measurement unit 30 described later. For example, as shown in FIG. 6, when the measurement points (straight line, arc (semicircle), arc (1/4 circle)) indicated by bold lines are measured, the preliminary measurement unit 26 An image is captured in a state where the representative point (for example, the center and the center of gravity) and the center of the field of view of the imaging unit 6 are matched.
  • images P1, P2, and P3 indicated by broken line rectangles are acquired as correction images.
  • the preliminary measurement unit 26 acquires a coordinate value in the reference coordinate system (for example, the center coordinate of the image in the reference coordinate system) when the correction image is acquired, and stores the acquired coordinate value in the image information DB 42. Further, the preliminary measurement unit 26 stores the illumination condition and magnification condition at the time of preliminary measurement (when the correction image is captured) and information on the shape measured in the preliminary measurement in the image information DB 42. Further, the preliminary measurement unit 26 uses the distance between the center coordinates of the correction image in the reference coordinate system and the origin of the reference coordinate system as information indicating the position of the image based on the reference coordinate value (that is, the origin of the reference coordinate system).
  • the information indicating the distance between the correction images are calculated and stored in the image information DB 42, and the illumination condition and the magnification condition when the correction image is acquired are also stored in the image information DB 42.
  • the information indicating the distance between the origin of the reference coordinate system and the correction image is not necessarily the distance between the origin of the reference coordinate system and the center coordinate of the correction image.
  • it may be a distance between a predetermined point near the origin of the reference coordinate system and a predetermined point of the correction image (may be a point other than the center point).
  • the information indicating the distance between the origin of the reference coordinate system and the correction image may be the coordinate value itself of a predetermined point of the correction image in the reference coordinate system. In this case, for example, the center coordinates of the correction image in the reference coordinate system may be used.
  • the preliminary measurement unit 26 may not perform preliminary measurement of the measurement location when the measurement location is designated by the user. In this case, the preliminary measurement unit 26 may capture an image including the measurement location and store it in the image information DB 42 when the measurement location is designated.
  • the preliminary measurement unit 26 stores the distance between the center coordinates of the correction image in the reference coordinate system and the origin of the reference coordinate system in the image information DB 42, but is not limited thereto, and the center of the correction image in the stage coordinate system is not limited thereto.
  • the distance between the image and the origin of the stage coordinate system may be stored, or the distance between the center coordinate of the correction image in the reference coordinate system and the origin of the stage coordinate system may be stored.
  • the preliminary measurement unit 26 uses the reference article image (hereinafter referred to as a test matching image) captured by the imaging unit 6 after the correction image is captured, and the correction image to perform test matching.
  • a process for identifying a portion (corresponding portion) similar to the correction image included in the image is executed, and the similarity (matching score) between the correction image and the corresponding portion of the test matching image is calculated. calculate.
  • a pattern matching algorithm an existing method such as a normalized correlation method or a geometric shape pattern matching method can be used.
  • the pattern matching performed by the preliminary measurement unit 26 is referred to as test matching
  • the matching score calculated by the preliminary measurement unit 26 is referred to as a test matching score.
  • the test matching image may have a plurality of locations where the similarity to the correction image is a predetermined value or more. That is, there may be a plurality of shapes similar to the correction image in the test matching image.
  • the maximum value of the similarity is specified, and the number of places where the similarity is equal to or higher than a predetermined value is specified.
  • the preliminary measurement unit 26 stores the maximum value of the similarity as the test matching score in the image information DB 42, and sets the number of locations where the similarity is equal to or greater than the predetermined value as the number of detected test matches in the image information DB 42.
  • the test matching score is an index indicating the ease of pattern matching using the correction image, which is influenced by the surface state of the reference article and the illumination condition (transmission illumination or epi-illumination).
  • the test matching score shows a high value when the illumination condition is transmitted illumination and the image is clear, or the illumination condition is epi-illumination, and there is a pattern or circuit pattern on the surface of the reference article In some cases, a low value is indicated.
  • the preliminary measurement unit 26 stores the type of geometric shape measured at the measurement location in the image information DB 42 as the measured shape.
  • the image information DB 42 in FIG. 5B shows a state in which information of correction image files 1.bmp to 3.bmp is stored as a correction image obtained from one reference article.
  • the measurement program storage unit 28 stores the measurement program in the measurement program DB 44 in association with the input name.
  • the measurement program includes information on the reference coordinate system and information on the measurement location.
  • the information of the reference coordinate system includes information on the position coordinates of the origin of the reference coordinate system in the stage coordinate system that can be acquired from the coordinate system DB 40 and the rotation angle of the reference coordinate system with respect to the stage coordinate system.
  • the information on the measurement location includes the measurement result (measurement item and measured value) of the measurement location of the reference article.
  • the repeated measurement unit 30 sets the measurement coordinate system of the measurement object 7 in a state where the measurement object 7 is placed on the XY stage 5, and repeats the measurement object 7 using the set measurement coordinate system. Perform the measurement.
  • setting the measurement coordinate system of the measurement object 7 means performing relative alignment between the measurement object 7 and the measurement coordinate system, that is, performing alignment with respect to the measurement object 7. Means that.
  • the repetitive measurement unit 30 corrects the set measurement coordinate system using the correction image when the user sets the measurement coordinate system on the image obtained by imaging the measurement object 7. Although details will be described later, the repetitive measurement unit 30 performs pattern matching between the correction image and an image obtained by imaging the measurement object 7, and corrects the measurement coordinate system based on the pattern matching result.
  • the repetitive measurement since the repetitive measurement is performed in a state in which the measurement object 7 is placed on the XY stage 5 (replaced state) after the reference article is retracted from the XY stage 5, the measurement is placed on the XY stage 5. It is difficult to match the position / posture of the measurement object 7 with the position / posture of the reference article placed. Therefore, the reference coordinate system cannot be used as it is as the measurement coordinate system.
  • the repeated measurement unit 30 is set using the reference article by correcting the positional relation between the measurement object 7 and the measurement coordinate system so as to match the positional relation between the reference coordinate system and the reference article in FIG.
  • the position coordinates of the measurement location in the reference coordinate system and the position coordinates in the measurement coordinate system of the image measurement target location on the measurement object 7 are matched.
  • an image suitable for correcting the measurement coordinate system cannot be captured, especially as the user is a beginner handling the image measuring apparatus.
  • the illumination condition and magnification condition of the correction image are determined in consideration of the influence of the illumination condition and magnification condition during the preliminary measurement (the illumination condition and magnification condition when the correction image is captured) on the correction of the measurement coordinate system. It is also difficult. In this case, the measurement coordinate system cannot be corrected (correction has failed), and it may be necessary to recapture the image, or even if the measurement coordinate system has been corrected (corrected successfully), the correction accuracy may be low There is.
  • the preliminary measurement unit 26 described above automatically captures the correction image, and the repeated measurement unit 30 actually performs the correction from the captured correction images, as will be described later.
  • a correction image used for correcting the measurement coordinate system is automatically extracted.
  • the correction of the measurement coordinate system described in the first embodiment is a concept included in the process of setting the image measurement coordinate system.
  • FIG. 7A is a diagram showing an example of a state in which the reference article is placed on the XY stage 5, and FIG. 7B shows the measurement object 7 in place of the reference article on the XY stage 5. It is a figure which shows an example of the state mounted (replaced).
  • the XY stage 5 itself is not shown.
  • the positional relationship between the origin of the reference coordinate system and the center C of the measurement location (arc) in the reference article placed on the XY stage 5 is the positional relationship as shown in FIG.
  • the repeated measurement unit 30 first extracts a correction image used for the correction of the measurement coordinate system from the image information DB 42.
  • the repetitive measurement unit 30 includes items (position (a) below) indicating predetermined positions of the correction image and parameter items (features (b) and (c) below) indicating the characteristics of the correction image. Then, based on the items indicating the imaging conditions of the correction image (the following (d) and (e)), the correction image used for correcting the measurement coordinate system is extracted. These items mean features related to images.
  • the distance from the origin of the reference coordinate system is long
  • the number of test matching detections is small
  • the test matching score is high
  • the zoom magnification is low
  • the illumination condition is transmitted illumination
  • each item is used in the order of (a) ⁇ (b) ⁇ (c) ⁇ (d) ⁇ (e). That is, the repeated measurement unit 30 identifies items to be used according to the above order, and extracts a correction image satisfying the contents of the identified items as a correction image to be used for correction of the measurement coordinate system. Specifically, the repeated measurement unit 30 first extracts a correction image having the longest distance as a correction image used for correcting the measurement coordinate system based on the item (a). In this case, if there are a plurality of correction images having the longest distance, a correction image that uses the image with the smallest number of test matching detections for correcting the measurement coordinate system based on the next item (b).
  • the correction image that is farther from the origin of the reference coordinate system is extracted because the correction image that is farther from the origin of the reference coordinate system is the reference coordinate system and the measurement coordinate system. This is because the measurement coordinate system can be accurately corrected by using the image for correction of the measurement coordinate system.
  • the image having the smallest number of test matching detections is extracted because there are many portions similar to the correction image used for correction of the measurement coordinate system in the image obtained by imaging the measurement object 7.
  • the correction image with a low zoom magnification at the time of imaging is extracted because the correction image with a low zoom magnification has a wide imaging field of view, so that the correction image in the image obtained by imaging the measurement object 7 is corrected. This is because a portion similar to the image can be found reliably and the measurement coordinate system can be reliably corrected. Also, by extracting a correction image with a low zoom magnification, the possibility of re-extracting the correction image due to failure in correction of the measurement coordinate system or the like can be reduced. This is because an appropriate correction image can be extracted.
  • the correction image whose illumination condition at the time of imaging is transmission illumination is extracted as the correction image used for correction of the measurement coordinate system than the correction image whose illumination condition is epi-illumination.
  • the correction image having a high contrast preferentially a portion similar to the correction image can be reliably and accurately extracted in the image obtained by imaging the measurement object 7. That is, by extracting the correction image used for correcting the measurement coordinate system using the above items (a) to (e), the measurement coordinate system can be corrected reliably and accurately even if the user is a beginner of measurement.
  • a correction image that can be performed can be automatically extracted as a correction image used for correcting the measurement coordinate system.
  • the order of the items (a) to (e) may be changed. For example, the order of (b) and (c) may be interchanged, or the order of (d) and (e) may be interchanged.
  • the feature amount of the image for correction may be used instead of the items (b) and (c) or together with the items (b) and (c).
  • the feature points can be obtained using the OpenCV general-purpose image processing library.
  • an algorithm for obtaining a feature amount Accelerated KAZE, SIFT (Scale-invariant transform), SURF (Speed-Upped Robust Feature), or the like can be used.
  • a correction image including a shape for example, a circle
  • a correction image that includes a shape with a low feature amount has priority. Extraction can be prevented.
  • the repeated measurement unit 30 may set threshold values in the items (a) to (d) when extracting a correction image used for correcting the measurement coordinate system.
  • the repeated measurement unit 30 applies the item (a), extracts a correction image whose distance from the origin of the reference coordinate system is longer than a predetermined condition (threshold value, for example, 50 mm), and a plurality of images are extracted.
  • the item (b) is applied to extract a correction image in which the number of test matching detections is smaller than a predetermined condition (threshold value, for example, 2) among the plurality of extracted correction images.
  • FIG. 8A is a diagram illustrating a state in which the reference article is placed on the XY stage 5 and the extracted correction image.
  • FIG. 8B is a diagram illustrating the measurement object 7 on the XY stage 5. It is a figure for demonstrating the correction
  • the XY stage 5 itself is not shown.
  • the extracted correction image is an image obtained by capturing the range indicated by the broken-line rectangle in FIG. 8A, and the reference coordinates (center of the circle including the semi-arc) included in the correction image.
  • the coordinate is (Xt2, Yt2).
  • the user has set a measurement coordinate system indicated by a one-dot chain line for the measurement object 7 as shown in FIG.
  • the repeated measurement unit 30 since the repeated measurement unit 30 stores the coordinates (Xt2, Yt2), the XY stage 5 is moved so that the position is imaged, and an image having a wider imaging range than the correction image is captured. 6 is used to capture an image.
  • the reason why the imaging range in this case is made wider than the imaging range of the correction image is to increase the possibility that a portion similar to the correction image is included in the captured image.
  • the imaging range may be the same as the size of the imaging range of the correction image.
  • the repeated measurement unit 30 performs pattern matching with the correction image, and the reference coordinates (coordinates of the center of gravity position of the semicircle, etc.) of the location corresponding to the shape (for example, a semicircle) included in the correction image on the measurement object 7 ) Is calculated.
  • the detected reference coordinates are shown as (Xs2, Ys2).
  • the repeated measurement unit 30 calculates an error ⁇ of the measurement coordinate system using the coordinates (Xt2, Yt2) and the coordinates (Xs2, Ys2). Specifically, ⁇ s2 and ⁇ t2 are obtained from the following equations (2) and (3), and ⁇ is calculated from the following equation (4).
  • ⁇ t2 arctan (Yt2 / Xt2) (2)
  • ⁇ s2 arctan (Ys2 / Xs2) (3)
  • ⁇ t2 ⁇ s2 (4)
  • the repeated measurement unit 30 corrects the measurement coordinate system by rotating the measurement coordinate system designated by the calculated ⁇ (the coordinate system indicated by the alternate long and short dash line in FIG. 8B is the coordinate system indicated by the broken line). Adjust to be).
  • the repeated measurement unit 30 makes (Xt2, Yt2) and (Xs2, Ys2) coincide with each other (in the XY direction between the origin of the measurement coordinate system and the origin of the reference coordinate system). In order to eliminate the deviation), correction is performed so that the origin of the measurement coordinate system is shifted by the deviation ( ⁇ X, ⁇ Y).
  • the present invention is not limited to this, and two or more correction images are used using the items (a) to (e). Then, ⁇ , ⁇ X, ⁇ Y may be calculated using each of the extracted correction images, and for example, the measurement coordinate system may be corrected using an average of the calculated plural ⁇ , ⁇ X, ⁇ Y. Even in this case, two or more correction images used for correction of the measurement coordinate system may be extracted according to the priority order of the items described above.
  • the repeated measurement unit 30 uses the corrected measurement coordinate system for the measurement object 7 on the XY stage 5 according to the procedure according to the measurement program. Perform repeated measurements. That is, the repeated measurement unit 30 measures the measurement location of the measurement object 7. Then, the repeated measurement unit 30 determines pass / fail of the measurement object 7 based on the measurement result and the measurement result of the reference article included in the measurement program. The repeated measurement unit 30 displays the measurement result on the display device 193 or displays the determination result of the quality of the measurement object 7 on the display device 193.
  • the repeated measurement unit 30 does not have to perform pass / fail determination using the measurement result of the measurement location. That is, the repeated measurement unit 30 may cause the user to make a pass / fail determination by displaying the measurement result on the display device 193.
  • the control unit 2 executes processing according to the flowchart of FIG. Specifically, as shown in FIG. 9, a measurement program creation process (S1000) and a repeated measurement process (S2000) are executed. Hereinafter, each process of step S1000 and S2000 is demonstrated.
  • step S10 the entire image acquisition unit 22 waits until the reference article is mounted on the XY stage 5 and an instruction to start measurement program creation is issued from the user. If the determination in step S10 is affirmed, the entire image acquisition unit 22 proceeds to step S12.
  • the entire image acquisition unit 22 executes an entire image acquisition process.
  • the entire image acquisition unit 22 captures an image using the imaging unit 6 while moving the XY stage 5 within the movable range as described above, and stitches the captured images together to form an entire image (stitching image). ).
  • the overall image acquisition unit 22 acquires the position coordinates on the stage coordinate system of the connected images and stores them in the overall image DB 38.
  • step S14 the coordinate system setting unit 24 executes a reference coordinate system setting process.
  • the process according to the flowchart of FIG. 11 is executed.
  • step S20 the coordinate system setting unit 24 stands by until an arbitrary coordinate system is designated by the user on the entire image.
  • the user designates a predetermined position (for example, the lower left corner) of the reference article as the origin of the coordinate system via the input device 195, and sets the rotation angle of the coordinate system to a predetermined angle (for example, orthogonal coordinates). The angle is such that the system matches two orthogonal sides of the corner of the reference article.
  • the coordinate system setting unit 24 proceeds to step S22.
  • the user may specify a coordinate system at a position other than the corner of the reference article.
  • step S22 the coordinate system setting unit 24 sets the designated coordinate system as the reference coordinate system.
  • step S24 the coordinate system setting unit 24 uses the coordinate system DB 40 as the reference coordinate system information to include information including the coordinates of the origin of the reference coordinate system in the stage coordinate system and the rotation angle of the reference coordinate system with respect to the stage coordinate system. (FIG. 5 (a)).
  • the process of FIG. 11 ends, and the process proceeds to step S16 of FIG. *
  • step S16 the preliminary measurement unit 26 performs a preliminary measurement process.
  • the process according to the flowchart of FIG. 12 is executed.
  • step S30 the preliminary measurement unit 26 waits until the measurement location is instructed by the user on the entire image.
  • the process proceeds to step S32, and the preliminary measurement unit 26 refers to the above-described whole image DB 38 so that the measurement location is within the field of view of the imaging unit 6.
  • the XY stage 5 is moved based on the coordinate value of the designated measurement location in the stage coordinate system. Note that the user may specify a measurement location on the image captured by the imaging unit 6.
  • the preliminary measurement unit 26 performs preliminary measurement of the measurement location by image processing, and displays the preliminary measurement result on the display device 193.
  • imaging conditions illumination conditions and magnification conditions
  • the preliminary measurement for example, when the user designates an arc as a measurement location, the center coordinates, diameter (radius), and roundness (see FIG. 2), which are measurement items, are measured, and the measurement result is displayed on the display device 193. Display above. Further, the preliminary measurement unit 26 stores the illumination condition and magnification condition at the time of preliminary measurement, and information on the measured shape in the image information DB 42.
  • step S36 the preliminary measurement unit 26 acquires (captures) a correction image while maintaining the illumination condition and magnification condition at the time of preliminary measurement, and stores them in the image information DB 42 (FIG. 5B).
  • the reference coordinate value of the correction image (the coordinate value of the imaging center in the reference coordinate system) and the distance between the origin of the reference coordinate system and the reference coordinate are stored in the image information DB 42.
  • step S38 the preliminary measurement unit 26 performs pattern matching (test matching) using the test matching image captured by the imaging unit 6 after capturing the correction image and the acquired correction image. . Since the test matching score and the number of detected test matches can be obtained by this test matching, the preliminary measurement unit 26 stores the image information in the image information DB 42 (FIG. 5B).
  • step S40 the preliminary measurement unit 26 determines whether another measurement location has been instructed. If the user indicates a new measurement location, the determination in step S40 is affirmed and the process returns to step S32. Returning to step S32, the preliminary measurement unit 26 executes the processing after step S32 in the same manner as described above. On the other hand, if the user inputs via the input device 195 to end the instruction of the measurement location, the determination in step S40 is denied and the processing in FIG. 12 ends. When the process in FIG. 12 is completed, the process proceeds to step S18 in FIG.
  • the measurement program storage unit 28 executes a measurement program storage process.
  • the process according to the flowchart of FIG. 13 is executed.
  • step S50 the measurement program storage unit 28 waits until the file name is input by the user and the save button is pressed.
  • the process proceeds to step S52.
  • step S52 the measurement program storage unit 28 stores the measurement program including the reference coordinate system information and the measurement location information in the measurement program DB 44.
  • the process of FIG. 13 ends and the measurement program creation process (S1000) of FIG. 10 ends.
  • step S202 the repeated measurement unit 30 waits until a measurement program is selected by the user.
  • the process proceeds to step S204, and the repetitive measurement unit 30 places the new measurement object 7 on the XY stage 5, and the user Wait until the measurement coordinate system is specified by.
  • the process proceeds to step S206.
  • the repetitive measurement is performed with the measurement object 7 placed on the XY stage 5 (repositioned state) after the reference article is retracted from the XY stage 5, the position of the measurement object 7 is determined. It is difficult to match the posture with the position / posture of the reference article placed on the XY stage 5.
  • the reference coordinate system cannot be used as it is as the measurement coordinate system. Therefore, the user remembers the approximate position of the reference coordinate system set when creating the measurement program, and sets the measurement coordinate system at the same position for the measurement object 7. In this case, since the user sets the measurement coordinate system, it is difficult to match the origin and rotation angle of the set measurement coordinate system with the origin and rotation angle of the reference coordinate system. Therefore, in the next step S206, a measurement coordinate system correction process is executed.
  • the repeated measurement unit 30 executes a process according to the flowchart of FIG.
  • step S220 of FIG. 15 the repeated measurement unit 30 extracts one of a plurality of correction images stored in the measurement program DB 44 as a correction image used for correcting the measurement coordinate system.
  • a correction image used for correcting the measurement coordinate system is extracted based on the items (a) to (e) described above.
  • step S222 the iterative measurement unit 30 moves the XY stage 5 so that the reference coordinates (center coordinates of the geometric shape) of the extracted correction image coincide with the center of the field of view of the imaging unit 6.
  • the reference coordinates are stored in the measurement program DB 44.
  • step S224 the repeated measurement unit 30 sets conditions.
  • the repeated measurement unit 30 reads the illumination condition and the magnification condition when the measurement location is preliminarily measured (when the correction image is captured) from the image information DB 42 and captures an image used for pattern matching described later.
  • An illumination condition and a magnification condition are set based on the read illumination condition and magnification condition.
  • the magnification condition here can be a magnification condition that can capture an image wider than the imaging range of the correction image.
  • step S226 the repeated measurement unit 30 performs pattern matching (search) using the image captured by the imaging unit 6 and the extracted correction image after setting the illumination condition and the magnification condition. That is, a part similar to the extracted correction image is specified among the images picked up by the image pickup unit 6 after setting the conditions.
  • the XY stage 5 is set in advance. The range in which the pattern matching is performed on the measurement object 7 may be expanded by moving within a predetermined range.
  • the imaging range of the imaging unit 6 is increased n times (for example, 2 times), and the XY stage 5 is moved by a size that is 1 / n times (for example, 1/2 times) of the imaging range to perform pattern matching.
  • the range to be implemented can be expanded.
  • step S228, the repeated measurement unit 30 determines whether the search has failed.
  • the failure of the search means a case where there is no similar part (a part where the similarity (matching score) is a predetermined value or more) as a result of pattern matching.
  • the case where the search fails is, for example, a case where burrs, scratches, dust, etc. exist on the measurement object 7.
  • the process proceeds to step S230, and the repeated measurement unit 30 re-extracts the correction image.
  • one of the correction images stored in the image information DB 42 is extracted from the images excluding the correction image extracted in the past in step S220 by the same process as in step S220. Thereafter, the process returns to step S222.
  • step S228 determines whether the search in step S226 is successful. If the determination in step S228 is negative, that is, if the search in step S226 is successful, the process proceeds to step S232.
  • the repetitive measurement unit 30 calculates the rotation error ⁇ and the position errors ⁇ X, ⁇ Y.
  • step S234 the repeated measurement unit 30 determines whether or not a calculation error has occurred.
  • the calculation error means a case where the calculation result of the rotation error ⁇ and the position errors ⁇ X, ⁇ Y exceeds an allowable value, and an appropriate calculation result cannot be obtained.
  • the repeated measurement unit 30 corrects the measurement coordinate system.
  • the repeated measurement unit 30 corrects the measurement coordinate system set by the user on the image obtained by imaging the measurement object 7 by the rotation error ⁇ and the position errors ⁇ X and ⁇ Y calculated in step S232.
  • the process of step S236 ends, the entire process of FIG. 15 ends, and the process proceeds to step S208 of FIG.
  • step S208 the repetitive measurement unit 30 performs image measurement at the measurement location recorded in the measurement program and displays the measurement result on the display device 193.
  • step S210 the repeat measurement unit 30 determines whether the repeat measurement is completed. That is, when the user inputs through the input device 195 that the measurement is to be repeated, the determination in step S210 is affirmed, and the processing in FIG. 14 and all the processing in FIG. 9 are ended. On the other hand, if the determination in step S210 is negative, the process returns to step S204, and the processes and determinations in steps S204 to S210 are repeatedly executed.
  • setting the measurement coordinate system in the first embodiment can be rephrased as setting the measurement location designated by the user for the reference article in the measurement object 7.
  • the iterative measurement unit 30 determines the characteristics (reference coordinate system of the reference coordinate system) from the images (correction images) of different parts of the reference article.
  • a correction image used for correcting the measurement coordinate system is extracted based on the distance from the origin, a test matching score, and the like, and the extracted correction image and an image of a portion corresponding to the correction image in the measurement object 7 Based on the above, alignment with respect to the measurement object 7 is performed, and the measurement object 7 is image-measured. In this way, by extracting an appropriate image as a correction image used for correcting the measurement coordinate system and performing alignment with respect to the measurement object 7 using the extracted image, alignment with respect to the measurement object 7 can be performed with high accuracy. It can be carried out.
  • the iterative measurement unit 30 also calculates the position of the correction image in the reference coordinate system set for the reference article and the portion of the image corresponding to the correction image of the measurement object 7.
  • the measurement coordinate system is set for the measurement object 7 so as to match the position on the measurement coordinate system (within an allowable error range).
  • the position of the correction image on the reference coordinate system is matched with the position of the image corresponding to the correction image of the measurement object 7 on the measurement coordinate system (within an allowable error range). Therefore, repeated measurement of the measurement object 7 can be performed with high accuracy.
  • the repeated measurement unit 30 extracts a correction image used for correction from a correction image having a long distance from the origin of the reference coordinate system set for the reference article. Extract (see item (a) above). This makes it possible to reduce the rotation error of the measurement coordinate system by performing correction using a correction image obtained by imaging a location far from the origin of the reference coordinate system, which is susceptible to the rotation error between the reference coordinate system and the measurement coordinate system. It can be corrected with high accuracy. In this way, by automatically extracting an appropriate correction image and performing alignment with respect to the measurement object 7, even a beginner can reliably perform highly accurate repeated measurement without failure.
  • the iterative measurement unit 30 extracts a correction image used for correction of the measurement coordinate system, and performs pattern matching (test matching) using the correction image and the test matching image. ) Is extracted from an image having a high test matching score (see item (c) above).
  • an image having a high test matching score which is an index indicating the ease of pattern matching using the correction image (an index affected by the surface condition of the reference article) is preferentially used for correcting the measurement coordinate system.
  • an image having a high test matching score which is an index indicating the ease of pattern matching using the correction image (an index affected by the surface condition of the reference article) is preferentially used for correcting the measurement coordinate system.
  • the measurement coordinate system can be corrected reliably and accurately.
  • the repeated measurement unit 30 extracts a correction image used for correcting the measurement coordinate system
  • the number of test matching detections (the number of test matching scores equal to or greater than a predetermined value) is calculated. Extract from a small number of correction images (see item (b) above).
  • a plurality of locations (similar locations) corresponding to the image for correction are specified.
  • the repeat measurement unit 30 extracts a correction image used for correction of the measurement coordinate system, and a magnification condition (imaging magnification) at the time of preliminary measurement (when the correction image is captured). ) Is extracted from the image for correction (see item (d) above).
  • a magnification condition imaging magnification
  • the correction image with a low imaging magnification has a wide imaging field of view
  • a portion (corresponding portion) similar to the correction image in the image obtained by imaging the measurement object 7 can be reliably extracted.
  • the repetition measurement unit 30 extracts the illumination condition at the time of preliminary measurement (when the correction image is captured) from the correction image in which the illumination is transmitted. (See item (e) above).
  • pattern matching between the correction image and the image captured by the imaging unit 6 can be performed reliably and accurately by preferentially using an image having a large contrast (a clear contrast), and the measurement coordinates System correction and measurement using a measurement coordinater can be performed reliably and accurately.
  • the repeated measurement is performed in a state where the measurement object 7 is placed on the XY stage 5 (replaced state) after the reference article is retracted from the XY stage 5. It is difficult to match the position / posture of the measurement object 7 with the position / posture of the reference article placed on the XY stage 5. Therefore, the reference coordinate system cannot be used as it is as the measurement coordinate system. For this reason, the repeated measurement unit 30 corrects the measurement coordinate system designated by the user for the measurement object 7 based on the pattern matching result of the correction image (S204, S206). In this case, by using the measurement coordinate system roughly designated by the user, it is possible to specify (pattern matching) a portion corresponding to the correction image in the image captured by the imaging unit 6 in a short time. As a result, the measurement coordinate system can be set (corrected) in a short time.
  • the preliminary measurement unit 26 when the preliminary measurement unit 26 preliminarily measures the measurement location designated by the user on the reference article, the preliminary measurement unit 26 captures the measurement location and acquires a correction image (S36). Then, the repeated measurement unit 30 corrects the measurement coordinate system designated by the user using the acquired correction image. In this case, it is not necessary for the user to designate a location for capturing the correction image, and the correction image can be automatically captured.
  • the repeated measurement unit 30 after repeatedly extracting the correction image used for correcting the measurement coordinate system, the repeated measurement unit 30 reselects another image when the measurement coordinate system cannot be corrected. (S230). As a result, the measurement coordinate system can be reliably corrected.
  • the pass / fail determination accuracy can be improved.
  • the correction image may be captured in a state where the XY stage 5 is positioned at a predetermined position. Moreover, it is good also as imaging the location according to the input from a user as a correction image.
  • the preliminary measurement unit 26 may capture a correction image before preliminary measurement of the measurement location.
  • priorities are assigned to the correction images using the items (a) to (e) described above.
  • the priority order may be associated with the correction image and stored in the image information DB 42.
  • the repeated measurement unit 30 can easily extract a correction image used for correcting the measurement coordinate system by referring to the priority order. For example, priorities may be assigned when correction images relating to all measurement locations are acquired in the measurement process (S16) in the measurement program creation process (S1000).
  • each item (a) to (e) is evaluated by quantifying (determining an evaluation value) for each image, and based on the total value of the results (evaluation values) of evaluating each item.
  • the priority order of each image may be determined. For example, as shown in FIG. 16, for the item (a) “distance from the origin of the reference coordinate system”, a higher evaluation value (score) is assigned to an image with a longer distance, and item (e) “correction image is selected.
  • the “illumination condition at the time of acquisition” a high score is assigned in the case of transmitted illumination, and a low score is assigned in the case of epi-illumination.
  • the weighting factor of item (a) is 10
  • the weighting factor of item (b) is 8
  • the weighting factor of item (c) is 6
  • the weighting factor of item (d) is 4,
  • the item (e) Can be set to 2 or the like.
  • the weighting coefficient (that is, the weighting condition) of each item it is possible to determine the priority order of each image in consideration of the importance of each item.
  • the measurement coordinate system may be corrected using an average value of errors ⁇ , ⁇ X, and ⁇ Y obtained using each correction image.
  • an image including the origin of the reference coordinate system may be captured, and the captured image may be used as a correction image.
  • the image in order to assist the user to specify the measurement coordinate system for the measurement object 7, the image includes the origin of the reference coordinate system specified by the user for the reference article (see 11) is created in step S22 of the standard coordinate system setting process (S14) of FIG. 11, for example, and the reference image is displayed on the display device 193, so that the reference image is provided to the user. May be.
  • the user while viewing the reference image, the user moves the XY stage 5 so that the part corresponding to the reference image of the measurement object 7 is imaged by the imaging unit 6, and performs measurement based on the reference image.
  • a coordinate system can be specified. Thereby, the user does not need to remember the position of the reference coordinate system, and it becomes easy to set the measurement coordinate system.
  • the reference image may be an image captured by the image capturing unit 6 when the user designates the standard coordinate system, or more than a range captured by the image capture unit 6 when the user designates the standard coordinate system.
  • An image obtained by imaging a wide range after designating the reference coordinate system may be used.
  • the repeated measurement unit 30 performs pattern matching between the reference image and the live image (that is, the image captured by the imaging unit 6 at a predetermined frame rate) while the user moves the XY stage 5. This may be performed sequentially, and when there is a location where the similarity with the reference image is greater than or equal to a predetermined value in the live image, this may be notified to the user. As a method of notification, for example, an alarm may be issued. As a result, it is possible to support the work of specifying the measurement coordinate system.
  • the reference image may be used as one of the correction images.
  • the repeated measurement unit 30 automatically sets the measurement coordinate system for the measurement object 7 by performing pattern matching using the image of the reference article including the origin of the reference coordinate system specified by the user. Also good.
  • a location similar to the image of the reference article including the origin of the reference coordinate system (referred to as an origin image) is specified in the image obtained by imaging the measurement object 7. Then, the position in the specified location corresponding to the position of the origin of the reference coordinate system in the origin image is specified, and the origin of the measurement coordinate system is set to the specified position.
  • the rotation angle of the measurement coordinate system in the specified location is set to be the same as the rotation angle of the reference coordinate system in the origin image. Also in this case, depending on the accuracy of pattern matching, the set measurement coordinate system may deviate from the reference coordinate system designated for the reference article. Therefore, the set measurement coordinate system is corrected by the above-described method. That's fine.
  • the repeat measurement unit 30 can extract a correction image used for correcting the measurement coordinate system in consideration of the number of search failures in steps S220 and S230.
  • the iterative measurement unit 30 may not extract a correction image having a search failure count of a predetermined number or more.
  • the iterative measurement unit 30 may preferentially extract a correction image with a small number of search failures.
  • the correction image may be extracted in consideration of the search success count instead of the search failure count.
  • the number of search failures and the number of successful searches are information related to alignment failure and information related to alignment success. Note that the information regarding the alignment failure and the information regarding the alignment success may be a search failure rate or a search success rate.
  • the trimmed correction image can be used as a candidate for extracting one image from the plurality of correction images in step S220. Therefore, for example, even if a foreign object such as dust or dust adheres to the area of the measurement object 7 (second article) corresponding to the correction image, or a defect such as a crack or a chip occurs, a pattern due to those problems is generated. It becomes possible to prevent the accuracy of matching (step S226) from being lowered.
  • the present invention is not limited to this. Absent.
  • the rotation error ⁇ and the position error ⁇ X, calculated in step S232 while the origin position and angle of the measurement coordinate system are fixed so that the measurement coordinate system designated by the user is set at a predetermined position of the measurement object 7.
  • the position of the measuring object 7 may be moved by ⁇ Y.
  • the process of moving the position of the measurement object 7 can be executed in place of the designation of the measurement coordinate system by the user in step S204 of FIG. 14 and the process of step S206 (measurement coordinate system correction process). it can.
  • a substage for placing the measurement object 7 on the XY stage 5 is provided, and the substage is moved in the XY direction relative to the XY stage 5 while the XY stage 5 is fixed. do it.
  • the user may adjust the position of the measurement object 7 on the XY stage 5, or may adjust the position of the measurement object 7 on the XY stage by a robot hand or the like.
  • adjusting the position of the measurement object 7 with respect to the measurement coordinate system in which the origin position is fixed is to perform relative alignment between the measurement object 7 and the measurement coordinate system. This means that alignment with respect to the measurement object 7 is executed.
  • the repeated measurement unit 30 describes a case where extraction is performed from a correction image having a long distance from the origin of the reference coordinate system set for the reference article (see item (a)).
  • it is not limited to this.
  • it may be extracted from a correction image having a short distance from the origin of the reference coordinate system set for the reference article.
  • the longer the distance from the origin of the reference coordinate system the more susceptible to the rotation error. That is, the position shift becomes larger as the distance from the origin of the reference coordinate system becomes longer due to the influence of the rotation error.
  • the measurement coordinate system can be corrected reliably and accurately without failing pattern matching.
  • the distance from the origin of the reference coordinate system is larger than the correction image used for correcting the measurement coordinate system.
  • the measurement coordinate system may be corrected again using a long correction image. Thereby, the measurement coordinate system can be corrected reliably and with high accuracy.
  • the correction image may be extracted in order of increasing distance from the origin of the reference coordinate system, and the correction of the measurement coordinate system may be repeated. In this case, the correction may be repeated until the measurement coordinate system need not be corrected, that is, even if the measurement coordinate system is corrected, the origin and the rotation angle of the measurement coordinate system are not changed by a predetermined value or more. Thereby, the number of corrections (the number of repetitions) for correcting the measurement coordinate system reliably and accurately can be set to an appropriate number.
  • the repeated measurement unit 30 extracts from a correction image with a low magnification condition (imaging magnification) at the time of preliminary measurement (image measurement) (see item (d) above).
  • imaging magnification a low magnification condition
  • Whether an image is extracted from a correction image having a low magnification condition (imaging magnification) or a correction image having a high magnification condition (imaging magnification) depends on whether the environment in which the image measuring apparatus 100 is installed is dust or dust. It is good also as using properly based on whether there are many environments.
  • the preliminary measurement unit 26 may capture the correction image after changing the various conditions such as the illumination condition and the magnification condition after performing the preliminary measurement.
  • the correction image may be captured in a state where the imaging magnification is lowered and the imaging range is made wider than that during preliminary measurement.
  • the second embodiment is different from the first embodiment in that the user can omit the work of specifying the reference coordinate system for the reference article. That is, in the second embodiment, step S14 in FIG. 10 can be omitted. Further, in the second embodiment, in addition to omitting the task of specifying the reference coordinate system, the task of specifying the measurement coordinate system can be omitted. In the second embodiment, the origin and rotation angle of the reference coordinate system are automatically set to match the origin and rotation angle of the stage coordinate system.
  • FIG. 17 shows a detailed block diagram of the CPU 190 in the second embodiment.
  • the DB stored in the HDD 196 is also illustrated for convenience of illustration and description.
  • a coordinate system setting image DB 55 is provided instead of the coordinate system DB 40 of the first embodiment.
  • the process (S18 ′) shown in FIG. 18 is executed as a measurement program storage process.
  • the preliminary measurement unit 26 performs measurement using the stage coordinate system when measuring the measurement location designated by the user in step S16.
  • step S18 ' the measurement program storage unit 28 waits until the file name is input by the user and the save button is pressed in step S150.
  • step S152 the measurement program storage unit 28 selects one of the correction images stored in the image information DB 42, and uses the coordinate system setting image DB 55 (FIG. 19A, FIG. 19A) as the coordinate system setting image. (See FIG. 19B).
  • the coordinate system setting image DB 55 stores a correction image used for enabling the measurement coordinate system to be automatically set even if the user does not specify the reference coordinate system using the reference article. It is a database. Specifically, it has a data structure as shown in FIG. In the coordinate system setting image DB 55, each item is empty (blank) as shown in FIG. 19A until step S152 is started.
  • the measurement program storage unit 28 selects a correction image to be stored in the coordinate system setting image DB 55 from the image information DB 42 based on the following items. These items mean features related to images.
  • the zoom magnification is low (b) The distance from the origin of the stage coordinate system is close (c) The number of test matching detections is small (d) The test matching score is high
  • the zoom magnification is the imaging It means magnification, and is an example of imaging conditions (magnification conditions).
  • the distance from the origin of the stage coordinate system is an example of information indicating the position of the image. Further, the number of test matching detections and the test matching score are examples of information indicating image characteristics.
  • each item when selecting, each item is used in the order of (a) ⁇ (b) ⁇ (c) ⁇ (d).
  • the measurement program storage unit 28 refers to the information of the correction image stored in the image information DB 42 in FIG. 5B, and the zoom magnification is low, and the reference coordinate system (stage coordinate system) from the origin.
  • a correction image file (2.bmp) having a short distance is specified.
  • the measurement program storage unit 28 extracts the information of the correction image file (2.bmp) from FIG. 5B and stores it in the coordinate system setting image DB 55 as shown in FIG. 19B.
  • 0 ° is stored in the column of the relative angle between the reference coordinate system and the stage coordinate system.
  • 0 ° is stored in the relative angle column as described above because the origin and the rotation angle of the reference coordinate system of the second embodiment are the same as the origin and the rotation angle of the stage coordinate system. Because I do it.
  • the correction image with a low zoom magnification at the time of imaging is preferentially selected because the correction image with a low zoom magnification has a wide imaging field of view, and thus the measurement object 7 is imaged. This is because a portion similar to the image for correction can be surely found in the image.
  • the correction image having a short distance from the origin of the reference coordinate system is preferentially selected because the reference object on the XY stage is retracted and the measurement object 7 Even if the measurement object 7 is displaced in the rotation direction with respect to the reference article when the object is placed, the position displacement due to the influence of the rotation error is small at a position where the distance from the origin of the reference coordinate system (stage coordinate system) is short. This is because pattern matching can be performed reliably and the measurement coordinate system can be set reliably.
  • an image with a small number of test matching detections is preferentially selected because an image similar to the correction image used for setting the measurement coordinate system has a lot in the image obtained by imaging the measurement object 7.
  • the correction image having a higher test matching score is preferentially selected because the correction image having a higher test matching score is an image that is easier to perform pattern matching. By using such a correction image, it is possible to reliably and accurately correct the measurement coordinate system without failing pattern matching.
  • a correction image whose illumination condition at the time of imaging is transmission illumination may be preferentially selected as a correction image used for setting the measurement coordinate system.
  • the measurement coordinate system can be set with high accuracy by preferentially using the correction image having a large contrast.
  • a correction image with a low zoom magnification at the time of imaging is preferentially selected.
  • the present invention is not limited to this, and a correction image with a high zoom magnification at the time of imaging is preferentially selected. It is good also as selecting.
  • the possibility that dust or dust is captured in the correction image can be reduced. As a result, it is possible to reduce the possibility that the correction of the measurement coordinate system will fail due to the influence of dust and dust, and to perform the correction of the measurement coordinate system reliably and accurately.
  • imaging magnification an image for correction with a low magnification condition
  • imaging magnification a correction image with a high magnification condition
  • the measurement program storage unit 28 acquires the correction image file stored in the coordinate system setting image DB 55 as a reference image.
  • the reference image is an image that indicates a location to be imaged by the imaging unit 6, that is, an image that indicates a position where the XY stage 5 should be moved.
  • the measurement program storage unit 28 refers to a newly captured image based on the reference coordinate value, the illumination condition, and the magnification condition when the correction image is acquired, which is stored in the coordinate system setting image DB 55. It may be acquired as an image.
  • the reference image may be an image having a larger field of view than the correction image, a small image, or the same image.
  • the measurement program storage unit 28 may use, as a reference image, an image extracted (cut out) from the entire image with the reference coordinate value as the center.
  • step S158 the measurement program storage unit 28 stores in the measurement program DB 44 a measurement program including the coordinate system setting image DB 55, the reference image, and measurement location information.
  • the process of FIG. 10 (S1000) also ends.
  • the repeated measurement unit 30 executes the repeated measurement process (S2000 ') shown in FIG. 20 instead of the repeated measurement process (S2000) of the first embodiment.
  • step S402 the process waits until a measurement program is selected by the user.
  • the repetitive measurement unit 30 proceeds to step S404 and displays the reference image included in the measurement program on the display device 193.
  • step S406 the repeated measurement unit 30 uses the correction image stored in the coordinate system setting image DB 55 and the image (so-called live image) captured by the imaging unit 6 at a predetermined frame rate. Perform pattern matching.
  • the user refers to the reference image so that a portion similar to the reference image is captured by the imaging unit 6 (so that a portion similar to the reference image is displayed on the display device 193).
  • the XY stage 5 is moved.
  • the repeated measurement unit 30 checks the increase or decrease of the matching score obtained by pattern matching.
  • step S408 the repeated measurement unit 30 stands by until the matching score becomes a predetermined value or more. If the determination in step S408 is affirmed, the repeat measurement unit 30 proceeds to step S410, displays on the display device 193 that the matching score is equal to or greater than a predetermined value, and notifies the user.
  • step S412 the repetitive measurement unit 30 stands by until a measurement start instruction is input from the user. In this case, when the user presses the measurement start button or the like, the repetitive measurement unit 30 proceeds to step S414.
  • step S414 the repeated measurement unit 30 calculates the origin of the measurement coordinate system in the reference coordinate system (stage coordinate system) and the rotation angle with respect to the reference coordinate system (stage coordinate system). This process will be described in detail with reference to FIGS. 21 (a) and 21 (b).
  • FIG. 21A the relationship between the reference article and the reference coordinate system (stage coordinate system) and the correction image stored in the reference coordinate system (stage coordinate system) and the coordinate system setting image DB 55 are acquired.
  • the relationship with the reference coordinate values (Xt, Yt) at the time is shown.
  • FIG. 21B shows the relationship between the measurement object, the reference coordinate system (stage coordinate system), and the measurement coordinate system, and is a diagram for explaining a measurement coordinate system setting method.
  • a broken-line rectangle in FIG. 21A indicates a correction image stored in the coordinate system setting image DB 55.
  • the measuring object 7 is shifted from the reference article in the X-axis direction and the Y-axis direction, and tilted with respect to the reference coordinate system (stage coordinate system). It is assumed that it is placed on the XY stage 5 in a state. In this case, when the user moves the XY stage 5 so that the imaging unit 6 can capture a range indicated by a broken-line rectangle, the repeated measurement unit 30 performs coordinate matching (Xs, Xs, Yt) by pattern matching. , Ys) and the rotation angle ⁇ s. In the second embodiment, a measurement coordinate system used when measuring the measurement object 7 is set using these coordinates and rotation angles.
  • the repetitive measurement unit 30 obtains the shift amounts dx, dy between the coordinates (Xs, Ys) and the coordinates (Xt, Yt) from the above equations (5), (6), and the origin of the reference coordinate system (stage coordinate system)
  • the origin of the measurement coordinate system is set at a position deviated by the deviation amounts dx and dy.
  • the repeated measurement unit 30 sets the angle of the measurement coordinate system by rotating the measurement coordinate system by an angle ⁇ s with respect to the reference coordinate system (stage coordinate system).
  • the repeated measurement unit 30 executes the measurement coordinate system correction process in the same manner as in step S206 of the first embodiment.
  • the repeated measurement unit 30 excludes the correction image selected in step S152 of FIG. 18 and extracts a correction image used for correcting the measurement coordinate system.
  • the repeated measurement unit 30 performs measurement at the measurement location recorded in the measurement program and displays the measurement on the display device 193, as in step S208 of the first embodiment.
  • the repeated measurement unit 30 determines whether or not the repeated measurement is completed, as in step S210 of the first embodiment. If the determination in step S420 is negative, the process returns to step S404. If the determination is positive, all the processes in FIG. 20 are completed and all the processes in FIG. 10 are also ended.
  • the iterative measurement unit 30 has an image (in the coordinate system setting image DB 55) that has a predetermined positional relationship with the origin of the reference coordinate system (stage coordinate system).
  • the measurement coordinate system is set for the measurement object 7 using the stored correction image), and then the correction image used for correcting the measurement coordinate system and the image of the measurement object 7 corresponding to the image are displayed.
  • the set measurement coordinate system is corrected based on the portion.
  • the user can set the measurement coordinate system when measuring the measurement object 7 without setting the reference coordinate system using the reference article. Therefore, since the user's work man-hours can be reduced, user convenience can be improved.
  • the origin and rotation angle of the reference coordinate system are automatically set to coincide with the origin and rotation angle of the stage coordinate system, and measurement is performed based on the reference coordinate system (stage coordinate system).
  • the reference coordinate system may be automatically set in the correction image stored in the coordinate system setting image DB 55, and the measurement coordinate system may be set and corrected using the reference coordinate system.
  • the reference coordinate system may be set at the center of the correction image, or may be set at a specific point (such as the center point) of the measurement location included in the correction image. Even if it does in this way, the effect similar to 2nd Embodiment mentioned above can be acquired.
  • the above processing functions can be realized by a computer.
  • a program describing the processing contents of the functions that the processing apparatus should have is provided.
  • the program describing the processing contents can be recorded on a computer-readable recording medium (except for a carrier wave).
  • the program When the program is distributed, for example, it is sold in the form of a portable recording medium such as a DVD (Digital Versatile Disc) or CD-ROM (Compact Disc Read Only Memory) on which the program is recorded. It is also possible to store the program in a storage device of a server computer and transfer the program from the server computer to another computer via a network.
  • a portable recording medium such as a DVD (Digital Versatile Disc) or CD-ROM (Compact Disc Read Only Memory) on which the program is recorded. It is also possible to store the program in a storage device of a server computer and transfer the program from the server computer to another computer via a network.
  • the computer that executes the program stores, for example, the program recorded on the portable recording medium or the program transferred from the server computer in its own storage device. Then, the computer reads the program from its own storage device and executes processing according to the program. The computer can also read the program directly from the portable recording medium and execute processing according to the program. Further, each time the program is transferred from the server computer, the computer can sequentially execute processing according to the received program.

Abstract

To provide an image measurement method that makes simple image measurement possible, an image measurement method is made to include the selection of an image from among images of different parts of a first article on the basis of characteristics of the images, alignment of a second article on the basis of the selected image and an image of a part of the second article corresponding to the selected image, and image measurement of the second article.

Description

画像測定方法、画像測定プログラム及び画像測定装置、並びに物品の製造方法Image measuring method, image measuring program, image measuring apparatus, and article manufacturing method
 本発明は、画像測定方法、画像測定プログラム及び画像測定装置、並びに物品の製造方法に関する。 The present invention relates to an image measurement method, an image measurement program, an image measurement device, and an article manufacturing method.
 従来、複数のワークを繰り返し測定する際に、マスタワークのパターン画像を用いたパターンマッチングにより各ワークの位置と回転角度を検出し、検出した位置と回転角度データを用いて各ワークの座標系を設定し、測定を行う技術が知られている(例えば、特許文献1等参照)。 Conventionally, when repeatedly measuring a plurality of workpieces, the position and rotation angle of each workpiece are detected by pattern matching using a pattern image of the master workpiece, and the coordinate system of each workpiece is determined using the detected position and rotation angle data. A technique for setting and measuring is known (see, for example, Patent Document 1).
特開2015-200582号公報Japanese Patent Laid-Open No. 2015-200582
 しかしながら、上記特許文献1等では、ワークの画像測定は難しく、測定を失敗したり、精度よく行えない場合がある。 However, in the above-mentioned Patent Document 1 or the like, it is difficult to measure the image of the workpiece, and the measurement may fail or may not be performed accurately.
 本発明は上記の課題に鑑みてなされたものであり、簡単に画像測定することが可能な画像測定方法、画像測定プログラム及び画像測定装置、並びに物品の良否を適切に判定することが可能な物品の製造方法を提供することを目的とする。 The present invention has been made in view of the above problems, and an image measurement method, an image measurement program, an image measurement apparatus, and an article capable of appropriately determining the quality of an article that can be easily measured. It aims at providing the manufacturing method of.
 本発明の画像測定方法は、第1の物品における異なる部分の画像の中から、該画像に関する特徴に基づいて、画像を選択することと、前記選択された画像と、第2の物品における前記選択された画像に対応する部分の画像とに基づいて、前記第2の物品に関する位置合わせを行うことと、前記第2の物品を画像測定することを含む。 The image measurement method of the present invention includes selecting an image from images of different parts of the first article based on characteristics relating to the image, the selected image, and the selection of the second article. And positioning the second article based on the image of the portion corresponding to the image obtained, and measuring the image of the second article.
 本発明の物品の製造方法は、物品を製造することと、前記製造することにおいて製造された前記物品を前記第2の物品として、本発明の画像測定方法を用いた画像測定を実行することと、前記画像測定の結果に基づいて、前記物品の良否を判定することとを含む。 The method for manufacturing an article of the present invention includes: manufacturing an article; and performing image measurement using the image measurement method of the present invention with the article manufactured in the manufacturing as the second article. And determining the quality of the article based on the result of the image measurement.
 本発明の画像測定プログラムは、コンピュータに、第1の物品における異なる部分の画像の中から、該画像に関する特徴に基づいて、画像を選択することと、前記選択された画像と、第2の物品における前記選択された画像に対応する部分の画像とに基づいて、前記第2の物品に関する位置合わせを行うことと、前記第2の物品を画像測定することを実行させるプログラムである。 The image measurement program of the present invention selects, on a computer, an image based on characteristics relating to the image from images of different parts of the first article, the selected image, and the second article. Is a program that executes alignment of the second article and image measurement of the second article based on the image of the portion corresponding to the selected image in the above.
 本発明の画像測定装置は、第1の物品における異なる部分の画像の中から、該画像に関する特徴に基づいて、画像を選択する画像選択部と、前記選択された画像と、第2の物品における前記選択された画像に対応する部分の画像とに基づいて、前記第2の物品に関する位置合わせを行う位置合わせ部と、前記第2の物品を画像測定する画像測定部と、を備えている。 The image measurement device of the present invention includes an image selection unit that selects an image from images of different parts of the first article based on characteristics relating to the image, the selected image, and the second article. An alignment unit that performs alignment on the second article based on an image of a portion corresponding to the selected image, and an image measurement unit that measures an image of the second article.
 本発明の画像測定方法、画像測定プログラム及び画像測定装置は、簡単に画像測定を行うことができるという効果を奏する。また、本発明の物品の製造方法は、物品の良否を適切に判定することができるという効果を奏する。 The image measurement method, the image measurement program, and the image measurement apparatus according to the present invention have an effect that image measurement can be easily performed. In addition, the method for manufacturing an article of the present invention has an effect that the quality of the article can be determined appropriately.
第1の実施形態に係る画像測定装置の構成を概略的に示す図である。1 is a diagram schematically illustrating a configuration of an image measurement device according to a first embodiment. 測定項目リストを示す図である。It is a figure which shows a measurement item list. 制御ユニットのブロック図(ハードウェア構成)である。It is a block diagram (hardware structure) of a control unit. CPU190の詳細ブロック図である。It is a detailed block diagram of CPU190. 図5(a)は、座標系DBを示す図であり、図5(b)は、画像情報DBを示す図である。FIG. 5A is a diagram showing the coordinate system DB, and FIG. 5B is a diagram showing the image information DB. 基準座標系、測定箇所及び補正用画像を説明するための図である。It is a figure for demonstrating a reference coordinate system, a measurement location, and the image for correction | amendment. 図7(a)、図7(b)は、基準座標系と測定座標系との回転誤差について説明するための図である。FIGS. 7A and 7B are diagrams for explaining a rotation error between the reference coordinate system and the measurement coordinate system. 図8(a)、図8(b)は、測定座標系の補正について説明するための図である。FIG. 8A and FIG. 8B are diagrams for explaining the correction of the measurement coordinate system. 制御ユニットの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of a control unit. 図9の測定プログラム作成処理の具体的な処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the specific process of the measurement program creation process of FIG. 図10の基準座標系設定処理の具体的な処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the specific process of the reference | standard coordinate system setting process of FIG. 図10の測定処理の具体的な処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a specific process of the measurement process of FIG. 図10の測定プログラム保存処理の具体的な処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the specific process of the measurement program preservation | save process of FIG. 図9の繰り返し測定処理の具体的な処理の流れを示すフローチャートである。10 is a flowchart showing a specific processing flow of the repeated measurement processing of FIG. 9. 図14の測定座標系の補正処理の具体的な処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a specific process of the correction process of the measurement coordinate system of FIG. 各補正用画像の各項目に点数をつけた例を示す図である。It is a figure which shows the example which gave the score to each item of each image for a correction | amendment. 第2の実施形態にかかるCPU190の詳細ブロック図である。It is a detailed block diagram of CPU190 concerning 2nd Embodiment. 第2の実施形態にかかる測定プログラム保存処理の具体的な処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the specific process of the measurement program preservation | save process concerning 2nd Embodiment. 図19(a)、図19(b)は、座標系設定用画像DBについて説明するための図である。FIG. 19A and FIG. 19B are diagrams for explaining the coordinate system setting image DB. 第2の実施形態にかかる繰り返し測定処理の具体的な処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the specific process of the repeated measurement process concerning 2nd Embodiment. 図21(a)、図21(b)は、図20のステップS414について説明するための図である。FIG. 21A and FIG. 21B are diagrams for explaining step S414 in FIG.
《第1の実施形態》
 以下、第1の実施形態に係る画像測定装置について、図1~図15に基づいて詳細に説明する。図1には、第1の実施形態に係る画像測定装置100の構成が概略的に示されている。
<< First Embodiment >>
Hereinafter, the image measuring apparatus according to the first embodiment will be described in detail with reference to FIGS. FIG. 1 schematically shows the configuration of an image measuring apparatus 100 according to the first embodiment.
 画像測定装置100は、図1に示すように、測定装置本体1と、制御ユニット2と、表示装置193と、入力装置195と、を備える。 As shown in FIG. 1, the image measurement device 100 includes a measurement device main body 1, a control unit 2, a display device 193, and an input device 195.
 測定装置本体1は、支持体3と、支持体3のベース部3a上に設けられたXYステージ5と、XYステージ5の上方に位置するように支持体3の支柱部3bに支持された撮像部6と、を有する。 The measuring apparatus main body 1 includes a support 3, an XY stage 5 provided on the base 3 a of the support 3, and an imaging supported by the support 3 of the support 3 so as to be positioned above the XY stage 5. Part 6.
 XYステージ5は、水平面内の直交する2軸方向(X軸及びY軸方向)に移動するステージである。XYステージ5の上面には、自動車の部品や機械の部品などの物品7(以下、測定対象物7と呼ぶ)が載置される。測定対象物7は、支持体3のベース部3aに設けられた透過照明光学系8又は撮像部6に設けられた落射照明光学系9によって照明される。なお、XYステージ5の上面には、測定対象物7を測定する前に、測定プログラム(後述)の作成において利用する物品(以下、基準物品と呼ぶ)が載置される。 The XY stage 5 is a stage that moves in two orthogonal directions (X-axis and Y-axis directions) in a horizontal plane. On the upper surface of the XY stage 5, an article 7 (hereinafter referred to as a measurement object 7) such as an automobile part or a machine part is placed. The measurement object 7 is illuminated by the transmission illumination optical system 8 provided on the base 3 a of the support 3 or the epi-illumination optical system 9 provided on the imaging unit 6. Note that an article (hereinafter referred to as a reference article) used for creating a measurement program (described later) is placed on the upper surface of the XY stage 5 before the measurement object 7 is measured.
 XYステージ5には、制御ユニット2からのステージ移動指示に基づきXYステージ5を2次元方向に移動させるXYステージ駆動部10と、XYステージ5の座標を検出し、ステージ座標値を表わす信号を制御ユニット2に対して出力するステージ位置検出部(不図示)とが設けられている。XYステージ駆動部10は、XYステージ5をX軸及びY軸方向にそれぞれ駆動するX軸用モータ及びY軸用モータを有する。ステージ位置検出部は、XYステージ5のX軸及びY軸方向の位置をそれぞれ検出するX軸用エンコーダ及びY軸用エンコーダを有する。 The XY stage 5 detects the coordinates of the XY stage 5 and moves the XY stage 5 in a two-dimensional direction based on a stage movement instruction from the control unit 2, and controls a signal representing the stage coordinate value. A stage position detector (not shown) for outputting to the unit 2 is provided. The XY stage drive unit 10 includes an X-axis motor and a Y-axis motor that drive the XY stage 5 in the X-axis and Y-axis directions, respectively. The stage position detection unit includes an X-axis encoder and a Y-axis encoder that detect the positions of the XY stage 5 in the X-axis and Y-axis directions, respectively.
 撮像部6は、落射照明光学系9のほか、測定対象物7からの光を結像する対物レンズ(不図示)と、結像光学系12と、結像光学系12により結像された測定対象物7の像を捉え(受け)、捉えた像の光強度分布に応じた電気信号を出力するCCD(Charge Coupled Device)カメラ13とを有する。また、本第1の実施形態の結像光学系12は変倍光学系になっている。なお、結像光学系は変倍光学系でなくてもよく、固定倍率の光学系であってもよい。 In addition to the epi-illumination optical system 9, the imaging unit 6 includes an objective lens (not shown) that forms an image of light from the measurement object 7, an imaging optical system 12, and a measurement imaged by the imaging optical system 12. It has a CCD (Charge-Coupled Device) camera 13 that captures (receives) an image of the object 7 and outputs an electrical signal corresponding to the light intensity distribution of the captured image. The imaging optical system 12 of the first embodiment is a variable magnification optical system. The imaging optical system may not be a variable magnification optical system, but may be an optical system with a fixed magnification.
 なお、撮像部6の近傍には、不図示のオートフォーカス機構が設けられている。オートフォーカス機構は、画像測定の際に測定対象物7に自動で焦点を合わせるためのものである。このオートフォーカスの方式としては、結像光学系12と測定対象物7のZ軸方向の相対的な距離を変化させて複数の画像を取得し、画像のコントラストが最大となる位置を合焦位置として算出するパッシブ方式と呼ばれる方式や、レーザダイオードやLED(Light Emitting Diode)光を補助光として測定対象物7に照射し、その反射光の光点位置の変位等から合焦位置を知るアクティブ方式と呼ばれるものがある。なお、オートフォーカス機構は、オートフォーカスの際に得られる情報に基づいて、測定対象物7の高さ測定(Z位置の測定)を行うこともできる。 Note that an autofocus mechanism (not shown) is provided in the vicinity of the imaging unit 6. The autofocus mechanism is for automatically focusing on the measurement object 7 during image measurement. As this autofocus method, a plurality of images are acquired by changing the relative distance between the imaging optical system 12 and the measuring object 7 in the Z-axis direction, and the position where the contrast of the image is maximized is determined as the in-focus position. A passive method that calculates as the active method that irradiates the measurement object 7 with auxiliary light such as a laser diode or LED (Light Emitting Diode) light and knows the in-focus position from the displacement of the light spot position of the reflected light, etc. There is something called. Note that the autofocus mechanism can also measure the height of the measurement object 7 (measurement of the Z position) based on information obtained during autofocus.
 制御ユニット2は、測定装置本体1の動作を制御して、測定対象物7の像を撮像して画像を取得し、取得した画像を表示装置193に表示する。また、制御ユニット2は、例えば同一ロットで製造された複数の物品を測定対象物として、各物品を測定し、測定結果に基づいて各物品の良否を判定する処理(以下、繰り返し測定と呼ぶ)を実行する。なお、測定対象物は、同一ロットで製造された物品でなくてもよい。例えば、測定対象物は、異なるロットで製造された、一部の形状が共通する物品であってもよい。 The control unit 2 controls the operation of the measurement apparatus main body 1, captures an image of the measurement object 7, acquires the image, and displays the acquired image on the display device 193. Moreover, the control unit 2 measures each article using, for example, a plurality of articles manufactured in the same lot as a measurement object, and determines the quality of each article based on the measurement result (hereinafter referred to as repeated measurement). Execute. Note that the measurement object may not be an article manufactured in the same lot. For example, the measurement object may be an article that is manufactured in different lots and has a part of the same shape.
 繰り返し測定においては、制御ユニット2は、XYステージ5の上面に載置される測定対象物7の画像に含まれる幾何形状(言い換えると、画像中における測定対象物7の輪郭)を、既存の特定方法により、画像のコントラストに基づいて特定し、特定した幾何形状に関する測定を行い、測定した幾何形状に関する情報を表示装置193に表示する。ここで、幾何形状とは、幾何学的な基本形状を意味し、円、直線、点、円弧などを含む。また、幾何形状に関する測定を行うとは、測定対象物7の画像から特定された幾何形状に近似する形状の輪郭に関する測定を実行することを意味する。図2は、幾何形状を測定する場合の具体的な測定項目を例示した測定項目リストである。図2に示すように、例えば、幾何形状として直線を測定する場合は、測定対象物7の画像において直線に近似する輪郭(言い換えると、直線)を特定し、特定した輪郭の角度(X軸からの角度)、真直度、単位ベクトル、始点座標、終点座標などを求める。
 ここで、画像中の幾何形状は、以下の方法により特定する。なお、画像中の幾何形状は、以下の方法で特定しなくてもよく、既存の他の方法により特定してもよい。
(1)ユーザが表示装置193に表示された画像上で入力装置195を介して選択した箇所(例えば、点)の周辺の輝度値の平均値を算出し、算出した平均値を用いて画像を2値化する。
(2)次に、ユーザが選択した箇所を始点とし、始点を中心として複数の方向に沿って、測定対象物7の画像における画素の輝度値(信号強度)に基づくコントラストを算出し、複数の方向について算出したコントラストのうち、コントラストが最も大きい方向をスキャン方向として決定し、その方向においてコントラストが最も大きくなる箇所の座標を検出して幾何形状の一部(言い換えると、画像中における測定対象物7の輪郭上の点)と特定する。
(3)次に、決定したスキャン方向とは異なる方向に(例えばスキャン方向と直交する方向に)所定のピッチだけ離れた位置で再度、(2)のスキャン方向に沿ってコントラストを算出し、コントラストが最大となる箇所の座標を検出して幾何形状の一部(輪郭上の点)と特定する。
(4)幾何形状の一部(輪郭上の点)が見つからなくなるまで(3)を繰り返し、測定対象物7の輪郭上の点列を取得する。そして、ユーザによって選択された幾何形状の種類に基づいて、取得した輪郭上の点列から幾何形状を特定する。
In the repetitive measurement, the control unit 2 determines the geometric shape included in the image of the measurement object 7 placed on the upper surface of the XY stage 5 (in other words, the contour of the measurement object 7 in the image). By the method, the measurement is performed based on the contrast of the image, the measurement regarding the specified geometric shape is performed, and the information regarding the measured geometric shape is displayed on the display device 193. Here, the geometric shape means a geometric basic shape, and includes a circle, a straight line, a point, an arc, and the like. In addition, the measurement related to the geometric shape means that the measurement related to the contour of the shape that approximates the geometric shape specified from the image of the measurement object 7 is performed. FIG. 2 is a measurement item list exemplifying specific measurement items when measuring a geometric shape. As shown in FIG. 2, for example, when measuring a straight line as a geometric shape, an outline (in other words, a straight line) that approximates a straight line is specified in the image of the measurement object 7, and the angle of the specified outline (from the X axis) Angle), straightness, unit vector, start point coordinates, end point coordinates, and the like.
Here, the geometric shape in the image is specified by the following method. The geometric shape in the image may not be specified by the following method, and may be specified by another existing method.
(1) An average value of luminance values around a location (for example, a point) selected via the input device 195 on the image displayed on the display device 193 by the user is calculated, and an image is displayed using the calculated average value. Binarize.
(2) Next, the contrast based on the luminance value (signal intensity) of the pixel in the image of the measurement object 7 is calculated along a plurality of directions centering on the start point at the location selected by the user, Of the contrasts calculated for the direction, the direction with the highest contrast is determined as the scan direction, and the coordinates of the part where the contrast is the highest in that direction are detected and a part of the geometric shape (in other words, the measurement object in the image) 7).
(3) Next, contrast is calculated again along the scan direction of (2) at a position separated by a predetermined pitch in a direction different from the determined scan direction (for example, in a direction orthogonal to the scan direction). The coordinates of the place where the maximum is detected is detected and specified as a part of the geometric shape (point on the contour).
(4) (3) is repeated until a part of the geometric shape (point on the contour) is not found, and a point sequence on the contour of the measurement object 7 is acquired. And based on the kind of geometric shape selected by the user, a geometric shape is specified from the acquired point sequence on the contour.
 また、制御ユニット2は、繰り返し測定の前に、例えば測定対象物の1つである第1の物品を基準物品とし、該基準物品を用いて第2の物品である測定対象物7の繰り返し測定に必要な測定プログラムを作成する処理を行う。ここで、測定プログラムとは、繰り返し測定の際に測定の基準となる座標系(測定座標系と呼ぶ)を設定するために用いる基準座標系の情報や、繰り返し測定において測定する箇所(測定箇所)、測定箇所の適正値(良否判定に用いる基準値)など、繰り返し測定に必要な情報を格納するプログラムである。ここで、本第1の実施形態において、基準座標系は、XYステージ5上に載置された基準物品を撮像した画像においてユーザが設定する任意の座標系である。基準座標系は、基準物品の各箇所の位置を定義する座標系である。また、基準座標系は、基準物品において、繰り返し測定で画像測定する箇所(測定箇所)の位置を定義する座標系とも言い換えることができる。ここで、測定対象物7がXYステージ5上に載置された場合に設定される測定座標系は、測定対象物7の各箇所の位置を定義する座標系であり(つまり、測定座標系は、測定対象物7において、繰り返し測定で画像測定する箇所の位置を定義する座標系とも言い換えることができる)、測定座標系と測定対象物7との位置関係は、基準座標系と基準物品との位置関係と対応している。したがって、基準座標系と測定座標系は、同一の性質を有する座標系であるといえるが、本実施形態においては、説明の便宜上、各座標系を“基準座標系”、“測定座標系”という異なる名称で呼ぶものとする。なお、測定プログラムに含まれる基準座標系の情報には、XYステージ5の座標系(いわゆる機械座標系、以下、ステージ座標系と称する)における基準座標系の原点の位置座標や、基準座標系のステージ座標系に対する回転角度が含まれる。制御ユニット2は、基準座標系と基準物品との位置関係と、測定座標系と測定対象物7との位置関係とを合わせるように測定座標系の位置・姿勢を設定した後、繰り返し測定を実行する。このように、基準座標系と基準物品との位置関係と、測定座標系と測定対象物7との位置関係とを合わせるのは、基準物品を用いて設定した測定箇所の基準座標系における位置座標と、測定対象物7における画像測定の対象箇所の測定座標系における位置座標とを合わせるためである。そして、これらの位置関係を合わせることにより、測定対象物7における所望の箇所の画像測定を行うことができる。ここで、基準座標系と基準物品との位置関係と、測定座標系と測定対象物7との位置関係とを合わせるとは、完全一致する場合に限らず、許容できる誤差の範囲内(例えば、繰り返し測定において生じる測定誤差の最大値が所定範囲内)でわずかに一致していない場合も含む概念である。繰り返し測定においては、測定対象物7それぞれに対して設定される測定座標系を用いて測定箇所の測定を行う。 In addition, before the repeated measurement, the control unit 2 uses, for example, a first article that is one of the measurement objects as a reference article, and repeatedly measures the measurement object 7 that is the second article using the reference article. To create a measurement program necessary for Here, the measurement program refers to information on a reference coordinate system used for setting a coordinate system (referred to as a measurement coordinate system) to be used as a measurement reference in repeated measurement, and a location (measurement location) to be measured in repeated measurement. This is a program for storing information necessary for repeated measurement, such as an appropriate value of a measurement location (a reference value used for pass / fail judgment). Here, in the first embodiment, the reference coordinate system is an arbitrary coordinate system set by the user in an image obtained by imaging the reference article placed on the XY stage 5. The reference coordinate system is a coordinate system that defines the position of each part of the reference article. In addition, the reference coordinate system can be rephrased as a coordinate system that defines the position of a location (measurement location) where image measurement is performed by repeated measurement in the reference article. Here, the measurement coordinate system set when the measurement object 7 is placed on the XY stage 5 is a coordinate system that defines the position of each location of the measurement object 7 (that is, the measurement coordinate system is The measurement object 7 can also be referred to as a coordinate system that defines the position of the location where the image is measured by repeated measurement). The positional relationship between the measurement coordinate system and the measurement object 7 is the relationship between the reference coordinate system and the reference article. Corresponds to the positional relationship. Therefore, the reference coordinate system and the measurement coordinate system can be said to be coordinate systems having the same properties, but in this embodiment, for convenience of explanation, each coordinate system is referred to as a “reference coordinate system” and a “measurement coordinate system”. It shall be called with a different name. The information on the reference coordinate system included in the measurement program includes the position coordinates of the origin of the reference coordinate system in the coordinate system of the XY stage 5 (so-called machine coordinate system, hereinafter referred to as the stage coordinate system), the reference coordinate system The rotation angle with respect to the stage coordinate system is included. The control unit 2 sets the position and orientation of the measurement coordinate system so as to match the positional relationship between the reference coordinate system and the reference article and the positional relationship between the measurement coordinate system and the measurement object 7, and then repeatedly performs measurement. To do. In this way, the positional relationship between the reference coordinate system and the reference article and the positional relationship between the measurement coordinate system and the measurement object 7 are matched with the position coordinates in the reference coordinate system of the measurement location set using the reference article. This is to match the position coordinates in the measurement coordinate system of the image measurement target portion in the measurement object 7. Then, by combining these positional relationships, it is possible to perform image measurement of a desired location in the measurement object 7. Here, matching the positional relationship between the reference coordinate system and the reference article and the positional relationship between the measurement coordinate system and the measurement object 7 is not limited to a perfect match, but within an allowable error range (for example, This is a concept that includes a case where the maximum value of measurement errors that occur in repeated measurement is slightly inconsistent within a predetermined range. In the repeated measurement, the measurement location is measured using a measurement coordinate system set for each measurement object 7.
 本第1の実施形態においては、基準物品を、同一ロットで製造された複数の物品のうちの1つとすることができるが、これに限られるものではない。例えば、基準物品は、同一ロットで製造され、良品であることが確認されている物品であってもよい。また、基準物品は、同一ロットで製造された物品でなくてもよく、例えば、同一ロットで製造された複数の物品と類似する物品であり、測定する幾何形状の大きさ、形状、位置が同一又は類似する物品であってもよい。 In the first embodiment, the reference article can be one of a plurality of articles manufactured in the same lot, but is not limited thereto. For example, the reference article may be an article manufactured in the same lot and confirmed to be a non-defective product. The reference article may not be an article manufactured in the same lot. For example, the reference article is an article similar to a plurality of articles manufactured in the same lot, and the size, shape, and position of the geometric shape to be measured are the same. Or it may be a similar article.
 図3には、制御ユニット2のブロック図(ハードウェア構成)が示されている。図3に示すように、制御ユニット2は、CPU(Central Processing Unit)190、ROM(Read Only Memory)192、RAM(Random Access Memory)194、記憶部(ここではHDD(Hard Disk Drive))196、及び可搬型記憶媒体用ドライブ199等を備えている。これら制御ユニット2の構成各部は、バス198に接続されている。 FIG. 3 shows a block diagram (hardware configuration) of the control unit 2. As shown in FIG. 3, the control unit 2 includes a CPU (Central Processing Unit) 190, a ROM (Read Only Memory) 192, a RAM (Random Access Memory) 194, a storage unit (here HDD (Hard Disk Drive)) 196, And a portable storage medium drive 199 and the like. Each component of the control unit 2 is connected to the bus 198.
 表示装置193は、液晶ディスプレイ等を含み、入力装置195は、コントローラ、キーボードやマウス等を含む。なお、入力装置195は、表示装置193に一体的に設けられたタッチパネルディスプレイであってもよい。表示装置193及び入力装置195は、不図示の入出力インタフェース等を介して図3のバス198に接続されている。 The display device 193 includes a liquid crystal display and the like, and the input device 195 includes a controller, a keyboard, a mouse, and the like. Note that the input device 195 may be a touch panel display provided integrally with the display device 193. The display device 193 and the input device 195 are connected to the bus 198 in FIG. 3 via an input / output interface (not shown).
 図4には、CPU190の詳細ブロック図が示されている。なお、図4においては、図示及び説明の便宜上、HDD196に格納されている全体画像DB38、座標系DB40、画像情報DB42、及び測定プログラムDB44も図示されている。制御ユニット2は、図4に示すように、測定プログラム作成部20と、繰り返し測定部30と、を有する。なお、図4の各部の機能は、CPU190がROM192あるいはHDD196に格納されているプログラム(画像測定プログラムを含む)、或いは可搬型記憶媒体用ドライブ199が可搬型記憶媒体191から読み取ったプログラム(画像測定プログラムを含む)を実行することにより実現されている。 FIG. 4 shows a detailed block diagram of the CPU 190. In FIG. 4, the entire image DB 38, the coordinate system DB 40, the image information DB 42, and the measurement program DB 44 stored in the HDD 196 are also illustrated for convenience of illustration and description. As shown in FIG. 4, the control unit 2 includes a measurement program creation unit 20 and a repeated measurement unit 30. 4 functions as a program (including an image measurement program) stored in the ROM 192 or the HDD 196 by the CPU 190 or a program (image measurement) read from the portable storage medium 191 by the portable storage medium drive 199. (Including programs).
 測定プログラム作成部20は、基準物品を用いて測定プログラムを作成し、測定プログラムDB44に保存する。測定プログラム作成部20は、図4に示すように、全体画像取得部22と、座標系設定部24と、予備測定部26と、測定プログラム保存部28と、を有する。 The measurement program creation unit 20 creates a measurement program using the reference article and stores it in the measurement program DB 44. As shown in FIG. 4, the measurement program creation unit 20 includes an entire image acquisition unit 22, a coordinate system setting unit 24, a preliminary measurement unit 26, and a measurement program storage unit 28.
 全体画像取得部22は、XYステージ5上に基準物品が載置された状態で、XYステージ5の移動と撮像部6による撮像とを繰り返すことで得られた画像をつなぎ合わせ、基準物品の全体を含む画像(以下、全体画像と称する)を作成する。つなぎ合わせて作成された全体画像は、スティッチング画像とも呼ばれる。なお、全体画像は、複数の画像をつなぎ合わせた画像でなくてもよい。例えば、撮像部6の視野内に基準物品の全体が入る場合には、基準物品全体を撮像した1枚の画像を全体画像としてもよい。ここで、全体画像取得部22は、全体画像を作成した際に、つなぎ合わせた各画像のステージ座標系上における位置座標を取得し、HDD196等の記憶部に格納されている全体画像DB38に記憶しているものとする。この全体画像DB38を参照することで、つなぎ合わせた各画像の各点の位置座標を特定することができる。 The whole image acquisition unit 22 joins the images obtained by repeating the movement of the XY stage 5 and the imaging by the imaging unit 6 in a state where the reference article is placed on the XY stage 5, and the whole reference article is obtained. (Hereinafter referred to as an entire image). The whole image created by joining together is also called a stitching image. The entire image may not be an image obtained by connecting a plurality of images. For example, when the entire reference article falls within the field of view of the imaging unit 6, one image obtained by imaging the entire reference article may be used as the entire image. Here, when the entire image is created, the entire image acquisition unit 22 acquires the position coordinates of the connected images on the stage coordinate system and stores them in the entire image DB 38 stored in the storage unit such as the HDD 196. Suppose you are. By referring to the entire image DB 38, the position coordinates of each point of the connected images can be specified.
 座標系設定部24は、ユーザが入力装置195を介して、全体画像上で指定した座標系を画像測定の基準座標系として設定する。言い換えると、ステージ座標系上の全体画像(基準物品)に対して基準座標系を設定する。この場合、ユーザは、例えば、全体画像上で基準座標系の原点として設定したい位置を選択するとともに、基準座標系の2軸(X軸、Y軸)の向き(ステージ座標系における回転角度)を入力する。図6は、XYステージ5上に基準物品が載置された状態を模式的に示す図である。本第1の実施形態では、ユーザは、一例として、図6に示す基準物品の左下角部に基準座標系を設定したものとする。座標系設定部24は、基準座標系の原点の位置座標(ステージ座標系の座標)及び基準座標系の回転角度(ステージ座標系に対する回転角度)を座標系DB40に格納する。図5(a)には、座標系DB40のデータ構造の一例が示されている。図5(a)においては、基準座標系の原点の座標としてステージ座標系における座標値(a,b)が格納され、基準座標系の回転角度(ステージ座標系における回転角度)としてα°が格納されている。なお、上述したように、本第1の実施形態では、ユーザは全体画像上で基準座標系を指定する場合について説明したが、基準物品全体の画像でなくてもよく、例えば、ユーザは、基準物品の画像をつなぎ合わせた基準物品の一部の画像上において、基準座標系を指定してもよいし、特定の視野で撮像部6が撮像した画像、すなわち、基準物品の一部分を撮像した画像において、基準座標系を指定することとしてもよい。この場合、ユーザは入力装置195を介してXYステージ駆動部10に指示を出し、XYステージ5を所望の位置に移動させ、当該位置において撮像部6により撮像された画像上で基準座標系を指定することとしてもよい。 The coordinate system setting unit 24 sets a coordinate system designated on the entire image by the user via the input device 195 as a reference coordinate system for image measurement. In other words, the reference coordinate system is set for the entire image (reference article) on the stage coordinate system. In this case, for example, the user selects a position to be set as the origin of the reference coordinate system on the entire image, and sets the directions of two axes (X axis and Y axis) of the reference coordinate system (rotation angle in the stage coordinate system). input. FIG. 6 is a diagram schematically showing a state in which the reference article is placed on the XY stage 5. In the first embodiment, as an example, it is assumed that the user sets the reference coordinate system at the lower left corner of the reference article shown in FIG. The coordinate system setting unit 24 stores the position coordinates of the origin of the reference coordinate system (the coordinates of the stage coordinate system) and the rotation angle of the reference coordinate system (the rotation angle with respect to the stage coordinate system) in the coordinate system DB 40. FIG. 5A shows an example of the data structure of the coordinate system DB 40. In FIG. 5A, coordinate values (a, b) in the stage coordinate system are stored as the coordinates of the origin of the reference coordinate system, and α ° is stored as the rotation angle of the reference coordinate system (rotation angle in the stage coordinate system). Has been. As described above, in the first embodiment, the case where the user designates the reference coordinate system on the entire image has been described. However, the image may not be an image of the entire reference article. The reference coordinate system may be specified on the image of a part of the reference article obtained by connecting the images of the articles, or an image captured by the imaging unit 6 in a specific field of view, that is, an image captured of a part of the reference article. The reference coordinate system may be designated. In this case, the user issues an instruction to the XY stage driving unit 10 via the input device 195, moves the XY stage 5 to a desired position, and designates the reference coordinate system on the image captured by the imaging unit 6 at the position. It is good to do.
 図4に戻り、予備測定部26は、XYステージ5上に基準物品が載置された状態で、ユーザが繰り返し測定で画像測定したい測定箇所(すなわち、基準物品における測定対象の幾何形状)を全体画像上で指定すると、指定された測定箇所(幾何形状)の測定項目を測定する。なお、本実施形態においては、この基準物品における測定箇所の測定を予備測定と呼ぶものとする。この予備測定の際には、画像の撮像条件がユーザにより設定される。画像の撮像条件には、例えば照明条件と倍率条件が含まれる。照明条件は、前述した透過照明光学系8を用いた透過照明方法を用いるか、落射照明光学系9を用いた落射照明方法を用いるかを意味する。倍率条件は、撮像部6が有する結像光学系12の結像倍率、すなわち撮像倍率を意味する。ただし、倍率条件は、撮像部6の対物レンズのレンズ倍率、結像光学系12の倍率×対物レンズのレンズ倍率であってもよい。なお、ユーザは、全体画像上ではなく、基準物品の一部分を撮像した画像上において、測定箇所を選択してもよい。予備測定部26は、幾何形状の測定を、座標系DB40に格納されている基準座標系を用いて実行するものとする。すなわち、予備測定部26は、図6の基準座標系の原点の座標を(0,0)として、予備測定を実行する。この場合、基準座標系とステージ座標系との相対的な位置関係は既知であるので、ステージ座標系において測定を実行しているとも言い換えることができる。なお、予備測定部26は、予備測定した測定箇所の情報、測定項目や測定結果の情報を測定プログラムの一部とする。 Returning to FIG. 4, the preliminary measurement unit 26 sets the entire measurement point (that is, the geometric shape of the measurement target in the reference article) that the user wants to perform image measurement by repeated measurement in a state where the reference article is placed on the XY stage 5. When specified on the image, the measurement item at the specified measurement location (geometric shape) is measured. In the present embodiment, the measurement at the measurement location in the reference article is referred to as preliminary measurement. In this preliminary measurement, an image capturing condition is set by the user. The image capturing condition includes, for example, an illumination condition and a magnification condition. The illumination condition means whether the above-described transmission illumination method using the transmission illumination optical system 8 or the epi-illumination method using the epi-illumination optical system 9 is used. The magnification condition means the imaging magnification of the imaging optical system 12 included in the imaging unit 6, that is, the imaging magnification. However, the magnification condition may be the lens magnification of the objective lens of the imaging unit 6, the magnification of the imaging optical system 12, and the lens magnification of the objective lens. Note that the user may select a measurement location not on the entire image but on an image obtained by capturing a part of the reference article. The preliminary measurement unit 26 performs measurement of the geometric shape using a reference coordinate system stored in the coordinate system DB 40. That is, the preliminary measurement unit 26 performs the preliminary measurement with the coordinates of the origin of the reference coordinate system in FIG. 6 as (0, 0). In this case, since the relative positional relationship between the reference coordinate system and the stage coordinate system is known, it can also be said that the measurement is performed in the stage coordinate system. Note that the preliminary measurement unit 26 uses the information of the preliminarily measured measurement locations, the measurement items, and the information of the measurement results as part of the measurement program.
 予備測定部26は、基準物品において測定箇所の予備測定を行った後に、予備測定時の照明条件及び倍率条件を維持したまま、測定箇所を含む画像(補正用画像と呼ぶ)を撮像し、撮像した補正用画像を画像情報DB42(図5(b)参照)に記憶する。補正用画像は、後述する繰り返し測定部30において利用する画像である。例えば、図6に示すように、太線で示す測定箇所(直線、円弧(半円)、円弧(1/4円))の測定を行った場合には、予備測定部26は、各測定箇所の代表点(例えば中心や重心など)と撮像部6の視野の中心とを一致させた状態で画像を撮像する。この場合、破線矩形で示す画像P1,P2,P3が補正用画像として取得される。また、予備測定部26は、補正用画像を取得したときの基準座標系における座標値(例えば、基準座標系における画像の中心座標)を取得し、基準座標値として画像情報DB42に記憶する。また、予備測定部26は、予備測定時(補正用画像の撮像時)の照明条件及び倍率条件、予備測定において測定した形状の情報を画像情報DB42に保存する。また、予備測定部26は、基準座標値に基づいて、画像の位置を示す情報として、基準座標系における補正用画像の中心座標と基準座標系の原点との距離(すなわち、基準座標系の原点と補正用画像の距離を示す情報)を計算し、画像情報DB42に記憶するとともに、補正用画像を取得したときの照明条件と倍率条件についても画像情報DB42に記憶する。なお、基準座標系の原点と、補正用画像との距離を示す情報は、必ずしも基準座標系の原点と補正用画像の中心座標との距離でなくてもよい。例えば、基準座標系の原点の近傍の所定点と、補正用画像の所定点(中心点以外の点であってもよい)との距離であってもよい。また、基準座標系の原点と、補正用画像との距離を示す情報は、基準座標系における補正用画像の所定の点の座標値そのものであってもよい。この場合、例えば、基準座標系における補正用画像の中心座標であってもよい。 The preliminary measurement unit 26, after performing the preliminary measurement of the measurement location on the reference article, captures an image including the measurement location (referred to as a correction image) while maintaining the illumination condition and the magnification condition at the time of the preliminary measurement. The corrected image is stored in the image information DB 42 (see FIG. 5B). The correction image is an image used in the repeated measurement unit 30 described later. For example, as shown in FIG. 6, when the measurement points (straight line, arc (semicircle), arc (1/4 circle)) indicated by bold lines are measured, the preliminary measurement unit 26 An image is captured in a state where the representative point (for example, the center and the center of gravity) and the center of the field of view of the imaging unit 6 are matched. In this case, images P1, P2, and P3 indicated by broken line rectangles are acquired as correction images. Further, the preliminary measurement unit 26 acquires a coordinate value in the reference coordinate system (for example, the center coordinate of the image in the reference coordinate system) when the correction image is acquired, and stores the acquired coordinate value in the image information DB 42. Further, the preliminary measurement unit 26 stores the illumination condition and magnification condition at the time of preliminary measurement (when the correction image is captured) and information on the shape measured in the preliminary measurement in the image information DB 42. Further, the preliminary measurement unit 26 uses the distance between the center coordinates of the correction image in the reference coordinate system and the origin of the reference coordinate system as information indicating the position of the image based on the reference coordinate value (that is, the origin of the reference coordinate system). And the information indicating the distance between the correction images) are calculated and stored in the image information DB 42, and the illumination condition and the magnification condition when the correction image is acquired are also stored in the image information DB 42. Note that the information indicating the distance between the origin of the reference coordinate system and the correction image is not necessarily the distance between the origin of the reference coordinate system and the center coordinate of the correction image. For example, it may be a distance between a predetermined point near the origin of the reference coordinate system and a predetermined point of the correction image (may be a point other than the center point). The information indicating the distance between the origin of the reference coordinate system and the correction image may be the coordinate value itself of a predetermined point of the correction image in the reference coordinate system. In this case, for example, the center coordinates of the correction image in the reference coordinate system may be used.
 なお、予備測定部26は、ユーザによって測定箇所が指定された際に、測定箇所の予備測定を行わなくてもよい。この場合、予備測定部26は、測定箇所が指定された場合に、測定箇所を含む画像を撮像し画像情報DB42に記憶すればよい。 Note that the preliminary measurement unit 26 may not perform preliminary measurement of the measurement location when the measurement location is designated by the user. In this case, the preliminary measurement unit 26 may capture an image including the measurement location and store it in the image information DB 42 when the measurement location is designated.
 なお、予備測定部26は、基準座標系における補正用画像の中心座標と基準座標系の原点との距離を画像情報DB42に記憶したが、これに限らず、ステージ座標系における補正用画像の中心画像とステージ座標系の原点との距離を記憶してもよいし、基準座標系における補正用画像の中心座標とステージ座標系の原点との距離を記憶してもよい。 The preliminary measurement unit 26 stores the distance between the center coordinates of the correction image in the reference coordinate system and the origin of the reference coordinate system in the image information DB 42, but is not limited thereto, and the center of the correction image in the stage coordinate system is not limited thereto. The distance between the image and the origin of the stage coordinate system may be stored, or the distance between the center coordinate of the correction image in the reference coordinate system and the origin of the stage coordinate system may be stored.
 さらに、予備測定部26は、補正用画像の撮像後に撮像部6により撮像した基準物品の画像(以下、テストマッチング用の画像と呼ぶ)と、補正用画像と、を用いて、テストマッチング用の画像中に含まれる補正用画像と類似する箇所(対応する部分)を特定する処理(パターンマッチング)を実行し、補正用画像とテストマッチング用の画像の対応箇所との類似度(マッチングスコア)を算出する。パターンマッチングのアルゴリズムとしては、正規化相関法や、幾何学形状パターンマッチング法など既存の方法を用いることができる。本実施形態においては、予備測定部26が実行するパターンマッチングをテストマッチングと呼ぶものとし、予備測定部26が算出するマッチングスコアをテストマッチングスコアと呼ぶものとする。ここで、テストマッチング用の画像には、補正用画像との類似度が所定値以上の箇所が複数存在する場合がある。すなわち、テストマッチング用の画像に補正用画像と類似する形状が複数存在する場合がある。この場合、類似度の最大値を特定するとともに、類似度が所定値以上となった箇所の数を特定する。そして、予備測定部26は、類似度の最大値をテストマッチングスコアとして、画像情報DB42に記憶し、類似度が所定値以上となった箇所の数をテストマッチングの検出数として、画像情報DB42に記憶する。ここで、テストマッチングスコアは、基準物品の表面状態や、照明条件(透過照明又は落射照明)により影響を受ける、補正用画像を用いたパターンマッチングのしやすさを示す指標である。テストマッチングスコアは、照明条件が透過照明であり、画像の明暗がはっきりしている場合に高い値を示したり、照明条件が落射照明であり、基準物品の表面に模様や回路パターンなどが存在する場合に低い値を示したりする。 Further, the preliminary measurement unit 26 uses the reference article image (hereinafter referred to as a test matching image) captured by the imaging unit 6 after the correction image is captured, and the correction image to perform test matching. A process (pattern matching) for identifying a portion (corresponding portion) similar to the correction image included in the image is executed, and the similarity (matching score) between the correction image and the corresponding portion of the test matching image is calculated. calculate. As a pattern matching algorithm, an existing method such as a normalized correlation method or a geometric shape pattern matching method can be used. In the present embodiment, the pattern matching performed by the preliminary measurement unit 26 is referred to as test matching, and the matching score calculated by the preliminary measurement unit 26 is referred to as a test matching score. Here, the test matching image may have a plurality of locations where the similarity to the correction image is a predetermined value or more. That is, there may be a plurality of shapes similar to the correction image in the test matching image. In this case, the maximum value of the similarity is specified, and the number of places where the similarity is equal to or higher than a predetermined value is specified. Then, the preliminary measurement unit 26 stores the maximum value of the similarity as the test matching score in the image information DB 42, and sets the number of locations where the similarity is equal to or greater than the predetermined value as the number of detected test matches in the image information DB 42. Remember. Here, the test matching score is an index indicating the ease of pattern matching using the correction image, which is influenced by the surface state of the reference article and the illumination condition (transmission illumination or epi-illumination). The test matching score shows a high value when the illumination condition is transmitted illumination and the image is clear, or the illumination condition is epi-illumination, and there is a pattern or circuit pattern on the surface of the reference article In some cases, a low value is indicated.
 また、予備測定部26は、測定箇所において測定した幾何形状の種類を、測定した形状として画像情報DB42に記憶する。図5(b)の画像情報DB42には、1つの基準物品から得られた補正用画像として、補正用画像ファイル1.bmp~3.bmpの情報が格納された状態が示されている。 Also, the preliminary measurement unit 26 stores the type of geometric shape measured at the measurement location in the image information DB 42 as the measured shape. The image information DB 42 in FIG. 5B shows a state in which information of correction image files 1.bmp to 3.bmp is stored as a correction image obtained from one reference article.
 図4に戻り、測定プログラム保存部28は、ユーザが入力装置195を介して測定プログラムの名称を入力した場合に、入力された名称と対応付けて測定プログラムDB44に測定プログラムを保存する。ここで、測定プログラムは、基準座標系の情報、測定箇所の情報を含む。基準座標系の情報は、座標系DB40から取得できるステージ座標系における基準座標系の原点の位置座標やステージ座標系に対する基準座標系の回転角度の情報を含む。測定箇所の情報は、基準物品の測定箇所の測定結果(測定項目、及び測定された値)を含む。 4, when the user inputs the name of the measurement program via the input device 195, the measurement program storage unit 28 stores the measurement program in the measurement program DB 44 in association with the input name. Here, the measurement program includes information on the reference coordinate system and information on the measurement location. The information of the reference coordinate system includes information on the position coordinates of the origin of the reference coordinate system in the stage coordinate system that can be acquired from the coordinate system DB 40 and the rotation angle of the reference coordinate system with respect to the stage coordinate system. The information on the measurement location includes the measurement result (measurement item and measured value) of the measurement location of the reference article.
 繰り返し測定部30は、XYステージ5上に測定対象物7が載置された状態で、測定対象物7の測定座標系を設定し、設定した測定座標系を用いて、測定対象物7の繰り返し測定を実行する。ここで、測定対象物7の測定座標系を設定することは、測定対象物7と測定座標系との相対的な位置合わせを行うことであり、すなわち、測定対象物7に関する位置合わせを実行することを意味する。 The repeated measurement unit 30 sets the measurement coordinate system of the measurement object 7 in a state where the measurement object 7 is placed on the XY stage 5, and repeats the measurement object 7 using the set measurement coordinate system. Perform the measurement. Here, setting the measurement coordinate system of the measurement object 7 means performing relative alignment between the measurement object 7 and the measurement coordinate system, that is, performing alignment with respect to the measurement object 7. Means that.
 繰り返し測定部30は、測定対象物7を撮像した画像上でユーザが測定座標系を設定した場合に、設定された測定座標系を補正用画像を用いて補正する。詳細については後述するが、繰り返し測定部30は、補正用画像と、測定対象物7を撮像した画像とのパターンマッチングを行い、パターンマッチングの結果に基づいて、測定座標系を補正する。ここで、繰り返し測定は、XYステージ5上から基準物品を退かした後、測定対象物7をXYステージ5上に置いた状態(置きなおした状態)で行われるため、XYステージ5上に載置していた基準物品の位置・姿勢に、測定対象物7の位置・姿勢を合わせることは難しい。したがって、基準座標系をそのまま測定座標系として用いることはできない。このため、ユーザは、測定プログラムを作成する際に設定した基準座標系のおおよその位置(図6に示す基準物品に対して指定した基準座標系の位置)を覚えておき、測定対象物7に対しても同様の位置に測定座標系を設定する。この場合、ユーザが測定座標系を設定するため、設定した測定座標系の原点及び回転角度と、基準座標系の原点及び回転角度とを合わせることは難しい。したがって、繰り返し測定部30は、測定対象物7と測定座標系の位置関係を、図6の基準座標系と基準物品の位置関係と合わせるように補正を行うことで、基準物品を用いて設定した測定箇所の基準座標系における位置座標と、測定対象物7における画像測定の対象箇所の測定座標系における位置座標とを合わせるようにしている。ここで、例えば、補正用画像をユーザに撮像させるとすると、特にユーザが画像測定装置を扱う初心者であるほど、測定座標系の補正に適した画像を撮像することができない可能性が高い。例えば、初心者等は、補正用画像を撮像する際に、基準座標系と測定座標系の回転誤差の影響を受けやすい箇所を認識したうえで、基準物品の撮像箇所を決めることは難しい。また、初心者等は、測定対象物7を撮像した画像とのパターンマッチングしやすい画像の特徴を認識したうえで、補正用画像を撮像することは難しい。また、初心者等は、パターンマッチングを高精度に行うことが可能な画像の特徴を認識したうえで、補正用画像を撮像することは難しい。また、初心者等は、補正用画像を撮像した箇所の周辺の状態が補正精度に与える影響まで考慮して補正用画像を撮像することは難しい。更に、予備測定時の照明条件や倍率条件(補正用画像を撮像したときの照明条件や倍率条件)が測定座標系の補正に与える影響を考慮して補正用画像の照明条件や倍率条件を決めることも難しい。この場合、測定座標系の補正ができず(補正に失敗し)、画像を撮像しなおす必要が生じたり、測定座標系の補正ができた(補正に成功した)としても補正精度が低い可能性がある。補正精度が低い場合、繰り返し測定の精度が悪化したり、繰り返し測定ができず、補正用画像を撮像しなおす必要が生じるおそれがある。そこで、本第1の実施形態では、前述した予備測定部26が、補正用画像を自動的に撮像し、後述するように、繰り返し測定部30が、撮像された補正用画像の中から実際に測定座標系の補正に用いる補正用画像を自動的に抽出することとしている。なお、本第1の実施形態において説明する測定座標系の補正は、画像測定の座標系を設定する処理に含まれる概念である。 The repetitive measurement unit 30 corrects the set measurement coordinate system using the correction image when the user sets the measurement coordinate system on the image obtained by imaging the measurement object 7. Although details will be described later, the repetitive measurement unit 30 performs pattern matching between the correction image and an image obtained by imaging the measurement object 7, and corrects the measurement coordinate system based on the pattern matching result. Here, since the repetitive measurement is performed in a state in which the measurement object 7 is placed on the XY stage 5 (replaced state) after the reference article is retracted from the XY stage 5, the measurement is placed on the XY stage 5. It is difficult to match the position / posture of the measurement object 7 with the position / posture of the reference article placed. Therefore, the reference coordinate system cannot be used as it is as the measurement coordinate system. For this reason, the user remembers the approximate position (the position of the reference coordinate system designated with respect to the reference article shown in FIG. 6) of the reference coordinate system set when creating the measurement program, The measurement coordinate system is set at the same position. In this case, since the user sets the measurement coordinate system, it is difficult to match the origin and rotation angle of the set measurement coordinate system with the origin and rotation angle of the reference coordinate system. Accordingly, the repeated measurement unit 30 is set using the reference article by correcting the positional relation between the measurement object 7 and the measurement coordinate system so as to match the positional relation between the reference coordinate system and the reference article in FIG. The position coordinates of the measurement location in the reference coordinate system and the position coordinates in the measurement coordinate system of the image measurement target location on the measurement object 7 are matched. Here, for example, assuming that the user captures an image for correction, there is a high possibility that an image suitable for correcting the measurement coordinate system cannot be captured, especially as the user is a beginner handling the image measuring apparatus. For example, it is difficult for a beginner or the like to determine an imaging location of a reference article after recognizing a location that is susceptible to the rotation error between the reference coordinate system and the measurement coordinate system when capturing a correction image. Moreover, it is difficult for beginners or the like to capture a correction image after recognizing the features of an image that is easy to pattern match with an image of the measurement object 7. In addition, it is difficult for beginners and the like to capture a correction image after recognizing image features that allow pattern matching with high accuracy. In addition, it is difficult for beginners and the like to capture a correction image in consideration of the influence of the surrounding state of the location where the correction image is captured on the correction accuracy. Further, the illumination condition and magnification condition of the correction image are determined in consideration of the influence of the illumination condition and magnification condition during the preliminary measurement (the illumination condition and magnification condition when the correction image is captured) on the correction of the measurement coordinate system. It is also difficult. In this case, the measurement coordinate system cannot be corrected (correction has failed), and it may be necessary to recapture the image, or even if the measurement coordinate system has been corrected (corrected successfully), the correction accuracy may be low There is. If the correction accuracy is low, the accuracy of repeated measurement may deteriorate, or repeated measurement may not be possible, and it may be necessary to recapture a correction image. Therefore, in the first embodiment, the preliminary measurement unit 26 described above automatically captures the correction image, and the repeated measurement unit 30 actually performs the correction from the captured correction images, as will be described later. A correction image used for correcting the measurement coordinate system is automatically extracted. The correction of the measurement coordinate system described in the first embodiment is a concept included in the process of setting the image measurement coordinate system.
 ここで、例えば、基準座標系と測定座標系の回転角度に誤差がある場合には、原点からの距離が遠い座標ほど、位置誤差が大きくなる。図7(a)は、XYステージ5上に基準物品が載置された状態の一例を示す図であり、図7(b)は、XYステージ5上に基準物品に代えて測定対象物7が載置された(置き直された)状態の一例を示す図である。なお、図7(a)、図7(b)においては、XYステージ5自体の図示は省略している。例えば、XYステージ5上に載置された基準物品において基準座標系の原点と測定箇所(円弧)の中心Cとの位置関係が、図7(a)に示すような位置関係であったとする。この場合、測定対象物7の測定座標系として図7(b)において破線で示すような座標系を設定すべきところ、ユーザが一点鎖線で示すような座標系を設定したとする。かかる場合に、座標系間の角度誤差がθであったとすると、原点からL(mm)だけ離れた測定箇所の中心Cと、一点鎖線で示す測定座標系上の中心Cに対応する点(C’)との誤差Δpは、次式(1)のように表される。
Δp={(Lsinθ)2+(L(1-cosθ)21/2   …(1)
Here, for example, when there is an error in the rotation angles of the reference coordinate system and the measurement coordinate system, the position error increases as the distance from the origin increases. FIG. 7A is a diagram showing an example of a state in which the reference article is placed on the XY stage 5, and FIG. 7B shows the measurement object 7 in place of the reference article on the XY stage 5. It is a figure which shows an example of the state mounted (replaced). In FIGS. 7A and 7B, the XY stage 5 itself is not shown. For example, it is assumed that the positional relationship between the origin of the reference coordinate system and the center C of the measurement location (arc) in the reference article placed on the XY stage 5 is the positional relationship as shown in FIG. In this case, it is assumed that a coordinate system as indicated by a broken line in FIG. 7B is to be set as the measurement coordinate system of the measurement object 7, but the user sets a coordinate system as indicated by a one-dot chain line. In this case, if the angle error between the coordinate systems is θ, the center C of the measurement location separated by L (mm) from the origin and the point (C corresponding to the center C on the measurement coordinate system indicated by the alternate long and short dash line) The error Δp with respect to ') is expressed as the following equation (1).
Δp = {(Lsinθ) 2 + (L (1-cosθ) 2 } 1/2 (1)
 上式(1)によれば、例えば、θ=0.5°、L=200mmの場合には、約1.75mmの誤差が生じることになる。画像測定装置100の撮像部6の視野は、倍率が高ければ、0.04mm×0.03mm程度になる場合もあるため、約1.75mmの誤差は無視できないレベルの誤差であるといえる。 According to the above equation (1), for example, when θ = 0.5 ° and L = 200 mm, an error of about 1.75 mm occurs. Since the field of view of the imaging unit 6 of the image measuring apparatus 100 may be about 0.04 mm × 0.03 mm if the magnification is high, an error of about 1.75 mm is an error that cannot be ignored.
 そこで、測定座標系の補正においては、繰り返し測定部30は、まず、測定座標系の補正に用いる補正用画像を画像情報DB42から抽出する。この場合、繰り返し測定部30は、あらかじめ定められている補正用画像の位置を示す項目(下記(a))や、補正用画像の特徴を示すパラメータの項目(下記(b)、(c))、補正用画像の撮像条件を示す項目(下記(d),(e))に基づいて、測定座標系の補正に用いる補正用画像を抽出する。これらの項目は、画像に関する特徴を意味する。
(a)基準座標系の原点から距離が遠い
(b)テストマッチングの検出数が少ない
(c)テストマッチングスコアが高い
(d)ズーム倍率が低い
(e)照明条件が透過照明
Therefore, in the correction of the measurement coordinate system, the repeated measurement unit 30 first extracts a correction image used for the correction of the measurement coordinate system from the image information DB 42. In this case, the repetitive measurement unit 30 includes items (position (a) below) indicating predetermined positions of the correction image and parameter items (features (b) and (c) below) indicating the characteristics of the correction image. Then, based on the items indicating the imaging conditions of the correction image (the following (d) and (e)), the correction image used for correcting the measurement coordinate system is extracted. These items mean features related to images.
(A) The distance from the origin of the reference coordinate system is long (b) The number of test matching detections is small (c) The test matching score is high (d) The zoom magnification is low (e) The illumination condition is transmitted illumination
 抽出の際に、各項目は、(a)→(b)→(c)→(d)→(e)の順に用いることとする。すなわち、繰り返し測定部30は、上記順に従って用いる項目を特定し、特定した項目の内容を満足する補正用画像を測定座標系の補正に用いる補正用画像として抽出する。具体的には、繰り返し測定部30は、最初に、項目(a)に基づいて、最も距離が遠い補正用画像を測定座標系の補正に用いる補正用画像として抽出する。この場合、最も距離が遠い補正用画像が複数存在していれば、次の項目(b)に基づいて、そのうちでテストマッチングの検出数が最も少ない画像を測定座標系の補正に用いる補正用画像として抽出する。また、最も距離が遠く、かつ検出数が最も少ない補正用画像が複数存在している場合には、項目(c)に基づいて、テストマッチングスコアが最も高い画像を測定座標系の補正に用いる補正用画像として抽出する。ここで、項目(a)において、基準座標系の原点からの距離が遠い補正用画像を抽出するのは、基準座標系の原点からの距離が遠い補正用画像ほど基準座標系と測定座標系との回転誤差の影響を受ける画像であり、当該画像を測定座標系の補正に用いることで、測定座標系を精度よく補正できるからである。また、項目(b)において、テストマッチングの検出数が最も少ない画像を抽出するのは、測定座標系の補正に用いる補正用画像と類似する箇所が測定対象物7を撮像した画像に多く存在することにより生じる、補正の失敗や補正精度の悪化を防止するためである。ここで、補正用画像と類似する箇所が多く存在すると、補正用画像と対応する箇所以外の箇所(誤った箇所)に基づいて測定座標系を補正する可能性があり、誤った箇所に基づいて測定座標系を補正することで補正が失敗したり、補正精度が悪化するおそれがある。また、項目(c)において、テストマッチングスコアが高い補正用画像を抽出するのは、テストマッチングスコアが高い補正用画像ほどパターンマッチングがしやすい画像であるからであり、このような補正用画像を用いることで、パターンマッチングを失敗することなく、測定座標系の補正を確実かつ精度よく行うことができるからである。また、項目(d)において、撮像時のズーム倍率が低い補正用画像を抽出するのは、ズーム倍率が低い補正用画像は、撮像視野が広いため、測定対象物7を撮像した画像において補正用画像に類似する箇所を確実に見つけることができ、測定座標系の補正を確実に行うことができるからである。また、ズーム倍率が低い補正用画像を抽出することで、測定座標系の補正に失敗するなどして補正用画像を抽出しなおす可能性を低減することができるため、簡単に(短時間で)適切な補正用画像を抽出できるからである。また、項目(e)において、撮像時の照明条件が透過照明である補正用画像を測定座標系の補正に用いる補正用画像として抽出するのは、照明条件が落射照明である補正用画像よりもコントラストが大きい補正用画像を優先的に用いることで、測定対象物7を撮像した画像において補正用画像に類似する箇所を確実かつ精度よく抽出することができるからである。すなわち、上記項目(a)~(e)を用いて測定座標系の補正に用いる補正用画像を抽出することで、ユーザが測定初心者であっても、測定座標系の補正を確実かつ高精度に行うことができる補正用画像を測定座標系の補正に用いる補正用画像として自動的に抽出することができる。なお、項目(a)~(e)の順は、変更してもよい。例えば、(b)と(c)の順を入れ替えたり、(d)と(e)の順を入れ替えてもよい。 In the extraction, each item is used in the order of (a) → (b) → (c) → (d) → (e). That is, the repeated measurement unit 30 identifies items to be used according to the above order, and extracts a correction image satisfying the contents of the identified items as a correction image to be used for correction of the measurement coordinate system. Specifically, the repeated measurement unit 30 first extracts a correction image having the longest distance as a correction image used for correcting the measurement coordinate system based on the item (a). In this case, if there are a plurality of correction images having the longest distance, a correction image that uses the image with the smallest number of test matching detections for correcting the measurement coordinate system based on the next item (b). Extract as Further, when there are a plurality of correction images having the longest distance and the smallest number of detections, correction using the image having the highest test matching score for correcting the measurement coordinate system based on the item (c) Extract as an image. Here, in the item (a), the correction image that is farther from the origin of the reference coordinate system is extracted because the correction image that is farther from the origin of the reference coordinate system is the reference coordinate system and the measurement coordinate system. This is because the measurement coordinate system can be accurately corrected by using the image for correction of the measurement coordinate system. In addition, in the item (b), the image having the smallest number of test matching detections is extracted because there are many portions similar to the correction image used for correction of the measurement coordinate system in the image obtained by imaging the measurement object 7. This is to prevent the failure of correction and the deterioration of correction accuracy caused by the above. Here, if there are many parts similar to the correction image, there is a possibility of correcting the measurement coordinate system based on a part other than the part corresponding to the correction image (wrong part). By correcting the measurement coordinate system, the correction may fail or the correction accuracy may deteriorate. In addition, in the item (c), the reason why the correction image having a high test matching score is extracted is that the correction image having a higher test matching score is more easily pattern-matched. This is because the measurement coordinate system can be corrected reliably and accurately without failing pattern matching. In addition, in the item (d), the correction image with a low zoom magnification at the time of imaging is extracted because the correction image with a low zoom magnification has a wide imaging field of view, so that the correction image in the image obtained by imaging the measurement object 7 is corrected. This is because a portion similar to the image can be found reliably and the measurement coordinate system can be reliably corrected. Also, by extracting a correction image with a low zoom magnification, the possibility of re-extracting the correction image due to failure in correction of the measurement coordinate system or the like can be reduced. This is because an appropriate correction image can be extracted. In the item (e), the correction image whose illumination condition at the time of imaging is transmission illumination is extracted as the correction image used for correction of the measurement coordinate system than the correction image whose illumination condition is epi-illumination. This is because, by using the correction image having a high contrast preferentially, a portion similar to the correction image can be reliably and accurately extracted in the image obtained by imaging the measurement object 7. That is, by extracting the correction image used for correcting the measurement coordinate system using the above items (a) to (e), the measurement coordinate system can be corrected reliably and accurately even if the user is a beginner of measurement. A correction image that can be performed can be automatically extracted as a correction image used for correcting the measurement coordinate system. Note that the order of the items (a) to (e) may be changed. For example, the order of (b) and (c) may be interchanged, or the order of (d) and (e) may be interchanged.
 なお、本実施形態においては、項目(b)、(c)に代えて、あるいは項目(b)、(c)とともに、補正用画像の特徴量を用いることとしてもよい。この場合、例えばOpenCV 汎用画像処理ライブラリで特徴点を求めることができる。特徴量を求めるアルゴリズムとしては、Accelerated KAZE、SIFT(Scale-invariant feature transform)、SURF(Speed-Upped Robust Feature)などを用いることができる。例えば、回転対称で、測定座標系の補正に用いた場合に誤差が生じやすい形状(例えば円)を含む補正用画像は、特徴量が低いため、特徴量の低い形状を含む補正用画像が優先的に抽出されないようにすることができる。 In this embodiment, the feature amount of the image for correction may be used instead of the items (b) and (c) or together with the items (b) and (c). In this case, for example, the feature points can be obtained using the OpenCV general-purpose image processing library. As an algorithm for obtaining a feature amount, Accelerated KAZE, SIFT (Scale-invariant transform), SURF (Speed-Upped Robust Feature), or the like can be used. For example, a correction image including a shape (for example, a circle) that is rotationally symmetric and that is likely to cause an error when used for correction of a measurement coordinate system has a low feature amount. Therefore, a correction image that includes a shape with a low feature amount has priority. Extraction can be prevented.
 また、繰り返し測定部30は、測定座標系の補正に用いる補正用画像を抽出する際に、項目(a)~(d)において閾値を設定してもよい。例えば、繰り返し測定部30は、項目(a)を適用して、基準座標系の原点からの距離が所定の条件(閾値、例えば、50mm)よりも遠い補正用画像を抽出し、複数抽出された場合には、項目(b)を適用して、抽出された複数の補正用画像のうちテストマッチングの検出数が所定の条件(閾値、例えば2)よりも少ない補正用画像を抽出するというように、ある項目が所定の条件を満たすかを、項目を異ならせながら繰り返し判断することで、複数の補正用画像を徐々に絞り込み、測定座標系の補正に用いる補正用画像を抽出する(選択する)こととしてもよい。 In addition, the repeated measurement unit 30 may set threshold values in the items (a) to (d) when extracting a correction image used for correcting the measurement coordinate system. For example, the repeated measurement unit 30 applies the item (a), extracts a correction image whose distance from the origin of the reference coordinate system is longer than a predetermined condition (threshold value, for example, 50 mm), and a plurality of images are extracted. In this case, the item (b) is applied to extract a correction image in which the number of test matching detections is smaller than a predetermined condition (threshold value, for example, 2) among the plurality of extracted correction images. By repeatedly determining whether an item satisfies a predetermined condition while changing the item, a plurality of correction images are gradually narrowed down, and correction images used for correcting the measurement coordinate system are extracted (selected). It is good as well.
 繰り返し測定部30は、上述したようにして抽出した補正用画像を用いて、測定座標系の補正を行う。図8(a)は、XYステージ5上に基準物品が載置された状態及び抽出された補正用画像を示す図であり、図8(b)は、XYステージ5上に測定対象物7が載置された状態を示すとともに、測定座標系の補正方法について説明するための図である。なお、図8(a)、図8(b)では、XYステージ5自体の図示は省略している。例えば、抽出した補正用画像が、図8(a)において破線矩形で示す範囲を撮像した画像であり、補正用画像に含まれる幾何形状(半円弧)の基準座標(半円弧を含む円の中心座標とする)が(Xt2,Yt2)であったとする。この場合において、図8(b)に示すように、ユーザが測定対象物7に対して一点鎖線で示す測定座標系を設定したとする。この場合、繰り返し測定部30は、座標(Xt2,Yt2)を記憶しているので、その位置が撮像されるようにXYステージ5を移動させ、補正用画像よりも撮像範囲が広い画像を撮像部6を用いて撮像する。この場合の撮像範囲を補正用画像の撮像範囲よりも広くしているのは、撮像した画像内に補正用画像と類似する箇所が含まれる可能性を高めるためである。ただし、撮像範囲は補正用画像の撮像範囲の大きさと同一であってもよい。そして、繰り返し測定部30は、補正用画像とのパターンマッチングにより、測定対象物7における補正用画像に含まれる形状(例えば半円)に対応する箇所の基準座標(半円の重心位置の座標等)を算出する。図8(b)では、検出した基準座標が(Xs2,Ys2)として示されている。 The repeated measurement unit 30 corrects the measurement coordinate system using the correction image extracted as described above. FIG. 8A is a diagram illustrating a state in which the reference article is placed on the XY stage 5 and the extracted correction image. FIG. 8B is a diagram illustrating the measurement object 7 on the XY stage 5. It is a figure for demonstrating the correction | amendment method of a measurement coordinate system while showing the mounted state. In FIG. 8A and FIG. 8B, the XY stage 5 itself is not shown. For example, the extracted correction image is an image obtained by capturing the range indicated by the broken-line rectangle in FIG. 8A, and the reference coordinates (center of the circle including the semi-arc) included in the correction image. Suppose the coordinate is (Xt2, Yt2). In this case, it is assumed that the user has set a measurement coordinate system indicated by a one-dot chain line for the measurement object 7 as shown in FIG. In this case, since the repeated measurement unit 30 stores the coordinates (Xt2, Yt2), the XY stage 5 is moved so that the position is imaged, and an image having a wider imaging range than the correction image is captured. 6 is used to capture an image. The reason why the imaging range in this case is made wider than the imaging range of the correction image is to increase the possibility that a portion similar to the correction image is included in the captured image. However, the imaging range may be the same as the size of the imaging range of the correction image. Then, the repeated measurement unit 30 performs pattern matching with the correction image, and the reference coordinates (coordinates of the center of gravity position of the semicircle, etc.) of the location corresponding to the shape (for example, a semicircle) included in the correction image on the measurement object 7 ) Is calculated. In FIG. 8B, the detected reference coordinates are shown as (Xs2, Ys2).
 繰り返し測定部30は、座標(Xt2,Yt2)と座標(Xs2,Ys2)を用いて、測定座標系の誤差Δθを算出する。具体的には、θs2、θt2を次式(2)、(3)より求め、次式(4)より、Δθを算出する。
 θt2=arctan(Yt2/Xt2)   …(2)
 θs2=arctan(Ys2/Xs2)   …(3)
 Δθ=θt2-θs2   …(4)
The repeated measurement unit 30 calculates an error Δθ of the measurement coordinate system using the coordinates (Xt2, Yt2) and the coordinates (Xs2, Ys2). Specifically, θs2 and θt2 are obtained from the following equations (2) and (3), and Δθ is calculated from the following equation (4).
θt2 = arctan (Yt2 / Xt2) (2)
θs2 = arctan (Ys2 / Xs2) (3)
Δθ = θt2−θs2 (4)
 そして、繰り返し測定部30は、算出したΔθだけ指定された測定座標系を回転することで、測定座標系の補正を行う(図8(b)において一点鎖線で示す座標系が破線で示す座標系となるように調整する)。 Then, the repeated measurement unit 30 corrects the measurement coordinate system by rotating the measurement coordinate system designated by the calculated Δθ (the coordinate system indicated by the alternate long and short dash line in FIG. 8B is the coordinate system indicated by the broken line). Adjust to be).
 また、測定座標系をΔθ回転した後、繰り返し測定部30は、(Xt2、Yt2)と(Xs2、Ys2)を一致させるため(測定座標系の原点と、基準座標系の原点とのXY方向のずれをなくすため)、ずれ分(ΔX,ΔY)だけ、測定座標系の原点をずらすように補正する。 Further, after rotating the measurement coordinate system by Δθ, the repeated measurement unit 30 makes (Xt2, Yt2) and (Xs2, Ys2) coincide with each other (in the XY direction between the origin of the measurement coordinate system and the origin of the reference coordinate system). In order to eliminate the deviation), correction is performed so that the origin of the measurement coordinate system is shifted by the deviation (ΔX, ΔY).
 なお、上記説明においては、1つの補正用画像を用いて測定座標系を補正する場合について説明したが、これに限らず、2以上の補正用画像を上記項目(a)~(e)を用いて抽出し、抽出した各補正用画像を用いてΔθ、ΔX、ΔYをそれぞれ算出し、例えば、算出した複数のΔθ、ΔX、ΔYの平均を用いて測定座標系を補正することとしてもよい。この場合においても、上述した項目の優先順位に従って、測定座標系の補正に用いる2以上の補正用画像を抽出することとすればよい。 In the above description, the case where the measurement coordinate system is corrected using one correction image has been described. However, the present invention is not limited to this, and two or more correction images are used using the items (a) to (e). Then, Δθ, ΔX, ΔY may be calculated using each of the extracted correction images, and for example, the measurement coordinate system may be corrected using an average of the calculated plural Δθ, ΔX, ΔY. Even in this case, two or more correction images used for correction of the measurement coordinate system may be extracted according to the priority order of the items described above.
 以上のようにして、測定座標系を補正した後は、繰り返し測定部30は、補正後の測定座標系を用いてXYステージ5上の測定対象物7に対して、測定プログラムに沿った手順で繰り返し測定を実行する。すなわち、繰り返し測定部30は、測定対象物7の測定箇所を測定する。そして、繰り返し測定部30は、測定結果と、測定プログラムに含まれる基準物品の測定結果と、に基づいて、測定対象物7の良否を判定する。繰り返し測定部30は、測定結果を表示装置193上に表示したり、測定対象物7の良否の判定結果を表示装置193上に表示する。 After correcting the measurement coordinate system as described above, the repeated measurement unit 30 uses the corrected measurement coordinate system for the measurement object 7 on the XY stage 5 according to the procedure according to the measurement program. Perform repeated measurements. That is, the repeated measurement unit 30 measures the measurement location of the measurement object 7. Then, the repeated measurement unit 30 determines pass / fail of the measurement object 7 based on the measurement result and the measurement result of the reference article included in the measurement program. The repeated measurement unit 30 displays the measurement result on the display device 193 or displays the determination result of the quality of the measurement object 7 on the display device 193.
 なお、繰り返し測定部30は、測定箇所の測定結果を用いた良否判定を行わなくてもよい。すなわち、繰り返し測定部30は、測定結果を表示装置193上に表示することで、ユーザに良否判定を行わせてもよい。 Note that the repeated measurement unit 30 does not have to perform pass / fail determination using the measurement result of the measurement location. That is, the repeated measurement unit 30 may cause the user to make a pass / fail determination by displaying the measurement result on the display device 193.
(制御ユニット2の処理手順)
 次に、制御ユニット2の処理手順について図9~図15のフローチャートに沿って詳細に説明する。
(Processing procedure of control unit 2)
Next, the processing procedure of the control unit 2 will be described in detail with reference to the flowcharts of FIGS.
 制御ユニット2では、図9のフローチャートに沿った処理を実行する。具体的には、図9に示すように、測定プログラム作成処理(S1000)と、繰り返し測定処理(S2000)と、を実行する。以下、ステップS1000、S2000の各処理について説明する。 The control unit 2 executes processing according to the flowchart of FIG. Specifically, as shown in FIG. 9, a measurement program creation process (S1000) and a repeated measurement process (S2000) are executed. Hereinafter, each process of step S1000 and S2000 is demonstrated.
<測定プログラム作成処理>
 測定プログラム作成処理(S1000)では、図10のフローチャートに沿った処理が実行される。
<Measurement program creation process>
In the measurement program creation process (S1000), the process according to the flowchart of FIG. 10 is executed.
 図10の処理において、ステップS10では、全体画像取得部22が、基準物品がXYステージ5上に搭載され、測定プログラム作成開始の指示がユーザから出されるまで待機する。ステップS10の判断が肯定されると、全体画像取得部22はステップS12に移行する。 10, in step S10, the entire image acquisition unit 22 waits until the reference article is mounted on the XY stage 5 and an instruction to start measurement program creation is issued from the user. If the determination in step S10 is affirmed, the entire image acquisition unit 22 proceeds to step S12.
 ステップS12に移行すると、全体画像取得部22は、全体画像取得処理を実行する。この場合、全体画像取得部22は、前述したようにXYステージ5を移動可能範囲内で移動させながら撮像部6を用いて画像を撮像し、撮像した画像をつなぎ合わせて全体画像(スティッチング画像)を作成する。また、全体画像取得部22は、つなぎ合わせた各画像のステージ座標系上における位置座標を取得し、全体画像DB38に記憶する。 When the process proceeds to step S12, the entire image acquisition unit 22 executes an entire image acquisition process. In this case, the entire image acquisition unit 22 captures an image using the imaging unit 6 while moving the XY stage 5 within the movable range as described above, and stitches the captured images together to form an entire image (stitching image). ). The overall image acquisition unit 22 acquires the position coordinates on the stage coordinate system of the connected images and stores them in the overall image DB 38.
 次いで、ステップS14では、座標系設定部24が、基準座標系設定処理を実行する。本処理においては、図11のフローチャートに沿った処理が実行される。 Next, in step S14, the coordinate system setting unit 24 executes a reference coordinate system setting process. In this process, the process according to the flowchart of FIG. 11 is executed.
(基準座標系設定処理)
 図11の処理において、ステップS20では、座標系設定部24が、全体画像上で、ユーザによって任意の座標系が指定されるまで待機する。ユーザは、入力装置195を介して、図6に示すように、基準物品の所定位置(例えば、左下角部)を座標系の原点に指定し、座標系の回転角度を所定角度(例えば直交座標系が基準物品の角部の直交する2辺と一致するような角度)に指定する。ユーザによって座標系が指定されると、座標系設定部24はステップS22に移行する。なお、ユーザは、基準物品の角部以外の位置に座標系を指定してもよい。
(Reference coordinate system setting process)
In the process of FIG. 11, in step S20, the coordinate system setting unit 24 stands by until an arbitrary coordinate system is designated by the user on the entire image. As shown in FIG. 6, the user designates a predetermined position (for example, the lower left corner) of the reference article as the origin of the coordinate system via the input device 195, and sets the rotation angle of the coordinate system to a predetermined angle (for example, orthogonal coordinates). The angle is such that the system matches two orthogonal sides of the corner of the reference article. When the coordinate system is designated by the user, the coordinate system setting unit 24 proceeds to step S22. The user may specify a coordinate system at a position other than the corner of the reference article.
 ステップS22に移行すると、座標系設定部24は、指定された座標系を基準座標系として設定する。 In step S22, the coordinate system setting unit 24 sets the designated coordinate system as the reference coordinate system.
 次いで、ステップS24では、座標系設定部24が、基準座標系の情報として、ステージ座標系における基準座標系の原点の座標や、ステージ座標系に対する基準座標系の回転角度を含む情報を座標系DB40(図5(a))に保存する。以上により、図11の処理が終了するので、図10のステップS16に移行する。    Next, in step S24, the coordinate system setting unit 24 uses the coordinate system DB 40 as the reference coordinate system information to include information including the coordinates of the origin of the reference coordinate system in the stage coordinate system and the rotation angle of the reference coordinate system with respect to the stage coordinate system. (FIG. 5 (a)). Thus, the process of FIG. 11 ends, and the process proceeds to step S16 of FIG. *
 ステップS16に移行すると、予備測定部26は、予備測定処理を実行する。本処理においては、図12のフローチャートに沿った処理が実行される。 When the process proceeds to step S16, the preliminary measurement unit 26 performs a preliminary measurement process. In this process, the process according to the flowchart of FIG. 12 is executed.
(予備測定処理)
 図12の処理において、ステップS30では、予備測定部26が、全体画像上でユーザによって測定箇所が指示されるまで待機する。ユーザが入力装置195を介して測定箇所を指示すると、ステップS32に移行し、予備測定部26は、撮像部6の視野内に測定箇所が収まるように、前述した全体画像DB38を参照して、ステージ座標系における指示された測定箇所の座標値に基づいてXYステージ5を移動する。なお、ユーザは、撮像部6が撮像している画像上で測定箇所を指定してもよい。
(Preliminary measurement process)
In the process of FIG. 12, in step S30, the preliminary measurement unit 26 waits until the measurement location is instructed by the user on the entire image. When the user designates a measurement location via the input device 195, the process proceeds to step S32, and the preliminary measurement unit 26 refers to the above-described whole image DB 38 so that the measurement location is within the field of view of the imaging unit 6. The XY stage 5 is moved based on the coordinate value of the designated measurement location in the stage coordinate system. Note that the user may specify a measurement location on the image captured by the imaging unit 6.
 次いで、ステップS34では、予備測定部26が、画像処理により測定箇所の予備測定を行い、予備測定結果を表示装置193上に表示する。予備測定の際には、撮像条件(照明条件や倍率条件)がユーザにより設定される。予備測定においては、例えば、ユーザが測定箇所として円弧を指定した場合には、測定項目である中心座標、直径(半径)、真円度(図2参照)を測定し、測定結果を表示装置193上に表示する。また、予備測定部26は、予備測定時の照明条件及び倍率条件、測定した形状の情報を画像情報DB42に保存する。 Next, in step S34, the preliminary measurement unit 26 performs preliminary measurement of the measurement location by image processing, and displays the preliminary measurement result on the display device 193. In the preliminary measurement, imaging conditions (illumination conditions and magnification conditions) are set by the user. In the preliminary measurement, for example, when the user designates an arc as a measurement location, the center coordinates, diameter (radius), and roundness (see FIG. 2), which are measurement items, are measured, and the measurement result is displayed on the display device 193. Display above. Further, the preliminary measurement unit 26 stores the illumination condition and magnification condition at the time of preliminary measurement, and information on the measured shape in the image information DB 42.
 次いで、ステップS36では、予備測定部26が、予備測定時の照明条件及び倍率条件を維持したまま補正用画像を取得(撮像)し、画像情報DB42(図5(b))に保存する。この際、補正用画像の基準座標値(基準座標系における撮像中心の座標値)と、基準座標系の原点と基準座標との距離を画像情報DB42に保存する。 Next, in step S36, the preliminary measurement unit 26 acquires (captures) a correction image while maintaining the illumination condition and magnification condition at the time of preliminary measurement, and stores them in the image information DB 42 (FIG. 5B). At this time, the reference coordinate value of the correction image (the coordinate value of the imaging center in the reference coordinate system) and the distance between the origin of the reference coordinate system and the reference coordinate are stored in the image information DB 42.
 次いで、ステップS38では、予備測定部26が、補正用画像の撮像後に撮像部6が撮像したテストマッチング用の画像と、取得した補正用画像と、を用いてパターンマッチング(テストマッチング)を実行する。本テストマッチングにより、前述したテストマッチングスコアと、テストマッチングの検出数を得ることができるので、予備測定部26は、画像情報DB42(図5(b))に保存する。 Next, in step S38, the preliminary measurement unit 26 performs pattern matching (test matching) using the test matching image captured by the imaging unit 6 after capturing the correction image and the acquired correction image. . Since the test matching score and the number of detected test matches can be obtained by this test matching, the preliminary measurement unit 26 stores the image information in the image information DB 42 (FIG. 5B).
 次いで、ステップS40では、予備測定部26が、他の測定箇所が指示されたか否かを判断する。ユーザが新たな測定箇所を指示した場合には、ステップS40の判断が肯定され、ステップS32に戻る。ステップS32に戻ると、予備測定部26は、ステップS32以降の処理を上述したのと同様に実行する。一方、ユーザが入力装置195を介して測定箇所の指示を終了する入力を行った場合には、ステップS40の判断が否定され、図12の処理が終了する。図12の処理が終了すると、図10のステップS18に移行する。 Next, in step S40, the preliminary measurement unit 26 determines whether another measurement location has been instructed. If the user indicates a new measurement location, the determination in step S40 is affirmed and the process returns to step S32. Returning to step S32, the preliminary measurement unit 26 executes the processing after step S32 in the same manner as described above. On the other hand, if the user inputs via the input device 195 to end the instruction of the measurement location, the determination in step S40 is denied and the processing in FIG. 12 ends. When the process in FIG. 12 is completed, the process proceeds to step S18 in FIG.
 ステップS18に移行すると、測定プログラム保存部28が、測定プログラム保存処理を実行する。本処理においては、図13のフローチャートに沿った処理が実行される。 When the process proceeds to step S18, the measurement program storage unit 28 executes a measurement program storage process. In this process, the process according to the flowchart of FIG. 13 is executed.
(測定プログラム保存処理)
 ステップS50では、測定プログラム保存部28が、ユーザによってファイル名が入力され、保存ボタンが押下されるまで待機する。ユーザが入力装置195を介してファイル名を入力し、保存ボタンを押下すると、ステップS52に移行する。
(Measurement program saving process)
In step S50, the measurement program storage unit 28 waits until the file name is input by the user and the save button is pressed. When the user inputs a file name via the input device 195 and presses the save button, the process proceeds to step S52.
 ステップS52に移行すると、測定プログラム保存部28は、基準座標系の情報、測定箇所の情報を含む測定プログラムを測定プログラムDB44に保存する。以上により、図13の処理が終了するとともに、図10の測定プログラム作成処理(S1000)が終了する。 In step S52, the measurement program storage unit 28 stores the measurement program including the reference coordinate system information and the measurement location information in the measurement program DB 44. Thus, the process of FIG. 13 ends and the measurement program creation process (S1000) of FIG. 10 ends.
<繰り返し測定処理>
 次に、図9の繰り返し測定処理(S2000)について説明する。繰り返し測定処理(S2000)では、図14のフローチャートに沿った処理が実行される。
<Repeated measurement process>
Next, the repeated measurement process (S2000) of FIG. 9 will be described. In the repeated measurement process (S2000), a process according to the flowchart of FIG. 14 is executed.
 図14の処理では、まず、ステップS202において、繰り返し測定部30が、ユーザによって測定プログラムが選択されるまで待機する。ユーザが入力装置195を介して保存されている測定プログラムの1つを選択すると、ステップS204に移行し、繰り返し測定部30は、新たな測定対象物7がXYステージ5上に載置され、ユーザにより測定座標系が指定されるまで待機する。ユーザによって、測定座標系が指定されると、ステップS206に移行する。ここで、繰り返し測定は、XYステージ5上から基準物品を退かした後、測定対象物7をXYステージ5上に置いた状態(置きなおした状態)で行われるため、測定対象物7の位置・姿勢を、XYステージ5上に載置していた基準物品の位置・姿勢と合わせることは難しい。したがって、基準座標系をそのまま測定座標系として用いることはできない。このため、ユーザは、測定プログラムを作成する際に設定した基準座標系のおおよその位置を覚えておき、測定対象物7に対しても同様の位置に測定座標系を設定する。この場合、ユーザが測定座標系を設定するため、設定した測定座標系の原点及び回転角度と、基準座標系の原点及び回転角度とを合わせることは難しい。したがって、次のステップS206においては、測定座標系の補正処理を実行する。 In the process of FIG. 14, first, in step S202, the repeated measurement unit 30 waits until a measurement program is selected by the user. When the user selects one of the measurement programs stored via the input device 195, the process proceeds to step S204, and the repetitive measurement unit 30 places the new measurement object 7 on the XY stage 5, and the user Wait until the measurement coordinate system is specified by. When the measurement coordinate system is designated by the user, the process proceeds to step S206. Here, since the repetitive measurement is performed with the measurement object 7 placed on the XY stage 5 (repositioned state) after the reference article is retracted from the XY stage 5, the position of the measurement object 7 is determined. It is difficult to match the posture with the position / posture of the reference article placed on the XY stage 5. Therefore, the reference coordinate system cannot be used as it is as the measurement coordinate system. Therefore, the user remembers the approximate position of the reference coordinate system set when creating the measurement program, and sets the measurement coordinate system at the same position for the measurement object 7. In this case, since the user sets the measurement coordinate system, it is difficult to match the origin and rotation angle of the set measurement coordinate system with the origin and rotation angle of the reference coordinate system. Therefore, in the next step S206, a measurement coordinate system correction process is executed.
 測定座標系の補正処理(S206)においては、繰り返し測定部30は、図15のフローチャートに沿った処理を実行する。 In the measurement coordinate system correction process (S206), the repeated measurement unit 30 executes a process according to the flowchart of FIG.
(測定座標系の補正処理)
 図15のステップS220では、繰り返し測定部30が、測定プログラムDB44に格納されている複数の補正用画像の1つを測定座標系の補正に用いる補正用画像として抽出する。この場合、前述した項目(a)~(e)に基づいて、測定座標系の補正に用いる補正用画像を抽出する。
(Measurement coordinate system correction processing)
In step S220 of FIG. 15, the repeated measurement unit 30 extracts one of a plurality of correction images stored in the measurement program DB 44 as a correction image used for correcting the measurement coordinate system. In this case, a correction image used for correcting the measurement coordinate system is extracted based on the items (a) to (e) described above.
 次いで、ステップS222では、繰り返し測定部30が、抽出した補正用画像の基準座標(幾何形状の中心座標)が撮像部6の視野中心と一致するように、XYステージ5を移動する。なお、基準座標は、測定プログラムDB44に格納されている。次いで、ステップS224では、繰り返し測定部30が、条件設定を行う。この場合、繰り返し測定部30は、測定箇所を予備測定したとき(補正用画像を撮像したとき)の照明条件や倍率条件を画像情報DB42から読み出し、後述するパターンマッチングに用いる画像を撮像するための照明条件及び倍率条件を、読み出した照明条件及び倍率条件に基づいて、設定する。ここでの倍率条件は、前述したように、補正用画像の撮像範囲よりも広い画像を撮像できる倍率条件とすることができる。 Next, in step S222, the iterative measurement unit 30 moves the XY stage 5 so that the reference coordinates (center coordinates of the geometric shape) of the extracted correction image coincide with the center of the field of view of the imaging unit 6. The reference coordinates are stored in the measurement program DB 44. Next, in step S224, the repeated measurement unit 30 sets conditions. In this case, the repeated measurement unit 30 reads the illumination condition and the magnification condition when the measurement location is preliminarily measured (when the correction image is captured) from the image information DB 42 and captures an image used for pattern matching described later. An illumination condition and a magnification condition are set based on the read illumination condition and magnification condition. As described above, the magnification condition here can be a magnification condition that can capture an image wider than the imaging range of the correction image.
 次いで、ステップS226では、繰り返し測定部30が、照明条件や倍率条件を設定した後に撮像部6により撮像された画像と抽出された補正用画像とを用いてパターンマッチング(サーチ)を行う。すなわち、条件設定後に撮像部6により撮像された画像のうち、抽出された補正用画像と類似する箇所を特定する。なお、条件設定後に撮像部6により撮像された画像において、抽出された補正用画像とマッチングする箇所(類似度(マッチングスコア)が所定値以上の箇所)がない場合には、XYステージ5を予め定めた範囲内で移動させて、測定対象物7においてパターンマッチングを実施する範囲を拡大してもよい。この場合、例えば、撮像部6の撮像範囲をn倍(例えば2倍)にし、XYステージ5を撮像範囲の1/n倍(例えば1/2倍)の寸法分だけ移動させて、パターンマッチングを実施する範囲を拡大することができる。 Next, in step S226, the repeated measurement unit 30 performs pattern matching (search) using the image captured by the imaging unit 6 and the extracted correction image after setting the illumination condition and the magnification condition. That is, a part similar to the extracted correction image is specified among the images picked up by the image pickup unit 6 after setting the conditions. In addition, in the image imaged by the imaging unit 6 after setting the conditions, if there is no location matching the extracted correction image (a location where the similarity (matching score) is a predetermined value or more), the XY stage 5 is set in advance. The range in which the pattern matching is performed on the measurement object 7 may be expanded by moving within a predetermined range. In this case, for example, the imaging range of the imaging unit 6 is increased n times (for example, 2 times), and the XY stage 5 is moved by a size that is 1 / n times (for example, 1/2 times) of the imaging range to perform pattern matching. The range to be implemented can be expanded.
 次いで、ステップS228では、繰り返し測定部30が、サーチに失敗したか否かを判断する。ここで、サーチに失敗するとは、パターンマッチングの結果、類似する箇所(類似度(マッチングスコア)が所定値以上の箇所)が存在しない場合等を意味する。サーチに失敗する場合とは、例えば、測定対象物7にバリや傷、ごみ等が存在する場合などである。このステップS228の判断が肯定された場合には、ステップS230に移行し、繰り返し測定部30は、補正用画像を再抽出する。この場合、画像情報DB42に保存された補正用画像のうち、ステップS220で過去に抽出された補正用画像を除く画像の中から、ステップS220と同様の処理により補正用画像を1つ抽出する。その後は、ステップS222に戻る。 Next, in step S228, the repeated measurement unit 30 determines whether the search has failed. Here, the failure of the search means a case where there is no similar part (a part where the similarity (matching score) is a predetermined value or more) as a result of pattern matching. The case where the search fails is, for example, a case where burrs, scratches, dust, etc. exist on the measurement object 7. When the determination in step S228 is affirmed, the process proceeds to step S230, and the repeated measurement unit 30 re-extracts the correction image. In this case, one of the correction images stored in the image information DB 42 is extracted from the images excluding the correction image extracted in the past in step S220 by the same process as in step S220. Thereafter, the process returns to step S222.
 一方、ステップS228の判断が否定された場合、すなわち、ステップS226のサーチに成功した場合には、ステップS232に移行する。 On the other hand, if the determination in step S228 is negative, that is, if the search in step S226 is successful, the process proceeds to step S232.
 ステップS232に移行すると、繰り返し測定部30は、回転誤差Δθや位置誤差ΔX,ΔYを算出する。 When the process proceeds to step S232, the repetitive measurement unit 30 calculates the rotation error Δθ and the position errors ΔX, ΔY.
 次いで、ステップS234では、繰り返し測定部30が、算出エラーとなったか否かを判断する。ここで、算出エラーとは、回転誤差Δθや位置誤差ΔX,ΔYの算出結果が、許容値を超えており、適切な算出結果が得られなかった場合等を意味する。このステップS234の判断が肯定された場合には、ステップS230に移行し、上述したのと同様、ステップS230を行った後、ステップS222に戻る。一方、ステップS234の判断が否定された場合には、ステップS236に移行する。 Next, in step S234, the repeated measurement unit 30 determines whether or not a calculation error has occurred. Here, the calculation error means a case where the calculation result of the rotation error Δθ and the position errors ΔX, ΔY exceeds an allowable value, and an appropriate calculation result cannot be obtained. When the determination in step S234 is affirmed, the process proceeds to step S230, and as described above, after performing step S230, the process returns to step S222. On the other hand, if the determination in step S234 is negative, the process proceeds to step S236.
 ステップS236に移行すると、繰り返し測定部30は、測定座標系を補正する。この場合、繰り返し測定部30は、測定対象物7を撮像した画像上でユーザが設定した測定座標系を、ステップS232で算出した回転誤差Δθや位置誤差ΔX,ΔYの分、補正する。ステップS236の処理が終了すると、図15の全処理を終了し、図14のステップS208に移行する。 When the process proceeds to step S236, the repeated measurement unit 30 corrects the measurement coordinate system. In this case, the repeated measurement unit 30 corrects the measurement coordinate system set by the user on the image obtained by imaging the measurement object 7 by the rotation error Δθ and the position errors ΔX and ΔY calculated in step S232. When the process of step S236 ends, the entire process of FIG. 15 ends, and the process proceeds to step S208 of FIG.
 ステップS208に移行すると、繰り返し測定部30は、測定プログラムに記録されている測定箇所で画像測定を行い、測定結果を表示装置193上に表示する。次いで、ステップS210では、繰り返し測定部30は、繰り返し測定が終了したか否かを判断する。すなわち、ユーザが繰り返し測定を終了する旨を入力装置195を介して入力した場合には、ステップS210の判断が肯定され、図14の処理及び図9の全処理を終了する。一方、ステップS210の判断が否定された場合には、ステップS204に戻り、ステップS204~S210の処理、判断を繰り返し実行する。 In step S208, the repetitive measurement unit 30 performs image measurement at the measurement location recorded in the measurement program and displays the measurement result on the display device 193. Next, in step S210, the repeat measurement unit 30 determines whether the repeat measurement is completed. That is, when the user inputs through the input device 195 that the measurement is to be repeated, the determination in step S210 is affirmed, and the processing in FIG. 14 and all the processing in FIG. 9 are ended. On the other hand, if the determination in step S210 is negative, the process returns to step S204, and the processes and determinations in steps S204 to S210 are repeatedly executed.
 なお、本第1の実施形態において測定座標系を設定することは、基準物品に対してユーザが指定した測定箇所を、測定対象物7において設定することと言い換えることができる。 In addition, setting the measurement coordinate system in the first embodiment can be rephrased as setting the measurement location designated by the user for the reference article in the measurement object 7.
 以上、詳細に説明したように、本第1の実施形態によると、繰り返し測定部30は基準物品における異なる部分の画像(補正用画像)の中から、該補正用画像の特徴(基準座標系の原点からの距離やテストマッチングスコア等)に基づいて、測定座標系の補正に用いる補正用画像を抽出し、抽出した補正用画像と、測定対象物7における補正用画像に対応する部分の画像とに基づいて、測定対象物7に関する位置合わせを行い、測定対象物7を画像測定する。このように、測定座標系の補正に用いる補正用画像として適切な画像を抽出し、抽出した画像を用いて測定対象物7に関する位置合わせを行うことで、測定対象物7に関する位置合わせを精度よく行うことができる。また、測定対象物7に関する位置合わせを精度よく行うことができることで、測定対象物7の繰り返し測定を高精度に行うことができる。この場合、ユーザに補正用画像を撮像させなくても、自動的に適切な補正用画像を取得できるので、ユーザの手間を省くことができる。特にユーザが初心者である場合には、補正用画像として基準物品のどの箇所を撮像すべきかを判断することが困難なため、自動的に適切な補正用画像を抽出し、測定対象物7に関する位置合わせを行うことで、初心者でも失敗することなく確実に高精度な繰り返し測定を行うことが可能である。 As described above in detail, according to the first embodiment, the iterative measurement unit 30 determines the characteristics (reference coordinate system of the reference coordinate system) from the images (correction images) of different parts of the reference article. A correction image used for correcting the measurement coordinate system is extracted based on the distance from the origin, a test matching score, and the like, and the extracted correction image and an image of a portion corresponding to the correction image in the measurement object 7 Based on the above, alignment with respect to the measurement object 7 is performed, and the measurement object 7 is image-measured. In this way, by extracting an appropriate image as a correction image used for correcting the measurement coordinate system and performing alignment with respect to the measurement object 7 using the extracted image, alignment with respect to the measurement object 7 can be performed with high accuracy. It can be carried out. In addition, since the positioning with respect to the measurement object 7 can be performed with high accuracy, repeated measurement of the measurement object 7 can be performed with high accuracy. In this case, since it is possible to automatically obtain an appropriate correction image without causing the user to capture a correction image, it is possible to save the user's trouble. In particular, when the user is a beginner, it is difficult to determine which part of the reference article should be imaged as the correction image. Therefore, an appropriate correction image is automatically extracted and the position related to the measurement object 7 is determined. By performing the alignment, even a beginner can reliably perform highly accurate repeated measurement without failure.
 また、本第1の実施形態では、繰り返し測定部30は、基準物品に対して設定された基準座標系における補正用画像の位置と、測定対象物7の補正用画像に対応する部分の画像の測定座標系上における位置と、を合わせる(許容できる誤差の範囲内となる)ように、測定対象物7に対して測定座標系を設定する。これにより、基準座標系上における補正用画像の位置と、測定座標系上における測定対象物7の補正用画像に対応する部分の画像の位置とを合わせる(許容できる誤差の範囲内とする)ことができるので、測定対象物7の繰り返し測定を精度よく行うことができる。 In the first embodiment, the iterative measurement unit 30 also calculates the position of the correction image in the reference coordinate system set for the reference article and the portion of the image corresponding to the correction image of the measurement object 7. The measurement coordinate system is set for the measurement object 7 so as to match the position on the measurement coordinate system (within an allowable error range). Thus, the position of the correction image on the reference coordinate system is matched with the position of the image corresponding to the correction image of the measurement object 7 on the measurement coordinate system (within an allowable error range). Therefore, repeated measurement of the measurement object 7 can be performed with high accuracy.
 また、本第1の実施形態では、繰り返し測定部30は、補正に用いる補正用画像を抽出するときに、基準物品に対して設定された基準座標系の原点との距離が長い補正用画像から抽出する(上記項目(a)参照)。これにより、基準座標系と測定座標系との回転誤差の影響を受けやすい、基準座標系の原点から遠い箇所を撮像した補正用画像を用いて補正を行うことで、測定座標系の回転誤差を精度よく補正することができる。このように、自動的に適切な補正用画像を抽出し、測定対象物7に関する位置合わせを行うことで、初心者でも失敗することなく確実に高精度な繰り返し測定を行うことができる。 In the first embodiment, the repeated measurement unit 30 extracts a correction image used for correction from a correction image having a long distance from the origin of the reference coordinate system set for the reference article. Extract (see item (a) above). This makes it possible to reduce the rotation error of the measurement coordinate system by performing correction using a correction image obtained by imaging a location far from the origin of the reference coordinate system, which is susceptible to the rotation error between the reference coordinate system and the measurement coordinate system. It can be corrected with high accuracy. In this way, by automatically extracting an appropriate correction image and performing alignment with respect to the measurement object 7, even a beginner can reliably perform highly accurate repeated measurement without failure.
 また、本第1の実施形態では、繰り返し測定部30は、測定座標系の補正に用いる補正用画像を抽出するときに、補正用画像とテストマッチング用の画像とを用いたパターンマッチング(テストマッチング)により得られるテストマッチングスコアが高い画像から抽出する(上記項目(c)参照)。これにより、補正用画像を用いたパターンマッチングのしやすさを示す指標(基準物品の表面状態等により影響を受ける指標)であるテストマッチングスコアが高い画像を優先的に測定座標系の補正に用いることで、パターンマッチングを失敗することなく、測定対象物7を撮像した画像において補正用画像に類似する箇所(対応する箇所)を精度よく抽出することができる。この場合、補正に失敗するなどして補正用画像を抽出しなおす可能性を低減することができるので、確実かつ精度よく測定座標系の補正を行うことが可能となる。 In the first embodiment, the iterative measurement unit 30 extracts a correction image used for correction of the measurement coordinate system, and performs pattern matching (test matching) using the correction image and the test matching image. ) Is extracted from an image having a high test matching score (see item (c) above). As a result, an image having a high test matching score, which is an index indicating the ease of pattern matching using the correction image (an index affected by the surface condition of the reference article) is preferentially used for correcting the measurement coordinate system. Thus, it is possible to accurately extract a portion (corresponding portion) similar to the correction image in the image obtained by capturing the measurement object 7 without failing the pattern matching. In this case, since it is possible to reduce the possibility of re-extracting the correction image due to failure of correction, the measurement coordinate system can be corrected reliably and accurately.
 また、本第1の実施形態では、繰り返し測定部30は、測定座標系の補正に用いる補正用画像を抽出するときに、テストマッチングの検出数(テストマッチングスコアが所定値以上である数)が少ない補正用画像から抽出する(上記項目(b)参照)。これにより、測定座標系を補正する際の補正用画像と撮像部6が撮像した測定対象物7の画像とのパターンマッチングにおいて、補正用画像に対応する箇所(類似する箇所)が複数特定されることにより、測定座標系の補正の失敗や補正精度が低下することを防止することができるので、ステップS234のような算出エラーの発生を防止することができる。すなわち、補正用画像を撮像した箇所の周辺の状態が補正精度に与える影響を考慮して、補正精度の低下を防止することが可能な補正用画像を自動的に抽出することができる。 In the first embodiment, when the repeated measurement unit 30 extracts a correction image used for correcting the measurement coordinate system, the number of test matching detections (the number of test matching scores equal to or greater than a predetermined value) is calculated. Extract from a small number of correction images (see item (b) above). Thereby, in pattern matching between the image for correction when correcting the measurement coordinate system and the image of the measurement object 7 captured by the imaging unit 6, a plurality of locations (similar locations) corresponding to the image for correction are specified. As a result, it is possible to prevent the measurement coordinate system from failing to be corrected and the correction accuracy from being lowered, so that it is possible to prevent the occurrence of a calculation error as in step S234. That is, it is possible to automatically extract a correction image that can prevent a reduction in correction accuracy in consideration of the influence on the correction accuracy by the state around the location where the correction image is captured.
 また、本第1の実施形態では、繰り返し測定部30は、測定座標系の補正に用いる補正用画像を抽出するときに、予備測定時(補正用画像を撮像した際)の倍率条件(撮像倍率)が低い補正用画像から抽出する(上記項目(d)参照)。この場合、撮像倍率が低い補正用画像は、撮像視野が広いため、測定対象物7を撮像した画像において補正用画像に類似する箇所(対応する箇所)を確実に抽出することができる。この場合、補正に失敗するなどして補正用画像を抽出しなおす可能性を低減することができるので、確実に測定座標系の補正を行うことが可能となり、ひいては、測定座標系の補正を簡単に(短時間)で行うことが可能となる。また、繰り返し測定部30は、測定座標系の補正に用いる補正用画像を抽出するときに、予備測定時(補正用画像を撮像した際)の照明条件が透過照明である補正用画像から抽出する(上記項目(e)参照)。これにより、コントラストが大きい(明暗がはっきりしている)画像を優先的に用いることで、補正用画像と撮像部6が撮像した画像とのパターンマッチングを確実かつ精度よく行うことができ、測定座標系の補正や測定座標家を用いた測定を確実かつ精度よく行うことができる。 In the first embodiment, the repeat measurement unit 30 extracts a correction image used for correction of the measurement coordinate system, and a magnification condition (imaging magnification) at the time of preliminary measurement (when the correction image is captured). ) Is extracted from the image for correction (see item (d) above). In this case, since the correction image with a low imaging magnification has a wide imaging field of view, a portion (corresponding portion) similar to the correction image in the image obtained by imaging the measurement object 7 can be reliably extracted. In this case, it is possible to reduce the possibility of re-extracting the correction image due to failure of the correction, etc., so that the measurement coordinate system can be reliably corrected, and thus the measurement coordinate system can be easily corrected. (Short time). Further, when the correction measurement unit 30 extracts the correction image used for correction of the measurement coordinate system, the repetition measurement unit 30 extracts the illumination condition at the time of preliminary measurement (when the correction image is captured) from the correction image in which the illumination is transmitted. (See item (e) above). Thereby, pattern matching between the correction image and the image captured by the imaging unit 6 can be performed reliably and accurately by preferentially using an image having a large contrast (a clear contrast), and the measurement coordinates System correction and measurement using a measurement coordinater can be performed reliably and accurately.
 また、本第1の実施形態では、繰り返し測定は、XYステージ5上から基準物品を退かした後、測定対象物7をXYステージ5上に置いた状態(置きなおした状態)で行われるため、測定対象物7の位置・姿勢を、XYステージ5上に載置していた基準物品の位置・姿勢と合致させることは難しい。したがって、基準座標系をそのまま測定座標系として用いることはできない。このため、繰り返し測定部30は、測定対象物7に対してユーザが指定した測定座標系を、補正用画像のパターンマッチング結果に基づいて補正する(S204,S206)。この場合、ユーザがおおまかに指定した測定座標系を用いることで、撮像部6が撮像する画像中の補正用画像に対応する箇所の特定(パターンマッチング)を短時間で行うことができる。これにより、測定座標系の設定(補正)を短時間で行うことが可能となる。 In the first embodiment, the repeated measurement is performed in a state where the measurement object 7 is placed on the XY stage 5 (replaced state) after the reference article is retracted from the XY stage 5. It is difficult to match the position / posture of the measurement object 7 with the position / posture of the reference article placed on the XY stage 5. Therefore, the reference coordinate system cannot be used as it is as the measurement coordinate system. For this reason, the repeated measurement unit 30 corrects the measurement coordinate system designated by the user for the measurement object 7 based on the pattern matching result of the correction image (S204, S206). In this case, by using the measurement coordinate system roughly designated by the user, it is possible to specify (pattern matching) a portion corresponding to the correction image in the image captured by the imaging unit 6 in a short time. As a result, the measurement coordinate system can be set (corrected) in a short time.
 また、本第1の実施形態では、予備測定部26は、基準物品上でユーザが指定した測定箇所を予備測定したときに、測定箇所を撮像して、補正用画像を取得する(S36)。そして、繰り返し測定部30は、取得した補正用画像を用いて、ユーザが指定した測定座標系を補正する。この場合、ユーザが補正用画像を撮像する箇所を指定等する必要がなく、補正用画像を自動的に撮像することができる。 In the first embodiment, when the preliminary measurement unit 26 preliminarily measures the measurement location designated by the user on the reference article, the preliminary measurement unit 26 captures the measurement location and acquires a correction image (S36). Then, the repeated measurement unit 30 corrects the measurement coordinate system designated by the user using the acquired correction image. In this case, it is not necessary for the user to designate a location for capturing the correction image, and the correction image can be automatically captured.
 また、本第1の実施形態では、繰り返し測定部30は、測定座標系の補正に用いる補正用画像を抽出した後、測定座標系の補正ができなかった場合に、他の画像を選択しなおす(S230)。これにより、測定座標系の補正を確実に行うことができる。 In the first embodiment, after repeatedly extracting the correction image used for correcting the measurement coordinate system, the repeated measurement unit 30 reselects another image when the measurement coordinate system cannot be corrected. (S230). As a result, the measurement coordinate system can be reliably corrected.
 また、本第1の実施形態では、製造された測定対象物7の測定座標系を精度よく設定し、繰り返し測定により良否判定を行うので、良否判定精度を向上することができる。 In the first embodiment, since the measurement coordinate system of the manufactured measurement object 7 is set with high accuracy and the pass / fail determination is performed by repeated measurement, the pass / fail determination accuracy can be improved.
 なお、本第1の実施形態では、基準物品に対してユーザが指定した測定箇所を撮像して、補正用画像を取得する場合について説明したが、これに限られるものではない。例えば、XYステージ5が予め定められた位置に位置決めされた状態で、補正用画像を撮像するようにしてもよい。また、ユーザからの入力に応じた箇所を補正用画像として撮像することとしてもよい。なお、予備測定部26は、測定箇所を予備測定する前に補正用画像を撮像することとしてもよい。 In the first embodiment, the case has been described in which the measurement location designated by the user with respect to the reference article is captured and the correction image is acquired. However, the present invention is not limited to this. For example, the correction image may be captured in a state where the XY stage 5 is positioned at a predetermined position. Moreover, it is good also as imaging the location according to the input from a user as a correction image. Note that the preliminary measurement unit 26 may capture a correction image before preliminary measurement of the measurement location.
 なお、本第1の実施形態では、図14のステップS206(図15のステップS220)を実行する前に、上述した項目(a)~(e)を用いて補正用画像に対して優先順位を付与しておき、優先順位を補正用画像と紐づけて画像情報DB42に格納しておいてもよい。この場合、繰り返し測定部30は、優先順位を参照することで、測定座標系の補正に用いる補正用画像を簡易に抽出することが可能となる。例えば、測定プログラム作成処理(S1000)における測定処理(S16)の中で、全ての測定箇所に関する補正用画像を取得した際に優先順位を付与してもよい。 In the first embodiment, prior to executing step S206 in FIG. 14 (step S220 in FIG. 15), priorities are assigned to the correction images using the items (a) to (e) described above. Alternatively, the priority order may be associated with the correction image and stored in the image information DB 42. In this case, the repeated measurement unit 30 can easily extract a correction image used for correcting the measurement coordinate system by referring to the priority order. For example, priorities may be assigned when correction images relating to all measurement locations are acquired in the measurement process (S16) in the measurement program creation process (S1000).
 なお、本第1の実施形態では、各画像について各項目(a)~(e)を数値化して評価し(評価値を求め)、各項目を評価した結果(評価値)の合計値に基づいて、各画像の優先順位を決定するようにしてもよい。例えば、図16に示すように、項目(a)“基準座標系の原点からの距離”については、距離が遠い画像ほど高い評価値(点数)を付与し、項目(e)“補正用画像を取得したときの照明条件”については、透過照明の場合に高い点数を付与し、落射照明の場合に低い点数を付与する。また、項目(d)“補正用画像を取得したときの倍率条件”については、倍率が低いほど高い点数を付与し、項目(b)“テストマッチングスコア”については、スコアが高いほど高い点数を付与し、項目(c)“テストマッチングの検出数”については、検出数が少ないほど高い点数を付与する。そして、各画像の点数を合計し、点数が高い順に優先順位を付与する。このようにすることで、各画像の各項目の評価値を考慮した優先順位を各画像に付与することができる。なお、図16の例では、合計値の高い画像2.bmpが抽出される。ここで、各項目に対し、重みづけをすることも可能である。例えば、上述した項目(a)~(e)の順番(a)→(b)→(c)→(d)→(e)に基づいて、各項目の点数に重みづけ係数を積算した後、重みづけ後の点数を合計するようにしてもよい。例えば、項目(a)の重みづけ係数を10、項目(b)の重みづけ係数を8、項目(c)の重みづけ係数を6、項目(d)の重みづけ係数を4、項目(e)の重みづけ係数を2などとすることができる。このように各項目の重みづけ係数(すなわち重みづけ条件)を用いることで、各項目の重要度を考慮して、各画像の優先順位を決定することが可能となる。 In the first embodiment, each item (a) to (e) is evaluated by quantifying (determining an evaluation value) for each image, and based on the total value of the results (evaluation values) of evaluating each item. Thus, the priority order of each image may be determined. For example, as shown in FIG. 16, for the item (a) “distance from the origin of the reference coordinate system”, a higher evaluation value (score) is assigned to an image with a longer distance, and item (e) “correction image is selected. Regarding the “illumination condition at the time of acquisition”, a high score is assigned in the case of transmitted illumination, and a low score is assigned in the case of epi-illumination. In addition, for the item (d) “magnification condition when the correction image is acquired”, a higher score is given as the magnification is lower, and for the item (b) “test matching score”, a higher score is given as the score is higher. As for the item (c) “number of detected test matching”, a higher number is given as the detected number is smaller. Then, the score of each image is summed, and the priority is given in descending order of the score. By doing in this way, the priority which considered the evaluation value of each item of each image can be given to each image. In the example of FIG. 16, the image 2.bmp having a high total value is extracted. Here, each item can be weighted. For example, after adding the weighting coefficient to the score of each item based on the order (a) → (b) → (c) → (d) → (e) of the items (a) to (e) described above, You may make it total the score after weighting. For example, the weighting factor of item (a) is 10, the weighting factor of item (b) is 8, the weighting factor of item (c) is 6, the weighting factor of item (d) is 4, and the item (e) Can be set to 2 or the like. As described above, by using the weighting coefficient (that is, the weighting condition) of each item, it is possible to determine the priority order of each image in consideration of the importance of each item.
 なお、上述したように、補正用画像にあらかじめ優先順位を付与しておく場合にも、優先順位に基づいて複数の補正用画像を抽出し、複数の補正用画像を用いて測定座標系の補正を行うようにすることもできる。この場合、各補正用画像を用いて求められる誤差Δθ、ΔX、ΔYの平均値を用いて、測定座標系の補正を行うこととしてもよい。 As described above, even when priorities are given to the correction images in advance, a plurality of correction images are extracted based on the priorities, and the measurement coordinate system is corrected using the plurality of correction images. It is also possible to perform. In this case, the measurement coordinate system may be corrected using an average value of errors Δθ, ΔX, and ΔY obtained using each correction image.
 なお、本第1の実施形態では、基準座標系を設定した際に、基準座標系の原点を含む画像を撮像し、この撮像した画像を補正用画像として用いることとしてもよい。 In the first embodiment, when the reference coordinate system is set, an image including the origin of the reference coordinate system may be captured, and the captured image may be used as a correction image.
 なお、本第1の実施形態では、ユーザが測定対象物7に対して測定座標系を指定する作業を支援するため、ユーザが基準物品に対して指定した基準座標系の原点を含む画像(参照用画像と呼ぶ)を例えば図11の基準座標系設定処理(S14)のステップS22において作成し、表示装置193に参照用画像を表示することで、ユーザに対して参照用画像を提供するようにしてもよい。この場合、ユーザは、参照用画像を見ながら、測定対象物7の参照用画像に対応する箇所が撮像部6によって撮像されるように、XYステージ5を移動させ、参照用画像に基づいて測定座標系を指定すればよい。これにより、ユーザは、基準座標系の位置を覚えていなくてもよくなり、測定座標系を設定することが容易になる。なお、参照用画像は、ユーザが基準座標系を指定したときに撮像部6が撮像した画像であってもよいし、ユーザが基準座標系を指定したときに撮像部6が撮像した範囲よりも広い範囲を、基準座標系の指定後に撮像した画像であってもよい。また、繰り返し測定部30は、ユーザがXYステージ5を移動させている間に、参照用画像とライブ画像(すなわち、撮像部6が所定のフレームレートで撮像している画像)とのパターンマッチングを順次行い、ライブ画像中に参照用画像との類似度が所定値以上の箇所が存在していた場合に、その旨をユーザに報知するようにしてもよい。報知する方法は、例えばアラームを発するようにしてもよい。これにより、測定座標系を指定する作業を支援することが可能となる。なお、参照用画像は、補正用画像の1つとして用いることとしてもよい。 In the first embodiment, in order to assist the user to specify the measurement coordinate system for the measurement object 7, the image includes the origin of the reference coordinate system specified by the user for the reference article (see 11) is created in step S22 of the standard coordinate system setting process (S14) of FIG. 11, for example, and the reference image is displayed on the display device 193, so that the reference image is provided to the user. May be. In this case, while viewing the reference image, the user moves the XY stage 5 so that the part corresponding to the reference image of the measurement object 7 is imaged by the imaging unit 6, and performs measurement based on the reference image. A coordinate system can be specified. Thereby, the user does not need to remember the position of the reference coordinate system, and it becomes easy to set the measurement coordinate system. Note that the reference image may be an image captured by the image capturing unit 6 when the user designates the standard coordinate system, or more than a range captured by the image capture unit 6 when the user designates the standard coordinate system. An image obtained by imaging a wide range after designating the reference coordinate system may be used. Further, the repeated measurement unit 30 performs pattern matching between the reference image and the live image (that is, the image captured by the imaging unit 6 at a predetermined frame rate) while the user moves the XY stage 5. This may be performed sequentially, and when there is a location where the similarity with the reference image is greater than or equal to a predetermined value in the live image, this may be notified to the user. As a method of notification, for example, an alarm may be issued. As a result, it is possible to support the work of specifying the measurement coordinate system. Note that the reference image may be used as one of the correction images.
 なお、本第1の実施形態では、ユーザが測定対象物7に対して測定座標系を指定する場合について説明したが、これに限られるものではない。例えば、繰り返し測定部30が、ユーザが指定した基準座標系の原点を含む基準物品の画像を用いたパターンマッチングを行うことで、測定対象物7に対して測定座標系を自動的に設定してもよい。この場合、基準座標系の原点を含む基準物品の画像(原点画像と呼ぶ)と類似する箇所を測定対象物7を撮像した画像において特定する。そして、原点画像における基準座標系の原点の位置と対応する、特定した箇所内の位置を特定し、特定した位置に測定座標系の原点を設定する。また、特定した箇所内における測定座標系の回転角度を、原点画像における基準座標系の回転角度と同一に設定する。この場合にも、パターンマッチングの精度によっては設定した測定座標系が基準物品に対して指定した基準座標系からずれるおそれがあるため、上述した方法により、設定した測定座標系を補正するようにすればよい。 In the first embodiment, the case where the user designates the measurement coordinate system for the measurement object 7 has been described. However, the present invention is not limited to this. For example, the repeated measurement unit 30 automatically sets the measurement coordinate system for the measurement object 7 by performing pattern matching using the image of the reference article including the origin of the reference coordinate system specified by the user. Also good. In this case, a location similar to the image of the reference article including the origin of the reference coordinate system (referred to as an origin image) is specified in the image obtained by imaging the measurement object 7. Then, the position in the specified location corresponding to the position of the origin of the reference coordinate system in the origin image is specified, and the origin of the measurement coordinate system is set to the specified position. Further, the rotation angle of the measurement coordinate system in the specified location is set to be the same as the rotation angle of the reference coordinate system in the origin image. Also in this case, depending on the accuracy of pattern matching, the set measurement coordinate system may deviate from the reference coordinate system designated for the reference article. Therefore, the set measurement coordinate system is corrected by the above-described method. That's fine.
 なお、本第1の実施形態では、図15のステップS228の判断が肯定された場合に、ステップS220で抽出された補正用画像と対応付けてサーチ失敗回数をHDD196等の記憶部に記憶しておいてもよい。この場合、繰り返し測定部30は、ステップS220、S230において、サーチ失敗回数を考慮して、測定座標系の補正に用いる補正用画像を抽出することができる。例えば、繰り返し測定部30は、サーチ失敗回数が所定回数以上の補正用画像は抽出しないようにしてもよい。あるいは、繰り返し測定部30は、サーチ失敗回数が少ない補正用画像を優先的に抽出するようにしてもよい。なお、サーチ失敗回数に代えて、サーチ成功回数を考慮して、補正用画像を抽出してもよい。なお、サーチ失敗回数及びサーチ成功回数は、位置合わせの失敗に関する情報及び位置合わせの成功に関する情報である。なお、位置合わせの失敗に関する情報及び位置合わせの成功に関する情報は、サーチ失敗率やサーチ成功率であってもよい。 In the first embodiment, when the determination in step S228 in FIG. 15 is affirmed, the number of search failures is stored in a storage unit such as the HDD 196 in association with the correction image extracted in step S220. It may be left. In this case, the repeat measurement unit 30 can extract a correction image used for correcting the measurement coordinate system in consideration of the number of search failures in steps S220 and S230. For example, the iterative measurement unit 30 may not extract a correction image having a search failure count of a predetermined number or more. Alternatively, the iterative measurement unit 30 may preferentially extract a correction image with a small number of search failures. Note that the correction image may be extracted in consideration of the search success count instead of the search failure count. Note that the number of search failures and the number of successful searches are information related to alignment failure and information related to alignment success. Note that the information regarding the alignment failure and the information regarding the alignment success may be a search failure rate or a search success rate.
 なお、本第1の実施形態では補正用画像を撮像した際に、取得した補正画像をトリミングによって切り出す領域を所定の幅で小さくしながら、切り出し画像とテストマッチング用の画像とのテストマッチングスコアの算出を繰り返し、テストマッチングスコアが最大となった補正用画像(トリミングで切り出した画像)を画像情報DB42に保存することとしてもよい。この場合トリミングした補正用画像をステップS220において複数の補正用画像の中から1つの画像を抽出する候補とすることができる。したがって、例えば、補正用画像に対応する測定対象物7(第2の物品)の領域にゴミや塵などの異物の付着、ヒビや欠けなどの欠損などが生じたとしても、それらの問題によるパターンマッチング(ステップS226)の精度の低下を防ぐことができるようになる。 In the first embodiment, when a correction image is captured, a test matching score between a cut-out image and a test matching image is reduced while a region where the acquired correction image is cut out by trimming is reduced by a predetermined width. The calculation may be repeated, and the correction image (image cut out by trimming) having the maximum test matching score may be stored in the image information DB 42. In this case, the trimmed correction image can be used as a candidate for extracting one image from the plurality of correction images in step S220. Therefore, for example, even if a foreign object such as dust or dust adheres to the area of the measurement object 7 (second article) corresponding to the correction image, or a defect such as a crack or a chip occurs, a pattern due to those problems is generated. It becomes possible to prevent the accuracy of matching (step S226) from being lowered.
 なお、本第1の実施形態では、ステップS232で算出した回転誤差Δθや位置誤差ΔX,ΔYの分だけ、ユーザが指定した測定座標系を補正する場合について説明したが、これに限られるものではない。例えば、ユーザが指定した測定座標系が測定対象物7の所定位置に設定されるように、測定座標系の原点位置や角度を固定したまま、ステップS232で算出した回転誤差Δθや位置誤差ΔX,ΔYの分だけ、測定対象物7の位置を移動させるようにしてもよい。この測定対象物7の位置を移動させる処理は、例えば、図14のステップS204におけるユーザによる測定座標系の指定と、ステップS206の処理(測定座標系の補正処理)に代えて、実行することができる。この場合、XYステージ5の上に測定対象物7を載置するためのサブステージを設け、XYステージ5は固定したまま、XYステージ5とは相対的にサブステージをXY方向に移動させるようにすればよい。あるいは、ユーザが測定対象物7の位置をXYステージ5上で調整するようにしてもよいし、ロボットハンド等により、測定対象物7の位置をXYステージ上で調整するようにしてもよい。ここで、原点位置が固定された測定座標系に対して測定対象物7の位置を調整することは、測定対象物7と測定座標系との相対的な位置合わせを行うことであり、すなわち、測定対象物7に関する位置合わせを実行することを意味する。 In the first embodiment, the case where the measurement coordinate system specified by the user is corrected by the rotation error Δθ and the position errors ΔX and ΔY calculated in step S232 has been described. However, the present invention is not limited to this. Absent. For example, the rotation error Δθ and the position error ΔX, calculated in step S232 while the origin position and angle of the measurement coordinate system are fixed so that the measurement coordinate system designated by the user is set at a predetermined position of the measurement object 7. The position of the measuring object 7 may be moved by ΔY. For example, the process of moving the position of the measurement object 7 can be executed in place of the designation of the measurement coordinate system by the user in step S204 of FIG. 14 and the process of step S206 (measurement coordinate system correction process). it can. In this case, a substage for placing the measurement object 7 on the XY stage 5 is provided, and the substage is moved in the XY direction relative to the XY stage 5 while the XY stage 5 is fixed. do it. Alternatively, the user may adjust the position of the measurement object 7 on the XY stage 5, or may adjust the position of the measurement object 7 on the XY stage by a robot hand or the like. Here, adjusting the position of the measurement object 7 with respect to the measurement coordinate system in which the origin position is fixed is to perform relative alignment between the measurement object 7 and the measurement coordinate system. This means that alignment with respect to the measurement object 7 is executed.
 なお、本第1の実施形態では、繰り返し測定部30は、基準物品に対して設定された基準座標系の原点との距離が長い補正用画像から抽出する場合(項目(a)参照)について説明したが、これに限られるものではない。例えば、基準物品に対して設定された基準座標系の原点との距離が短い補正用画像から抽出することとしてもよい。ここで、基準座標系の原点との距離が長い位置ほど回転誤差の影響を受けやすい。すなわち、基準座標系の原点との距離が長い位置ほど回転誤差の影響により位置ずれが大きくなる。このため、基準座標系の原点から近い補正用画像から抽出し、測定座標系の補正に用いることで、回転誤差の影響が低減され、補正用画像と測定対象物7を撮像した画像とのパターンマッチングがしやすくなる。これにより、パターンマッチングを失敗することなく、測定座標系の補正を確実かつ精度よく行うことができる。 In the first embodiment, the repeated measurement unit 30 describes a case where extraction is performed from a correction image having a long distance from the origin of the reference coordinate system set for the reference article (see item (a)). However, it is not limited to this. For example, it may be extracted from a correction image having a short distance from the origin of the reference coordinate system set for the reference article. Here, the longer the distance from the origin of the reference coordinate system, the more susceptible to the rotation error. That is, the position shift becomes larger as the distance from the origin of the reference coordinate system becomes longer due to the influence of the rotation error. For this reason, by extracting from the correction image close to the origin of the reference coordinate system and using it for the correction of the measurement coordinate system, the influence of the rotation error is reduced, and the pattern of the correction image and the image obtained by imaging the measurement object 7 Matching is easy. Thus, the measurement coordinate system can be corrected reliably and accurately without failing pattern matching.
 なお、基準座標系の原点からの距離が近い補正用画像を用いて測定座標系の補正を行った後、測定座標系の補正に用いた補正用画像よりも基準座標系の原点からの距離が長い補正用画像を用いて再度測定座標系の補正を行うこととしてもよい。これにより、確実かつ高精度に測定座標系の補正することができる。また、基準座標系の原点からの距離が近い順に補正用画像を抽出して測定座標系の補正を繰り返してもよい。この場合、測定座標系の補正の必要がなくなるまで、すなわち、測定座標系の補正を行っても測定座標系の原点や回転角度が所定以上変更されなくなるまで補正を繰り返すようにしてもよい。これにより、確実かつ高精度に測定座標系の補正するための、補正回数(繰り返し回数)を適切な回数とすることができる。 After correcting the measurement coordinate system using the correction image that is close to the origin of the reference coordinate system, the distance from the origin of the reference coordinate system is larger than the correction image used for correcting the measurement coordinate system. The measurement coordinate system may be corrected again using a long correction image. Thereby, the measurement coordinate system can be corrected reliably and with high accuracy. Further, the correction image may be extracted in order of increasing distance from the origin of the reference coordinate system, and the correction of the measurement coordinate system may be repeated. In this case, the correction may be repeated until the measurement coordinate system need not be corrected, that is, even if the measurement coordinate system is corrected, the origin and the rotation angle of the measurement coordinate system are not changed by a predetermined value or more. Thereby, the number of corrections (the number of repetitions) for correcting the measurement coordinate system reliably and accurately can be set to an appropriate number.
 また、本第1の実施形態では、繰り返し測定部30は、予備測定時(画像測定時)の倍率条件(撮像倍率)が低い補正用画像から抽出する場合(上記項目(d)参照)について説明したが、これに限られるものではない。例えば、倍率条件(撮像倍率)が高い補正用画像から抽出することとしてもよい。この場合、撮像範囲が狭い補正用画像を測定座標系の補正に用いることになるため、補正用画像においてごみや埃が撮像されている可能性を少なくすることができる。これにより、ごみや埃による影響で、測定座標系の補正精度が悪化する、又は測定座標系の補正に失敗する可能性を低減することが可能となる。なお、倍率条件(撮像倍率)が低い補正用画像から抽出するか、倍率条件(撮像倍率)が高い補正用画像から抽出するかは、画像測定装置100が設置される環境が、ごみや埃の多い環境か否かに基づいて使い分けることとしてもよい。 In the first embodiment, the repeated measurement unit 30 extracts from a correction image with a low magnification condition (imaging magnification) at the time of preliminary measurement (image measurement) (see item (d) above). However, it is not limited to this. For example, it is good also as extracting from the image for correction | amendment with high magnification conditions (imaging magnification). In this case, since the correction image with a narrow imaging range is used for the correction of the measurement coordinate system, the possibility that dust or dust is captured in the correction image can be reduced. As a result, it is possible to reduce the possibility that the correction accuracy of the measurement coordinate system deteriorates due to the influence of dust and dust, or the correction of the measurement coordinate system fails. Whether an image is extracted from a correction image having a low magnification condition (imaging magnification) or a correction image having a high magnification condition (imaging magnification) depends on whether the environment in which the image measuring apparatus 100 is installed is dust or dust. It is good also as using properly based on whether there are many environments.
 なお、本第1の実施形態では、予備測定部26は、予備測定の状態から照明条件や倍率条件を変更せずに補正用画像を撮像する場合について説明したが、これに限られるものではない。例えば、予備測定部26は、予備測定を行った後、照明条件や倍率条件などの種々条件を変更してから、補正用画像を撮像することとしてもよい。例えば、撮像倍率を下げ、撮像範囲を予備測定時よりも広くした状態で補正用画像を撮像するようにしてもよい。 In the first embodiment, the case where the preliminary measurement unit 26 captures a correction image without changing the illumination condition or the magnification condition from the preliminary measurement state has been described. However, the present invention is not limited to this. . For example, the preliminary measurement unit 26 may capture the correction image after changing the various conditions such as the illumination condition and the magnification condition after performing the preliminary measurement. For example, the correction image may be captured in a state where the imaging magnification is lowered and the imaging range is made wider than that during preliminary measurement.
≪第2の実施形態≫
 次に、第2の実施形態について、図17~図21に基づいて詳細に説明する。
<< Second Embodiment >>
Next, the second embodiment will be described in detail with reference to FIGS.
 本第2の実施形態は、ユーザが、基準物品に対して基準座標系を指定する作業を省略できる点が第1の実施形態と異なっている。すなわち、本第2の実施形態では、図10のステップS14を省略することができる。また、本第2の実施形態では、基準座標系の指定する作業を省略できることに加え、測定座標系を指定する作業についても省略できる。本第2の実施形態では、基準座標系の原点及び回転角度を、ステージ座標系の原点及び回転角度と一致するように自動設定する。 The second embodiment is different from the first embodiment in that the user can omit the work of specifying the reference coordinate system for the reference article. That is, in the second embodiment, step S14 in FIG. 10 can be omitted. Further, in the second embodiment, in addition to omitting the task of specifying the reference coordinate system, the task of specifying the measurement coordinate system can be omitted. In the second embodiment, the origin and rotation angle of the reference coordinate system are automatically set to match the origin and rotation angle of the stage coordinate system.
 図17には、本第2の実施形態におけるCPU190の詳細ブロック図が示されている。なお、図17においては、図示及び説明の便宜上、HDD196に格納されているDBも図示されている。図17に示すように、本第2の実施形態では、第1の実施形態の座標系DB40に代えて、座標系設定用画像DB55が設けられている。 FIG. 17 shows a detailed block diagram of the CPU 190 in the second embodiment. In FIG. 17, the DB stored in the HDD 196 is also illustrated for convenience of illustration and description. As shown in FIG. 17, in the second embodiment, a coordinate system setting image DB 55 is provided instead of the coordinate system DB 40 of the first embodiment.
 本第2の実施形態では、図10のステップS10、S12、S16の処理を第1の実施形態と同様に実行した後、測定プログラム保存処理として、図18に示す処理(S18’)を実行する。なお、予備測定部26は、ステップS16においてユーザが指定した測定箇所を測定する際には、ステージ座標系を用いた測定を行う。 In the second embodiment, after the processes of steps S10, S12, and S16 in FIG. 10 are executed in the same manner as in the first embodiment, the process (S18 ′) shown in FIG. 18 is executed as a measurement program storage process. . The preliminary measurement unit 26 performs measurement using the stage coordinate system when measuring the measurement location designated by the user in step S16.
 ステップS18’においては、測定プログラム保存部28は、ステップS150において、ユーザによってファイル名が入力され、保存ボタンが押下されるまで待機する。次いで、ステップS152では、測定プログラム保存部28は、画像情報DB42に格納されている補正用画像の1つを選択し、座標系設定用画像として座標系設定用画像DB55(図19(a)、図19(b)参照)に格納する。 In step S18 ', the measurement program storage unit 28 waits until the file name is input by the user and the save button is pressed in step S150. Next, in step S152, the measurement program storage unit 28 selects one of the correction images stored in the image information DB 42, and uses the coordinate system setting image DB 55 (FIG. 19A, FIG. 19A) as the coordinate system setting image. (See FIG. 19B).
 座標系設定用画像DB55は、ユーザが基準物品を用いた基準座標系の指定をしなくても、測定座標系を自動的に設定することを可能にするために用いられる補正用画像を格納するデータベースである。具体的には、図19(a)に示すようなデータ構造を有する。座標系設定用画像DB55は、ステップS152が開始されるまでは、図19(a)に示すように各項目は空(ブランク)となっている。測定プログラム保存部28は、座標系設定用画像DB55に格納する補正用画像を、画像情報DB42の中から、以下の項目に基づいて選定する。これらの項目は、画像に関する特徴を意味する。
(a)ズーム倍率が低い
(b)ステージ座標系の原点からの距離が近い
(c)テストマッチングの検出数が少ない
(d)テストマッチングスコアが高い
 なお、上記各項目において、ズーム倍率は、撮像倍率を意味し、撮像条件(倍率条件)の一例である。ステージ座標系の原点からの距離は、画像の位置を示す情報の一例である。また、テストマッチングの検出数やテストマッチングスコアは、画像の特徴を示す情報の一例である。
The coordinate system setting image DB 55 stores a correction image used for enabling the measurement coordinate system to be automatically set even if the user does not specify the reference coordinate system using the reference article. It is a database. Specifically, it has a data structure as shown in FIG. In the coordinate system setting image DB 55, each item is empty (blank) as shown in FIG. 19A until step S152 is started. The measurement program storage unit 28 selects a correction image to be stored in the coordinate system setting image DB 55 from the image information DB 42 based on the following items. These items mean features related to images.
(A) The zoom magnification is low (b) The distance from the origin of the stage coordinate system is close (c) The number of test matching detections is small (d) The test matching score is high Note that in each of the above items, the zoom magnification is the imaging It means magnification, and is an example of imaging conditions (magnification conditions). The distance from the origin of the stage coordinate system is an example of information indicating the position of the image. Further, the number of test matching detections and the test matching score are examples of information indicating image characteristics.
 ここで、本第2実施形態において、選定の際には、各項目は、(a)→(b)→(c)→(d)の順に用いることとする。例えば、測定プログラム保存部28は、図5(b)の画像情報DB42に格納されている補正用画像の情報を参照して、ズーム倍率が低く、基準座標系(ステージ座標系)の原点からの距離が近い補正用画像ファイル(2.bmp)を特定する。そして、測定プログラム保存部28は、補正用画像ファイル(2.bmp)の情報を図5(b)から抽出し、図19(b)に示すように座標系設定用画像DB55に格納する。なお、基準座標系とステージ座標系との相対角度の欄には、0°が格納される。このように、相対角度の欄に0°が格納されるのは、前述したように、本第2の実施形態の基準座標系の原点及び回転角度が、ステージ座標系の原点及び回転角度と一致しているからである。 Here, in the second embodiment, when selecting, each item is used in the order of (a) → (b) → (c) → (d). For example, the measurement program storage unit 28 refers to the information of the correction image stored in the image information DB 42 in FIG. 5B, and the zoom magnification is low, and the reference coordinate system (stage coordinate system) from the origin. A correction image file (2.bmp) having a short distance is specified. Then, the measurement program storage unit 28 extracts the information of the correction image file (2.bmp) from FIG. 5B and stores it in the coordinate system setting image DB 55 as shown in FIG. 19B. Note that 0 ° is stored in the column of the relative angle between the reference coordinate system and the stage coordinate system. As described above, 0 ° is stored in the relative angle column as described above because the origin and the rotation angle of the reference coordinate system of the second embodiment are the same as the origin and the rotation angle of the stage coordinate system. Because I do it.
 ここで、項目(a)において、撮像時のズーム倍率が低い補正用画像を優先的に選定するのは、ズーム倍率が低い補正用画像は、撮像視野が広いため、測定対象物7を撮像した画像において補正用画像に類似する箇所を確実に見つけることができるからである。また、項目(b)において、基準座標系(ステージ座標系)の原点からの距離が近い補正用画像を優先的に選定するのは、XYステージ上の基準物品を退かして測定対象物7を置いたときに、測定対象物7が基準物品に対して回転方向にずれても、基準座標系(ステージ座標系)の原点からの距離が近い箇所は、回転誤差の影響による位置ずれが小さく、パターンマッチングを確実に行うことができ、測定座標系を確実に設定することができるからである。また、項目(c)において、テストマッチングの検出数が少ない画像を優先的に選定するのは、測定座標系の設定に用いる補正用画像と類似する箇所が測定対象物7を撮像した画像に多く存在する場合に生じる、測定座標系の設定精度の悪化を防止するためである。また、項目(d)において、テストマッチングスコアが高い補正用画像を優先的に選定するのは、テストマッチングスコアが高い補正用画像ほどパターンマッチングがしやすい画像であるからである。このような補正用画像を用いることで、パターンマッチングを失敗することなく、測定座標系の補正を確実かつ精度よく行うことができる。 Here, in the item (a), the correction image with a low zoom magnification at the time of imaging is preferentially selected because the correction image with a low zoom magnification has a wide imaging field of view, and thus the measurement object 7 is imaged. This is because a portion similar to the image for correction can be surely found in the image. Further, in the item (b), the correction image having a short distance from the origin of the reference coordinate system (stage coordinate system) is preferentially selected because the reference object on the XY stage is retracted and the measurement object 7 Even if the measurement object 7 is displaced in the rotation direction with respect to the reference article when the object is placed, the position displacement due to the influence of the rotation error is small at a position where the distance from the origin of the reference coordinate system (stage coordinate system) is short. This is because pattern matching can be performed reliably and the measurement coordinate system can be set reliably. In the item (c), an image with a small number of test matching detections is preferentially selected because an image similar to the correction image used for setting the measurement coordinate system has a lot in the image obtained by imaging the measurement object 7. This is to prevent the deterioration of the setting accuracy of the measurement coordinate system that occurs when it exists. In addition, in the item (d), the correction image having a higher test matching score is preferentially selected because the correction image having a higher test matching score is an image that is easier to perform pattern matching. By using such a correction image, it is possible to reliably and accurately correct the measurement coordinate system without failing pattern matching.
 なお、上記項目に加えて、撮像時の照明条件が透過照明である補正用画像を測定座標系の設定に用いる補正用画像として優先的に選定するようにしてもよい。これにより、コントラストが大きい補正用画像を優先的に用いることで、測定座標系を精度よく設定することが可能となる。 In addition to the above items, a correction image whose illumination condition at the time of imaging is transmission illumination may be preferentially selected as a correction image used for setting the measurement coordinate system. As a result, the measurement coordinate system can be set with high accuracy by preferentially using the correction image having a large contrast.
 なお、項目(a)においては、撮像時のズーム倍率が低い補正用画像を、優先的に選定することとしたが、これに限らず、撮像時のズーム倍率が高い補正用画像を優先的に選定することとしてもよい。この場合、撮像範囲が狭い補正用画像を測定座標系の補正に用いることになるため、補正用画像においてごみや埃が撮像されている可能性を少なくすることができる。これにより、ごみや埃による影響により、測定座標系の補正に失敗する可能性を低減し、測定座標系の補正を確実かつ精度よく行うことが可能となる。なお、倍率条件(撮像倍率)が低い補正用画像を優先的に選定するか、倍率条件(撮像倍率)が高い補正用画像優先的に選定するかは、画像測定装置100が設置される環境が、ごみや埃の多い環境か否かに基づいて使い分けることとしてもよい。 In item (a), a correction image with a low zoom magnification at the time of imaging is preferentially selected. However, the present invention is not limited to this, and a correction image with a high zoom magnification at the time of imaging is preferentially selected. It is good also as selecting. In this case, since the correction image with a narrow imaging range is used for the correction of the measurement coordinate system, the possibility that dust or dust is captured in the correction image can be reduced. As a result, it is possible to reduce the possibility that the correction of the measurement coordinate system will fail due to the influence of dust and dust, and to perform the correction of the measurement coordinate system reliably and accurately. Whether an image for correction with a low magnification condition (imaging magnification) is preferentially selected or whether a correction image with a high magnification condition (imaging magnification) is preferentially selected depends on the environment in which the image measuring apparatus 100 is installed. Depending on whether the environment is dusty or dusty, it may be used properly.
 次いで、ステップS156では、測定プログラム保存部28は、座標系設定用画像DB55に格納されている補正用画像ファイルを参照用画像として取得する。参照用画像は、撮像部6が撮像すべき箇所を示す画像、すなわち、XYステージ5を移動させるべき位置を示す画像である。参照用画像をユーザに提供することで、ユーザは、参照用画像を見ながら参照用画像と対応する箇所が撮像部6によって撮像されるようにXYステージ5を簡単に移動させることができる。なお、測定プログラム保存部28は、座標系設定用画像DB55に格納されている、補正用画像を取得した時の基準座標値や照明条件、倍率条件に基づいて、新たに撮像した画像を参照用画像として取得してもよい。この場合、参照用画像は、補正用画像よりも撮像視野が大きい画像、小さい画像、同一の画像のいずれであってもよい。なお、測定プログラム保存部28は、全体画像から基準座標値を中心として抽出した(切り出した)画像を参照用画像としてもよい。 Next, in step S156, the measurement program storage unit 28 acquires the correction image file stored in the coordinate system setting image DB 55 as a reference image. The reference image is an image that indicates a location to be imaged by the imaging unit 6, that is, an image that indicates a position where the XY stage 5 should be moved. By providing the reference image to the user, the user can easily move the XY stage 5 so that the portion corresponding to the reference image is imaged by the imaging unit 6 while viewing the reference image. The measurement program storage unit 28 refers to a newly captured image based on the reference coordinate value, the illumination condition, and the magnification condition when the correction image is acquired, which is stored in the coordinate system setting image DB 55. It may be acquired as an image. In this case, the reference image may be an image having a larger field of view than the correction image, a small image, or the same image. Note that the measurement program storage unit 28 may use, as a reference image, an image extracted (cut out) from the entire image with the reference coordinate value as the center.
 次いで、ステップS158では、測定プログラム保存部28は、座標系設定用画像DB55、参照用画像、測定箇所の情報を含む測定プログラムを測定プログラムDB44に保存する。以上により、図18の処理が終了すると、図10の処理(S1000)も終了する。 Next, in step S158, the measurement program storage unit 28 stores in the measurement program DB 44 a measurement program including the coordinate system setting image DB 55, the reference image, and measurement location information. As described above, when the process of FIG. 18 ends, the process of FIG. 10 (S1000) also ends.
 次に、本第2の実施形態の繰り返し測定処理について説明する。本第2の実施形態では、繰り返し測定部30は、第1の実施形態の繰り返し測定処理(S2000)に代えて、図20に示す繰り返し測定処理(S2000’)を実行する。 Next, the repeated measurement process of the second embodiment will be described. In the second embodiment, the repeated measurement unit 30 executes the repeated measurement process (S2000 ') shown in FIG. 20 instead of the repeated measurement process (S2000) of the first embodiment.
 図20の処理では、まず、ステップS402において、ユーザによって測定プログラムが選択されるまで待機する。ユーザが測定プログラムを選択すると、繰り返し測定部30は、ステップS404に移行し、測定プログラムに含まれる参照用画像を表示装置193上に表示する。 In the process of FIG. 20, first, in step S402, the process waits until a measurement program is selected by the user. When the user selects the measurement program, the repetitive measurement unit 30 proceeds to step S404 and displays the reference image included in the measurement program on the display device 193.
 次いで、ステップS406では、繰り返し測定部30は、座標系設定用画像DB55に格納されている補正用画像と撮像部6が所定のフレームレートで撮像している画像(いわゆる、ライブ画像)とを用いたパターンマッチングを実施する。この場合、ユーザは、参照用画像を参照して、撮像部6により参照用画像と類似する箇所が撮像されるように(表示装置193に参照用画像と類似する箇所が表示されるように)XYステージ5を移動させる。そして、繰り返し測定部30は、パターンマッチングにより得られるマッチングスコアの増減をチェックする。 Next, in step S406, the repeated measurement unit 30 uses the correction image stored in the coordinate system setting image DB 55 and the image (so-called live image) captured by the imaging unit 6 at a predetermined frame rate. Perform pattern matching. In this case, the user refers to the reference image so that a portion similar to the reference image is captured by the imaging unit 6 (so that a portion similar to the reference image is displayed on the display device 193). The XY stage 5 is moved. Then, the repeated measurement unit 30 checks the increase or decrease of the matching score obtained by pattern matching.
 次いで、ステップS408では、繰り返し測定部30は、マッチングスコアが所定値以上となるまで待機する。ステップS408の判断が肯定されると、繰り返し測定部30は、ステップS410に移行し、マッチングスコアが所定値以上になったことを表示装置193に表示し、ユーザに報知する。 Next, in step S408, the repeated measurement unit 30 stands by until the matching score becomes a predetermined value or more. If the determination in step S408 is affirmed, the repeat measurement unit 30 proceeds to step S410, displays on the display device 193 that the matching score is equal to or greater than a predetermined value, and notifies the user.
 次いで、ステップS412では、繰り返し測定部30は、ユーザからの測定開始指示が入力されるまで待機する。この場合、ユーザが測定開始ボタン等を押した段階で、繰り返し測定部30は、ステップS414に移行する。 Next, in step S412, the repetitive measurement unit 30 stands by until a measurement start instruction is input from the user. In this case, when the user presses the measurement start button or the like, the repetitive measurement unit 30 proceeds to step S414.
 ステップS414では、繰り返し測定部30は、基準座標系(ステージ座標系)における測定座標系の原点及び基準座標系(ステージ座標系)に対する回転角度を計算する。本処理について、図21(a)、図21(b)に基づいて詳細に説明する。 In step S414, the repeated measurement unit 30 calculates the origin of the measurement coordinate system in the reference coordinate system (stage coordinate system) and the rotation angle with respect to the reference coordinate system (stage coordinate system). This process will be described in detail with reference to FIGS. 21 (a) and 21 (b).
 図21(a)には、基準物品と基準座標系(ステージ座標系)との関係、及び基準座標系(ステージ座標系)と座標系設定用画像DB55に格納されている補正用画像を取得した時の基準座標値(Xt、Yt)との関係が示されている。また、図21(b)は、測定対象物と基準座標系(ステージ座標系)及び測定座標系との関係を示すとともに、測定座標系の設定方法について説明するための図である。ここで、図21(a)において破線矩形は、座標系設定用画像DB55に格納されている補正用画像を示している。 In FIG. 21A, the relationship between the reference article and the reference coordinate system (stage coordinate system) and the correction image stored in the reference coordinate system (stage coordinate system) and the coordinate system setting image DB 55 are acquired. The relationship with the reference coordinate values (Xt, Yt) at the time is shown. FIG. 21B shows the relationship between the measurement object, the reference coordinate system (stage coordinate system), and the measurement coordinate system, and is a diagram for explaining a measurement coordinate system setting method. Here, a broken-line rectangle in FIG. 21A indicates a correction image stored in the coordinate system setting image DB 55.
 この場合において、図21(b)に示すように、測定対象物7が基準物品に対してX軸方向及びY軸方向にずれた状態、かつ基準座標系(ステージ座標系)に対して傾いた状態でXYステージ5上に載置されたとする。この場合、ユーザが破線矩形で示す範囲を撮像部6が撮像できるようにXYステージ5を移動すると、繰り返し測定部30は、パターンマッチングにより、基準座標値(Xt,Yt)に対応する座標(Xs,Ys)と、回転角度θsとを取得することができる。本第2の実施形態では、これらの座標や回転角度を用いて、測定対象物7の測定の際に用いる測定座標系を設定する。 In this case, as shown in FIG. 21B, the measuring object 7 is shifted from the reference article in the X-axis direction and the Y-axis direction, and tilted with respect to the reference coordinate system (stage coordinate system). It is assumed that it is placed on the XY stage 5 in a state. In this case, when the user moves the XY stage 5 so that the imaging unit 6 can capture a range indicated by a broken-line rectangle, the repeated measurement unit 30 performs coordinate matching (Xs, Xs, Yt) by pattern matching. , Ys) and the rotation angle θs. In the second embodiment, a measurement coordinate system used when measuring the measurement object 7 is set using these coordinates and rotation angles.
 ここで、座標(Xs,Ys)と、座標(Xt,Yt)を中心として座標(Xs,Ys)をθsだけ回転した点の座標(Xt+dx,Yt+dy)との関係は次式(5)、(6)のように表すことができる。
 Xs=(Xt+dx)cosθs-(Yt+dy)sinθs   …(5)
 Ys=(Xt+dx)sinθs-(Yt+dy)cosθs   …(6)
Here, the relationship between the coordinates (Xs, Ys) and the coordinates (Xt + dx, Yt + dy) of the point obtained by rotating the coordinates (Xs, Ys) by θs around the coordinates (Xt, Yt) is expressed by the following equations (5), ( 6).
Xs = (Xt + dx) cos θs− (Yt + dy) sin θs (5)
Ys = (Xt + dx) sinθs− (Yt + dy) cosθs (6)
 繰り返し測定部30は、上式(5)、(6)から座標(Xs,Ys)と座標(Xt,Yt)の間のずれ量dx,dyを求め、基準座標系(ステージ座標系)の原点からずれ量dx,dyだけずれた位置に測定座標系の原点を設定する。また、繰り返し測定部30は、基準座標系(ステージ座標系)に対して角度θsだけ測定座標系を回転させることで、測定座標系の角度を設定する。このようにすることで、本第2の実施形態では、基準物品を用いてユーザが基準座標系を設定しなくても、測定対象物7ごとに測定座標系を設定することができる。 The repetitive measurement unit 30 obtains the shift amounts dx, dy between the coordinates (Xs, Ys) and the coordinates (Xt, Yt) from the above equations (5), (6), and the origin of the reference coordinate system (stage coordinate system) The origin of the measurement coordinate system is set at a position deviated by the deviation amounts dx and dy. Further, the repeated measurement unit 30 sets the angle of the measurement coordinate system by rotating the measurement coordinate system by an angle θs with respect to the reference coordinate system (stage coordinate system). By doing in this way, in this 2nd Embodiment, even if a user does not set a reference coordinate system using a reference article, a measurement coordinate system can be set up for every measuring object 7.
 図20に戻り、次のステップS416では、繰り返し測定部30は、第1の実施形態のステップS206と同様に、測定座標系の補正処理を実行する。なお、図15のステップS220、S230においては、繰り返し測定部30は、図18のステップS152において選定された補正用画像を除外して、測定座標系の補正に用いる補正用画像を抽出するようにする。次いで、ステップS418では、繰り返し測定部30は、第1の実施形態のステップS208と同様、測定プログラムに記録されている測定箇所で測定を行い、表示装置193に表示する。そして、ステップS420では、繰り返し測定部30は、第1の実施形態のステップS210と同様に、繰り返し測定が終了か否かを判断する。このステップS420の判断が否定された場合には、ステップS404に戻るが、肯定された場合には、図20の全処理を終了するとともに、図10の全処理も終了する。 Referring back to FIG. 20, in the next step S416, the repeated measurement unit 30 executes the measurement coordinate system correction process in the same manner as in step S206 of the first embodiment. In steps S220 and S230 of FIG. 15, the repeated measurement unit 30 excludes the correction image selected in step S152 of FIG. 18 and extracts a correction image used for correcting the measurement coordinate system. To do. Next, in step S418, the repeated measurement unit 30 performs measurement at the measurement location recorded in the measurement program and displays the measurement on the display device 193, as in step S208 of the first embodiment. In step S420, the repeated measurement unit 30 determines whether or not the repeated measurement is completed, as in step S210 of the first embodiment. If the determination in step S420 is negative, the process returns to step S404. If the determination is positive, all the processes in FIG. 20 are completed and all the processes in FIG. 10 are also ended.
 以上、詳細に説明したように、本第2の実施形態によると、繰り返し測定部30は、基準座標系(ステージ座標系)の原点と所定の位置関係にある画像(座標系設定用画像DB55に格納されている補正用画像)を用いて測定対象物7に対して測定座標系を設定した後、測定座標系の補正に用いる補正用画像と、該画像に対応する測定対象物7の画像の部分とに基づいて、設定した測定座標系を補正する。これにより、ユーザは、基準物品を用いて基準座標系を設定しなくても、測定対象物7の測定の際に測定座標系を設定することが可能となる。したがって、ユーザの作業工数を削減することができるので、ユーザの使い勝手を向上することができる。 As described above in detail, according to the second embodiment, the iterative measurement unit 30 has an image (in the coordinate system setting image DB 55) that has a predetermined positional relationship with the origin of the reference coordinate system (stage coordinate system). The measurement coordinate system is set for the measurement object 7 using the stored correction image), and then the correction image used for correcting the measurement coordinate system and the image of the measurement object 7 corresponding to the image are displayed. The set measurement coordinate system is corrected based on the portion. Thus, the user can set the measurement coordinate system when measuring the measurement object 7 without setting the reference coordinate system using the reference article. Therefore, since the user's work man-hours can be reduced, user convenience can be improved.
 また、本第2の実施形態では、ユーザは、測定座標系を指定する作業を行わなくてもよいため、この点からもユーザの使い勝手を向上することができる。 In the second embodiment, since the user does not have to specify the measurement coordinate system, the usability of the user can be improved from this point.
 なお、本第2の実施形態では、基準座標系の原点及び回転角度を、ステージ座標系の原点及び回転角度と一致するように自動設定し、基準座標系(ステージ座標系)に基づいて、測定座標系の補正を行う場合について説明したが、これに限られるものではない。例えば、座標系設定用画像DB55に格納されている補正用画像において基準座標系を自動的に設定し、当該基準座標系を用いて測定座標系の設定及び補正を行うこととしてもよい。この場合、基準座標系は、補正用画像の中心に設定されてもよいし、補正用画像に含まれる測定箇所の特定の点(中心点など)に設定されてもよい。このようにしても、上述した第2の実施形態と同様の作用効果を得ることができる。 In the second embodiment, the origin and rotation angle of the reference coordinate system are automatically set to coincide with the origin and rotation angle of the stage coordinate system, and measurement is performed based on the reference coordinate system (stage coordinate system). Although the case of correcting the coordinate system has been described, the present invention is not limited to this. For example, the reference coordinate system may be automatically set in the correction image stored in the coordinate system setting image DB 55, and the measurement coordinate system may be set and corrected using the reference coordinate system. In this case, the reference coordinate system may be set at the center of the correction image, or may be set at a specific point (such as the center point) of the measurement location included in the correction image. Even if it does in this way, the effect similar to 2nd Embodiment mentioned above can be acquired.
 なお、上記の処理機能は、コンピュータによって実現することができる。その場合、処理装置が有すべき機能の処理内容を記述したプログラムが提供される。そのプログラムをコンピュータで実行することにより、上記処理機能がコンピュータ上で実現される。処理内容を記述したプログラムは、コンピュータで読み取り可能な記録媒体(ただし、搬送波は除く)に記録しておくことができる。 Note that the above processing functions can be realized by a computer. In that case, a program describing the processing contents of the functions that the processing apparatus should have is provided. By executing the program on a computer, the above processing functions are realized on the computer. The program describing the processing contents can be recorded on a computer-readable recording medium (except for a carrier wave).
 プログラムを流通させる場合には、例えば、そのプログラムが記録されたDVD(Digital Versatile Disc)、CD-ROM(Compact Disc Read Only Memory)などの可搬型記録媒体の形態で販売される。また、プログラムをサーバコンピュータの記憶装置に格納しておき、ネットワークを介して、サーバコンピュータから他のコンピュータにそのプログラムを転送することもできる。 When the program is distributed, for example, it is sold in the form of a portable recording medium such as a DVD (Digital Versatile Disc) or CD-ROM (Compact Disc Read Only Memory) on which the program is recorded. It is also possible to store the program in a storage device of a server computer and transfer the program from the server computer to another computer via a network.
 プログラムを実行するコンピュータは、例えば、可搬型記録媒体に記録されたプログラムもしくはサーバコンピュータから転送されたプログラムを、自己の記憶装置に格納する。そして、コンピュータは、自己の記憶装置からプログラムを読み取り、プログラムに従った処理を実行する。なお、コンピュータは、可搬型記録媒体から直接プログラムを読み取り、そのプログラムに従った処理を実行することもできる。また、コンピュータは、サーバコンピュータからプログラムが転送されるごとに、逐次、受け取ったプログラムに従った処理を実行することもできる。 The computer that executes the program stores, for example, the program recorded on the portable recording medium or the program transferred from the server computer in its own storage device. Then, the computer reads the program from its own storage device and executes processing according to the program. The computer can also read the program directly from the portable recording medium and execute processing according to the program. Further, each time the program is transferred from the server computer, the computer can sequentially execute processing according to the received program.
 なお、本発明の趣旨を逸脱しない範囲で、各実施の形態に、多様な変更または改良を加えることが可能である。また、各実施形態で説明した要件の1つ以上は、省略されることがある。そのような変更または改良、省略した形態も本発明の技術的範囲に含まれる。また、各実施形態の構成を適宜組み合わせて適用することも可能である。また、法令で許容される限りにおいて、各実施形態で引用した画像測定装置などに関する全ての公開公報及び米国特許の開示を援用して本文の記載の一部とする。 It should be noted that various modifications or improvements can be added to each embodiment without departing from the spirit of the present invention. In addition, one or more of the requirements described in each embodiment may be omitted. Such modifications, improvements, and omitted forms are also included in the technical scope of the present invention. In addition, the configurations of the embodiments can be applied in combination as appropriate. In addition, as long as it is permitted by law, the disclosures of all published publications and US patents related to the image measurement apparatus and the like cited in each embodiment are incorporated herein by reference.
  5 XYステージ
  6 撮像部
  7 測定対象物
  30 繰り返し測定部
  100 画像測定装置
5 XY stage 6 Imaging unit 7 Measurement object 30 Repeat measurement unit 100 Image measurement device

Claims (23)

  1.  第1の物品における異なる部分の画像の中から、該画像に関する特徴に基づいて、画像を選択することと、
     前記選択された画像と、第2の物品における前記選択された画像に対応する部分の画像とに基づいて、前記第2の物品に関する位置合わせを行うことと、
     前記第2の物品を画像測定することを含む画像測定方法。
    Selecting an image from images of different parts of the first article based on features relating to the image;
    Aligning the second article based on the selected image and an image of a portion of the second article corresponding to the selected image;
    An image measurement method comprising measuring an image of the second article.
  2.  前記位置合わせを行うことにおいては、前記画像測定の座標系を設定することを含むことを特徴とする請求項1に記載の画像測定方法。 2. The image measuring method according to claim 1, wherein the alignment includes setting a coordinate system for the image measurement.
  3.  前記位置合わせを行うことにおいては、前記第2の物品の位置を設定することを含むことを特徴とする請求項1に記載の画像測定方法。 2. The image measuring method according to claim 1, wherein performing the alignment includes setting a position of the second article.
  4.  前記画像に関する特徴は、該画像の位置を示す情報、該画像の特徴を示す情報、該画像の撮像条件を示す情報の少なくとも1つを含むことを特徴とする請求項1~3のいずれか一項に記載の画像測定方法。 The feature relating to the image includes at least one of information indicating a position of the image, information indicating the feature of the image, and information indicating an imaging condition of the image. The image measuring method according to item.
  5.  前記画像の位置を示す情報は、前記画像測定の座標系の原点と、前記第1の物品における異なる部分の画像との距離を示す情報含むことを特徴とする請求項4に記載の画像測定方法。 5. The image measurement method according to claim 4, wherein the information indicating the position of the image includes information indicating a distance between an origin of the coordinate system of the image measurement and an image of a different portion of the first article. .
  6.  前記画像の特徴を示す情報は、前記第1の物品における異なる部分の画像と、前記第1の物品における該異なる部分に対応する画像との類似度と、前記第1の物品における該類似度が所定値以上となる箇所の数との少なくとも1つを含むことを特徴とする請求項4又は5に記載の画像測定方法。 The information indicating the characteristics of the image includes the similarity between an image of a different part of the first article, an image corresponding to the different part of the first article, and the similarity of the first article. The image measurement method according to claim 4, comprising at least one of a number of locations that are equal to or greater than a predetermined value.
  7.  前記画像の特徴を示す情報は、前記第1の物品における異なる部分の画像の特徴量を含むことを特徴とする請求項4~6のいずれか一項に記載の画像測定方法。 The image measurement method according to any one of claims 4 to 6, wherein the information indicating the feature of the image includes a feature amount of an image of a different part of the first article.
  8.  前記画像の撮像条件を示す情報は、撮像倍率を含むことを特徴とする請求項4~7のいずれか一項に記載の画像測定方法。 The image measurement method according to any one of claims 4 to 7, wherein the information indicating the imaging condition of the image includes an imaging magnification.
  9.  前記画像の撮像条件を示す情報は、撮像する際の照明方法を含むことを特徴とする請求項4~8のいずれか一項に記載の画像測定方法。 The image measurement method according to any one of claims 4 to 8, wherein the information indicating the imaging condition of the image includes an illumination method for imaging.
  10.  前記位置合わせを行うことにおいては、前記第2の物品に画像測定の座標系を設定し、前記選択された画像と、前記第2の物品における前記選択された画像に対応する部分の画像とに基づいて、前記第2の物品に設定した前記画像測定の座標系を補正することを特徴とする請求項1に記載の画像測定方法。 In performing the alignment, an image measurement coordinate system is set for the second article, and the selected image and a portion of the second article corresponding to the selected image are set. The image measurement method according to claim 1, wherein the image measurement coordinate system set for the second article is corrected based on the image measurement coordinate system.
  11.  前記第2の物品に画像測定の座標系を設定することにおいては、ユーザの入力に基づいて前記第2の物品に画像測定の座標系を設定することを特徴とする請求項10に記載の画像測定方法。 11. The image according to claim 10, wherein in setting an image measurement coordinate system for the second article, an image measurement coordinate system is set for the second article based on a user input. Measuring method.
  12.  前記第2の物品に画像測定の座標系を設定することは、前記第1の物品の所定部分の画像と、前記第2の物品における前記所定部分に対応する部分の画像とに基づいて、前記第2の物品に前記画像測定の座標系を設定することを特徴とする請求項10に記載の画像測定方法。 Setting a coordinate system for image measurement on the second article is based on an image of a predetermined part of the first article and an image of a part corresponding to the predetermined part of the second article. The image measurement method according to claim 10, wherein a coordinate system for the image measurement is set for the second article.
  13.  前記第1の物品の所定部分の画像は、前記第1の物品における異なる部分の画像の中から、該画像に関する前記特徴に基づいて選択された画像であることを特徴とする請求項12に記載の画像測定方法。 13. The image of the predetermined part of the first article is an image selected based on the feature relating to the image from images of different parts of the first article. Image measurement method.
  14.  更に、前記第1の物品の複数箇所の選択を受け付けることと、
     選択された箇所を含む範囲を撮像して、前記第1の物品における異なる部分の画像を取得することと、を含み、
     前記画像測定することにおいては、前記第1の物品の前記複数箇所に対応する前記第2の物品の箇所を画像測定することを特徴とする請求項1~13のいずれか一項に記載の画像測定方法。
    Further accepting selection of a plurality of locations of the first article;
    Capturing a range including the selected location and obtaining an image of a different portion of the first article,
    The image according to any one of claims 1 to 13, wherein in the image measurement, image measurement is performed on a portion of the second article corresponding to the plurality of locations of the first article. Measuring method.
  15.  前記位置合わせを行うことにおいて、前記第2の物品に関する位置合わせができなかった場合には、他の画像を選択しなおすことを特徴とする請求項1~14のいずれか一項に記載の画像測定方法。 The image according to any one of claims 1 to 14, wherein in the alignment, if the alignment of the second article cannot be performed, another image is selected again. Measuring method.
  16.  前記画像を選択することにおいては、前記第2の物品に関する位置合わせが失敗、又は成功した該位置合わせの際に選択されていた画像の失敗、又は成功に関する情報に基づいて選択することを特徴とする請求項1~15のいずれか一項に記載の画像測定方法。 In selecting the image, the selection on the basis of the information on the failure or the success of the image selected at the time of the alignment that has failed or succeeded in the alignment of the second article. The image measurement method according to any one of claims 1 to 15.
  17.  前記画像に関する特徴は、前記画像の特徴に関する複数種類の情報を含み、
     前記画像を選択することにおいては、前記複数種類の情報それぞれを用いて前記画像を評価した結果に基づいて、前記画像を選択することを特徴とする請求項1~16のいずれか一項に記載の画像測定方法。
    The feature relating to the image includes a plurality of types of information relating to the feature of the image,
    The selection of the image, wherein the image is selected based on a result of evaluating the image using each of the plurality of types of information. Image measurement method.
  18.  前記画像を選択することにおいては、前記複数種類の情報それぞれを用いて前記画像を評価した結果と、前記複数種類の情報それぞれの重みづけ条件とに基づいて前記画像を選択することを特徴とする請求項17に記載の画像測定方法。 In selecting the image, the image is selected based on a result of evaluating the image using each of the plurality of types of information and a weighting condition for each of the plurality of types of information. The image measurement method according to claim 17.
  19.  前記画像に関する特徴は、前記画像の特徴に関する複数種類の情報を含み、
     前記画像を選択することにおいては、前記第1の物品における異なる部分の画像から、前記複数種類の情報のうちの1つの情報が所定の条件を満たす画像を抽出する処理を、前記複数種類の情報のそれぞれの情報に対して繰り返し、選択する画像を絞り込むことを特徴とする請求項1~16のいずれか一項に記載の画像測定方法。
    The feature relating to the image includes a plurality of types of information relating to the feature of the image,
    In selecting the image, the process of extracting an image in which one information of the plurality of types of information satisfies a predetermined condition from the images of different parts of the first article is performed using the plurality of types of information. The image measuring method according to any one of claims 1 to 16, wherein the image to be selected is narrowed down repeatedly for each piece of information.
  20.  前記第1の物品は、画像測定の基準となる物品を含み、
     前記第2の物品は、画像測定の対象となる物品を含むことを特徴とする請求項1~19のいずれか一項に記載の画像測定方法。
    The first article includes an article serving as a reference for image measurement,
    The image measurement method according to any one of claims 1 to 19, wherein the second article includes an article to be subjected to image measurement.
  21.  物品を製造することと、
     前記製造することにおいて製造された前記物品を前記第2の物品として、請求項1~20のいずれか一項に記載の画像測定方法を用いた画像測定を実行することと、
     前記画像測定の結果に基づいて、前記物品の良否を判定することとを含む物品の製造方法。
    Manufacturing articles,
    Performing the image measurement using the image measurement method according to any one of claims 1 to 20, using the article manufactured in the manufacturing as the second article;
    Determining the quality of the article based on the result of the image measurement.
  22.  コンピュータに、
     第1の物品における異なる部分の画像の中から、該画像に関する特徴に基づいて、画像を選択することと、
     前記選択された画像と、第2の物品における前記選択された画像に対応する部分の画像とに基づいて、前記第2の物品に関する位置合わせを行うことと、
     前記第2の物品を画像測定することとを実行させる画像測定プログラム。
    On the computer,
    Selecting an image from images of different parts of the first article based on features relating to the image;
    Aligning the second article based on the selected image and an image of a portion of the second article corresponding to the selected image;
    An image measurement program for executing image measurement on the second article.
  23.  第1の物品における異なる部分の画像の中から、該画像に関する特徴に基づいて、画像を選択する画像選択部と、
     前記選択された画像と、第2の物品における前記選択された画像に対応する部分の画像とに基づいて、前記第2の物品に関する位置合わせを行う位置合わせ部と、
     前記第2の物品を画像測定する画像測定部と、を備える画像測定装置。
    An image selection unit that selects an image from images of different parts of the first article based on characteristics relating to the image;
    An alignment unit that performs alignment for the second article based on the selected image and an image of a portion of the second article corresponding to the selected image;
    An image measurement device comprising: an image measurement unit that measures an image of the second article.
PCT/JP2016/075580 2016-08-31 2016-08-31 Image measurement method, image measurement program, image measurement device, and article production method WO2018042580A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/JP2016/075580 WO2018042580A1 (en) 2016-08-31 2016-08-31 Image measurement method, image measurement program, image measurement device, and article production method
JP2018536604A JP6822478B2 (en) 2016-08-31 2016-08-31 Image measurement method, image measurement program and image measurement device, and manufacturing method of articles

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2016/075580 WO2018042580A1 (en) 2016-08-31 2016-08-31 Image measurement method, image measurement program, image measurement device, and article production method

Publications (1)

Publication Number Publication Date
WO2018042580A1 true WO2018042580A1 (en) 2018-03-08

Family

ID=61300502

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2016/075580 WO2018042580A1 (en) 2016-08-31 2016-08-31 Image measurement method, image measurement program, image measurement device, and article production method

Country Status (2)

Country Link
JP (1) JP6822478B2 (en)
WO (1) WO2018042580A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020153683A (en) * 2019-03-18 2020-09-24 株式会社キーエンス Image measuring device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0689341A (en) * 1992-09-07 1994-03-29 Toshiba Corp Component position detecting method
JPH0854222A (en) * 1994-08-12 1996-02-27 Matsushita Electric Works Ltd Method for detecting displacement by image processing
JPH10173029A (en) * 1996-12-13 1998-06-26 Dainippon Screen Mfg Co Ltd Method of determining measuring positions of wafer
JP2004207886A (en) * 2002-12-24 2004-07-22 Canon Inc Imaging apparatus
JP2011107878A (en) * 2009-11-16 2011-06-02 Seiko Epson Corp Position detection apparatus and position detection method
JP2012007934A (en) * 2010-06-23 2012-01-12 Cognex Corp Mobile object control system, program and mobile object control method
JP2013246162A (en) * 2012-05-30 2013-12-09 Hitachi High-Technologies Corp Defect inspection method and defect inspection device
JP2014055864A (en) * 2012-09-13 2014-03-27 Keyence Corp Image measurement device, manufacturing method of the same and program for image measurement device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0689341A (en) * 1992-09-07 1994-03-29 Toshiba Corp Component position detecting method
JPH0854222A (en) * 1994-08-12 1996-02-27 Matsushita Electric Works Ltd Method for detecting displacement by image processing
JPH10173029A (en) * 1996-12-13 1998-06-26 Dainippon Screen Mfg Co Ltd Method of determining measuring positions of wafer
JP2004207886A (en) * 2002-12-24 2004-07-22 Canon Inc Imaging apparatus
JP2011107878A (en) * 2009-11-16 2011-06-02 Seiko Epson Corp Position detection apparatus and position detection method
JP2012007934A (en) * 2010-06-23 2012-01-12 Cognex Corp Mobile object control system, program and mobile object control method
JP2013246162A (en) * 2012-05-30 2013-12-09 Hitachi High-Technologies Corp Defect inspection method and defect inspection device
JP2014055864A (en) * 2012-09-13 2014-03-27 Keyence Corp Image measurement device, manufacturing method of the same and program for image measurement device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020153683A (en) * 2019-03-18 2020-09-24 株式会社キーエンス Image measuring device
JP7252018B2 (en) 2019-03-18 2023-04-04 株式会社キーエンス Image measuring device

Also Published As

Publication number Publication date
JPWO2018042580A1 (en) 2019-07-04
JP6822478B2 (en) 2021-01-27

Similar Documents

Publication Publication Date Title
US8611638B2 (en) Pattern inspection method and pattern inspection apparatus
KR100598787B1 (en) Improved method and apparatus for direct probe sensing
US8004659B2 (en) Vision measuring machine and focusing method thereof
US8503758B2 (en) Image measurement device, method for image measurement, and computer readable medium storing a program for image measurement
US10318805B2 (en) Pattern matching method and apparatus
US7120286B2 (en) Method and apparatus for three dimensional edge tracing with Z height adjustment
JP2014194776A (en) Edge detection tool enhanced toward edge on uneven surface
US10360684B2 (en) Method and apparatus for edge determination of a measurement object in optical metrology
JP6980631B2 (en) Inspection method and inspection equipment
JP7353757B2 (en) Methods for measuring artifacts
CN113579601B (en) Welding bead positioning method and device, welding robot and storage medium
WO2018042580A1 (en) Image measurement method, image measurement program, image measurement device, and article production method
US10260870B2 (en) On-line measuring system, datum calibrating method, deviation measuring method and computer-readable medium
JP2012094430A (en) Method and device for inspecting defect
JP5403367B2 (en) Object shape evaluation device
WO2019180899A1 (en) Appearance inspection device
JP5445848B2 (en) Object shape evaluation device
JP2023015886A (en) Shape inspection device, processing device, height image processing method, and height image processing program
JP2006300935A (en) Method of determining side bias of xyz stage
JP2017096907A (en) Wire bonding inspection device, wire bonding inspection method, and program
JP2020051762A (en) Three-dimensional shape inspection device, three-dimensional shape inspection method, three-dimensional shape inspection program, and computer
JP7288138B2 (en) Specimen Observation Device, Specimen Observation Method
JP7481468B2 (en) Robot system and control method
CN115937273A (en) Image alignment method, system, recording medium, and computer program product
JP5641325B2 (en) Template character type recognition device

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

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2018536604

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16915141

Country of ref document: EP

Kind code of ref document: A1