Image measuring device and setting support device for image measuring device
The image measuring device automates the adjustment of imaging conditions for efficient and user-friendly measurement setup, addressing the time-consuming manual adjustments in conventional devices.
Patent Information
- Application Number
- PCT/JP2025/013956
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-03-25
- Filing Date
- 2025-04-07
- Publication Date
- 2025-10-23
AI Technical Summary
Conventional image measuring devices require manual adjustment of multiple measurement conditions, such as camera type, lighting, and image processing parameters, which is time-consuming and necessitates specialized knowledge, limiting their usability.
An image measuring device with an automatic adjustment unit that sets and adjusts imaging conditions for each measurement position, including illumination and imaging settings, allowing for automated edge extraction and measurement.
Facilitates easy and efficient setup of measurement conditions without specialized knowledge, enhancing user accessibility and reducing setup time.
Smart Images

Figure JP2025013956_23102025_PF_FP_ABST
Abstract
Description
Image measuring device and setting support device for image measuring device
[0001] The present disclosure relates to an image measuring device and a setting support device for an image measuring device.
[0002] The image measuring device performs dimensional measurements of each part using an image generated by capturing an image of the workpiece with an imaging unit. For example, the image measuring device disclosed in Patent Document 1 includes an adjustment unit that adjusts the focus of the imaging unit, and can determine the height of the workpiece relative to the light-transmitting plate based on the control parameters of the adjustment unit when the focus is on the workpiece and the control parameters of the adjustment unit when the focus is on the light-transmitting plate on which the workpiece is placed. Furthermore, the image measuring device disclosed in Patent Document 2 acquires the brightness distribution of a newly generated workpiece image with the imaging unit during operation, and determines measurement points on the newly generated workpiece image based on the positions and brightness information of the measurement points previously stored in a memory unit.
[0003] Patent No. 7252019 Patent No. 7280810
[0004] When using an image measuring device, it is necessary not only to set the measurement location and measurement content, but also to adjust multiple measurement conditions, including the type of camera used to capture the workpiece, the type of lighting, the camera position, and image processing parameters.
[0005] Although it is possible to automatically determine some of these measurement conditions, other conditions must be adjusted by the user, which is time-consuming.
[0006] The present disclosure has been made in consideration of the above points, and an object thereof is to make it possible to easily set measurement conditions.
[0007] In order to achieve the above object, an image measuring device according to one aspect of the present disclosure includes: a mounting table having a light-transmitting plate and on which a workpiece is placed on a first surface of the light-transmitting plate; a transmitted illumination unit provided below the light-transmitting plate and irradiating transmitted illumination light onto the workpiece placed on the light-transmitting plate; an epi-illumination unit provided above the light-transmitting plate and irradiating epi-illumination light onto the workpiece placed on the light-transmitting plate; an imaging unit provided above the mounting table and imaging the workpiece placed on the mounting table to generate an image including a workpiece image; a measurement setting unit that sets at least one of a plurality of measurement positions or one or more measurement items for the workpiece image included in the image generated by the imaging unit as measurement elements; an automatic adjustment unit that automatically adjusts, for each measurement position, a plurality of types of measurement conditions including the imaging conditions of the imaging unit for the measurement elements set by the measurement setting unit; and a measurement unit that extracts edges from the image generated by the imaging unit based on the measurement elements set by the measurement setting unit and the measurement conditions automatically adjusted by the automatic adjustment unit, and performs measurement of the measurement elements using the edges.
[0008] According to this configuration, when a measurement position or measurement item is set as a measurement element for a workpiece image, multiple types of measurement conditions, including the imaging conditions of the imaging unit for the set measurement element, are automatically adjusted for each measurement position. Measurement of the measurement element can be performed based on the automatically adjusted measurement conditions, which saves the user the trouble of setting the measurement conditions.
[0009] Another aspect can be a configuration support device for a vision measuring device that supports the configuration of the vision measuring device. The configuration support device for a vision measuring device includes a measurement setting unit that sets at least one of a plurality of measurement positions or one or more measurement items for a workpiece image included in an image generated by the imaging unit as measurement elements, and an automatic adjustment unit that automatically adjusts, for each measurement position, a plurality of measurement conditions including imaging conditions of the imaging unit for the measurement elements set by the measurement setting unit. Based on the measurement elements set by the measurement setting unit and the measurement conditions automatically adjusted by the automatic adjustment unit, edges can be extracted from the image generated by the imaging unit, and a setting process can be performed so that the measurement unit measures the measurement elements using the edges.
[0010] In another aspect, the image measuring device may include: a mounting table having a light-transmitting plate having translucency and on which a workpiece is placed on a first surface of the light-transmitting plate; a transmitted illumination unit provided below the light-transmitting plate and irradiating transmitted illumination light onto the workpiece placed on the light-transmitting plate; an epi-illumination unit provided above the light-transmitting plate and irradiating epi-illumination light onto the workpiece placed on the light-transmitting plate; an imaging unit provided above the mounting table and imaging the workpiece placed on the mounting table to generate an image including a workpiece image; a measurement setting unit that sets at least one of a plurality of measurement positions or one or more measurement items for the workpiece image included in the image generated by the imaging unit as measurement elements; an automatic adjustment unit that automatically adjusts, for each measurement position, a plurality of types of measurement conditions including the imaging conditions of the imaging unit for the measurement elements set by the measurement setting unit; and a measurement unit that extracts edges from the image generated by the imaging unit based on the measurement elements set by the measurement setting unit and the measurement conditions automatically adjusted by the automatic adjustment unit, and performs measurement of the measurement elements using the edges.
[0011] In another aspect, a mounting table has a light-transmitting plate having translucency, and a workpiece is mounted on a first surface of the light-transmitting plate; a transmission illumination unit provided below the light-transmitting plate and irradiating the workpiece mounted on the light-transmitting plate with transmitted illumination light; a reflection illumination unit provided above the light-transmitting plate and irradiating the workpiece mounted on the light-transmitting plate with reflected illumination light; an imaging unit provided above the mounting table and imaging the workpiece mounted on the mounting table to generate an image including a workpiece image; an update image acquisition unit that sequentially images the workpieces using the imaging unit and sequentially acquires images including the sequentially generated workpiece images as update images; a setting image acquisition unit that acquires an image related to the shape of the workpiece as a setting image; and an automatic adjustment unit that automatically adjusts multiple types of measurement conditions for each measurement element based on updated images having different measurement conditions sequentially acquired by the updated image acquisition unit and each measurement element set by the measurement setting unit; and a measurement unit that extracts edges from an image generated by the imaging unit based on the measurement elements set by the measurement setting unit and the measurement conditions automatically adjusted by the automatic adjustment unit, identifies the measurement elements using the edges, and performs measurements of the measurement items set by the measurement setting unit based on the measurement elements.
[0012] In another aspect, a mounting table has a light-transmitting plate having translucency and on which a workpiece is placed on a first surface of the light-transmitting plate; a transmitted illumination unit provided below the light-transmitting plate and irradiating the workpiece placed on the light-transmitting plate with transmitted illumination light; a reflection illumination unit provided above the light-transmitting plate and irradiating the workpiece placed on the light-transmitting plate with reflected illumination light; an imaging unit provided above the mounting table and imaging the workpiece placed on the mounting table to generate an image including a workpiece image; an updated image acquisition unit that sequentially images the workpiece using the imaging unit and sequentially acquires images including the sequentially generated workpiece images as updated images; shape information regarding the shape of the workpiece and a plurality of images corresponding to the shape of the workpiece The image measuring device may include a setting receiving unit that receives setting information including measurement elements and measurement items related to the measurement elements; an automatic adjustment unit that automatically adjusts multiple types of measurement conditions for each measurement element based on updated images having different measurement conditions that are sequentially acquired by the updated image acquisition unit and each measurement element set by the measurement setting unit; and a measurement unit that extracts edges from an image generated by the imaging unit based on the measurement elements of the setting information and the measurement conditions automatically adjusted by the automatic adjustment unit, identifies the measurement elements using the edges, and performs measurements of the measurement items of the setting information based on the measurement elements.
[0013] As described above, since a plurality of types of measurement conditions including the imaging conditions of the imaging unit for the measurement element are automatically adjusted for each measurement position, the measurement conditions can be easily set.
[0014] FIG. 1 is a diagram showing a schematic configuration of an image measuring device according to this embodiment. FIG. 2 is a front view of the device main body. FIG. 3 is a perspective view of the device main body. FIG. 4 is a block diagram of the image measuring device. FIG. 5A is a diagram outlining the automation functions of the image measuring device. FIG. 5B is a diagram showing an example of CAD data. FIG. 6A is a flowchart showing an example of processing executed by the image measuring device. FIG. 6B is a diagram showing the type of drawing to be imported and the relationship between pixels in each part. FIG. 7 is a diagram showing an example of a user interface screen for displaying a drawing. FIG. 8 is a flowchart showing an example of scaling estimation processing. FIG. 9 is a diagram showing an example of imported drawing data. FIG. 10 is a diagram showing an example of a user interface screen displaying a drawing guide. FIG. 11 is a flowchart showing an example of contour best fit processing. FIG. 12 is a diagram showing an example of a workpiece image and an edge image. FIG. 13 is a diagram showing an example of generating a template image from an edge image. FIG. 14 is a diagram showing an example of a user interface screen for alignment confirmation. FIG. 15 is a diagram showing an example of a user interface screen displaying two screens. FIG. 16 is a flowchart showing processing of a first example of program creation assistance. FIG. 17A is a diagram equivalent to FIG. 15 when a dimension is clicked. FIG. 17B is a diagram equivalent to FIG. 17A when the corresponding measurement item is displayed. FIG. 17C is a diagram equivalent to FIG. 17A when displaying corresponding measurement element candidates. FIG. 17D is a diagram equivalent to FIG. 17C after a confirmation operation. FIG. 18 is a diagram equivalent to FIG. 15 displayed when measurement element candidates are presented. FIG. 19 is a flowchart showing the processing of a second example of program creation assistance. FIG. 20 is a diagram showing a window displayed when setting edge extraction conditions. FIG. 21 is a diagram explaining edge extraction processing. FIG. 22 is a flowchart outlining automatic adjustment by the automatic adjustment unit. FIG. 23 is a diagram showing an example of a user interface screen for measurement settings. FIG. 24 is a diagram equivalent to FIG. 23 showing automatically adjusted measurement elements. FIG. 25 is a diagram showing an example of a user interface screen for detailed display. FIG. 26 is a flowchart of automatic adjustment. FIG. 27 is a flowchart showing an example of the adjustment order of multiple measurement conditions. FIG. 28A is a timing chart showing the concept of background automatic adjustment.FIG. 28B is a timing chart showing another example of automatic background adjustment. FIG. 29 is a flowchart showing a process during operation of the image measuring device. FIG. 30 is a block diagram of a setting support device for the image measuring device. FIG. 31 is a flowchart showing an example of offline program creation processing. FIG. 32 is a diagram showing an example of a user interface screen displaying an image based on imported drawing data. FIG. 33 is a diagram corresponding to FIG. 32 showing a state in which the specification of the import range has been accepted. FIG. 34 is a diagram corresponding to FIG. 32 showing a state in which the drawing data of the import range is displayed. FIG. 35 is a diagram corresponding to FIG. 34 showing a state in which fill processing has been executed. FIG. 36 is a diagram showing a window for setting fill processing. FIG. 37 is a diagram showing an example of a user interface screen that can be displayed in two screens. FIG. 38 is a diagram corresponding to FIG. 37 showing a state in which dimensions have been selected. FIG. 39 is a diagram showing an example of a user interface screen for pattern registration. FIG. 40 is a diagram corresponding to FIG. 37 when there is no fill. FIG. 41 is a diagram corresponding to FIG. 38 when there is no fill. Fig. 42 is a flowchart showing an example of processing when a program created offline is read into an image measuring device online. Fig. 43 is a diagram showing an example of a user interface screen displayed when a pattern image is registered. Fig. 44 is a diagram showing a screen for superimposing a created program on a workpiece W placed on a stage. Fig. 45 is a diagram corresponding to Fig. 4 showing an example of a configuration including a specifying unit.
[0015] Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. Note that the following description of the preferred embodiments is merely exemplary in nature and is not intended to limit the present invention, its applications, or its uses.
[0016] Fig. 1 is a diagram showing a schematic configuration of an image measuring device 1 according to an embodiment of the present invention. Fig. 2 is a front view of the image measuring device 1 according to an embodiment of the present invention, and Fig. 3 is a perspective view of the image measuring device 1 according to an embodiment of the present invention. Fig. 4 is a block diagram showing a schematic configuration of the image measuring device 1. The image measuring device 1 measures, for example, dimensions of various workpieces W (shown in Fig. 2) that are measurement objects, and can also be called a dimension measuring device, a dimension measuring system, etc.
[0017] 1, the image measuring device 1 includes a device main body 2, a personal computer 100, a display unit 102, a keyboard 103, and a mouse 104. The personal computer 100 may be a desktop computer or a notebook computer. A general-purpose personal computer on which a computer program (software) for executing the control and processing described below is installed can be used as the personal computer 100.
[0018] The personal computer 100 includes a control unit 110 and a storage unit 120. The control unit 110 is composed of a central processing unit, ROM, RAM, etc., included in the personal computer 100. The storage unit 120 is connected to the control unit 110. The storage unit 120 is composed of, for example, an SSD (Solid State Drive) or a hard disk drive. The control unit 110 is connected to each piece of hardware and controls the operation of each piece of hardware. The control unit 110 also executes software functions in accordance with computer programs stored in the storage unit 120. The control unit 110 executes the software functions to configure a measurement unit 110A, a drawing capture unit 111, a drawing acceptance unit 112, a measurement setting unit 113, a matching unit 114, a display screen generation unit 115, a measurement element selection unit 116, an automatic adjustment unit 117, a data generation unit 118, an association unit 119, etc. The measurement unit 110A, drawing capture unit 111, drawing acceptance unit 112, measurement setting unit 113, matching unit 114, display screen generation unit 115, measurement element selection unit 116, automatic adjustment unit 117, data generation unit 118, and association unit 119 may be configured as a combination of software functions and hardware. Furthermore, parts of the measurement unit 110A, drawing capture unit 111, drawing acceptance unit 112, measurement setting unit 113, matching unit 114, display screen generation unit 115, measurement element selection unit 116, automatic adjustment unit 117, data generation unit 118, and association unit 119 may be configured as a processor separate from the control unit 110. Load modules are loaded into the RAM of the control unit 110 when a computer program is executed, and temporary data generated during execution of the computer program is stored therein. Instead of the personal computer 100, a processor dedicated to image measurement may be provided.
[0019] The display unit 102 is configured with, for example, a liquid crystal display or an organic EL display, and is connected to the control unit 110. The control unit 110 controls the display unit 102 to display various user interface screens on the display unit 102.
[0020] The keyboard 103 and the mouse 104 are typical examples of members for operating the control unit 110. When the keyboard 103 and the mouse 104 are operated by the user, the control unit 110 detects the operation states of the keyboard 103 and the mouse 104, and controls each section according to the operation states of the keyboard 103 and the mouse 104. The members for operating the control unit 110 may be a touch panel or various pointing devices capable of detecting touch operations by the user.
[0021] In this embodiment, an example will be described in which the control unit 110 is separate from the device main body 2 and is communicatively connected via a communication line or the like, but the configuration of the image measuring device 1 is not limited to the configuration described above, and the control unit 110 may be incorporated into and integrated with the device main body 2. Similarly, the storage unit 120 may be separate from the device main body 2, or may be incorporated into and integrated with the device main body 2. The control unit 110 and the storage unit 120 may be separate or integrated. Part or all of the storage unit 120 may be configured as cloud-based storage.
[0022] In the description of this embodiment, the side of the device body 2 of the image measuring device 1 that is located in front when facing a user positioned in the expected access direction will be referred to as the front side, and the side that is located behind will be referred to as the rear side. Furthermore, the side that is located to the left when viewed from the user of the device body 2 of the image measuring device 1 will be referred to as the left side, and the side that is located to the right will be referred to as the right side. To align the definitions with those viewed from the user's perspective, the front side can be referred to as the near side, and the rear side can also be referred to as the far side. This definition is provided merely for convenience of description and does not limit the orientation during actual use.
[0023] As shown in FIGS. 1 to 3 , the device main body 2 includes a base 10 and an arm 11 extending upward from the rear side of the base 10. A stage 12, which serves as a platform for placing a workpiece W, is provided on top of the base 10. The stage 12 extends substantially horizontally. A light-transmitting plate 12a, which transmits light, is provided near the center of the stage 12. For example, the top surface of the light-transmitting plate 12a is referred to as the first surface, and the workpiece W is placed on the first surface of the light-transmitting plate 12a. In the following description, the first surface of the light-transmitting plate 12a will be referred to as the upper surface of the light-transmitting plate 12a. The stage 12, which includes the light-transmitting plate 12a, can be driven in the horizontal and vertical directions by a stage driver 12c shown in FIG. 4 . The stage driver 12c drives the stage 12 in the left-right direction (X direction), the depth direction (Y direction), and the height direction (Z direction). The stage driving unit 12c receives an instruction from the control unit 110 and drives the stage 12 in the specified direction by the specified movement amount as long as it is within a predetermined driving range. The stage 21 can be moved by an electric actuator or the like, but may also be moved manually by a user.
[0024] As shown in FIG. 4 , the device main body 2 includes an illumination unit 13. The illumination unit 13 includes an incident illumination unit 13a built into the upper part of the arm unit 11 and a transmitted illumination unit 13b built into the base unit 10. As shown by the dashed line in FIG. 2 , the transmitted illumination unit 13b is provided below the light-transmitting plate 12a and is oriented to irradiate light upward. The light emitted from the transmitted illumination unit 13b passes through the light-transmitting plate 12a upward and is irradiated from below onto the workpiece W placed on the upper surface of the light-transmitting plate 12a. In other words, the transmitted illumination unit 13b is a component that irradiates the workpiece W placed on the light-transmitting plate 12a with transmitted illumination light. The transmitted illumination unit 13b includes an illumination light source, an illumination aperture, and an illumination lens. The transmitted illumination unit 13b may be an object-side telecentric system that shapes light from the light source using an aperture aperture and collimates it using a lens. The illumination aperture may be a variable aperture. In this case, for example, by making the shape of the aperture a shape that corresponds to the entrance pupil of the object-side telecentric system, it is possible to switch between a mode in which the light irradiated onto the workpiece W is made into parallel light, and a mode in which the light irradiated onto the workpiece W is made into light at various angles by making the shape of the aperture an open shape.
[0025] The epi-illumination unit 13a is provided above the light-transmitting plate 12a and is oriented so as to irradiate light downward. The light emitted from the epi-illumination unit 13a is irradiated from above onto the workpiece W placed on the light-transmitting plate 12a. In other words, the epi-illumination unit 13a is a member that irradiates epi-illumination light onto the workpiece W placed on the light-transmitting plate 12a.
[0026] The illumination unit 13 may include, for example, a ring illumination unit 13c formed in a ring shape surrounding the optical axis A of the imaging unit 15 described later, a slit illumination unit 13d that illuminates the workpiece W from the side, and the like.
[0027] An operation unit 14 is provided on the front side of the base unit 10. The operation unit 14 includes various buttons, switches, dials, etc. that are operated by the user. An example of a button included in the operation unit 14 is a measurement start button. The control unit 110 is also capable of detecting the operation state of the operation unit 14 and controlling each unit in accordance with the operation state of the operation unit 14. The operation unit 14 may be configured as a touch panel or the like that can detect touch operations by the user. In this case, the operation unit 14 can be incorporated into the main body display unit 16, which will be described later.
[0028] The incident illumination unit 13a and the transmitted illumination unit 13b are controlled by the control unit 110. For example, when the control unit 110 detects that an operation to start measurement of the workpiece W has been performed by the operation unit 14, the incident illumination unit 13a or the transmitted illumination unit 13b can be turned on to irradiate incident illumination light or transmitted illumination light.
[0029] 1, the arm unit 11 is provided with an imaging unit 15 located above the stage 12. The imaging unit 15 is a part that captures an image of the workpiece W placed on the stage 12 and generates an image including an image of the workpiece. In the following description, an image including an image of the workpiece will be referred to as a workpiece image.
[0030] A typical example of the imaging unit 15 is a camera having an imaging element such as a CCD (Charge Coupled Device) or a CMOS (Complementary Metal Oxide Semiconductor). As shown in FIG. 1 , the optical axis A of the imaging unit 15 is set vertically downward, and an optical system 15a including a light receiving lens and an imaging lens is arranged coaxially with the optical axis A of the imaging unit 15. For example, the optical system 15a includes an object-side telecentric lens. This allows an image of the workpiece W of the same size to be captured regardless of the distance to the workpiece W, even when the focal depth is increased. When the focal depth is shallow and the focal position is fixed, a telecentric lens is not necessarily required. The optical system 15a is configured to allow for variable magnification. For example, multiple lenses with different magnifications are arranged at different optical path positions, and the magnification can be changed by switching the optical path used. The optical system 15a may also include a zoom lens. The optical system 15a also includes an aperture that adjusts the amount of light incident on the imaging unit 15.
[0031] The imaging unit 15 may be an imaging unit including an optical system 15a, or may be an imaging element that does not include the optical system 15a. Light irradiated from the epi-illumination unit 13a and reflected by the workpiece W, light irradiated from the transmitted illumination unit 13b and transmitted through the light-transmitting plate 12a of the stage 12, etc. are incident on the imaging unit 15. Methods for adjusting the focus using the optical system 15a include, for example, a method of adjusting based on the position where the sharpness, contrast, maximum brightness, etc. of the workpiece image are maximized, or a method of arranging a distance measuring sensor and adjusting based on the measurement signal of the distance measuring sensor.
[0032] The imaging unit 15 generates a workpiece image based on the amount of received light. The imaging unit 15 is connected to the control unit 110, and the workpiece image generated by the imaging unit 15 is transmitted to the control unit 110 as image data. The control unit 110 can also control the imaging unit 15. For example, when the control unit 110 detects that an operation to start measurement of the workpiece W has been performed by the operation unit 14, the control unit 110 causes the imaging unit 15 to perform imaging processing while turning on the epi-illumination unit 13a or the transmitted illumination unit 13b to irradiate light. As a result, a workpiece image is generated in the imaging unit 15, and the generated workpiece image is transmitted to the control unit 110.
[0033] The control unit 110 can incorporate the workpiece image transmitted from the imaging unit 15 into a user interface screen and display it on the display unit 101 or the main body display unit 16. The main body display unit 16 is provided on the upper part of the arm unit 11 so as to face forward. The main body display unit 16 is configured with, for example, a liquid crystal display or an organic EL display. The control unit 110 can control the main body display unit 16 to display various user interface screens on the main body display unit 16 as well.
[0034] The control unit 110 is provided with a measurement unit 110A. The measurement unit 110A extracts the edges (contours) of the workpiece W by performing image processing such as edge extraction processing on the workpiece image transmitted from the imaging unit 15, and generates an edge image. The measurement unit 110A measures the dimensions of each part of the workpiece W using the generated edge image. The measurement portion for measuring the dimensions can be specified in advance by the user, as will be described later. The measurement unit 110A calculates the dimensions corresponding to the measurement portion specified by the user.
[0035] The device main body 2 also includes an overhead camera 17, although this is not essential. The overhead camera 17 is provided above the light-transmitting plate 12a and is a camera for capturing an image of the workpiece W placed on the light-transmitting plate 12a from an angle looking down from above to generate an overhead image. The overhead camera 17 has an imaging element similar to that of the imaging unit 15. The overhead image generated by the overhead camera 17 is transmitted to the control unit 110. The position of the overhead camera 17 is not particularly limited, but if it is located, for example, in front of the imaging unit 15, it can also be called a front camera.
[0036] (Measurement Settings) When using a conventional vision measuring device, it is necessary to set the inspection measurement items. Generally, a user understands the inspection measurement items specified in a drawing, adjusts the observation conditions of the vision measuring device, and instructs the vision measuring device to associate the captured image with the measurement elements. The user then instructs the vision measuring device to adjust the measurement conditions. In this way, the user must perform the following procedures for all elements to be measured: understanding the drawing instructions, adjusting the observation conditions, associating the captured image with the measurement elements, and adjusting the measurement conditions. To assist in setting the inspection measurement items, the user may also import drawing data such as DXF data into the vision measuring device as inspection data to set the inspection measurement items. However, alignment of the workpiece image and the drawing data is required, and the user must create a reference element (e.g., a reference coordinate system) to align the workpiece image and the drawing data. Furthermore, it is necessary to specify the measurement position, measurement elements, etc. for the drawing data imported into the vision measuring device, as well as adjust measurement conditions such as focus adjustment for the imaging unit and illumination adjustment for the lighting unit. For this reason, conventional image measuring devices require users to have specialized knowledge of CAD (Computer Aided Design) and measuring instruments, which has led to the problem that only a limited number of people can operate them.
[0037] In contrast, the image measuring device 1 of this embodiment is equipped with an automation function that can almost automatically perform the above-mentioned alignment, designation of measurement elements, adjustment of the imaging unit, adjustment of the lighting unit, etc. By incorporating the automation function, the user can easily perform the desired measurement even if they do not have specialized knowledge of CAD or measuring instruments. Note that the above-mentioned DXF stands for Drawing Exchange Format, and is a format for representing two-dimensional and three-dimensional shapes in vector format.
[0038] An outline of the automation functions of the vision measuring device 1 is shown in Fig. 5A. In steps SA1 and SA2, the user inputs the workpiece image generated by the imaging unit 15 and drawing data into the vision measuring device 1. In step SA2, CAD data, PDF data, image data, and paper drawings can all be input. Fig. 5B shows an example of CAD data.
[0039] In step SA3, the image measuring device 1 imports inspection data from the drawing data. The drawing data may include a single projection view, such as a front view or a plan view, for inspection purposes, but in most cases includes multiple projection views, such as three- or six-view views. In step SA3, the image measuring device 1 may partially import, as inspection data, a region that the user specifies as the desired region from the multiple projection views included in the drawing data. At this time, the image measuring device 1 may automatically determine a region from the drawing data that includes a projection view with a large amount of measurement-related information, and suggest the determined measurement location to the user (step SA4).
[0040] In step SA5, the image measuring device 1 aligns the workpiece image input in step SA1 with the drawing data input in step SA2. When selecting measurement dimensions in step SA6, it generates measurement elements in bulk based on information about the outline extracted from the drawing data in step SA7, or it proposes measurement element positions based on information about the outline extracted from the drawing data in step SA8, and sequentially accepts user instructions for the proposed measurement element positions to generate measurement elements. In step SA9, it automatically adjusts the measurement conditions for each measurement element, and in step SA10, the user can confirm the measurement results. At this time, in step SA11, the image measuring device 1 proposes other candidate measurement conditions, and in step SA12, it proposes readjustment of the measurement conditions. In this way, the image measuring device 1 generates measurement data. Only some of the multiple processes shown in FIG. 5A may be executed.
[0041] A detailed description will be given below based on the flowchart shown in Fig. 6A. In the flowchart shown in Fig. 6A, first, the display screen generation unit 115 of the control unit 110 generates a main screen (not shown) and displays it on the display unit 101 and the main body display unit 16. The main screen may be displayed on only one of the display unit 101 and the main body display unit 16. The same applies to screen displays below, and the main screen may be displayed on both the display unit 101 and the main body display unit 16, or on only one of them.
[0042] Step SB1 is a drawing data type selection step. The drawing data includes the workpiece shape and may be CAD data as shown in FIG. 5B or non-CAD data. Non-CAD data includes information necessary for creating a measurement program, such as design values and tolerances for the workpiece being measured, but is data such as PDF or images in which design values (dimensions) are not linked to leader lines (lines used for dimensioning). However, since the format (raster or vector) is not important, non-CAD data includes, for example, PDF data, which is vector data, as well as image data, PDF data, which is raster data, and PDF data, which is a mixture of raster and vector data. Image data here includes JPEG data, PNG data, TIFF data, and data obtained by scanning paper drawings (paper data shown in FIG. 6B). Here, CAD data generally refers to design drawing data, but is not limited to this. The CAD data may be drawing data for inspection, as long as it is drawing data in which dimensions such as inspection values are linked to lines used for entering dimensions such as dimension lines.
[0043] In step SB1, the user can select the type of drawing data by operating, for example, a drawing data type selection button displayed on the main screen. That is, the control unit 110 includes a drawing import unit 111 for importing drawings to be imported and a drawing reception unit 112 for receiving the drawings. The drawing import unit 111 is a unit that selectively imports drawing data including workpiece shapes in response to an import instruction from the user. The drawing reception unit 112 is a unit that receives the drawing data including workpiece shapes imported by the drawing import unit 111.
[0044] Specifically, the drawing import unit 111 accepts the selection of "electronic file" or "paper drawing" as the type of drawing data to be imported, as described above. After accepting the selection of the type of drawing data in step SB1, if the type of drawing data is "electronic file," the drawing import unit 111 imports the electronic file as shown by arrow 500 in Figure 6B. If the imported electronic file is CAD data, the process proceeds to step SB2. The CAD data imported by the drawing import unit 111 is accepted by the drawing acceptance unit 112.
[0045] After receiving the selection of the type of drawing data in step SB1, the drawing import unit 111 imports the electronic file if the type of drawing data is "electronic file." If the imported electronic file is vector data, the process proceeds to step SB3. The vector data imported by the drawing import unit 111 is accepted by the drawing acceptance unit 112.
[0046] Furthermore, after receiving the selection of the type of drawing data in step SB1, the drawing import unit 111 imports the electronic file if the type of drawing data is "electronic file." If the imported electronic file is raster data, the process proceeds to step SB4. The vector data imported by the drawing import unit 111 is accepted by the drawing acceptance unit 112. If the type of drawing data is CAD data, vector data, or raster data, the user can specify the data from the storage location of the data, which allows the drawing acceptance unit 112 to accept the data.
[0047] On the other hand, after receiving the selection of the drawing data type in step SB1, the drawing capture unit 111 proceeds to step SB5 if the drawing data type is "paper drawing." When capturing drawing data of a paper drawing, the process proceeds to step SB6, where the user places the paper drawing on the upper surface of the stage 12, as indicated by arrow 501 in FIG. 6B. Then, the process proceeds to step SB7, where the image measuring device 1 executes an automatic drawing capture process. Specifically, when the user places the paper drawing on the upper surface of the stage 12 and issues a capture instruction, the control unit 110 captures an image of the paper drawing using the imaging unit 15 and captures the image as drawing data using the drawing capture unit 111. In this way, in the case of a paper drawing, the drawing capture unit 111 can capture the image obtained by capturing the paper drawing as drawing data. When the paper drawing data is captured, the drawing acceptance unit 112 accepts the paper drawing data.
[0048] When capturing an image of a paper drawing, if the paper drawing is larger than the field of view of the imaging unit 15, the control unit 110 issues an instruction to the stage driving unit 12c to move the stage 12 in the horizontal direction, and then another portion of the paper drawing is captured by the imaging unit 15. By repeating this process and linking multiple images obtained, it is possible to automatically capture an image of the required range of the paper drawing as drawing data.
[0049] If the drawing data includes multiple projections, one of the projections is captured by the imaging unit 15. If the target projection is larger than the field of view of the imaging unit 15, the control unit 110 instructs the stage driver 12c to move the stage 12 horizontally, and then another portion of the projection is captured by the imaging unit 15. By repeating this process and concatenating the multiple images obtained, an image of the range corresponding to the selected projection on the paper drawing can be automatically captured as drawing data. To capture one projection from multiple projections, the imaging range may be determined based on a specified position on the display image corresponding to the target projection. Alternatively, the paper drawing may be placed so that the target projection is located within the field of view of the imaging unit 15, and the image measurement device 1 may detect a partial area of the target projection by blob processing the image captured by the imaging unit 15. Based on the detected partial area, the image measurement device 1 estimates other partial areas of the target projection that are outside the field of view of the imaging unit 15. Based on the estimated other partial area, the control unit 110 issues an instruction to the stage driving unit 12c, which moves the stage 12 in the horizontal direction, and then the other partial area of the projection drawing is imaged by the imaging unit 15. By repeating this process and connecting multiple images obtained, it is possible to automatically import an image of the range corresponding to the selected projection drawing as drawing data by arranging the paper drawing so as to be positioned within the field of view of the imaging unit 15.
[0050] Therefore, even at a measurement site where only paper drawings are available, there is no need to scan the paper drawings with a dedicated scanner to convert them into image data, and they can be quickly captured by capturing an image using the image measuring device 1. The image measuring device 1 can not only capture image data obtained by scanning a paper drawing with a dedicated scanner as drawing data in step SB4, but can also capture the paper drawing as drawing data by capturing an image of it with the imaging unit 15 in step SB7. In other words, the image measuring device 1 also has a part that directly captures paper drawings as drawing data.
[0051] Furthermore, in step SB7, a paper drawing can also be captured as drawing data using a camera other than the imaging unit 15. In this embodiment, the apparatus main body 2 is equipped with the overhead camera 17, so that the paper drawing placed on the upper surface of the stage 12 can be imaged by the overhead camera 17 and captured as drawing data. A camera other than the imaging unit 15 and the overhead camera 17 may also be provided, and in this case, the paper drawing can also be imaged by a camera other than the imaging unit 15 and the overhead camera 17.
[0052] The CAD data received in step SB2 is displayed on the display unit 101. For example, as shown in Fig. 7, the drawing import unit 111 generates a drawing display user interface screen 150 and displays it on the display unit 101 or the like.
[0053] In step SB8, the user selects the import range of the CAD data accepted in step SB2. Specifically, while viewing the CAD data on the drawing display user interface screen 150 displayed on the display unit 101, the user operates the mouse 104 or the like to specify the range so that the area requiring dimensional measurement is the import range. In FIG. 7 , the specified range is indicated by a rectangular frame 151. This is the user's import instruction. The range can be specified by a drag operation or the like, as has been done conventionally. If the CAD data is two-dimensional drawing data, the CAD data includes multiple projection views, such as a front view, a top view, and a side view, in which the three-dimensional workpiece, which is the measurement target, is parallel projected onto a two-dimensional plane from multiple different directions, as shown in FIG. 5B . The user operates the mouse 104 or the like to specify the range so that the projection views requiring dimensional measurement are the import range among the multiple projection views included in the CAD data.
[0054] As described above, the drawing import unit 111 is a part that selectively imports drawing data including the workpiece shape in response to an import instruction, and can import only drawing data within the range specified by the user's import instruction, for example. The drawing import unit 111 can also selectively import non-CAD data including the workpiece shape in response to an import instruction, and can also selectively import raster image drawing data including the workpiece shape and vector image drawing data including the workpiece shape in response to an import instruction. Note that only a portion of the drawing data including the workpiece shape may be imported, or all of the drawing data including the workpiece shape may be imported. When the drawing data includes multiple projection views, only those projection views that require dimensional measurement may be imported, or all of the projection views may be imported.
[0055] In step SB9, it is determined whether or not the scale (scaling value) can be read from the CAD data received in step SB2. When a workpiece W having a shape as shown in Fig. 6B is imaged by the imaging unit 15, the pixels of the captured image and the image data will have the same scale unless binning, scaling, thinning processing, super-resolution processing, etc. are performed, but the display pixels displayed on the display unit 101 and the pixels of the image data may change depending on the scale.
[0056] Here, the term "scale" generally refers to the reduction ratio when drawing data is created using dimensions smaller than the actual dimensions. In this specification, unless otherwise specified, the term "scale" is equivalent to a scale that includes not only a reduction ratio but also the actual scale (full scale) or the double scale (enlargement ratio). The scaling value refers to the actual dimension per unit length of the dimension that constitutes the drawing data. When the unit of the dimension that constitutes the drawing data is the same as the unit of the actual dimension, the scaling value and the scale are equivalent. When the drawing data is created using values based on pixel position, such as pixel pitch, the scaling value depends on the conversion ratio between the dimension expressed in units based on pixel position and the dimension that constitutes the drawing data, and the scale of the drawing data.
[0057] Normally, CAD data includes scale information, but there are cases where scale information is not included for some reason, so the measurement setting unit 113 of the control unit 110 determines whether or not scale information is included in the CAD data. If scale information is included in the CAD data, the measurement setting unit 113 determines YES in step SB9. If scale information is not included in the CAD data for some reason, the measurement setting unit 113 determines NO in step SB9.
[0058] If step SB9 returns NO, the process proceeds to step SB10. In step SB10, the measurement setting unit 113 acquires dimensional information contained in the drawing data and estimates the scale of the drawing based on the acquired dimensional information. The process of estimating scaling values, including the scale, is called scaling estimation. Dimensional information includes dimensions and lines of dimensioning, such as dimension lines. In the case of CAD data, dimensions and lines used for dimensioning are linked, so the scale of the drawing can be estimated based on the linked dimensions and lines used for dimensioning. Lines used for dimensioning include dimension lines, extension lines, and leader lines. For example, the scale can be estimated by comparing the dimension value with the length of the dimension line corresponding to the dimension. The measurement setting unit 113 can also acquire title block information from the CAD data and use the scale contained in the title block information as the scale of the drawing. After step SB10, the process proceeds to step SB14, described below.
[0059] In step SB11, which is reached after the non-CAD data is accepted, the user selects the import range for the non-CAD data in the same manner as in step SB8. The drawing import unit 111 imports only the drawing data within the range specified by the user.
[0060] In step SB12, the measurement setting unit 113 vectorizes the range of the non-CAD data imported in step SB11. For example, by converting raster data composed of dots into vector data by vectorization, the data can be converted into a format that can be recognized as a predetermined object, such as a line, circle, or arc. Vectorization can be achieved by, for example, using an image processing algorithm such as a Hough transform or by deep learning recognition.
[0061] For non-CAD data, even after vectorization, dimensions and lines used for dimensioning, such as dimension lines, are not associated with each other as in CAD data. Therefore, scaling estimation as described in step SB10 of FIG. 6A is not possible. Therefore, scaling candidates are calculated by matching the OCR information of dimensions acquired by OCR processing of the drawing data with the intersections of dimension lines and extension lines on the drawing and the arrow information of the dimension lines. In the scaling estimation process, corresponding dimensions and dimension lines are determined based on the positional relationships between multiple dimensions and multiple dimension lines, and scaling candidates are calculated based on the dimension values based on the OCR information of the dimensions and the lengths of the dimension lines on the drawing corresponding to the dimensions. A final scaling value is calculated by performing statistical processing on the multiple scaling candidates calculated from the multiple dimensions and their corresponding dimension lines. For example, the scaling value is calculated based on the class or class group with the largest number in the frequency distribution of the scaling candidates. This process is called scaling estimation processing for non-CAD data. When calculating the scaling value, the measurement setting unit 113 acquires the units (mm, inches, etc.) of the drawing. The information about the units may be specified by the user, may be obtained from a summary field included in the drawing data, or may be obtained from letters or symbols added as units to the dimensions.
[0062] In the case of non-CAD data, the units of each coordinate value on the drawing indicated by the ends of a dimension line may be expressed in units corresponding to the actual size of the drawing, or may be expressed in units based on the pixel position in the image data of the drawing. When the units of each coordinate value are expressed in units based on the pixel position, the length based on the pixel position of each coordinate is converted to determine the actual length on the drawing. In this case, the length between the ends of the dimension line based on the pixel position can be calculated based on the actual size of the drawing by multiplying the length between the ends of the dimension line based on the pixel position by the actual length per pixel unit, such as the pixel pitch. For example, the length between the ends of the dimension line based on the actual size of the drawing can be calculated by multiplying the reciprocal of the image resolution (ppi) and converting the result to mm.
[0063] In step SB13, the measurement setting unit 113 executes a scaling estimation process for the non-CAD data. In the scaling estimation process, the measurement setting unit 113 acquires dimensional information contained in the imported non-CAD data and estimates the scale of the drawing based on the acquired dimensional information. FIG. 8 shows the details of the procedure for the scaling estimation process for non-CAD data. In step SC1, the measurement setting unit 113 extracts vertical and horizontal lines from the drawing based on the non-CAD data. Vertical lines are lines extending vertically (up and down) on the drawing, and horizontal lines are lines extending horizontally (left and right) on the drawing. Therefore, vertical and horizontal lines are orthogonal to each other. For example, when drawing data such as that shown in FIG. 9 is imported, line segments L1, L2, L3, and L4 are extracted as vertical lines, and line segments L5, L6, L7, and L8 are extracted as horizontal lines. The line segments L1, L2, L3, L7 to L8 are dimension lines, and the line segments L4 to L6 are extension lines. Therefore, the measurement setting unit 113 recognizes the lines used for dimensioning that are included in the drawing data imported by the drawing import unit 111.
[0064] The drawing data shown in FIG. 9 is an example and shows a simple workpiece shape, but many drawings include circles, arcs, chamfered portions, etc. For example, the radius and diameter of the circular and arc portions are specified as dimension instructions, and the amount of chamfering is specified for the chamfered portions.
[0065] In step SC2, the measurement setting unit 113 extracts points where multiple line segments L1 to L8 included in the drawing intersect with each other (intersections of line segments L1 to L8). In the case shown in Figure 9, intersections P1 to P5 are extracted as the intersections.
[0066] In step SC3, the measurement setting unit 113 detects the directions of the arrows B1 to B6 at the intersections P1 to P5 of the line segments L1 to L8 extracted in step SC2. The arrows detected in step SC3 are the arrows located at the tips of the dimension lines.
[0067] In step SC4, corresponding intersections on the dimension display are paired based on the directions of the arrows B1 to B6 detected in step SC3 and the straight line information extracted in step SC1. In the case shown in Figure 9, arrows B1 and B2 are paired, arrows B3 and B4 are paired, and arrows B5 and B6 are paired.
[0068] In step SC5, the measurement setting unit 113 recognizes all dimensions, tolerances, processing instructions, etc. on the drawing. The method for recognizing dimensions, tolerances, processing instructions, etc. is not particularly limited, but since it is sufficient to recognize numbers or predetermined symbols, for example, optical character recognition (OCR) can be used. The OCR may be OCR based on machine learning.
[0069] 9, since the dimensions are "21," "26," and "45," the measurement setting unit 113 recognizes "21," "26," and "45" as dimensions. Furthermore, if the imported drawing data is vector data (PDF), the measurement setting unit 113 extracts the text included in the vector data.
[0070] In step SC6, the measurement setting unit 113 acquires the positions of the intersections paired in step SC4 and the positions of the dimensions recognized or extracted in step SC5, and matches the paired intersections and dimensions based on their positional relationship. In the example shown in FIG. 9 , intersections P1 and P2 are matched with the dimension "21," intersections P2 and P3 are matched with the dimension "26," and intersections P4 and P5 are matched with the dimension "45." This links the dimensions and the pairs of intersections, forming pairs of dimensions and pairs of intersections. In this way, the measurement setting unit 113 can extract dimension measurement locations from the drawing data, as well as tolerances displayed near the dimensions.
[0071] In step SC7, the measurement setting unit 113 performs statistical processing on the plurality of pairs matched in step SC6 to estimate a scaling value for the drawing data.
[0072] The above is the scaling estimation process shown in FIG. 8 . After step SC7 is completed, the process proceeds to step SB14 in FIG. 6A . In step SB14, the user places the workpiece W on the upper surface of the stage 12. The workpiece W placed on the upper surface of the stage 12 is captured by the imaging unit 15 or the overhead camera 17, and a live image is generated. The generated live image is displayed on the main body display unit 16, for example, in a state where it is incorporated into a user interface screen 160 as shown in FIG. 10 . At this time, a drawing guide 161 for guiding the workpiece W to a predetermined placement location is displayed on the user interface screen 160. The drawing guide 161 is generated based on the drawing data imported by range specification and is identical to the workpiece shape contained in the drawing data. The drawing guide 161 may also be generated based on the drawing data imported by range specification and an estimated scaling value. In this case, the drawing guide 161 is identical to the workpiece shape contained in the drawing data and is life-size. The live image of the workpiece W is displayed on the main body display unit 16, for example, at a predetermined display scale. The live image of the workpiece W and the life-size drawing guide 161 are displayed on the main body display unit 16 or the like at the same display scale. The drawing guide 161 does not have to be exactly the same as the workpiece shape, and the drawing guide 161 may be configured with only a part of the workpiece shape. The drawing guide 161 may be configured with only the outline of the workpiece shape. The drawing guide 161 may be displayed with lines indicating the shape, or with a color indicating the shape.
[0073] While viewing the drawing guide 161 displayed on the user interface screen 160 and the workpiece W displayed in the live image, the user moves the workpiece W on the upper surface of the stage 12 and adjusts the position of the workpiece W so that it is positioned at the guided position by the drawing guide 161. By comparing the drawing guide 161 with the live image, the user can confirm whether the scaling value is correct. The drawing guide 161 guides the position and orientation of the workpiece W, making it easier to correctly align the drawing data and workpiece image in the subsequent alignment process. The drawing guide 161 is not required and may be omitted. When non-CAD data is imported, dimensions and lines used for dimensioning are also drawn as part of the drawing guide 161, but when CAD data is imported, the drawing guide 161 is composed of only the workpiece shape. Furthermore, when non-CAD data is imported, the size of the drawing guide 161 can also be adjusted. For example, in step SB13, when the measurement setting unit 113 estimates a scaling value related to the drawing data, the scaling value estimated by the measurement setting unit 113 is displayed on the user interface screen 160 together with a drawing guide 161 for guiding the workpiece W to a predetermined placement location. An adjustment instruction is received from the user for the scaling value displayed on the user interface screen 160, and the scaling value is adjusted in accordance with the adjustment instruction, thereby adjusting the size of the drawing guide 161 displayed on the user interface screen 160.
[0074] In step SB15, the imaging unit 15 captures an image of the workpiece W placed on the upper surface of the stage 12, thereby generating a workpiece image. The workpiece image is stored, for example, in the storage unit 120. The workpiece image may be generated in response to an import instruction from a user and stored as a still image in the storage unit 120. Alternatively, the workpiece image may be a live image, which is a moving image to be displayed.
[0075] In step SB16, the matching unit 114 of the control unit 110 performs a matching process to match the workpiece shape included in the drawing data received by the drawing receiving unit 112 with the workpiece image included in the workpiece image generated by the imaging unit 15. As an example of the matching process, the matching unit 114 performs a contour extraction process for the workpiece W based on the workpiece image captured by the imaging unit 15 of the workpiece W illuminated by the transmitted illumination light irradiated from the transmitted illumination unit 13b, and then performs a contour best fit process using the contour of the workpiece W extracted by the contour extraction process, thereby matching the workpiece shape included in the drawing data with the workpiece image included in the workpiece image generated by the imaging unit 15. Note that the matching unit 114 may acquire the coordinate system of the drawing data received by the drawing receiving unit 112 and the coordinate system of the workpiece image generated by the imaging unit 15, and match the workpiece shape included in the drawing data with the workpiece image included in the workpiece image generated by the imaging unit 15 using the coordinate system of the acquired drawing data and the coordinate system of the workpiece image.
[0076] In this embodiment, a case where the matching unit 114 executes the contour best fit process will be described. Fig. 11 is a flowchart showing an example of the contour best fit process. In step SD1, first, the workpiece W is imaged by the imaging unit 15 while being irradiated with transmitted illumination light from the transmitted illumination unit 13b. The workpiece image captured while being irradiated with transmitted illumination light is a so-called shadow picture, in which the workpiece W is black and the background is white. Fig. 12 shows an example of a workpiece image.
[0077] The workpiece image has a boundary between black and white. The boundary between black and white is the edge (contour) of the workpiece W. The matching unit 114 executes a contour extraction process to extract the boundary between black and white, i.e., the edge of the workpiece W, from the workpiece image.
[0078] In step SD2, the matching unit 114 generates an edge image based on the edges extracted in step SD1. Fig. 12 shows an example of an edge image, in which the background is displayed in black and the outline of the workpiece W is displayed in white. In step SD3, as shown in Fig. 13, the matching unit 114 generates a bounding box 200 from the edge image generated in step SD2. The bounding box 200 is indicated by the smallest rectangular frame that can enclose the outline of the workpiece W. The matching unit 114 cuts out an image of the area surrounded by the bounding box 200, and uses the cut-out image as a template image. In this way, the matching unit 114 executes the process of generating a template image.
[0079] In step SD4, the matching unit 114 determines whether the inspection setting drawing imported by the drawing import unit 111 is CAD data. If step SD4 returns NO and the inspection setting drawing imported by the drawing import unit 111 is non-CAD data, the process proceeds to step SD6. On the other hand, if step SD4 returns YES and the inspection setting drawing imported by the drawing import unit 111 is CAD data, the process proceeds to step SD5. In step SD5, the matching unit 114 extracts the outlines contained in the CAD data and generates an image of the outlines. This allows the contour of the workpiece shape contained in the drawing data to be obtained. By converting the CAD data, which is the inspection drawing data, into image data, image comparison processing can be applied to the workpiece image and the inspection drawing data. By aligning the conversion ratio between the actual dimensions and the dimensions based on the pixel position in the image, image comparison processing becomes easier. As shown in FIG. 6B , the workpiece image of the workpiece W is projected onto the imaging element of the imaging unit 15 via the optical system 15a, and the imaging unit 15 generates a workpiece image corresponding to the workpiece image. Here, the image of the workpiece W in real space is projected onto an image based on the pixel position in the workpiece image, depending on the magnification of the optical system 15a and the pixel spacing of the imaging element. At this time, the conversion ratio between the dimensions in real space and the dimensions based on the pixel position in the workpiece image corresponds to the scaling value. The matching unit 114 extracts the outlines contained in the CAD data and generates an image of the outlines corresponding to the conversion ratio between the dimensions in real space and the dimensions based on the pixel position in the workpiece image. As a result, objects with the same dimensions in real space and the same dimensions in the CAD data appear to be the same size on the workpiece image. When the drawing size in the CAD data is reduced according to the scale of the CAD data, the matching unit 114 generates an image of the outlines at the actual drawing size based on the scale information of the CAD data. Furthermore, when the magnification of the optical system 15a is changed, the conversion ratio between the dimensions in real space and the dimensions based on the pixel position in the workpiece image is changed, and the size of the outlines included in the CAD data in the workpiece image changes in accordance with the change in the conversion ratio.
[0080] Then, the process proceeds to step SD6, where the matching unit 114 performs a contour pattern search on the template image based on the edge image of the workpiece W generated in step SD3 against the drawing image based on the inspection drawing data. The contour pattern search matches the edge portion (contour portion) of the workpiece W with the outline of the drawing data. For example, in the contour pattern search, the matching unit 114 calculates the total area of the white portions corresponding to the edges of the template image. Then, the matching unit 114 searches for the position and angle of the template image that maximizes the area that matches the portion of the drawing data, such as the outline, contained in the drawing image. The contour pattern search may also search for the size of the template image in addition to the position and angle. For example, the size may be searched by changing the scaling value. Using the result of the scaling estimation described above as an initial solution, a detailed estimation of the scaling value is also performed by pyramid search. While the example of performing a contour pattern search on the template image based on the edge image of the workpiece W against the drawing image based on the inspection drawing data has been described, the present invention is not limited to this example. A drawing image based on the inspection drawing data may be subjected to a contour pattern search against a template image based on an edge image of the workpiece W.
[0081] If the drawing data imported by the drawing import unit 111 is CAD data, an image of the outline is generated in step SD5, and a contour pattern search is performed. On the other hand, if the drawing data imported by the drawing import unit 111 is non-CAD data, if the data is image data, a contour pattern search is performed on the image data as is, or if the data is non-CAD data, the image data is converted to image data and then a contour pattern search is performed. Here, the image data used for the contour pattern search is resized to correspond to the actual dimensions based on the estimated scaling value. In the case of non-CAD data, the search process is performed on image data that includes not only the outline but also dimension values and lines used for dimensioning. The evaluation of the degree of match in the search process is limited to the edge portion of the template image. As a result, even if the drawing data to be searched contains data other than the outline, the degree of match can be evaluated as high if the outline matches the edge portion. In this way, the matching unit 114 matches the work shape contained in the drawing data imported by the drawing import unit 111 with the work image contained in the work image generated by the imaging unit 15 by processing according to the type of drawing data imported by the drawing import unit 111.
[0082] In step SD7, the matching unit 114 performs detailed alignment of the template image with the drawing image based on the edge extraction results of the template image and the design value point sequence (outline point sequence) of the drawing image. At this time, the template image and the drawing image are positioned in the same position, and the orientation of the template image and the orientation of the drawing image are made the same. Furthermore, since the scaling value is estimated, the size of the template image and the size of the drawing image can also be made the same. In other words, simply by specifying the range the user wants to import, the matching unit 114 performs alignment processing to visually match the template image and the drawing image at the same position, size, and orientation. This alignment processing is possible for both CAD data and non-CAD data.
[0083] The matching unit 114 can regard a linear edge as a linear portion of the workpiece W. In this case, the matching unit 114 can match the linear portion of the workpiece shape included in the drawing data with the linear portion of the workpiece image included in the image generated by the imaging unit 15. The matching unit 114 can also regard a circular edge as a circular portion of the workpiece. In this case, the matching unit 114 can match the circular portion of the workpiece shape included in the drawing data with the circular portion of the workpiece image included in the image generated by the imaging unit 15. The matching unit 114 can also regard an arc edge as an arc portion of the workpiece. In this case, the matching unit 114 can match the arc portion of the workpiece shape included in the drawing data with the arc portion of the workpiece image included in the image generated by the imaging unit 15.
[0084] The above is the contour best-fit process shown in FIG. 11 . The contour best-fit process can easily align the coordinate systems of the workpiece image and the drawing data. Furthermore, by converting CAD data or non-image data drawing data, such as non-CAD data, into image data, best-fit processing with the edge image based on the workpiece image becomes possible. Aligning the coordinate systems of the workpiece image and the drawing data allows for visual correspondence, facilitating the setting of measurement points for inspection and the adjustment of inspection conditions. By creating a drawing shape that corresponds to the actual dimensions based on the scale of the drawing data and estimated scaling values, best-fit processing with the edge image based on the workpiece image becomes possible, and the coordinate systems of the workpiece image and the drawing data can be aligned so that the image of the workpiece W and the drawing of the workpiece W are in the same position and orientation. Furthermore, by searching while changing the size in addition to the position and angle as part of the best-fit process, the coordinate systems of the workpiece image and the drawing data can be aligned so that the image of the workpiece W and the drawing of the workpiece W are in the same position, orientation, and size. Although the best-fit process is shown as a two-stage process consisting of step SD6 of rough search and step SD7 of detailed alignment, the process is not limited to this. The best-fit process may consist of only step SD6 of rough search or only step SD7 of detailed alignment.
[0085] When step SD7 is completed, the process proceeds to step SB17 in Fig. 6A. In step SB17, alignment confirmation is performed by superimposing the drawing and the workpiece W. The display screen generation unit 115 of the control unit 110 generates a user interface screen 170 as shown in Fig. 14 and displays it on the display unit 101, etc. On this user interface screen 170, a workpiece shape 171 included in the drawing data and a workpiece image 172 included in the image generated by the imaging unit 15 are superimposed and drawn, and the area where the workpiece shape 171 and the workpiece image 172 are superimposed and drawn is called the superimposed display area where the workpiece shape 171 and the workpiece image 172 are superimposed and displayed.
[0086] The user can check whether the two data are aligned by looking at the user interface screen 170. The user interface screen 170 is a display screen that displays a visual correspondence between the workpiece shape included in the drawing data imported by the drawing import unit 111 and the workpiece image included in the image generated by the imaging unit 15. If the two data are not aligned, the alignment unit 114 performs alignment processing between the workpiece shape included in the drawing data and the workpiece image included in the image generated by the imaging unit 15 based on a user's instruction to manually adjust the translation and rotation of the drawing data. Furthermore, when non-CAD data is imported, the alignment unit 114 may perform alignment processing between the workpiece shape included in the drawing data and the workpiece image included in the image generated by the imaging unit 15 based on a user's instruction to manually adjust the scaling value in addition to the translation and rotation of the drawing data. The user interface screen 170 displays the manually adjusted workpiece shape included in the drawing data and the workpiece image included in the image generated by the imaging unit 15.
[0087] When non-CAD data is imported, the color of the lines used for dimensions and dimensioning is the same as the color of the workpiece shape 171 in the drawing data. On the other hand, when CAD data is imported, the color of the lines used for dimensions and dimensioning is different from the color of the workpiece shape 171. Note that this difference in color is not essential, and the color of the lines used for dimensions and dimensioning may be the same as the color of the workpiece shape 171.
[0088] In step SB18, a dual-screen display is performed. The display screen generation unit 115 generates a dual-screen user interface screen 180 as shown in FIG. 15 and displays it on the display unit 101 or the like. This user interface screen 180 has a workpiece image display area 181 that displays a workpiece image captured by the imaging unit 15 as a preview screen, and a drawing data display area 182 that displays drawing data as a drawing screen. Since the workpiece image display area 181 and the drawing data display area 182 are arranged side by side, the workpiece image displayed in the workpiece image display area 181 and the drawing data displayed in the drawing data display area 182 can be compared side by side. In short, the display screen generation unit 115 generates a display screen that allows a side-by-side comparison of the workpiece image and the drawing data, and presents it to the user. Note that when non-CAD data is imported, the colors of the lines used for dimensions and dimension entry are the same as the colors of the lines indicating the workpiece shape in the drawing data.
[0089] After the matching unit 114 matches the workpiece shape included in the drawing data with the workpiece image included in the image, step SB19 executes program creation assistance, which selects measurement elements associated with the dimensions based on the dimensions and information on the lines used to enter the dimensions, and presents the measurement elements as measurement candidates. FIG. 16 is a flowchart showing the processing of a first example of program creation assistance. In step SE1, the user clicks on a dimension. For example, FIG. 17A shows a case where, in the drawing data display area 182 where the drawing screen is displayed, the pointer 183 is positioned on the dimension "45" and the mouse 104 is clicked. Clicking on the dimension "45" displays a measurement item 184 corresponding to the dimension "45" in the workpiece image display area 181 where the workpiece image is displayed, as shown in FIG. 17B.
[0090] 17C, when candidate measurement elements are displayed in the drawing data display area 182 where the drawing screen is displayed, the corresponding display can also be made in the work image display area 181. In this case, when the candidate is confirmed, the display after confirmation is made as shown in FIG.
[0091] Furthermore, two candidate measurement elements required to determine measurement item 184 are displayed in drawing data display area 182 and workpiece image display area 181, where the drawing screen is displayed. Two straight line elements are displayed as the two candidate measurement elements in drawing data display area 182. Two candidate straight line elements and a measurement range, which is the target range for extracting each straight line element, are displayed in workpiece image display area 181. Similarly, when pointer 183 is positioned on dimension "21" and clicked, the measurement item corresponding to dimension "21" is displayed in workpiece image display area 181, and two candidate straight line elements corresponding to the measurement items are displayed in drawing data display area 182 and workpiece image display area 181. When pointer 183 is positioned on dimension "26" and clicked, the measurement item corresponding to dimension "26" is displayed in workpiece image display area 181, and two candidate straight line elements corresponding to the measurement items are displayed in drawing data display area 182 and workpiece image display area 181. 17A shows linear dimensions, but similarly, for example, for circles, arcs, etc., by pointing the pointer 183 and clicking, the corresponding measurement item and candidate measurement elements are displayed in the work image display area 181. The user can change the candidate measurement elements displayed in the drawing data display area 182. When a measurement item is selected and a pair of candidate measurement elements is displayed, by pointing the pointer 183 at another measurement element and clicking, the measurement element selected by the click operation is displayed as a candidate measurement element, and the measurement element of the pair of candidate measurement elements that corresponds to the same extension line as the selected measurement element is removed from the candidates. The measurement elements and measurement range displayed in the work image display area 181 are changed to correspond to the drawing data display area 182.
[0092] In this way, when the measurement setting unit 113 receives an instruction for a measurement item on the drawing data displayed in the drawing data display area 182, it can reflect the measurement item for which the instruction was received on the drawing data, the measurement element corresponding to the measurement item, and the measurement range corresponding to the measurement element on the workpiece image displayed in the workpiece image display area 181. Furthermore, the user does not need to be aware of which measurement element to generate, such as a line, a circle, or an arc, as the image measuring device 1 automatically generates an appropriate measurement element. The generated measurement element is stored in the memory unit 120, etc., and the same applies below. The measurement element is also called an element tool, and includes a measurement range corresponding to the shape and position of the element to be measured.
[0093] In the case of CAD data, dimensions are attributed dimensions with attributes such as distance, angle, circle diameter, and radius of curvature. The measurement setting unit 113 selects measurement elements based on the dimension attributes related to the measurement position read from the CAD data. For each selected measurement element, the measurement setting unit 113 sets each measurement element, including a measurement range corresponding to the shape and position. The measurement setting unit 113 also sets setting items using each selected measurement element. Even in the case of CAD data, if a dimension does not have attributes such as distance, angle, circle diameter, or radius of curvature, when a measurement item is selected by the user, as shown in FIG. 18 , a candidate presentation window 185 is displayed on the user interface screen 180. The candidate presentation window 185 displays candidate attributes corresponding to the dimension information specified by the user. In this example, "distance," "angle," "circle," and "arc" are displayed as candidate dimension attributes, but it is sufficient for one or more of these candidates to be displayed in the candidate presentation window 185. Similarly, in the case of non-CAD data, the dimension attributes are unknown, so when a measurement item is selected by the user, a candidate presentation window 185 is displayed on the user interface screen 180, as shown in Fig. 18. Candidates for attributes corresponding to the dimension information specified by the user are displayed in the candidate presentation window 185. In this way, by displaying candidate dimension attributes in the candidate presentation window 185, candidate measurement elements can be presented to the user.
[0094] The user specifies and selects an appropriate measurement element from the measurement element candidates displayed in the candidate presentation window 185. For example, by positioning the pointer 183 on the measurement element to be specified and clicking the mouse 104, the measurement element on which the pointer 183 is positioned is specified and selected. In this way, the measurement element selection unit 116 presents measurement element candidates corresponding to the dimension information, and allows the user to select a measurement element from the candidates in accordance with the user's specification.
[0095] The operation of aligning the pointer 183 with the dimension and clicking is an operation of specifying the measurement position and measurement item on the workpiece shape included in the drawing data. The measurement setting unit 113 receives the user's instruction of the measurement position and measurement item on the workpiece shape by detecting the position of the pointer 183 and the operation state of the mouse 104. When receiving the instruction of the measurement position, the measurement setting unit 113 can receive it using an element tool such as a line, circle, or arc.
[0096] The measurement setting unit 113 accepts instructions for measurement positions and measurement items from the user and reflects them as measurement positions and measurement items for the workpiece image generated by the imaging unit 15. When accepting instructions for measurement positions and measurement items, the measurement setting unit 113 can accept, as measurement item instructions, measurement elements such as the dimension between two straight lines, the distance between circles, the distance between a circle and a straight line, the angle of an arc, the angle of an inclined surface, etc. In addition to being able to accept the above-mentioned dimension specifications, the measurement setting unit 113 can also accept tolerance specifications included in the drawing.
[0097] For example, instead of the dual-screen display shown in Fig. 15, the measurement setting unit 113 can use a single-screen overlapping display as shown in Fig. 14 to receive instructions for measurement items from the user on the drawing data displayed in the overlapping display area of the user interface screen 170. When the measurement setting unit 113 receives instructions for measurement items on the drawing data displayed in the overlapping display area, it reflects the measurement items in the workpiece image displayed in the overlapping display area.
[0098] The measurement setting unit 113 may also accept instructions for measurement positions or measurement items in the workpiece shape included in the drawing data and reflect them as measurement positions or measurement items in the workpiece image. For example, it is possible to accept only instructions for measurement positions in the workpiece shape or only instructions for measurement items. When only instructions for measurement positions are accepted, it is possible to reflect measurement positions in the workpiece image. When only instructions for measurement items are accepted, it is possible to reflect measurement items in the workpiece image.
[0099] By reflecting the measurement positions or measurement items on the workpiece image, the measurement positions or measurement items are set on the workpiece image. The measurement setting unit 113 can set only one measurement position or multiple measurement positions on the workpiece image included in the image generated by the imaging unit 15. Regarding the measurement items, the measurement setting unit 113 can also set only one measurement item or multiple measurement items on the workpiece image included in the image generated by the imaging unit 15. In this way, the measurement setting unit 113 can set at least one of multiple measurement positions or one or more measurement items on the workpiece image as the measurement element.
[0100] The measurement element selection unit 116 of the control unit 110 can accept a specification of the position of dimensional information in the drawing data imported by the drawing import unit 111. The specification of the position of dimensional information in the drawing data is performed by the user. For example, the user's clicking on a dimension in step SE1 of FIG. 16 corresponds to the specification of the position of the dimensional information. The specification of the position of dimensional information in the drawing data may also be performed by the user clicking on a line used for entering dimensions, such as a dimension line, extension line, or leader line. When the measurement element selection unit 116 accepts the specification of the position of dimensional information in the drawing data, it selects a measurement element corresponding to the dimensional information. When the measurement element selection unit 116 selects a measurement element, the measurement setting unit 113 reflects the measurement position and measurement item on the workpiece image based on the measurement element corresponding to the dimensional information and the measurement item corresponding to the dimensional information. The data generation unit 118 of the control unit 110 generates measurement setting data based on the measurement position and measurement element reflected by the measurement setting unit 113. The measurement setting data generated by the data generation unit 118 is stored, for example, in the memory unit 120.
[0101] In step SE2, the measurement element selector 116 presents candidate measurement elements corresponding to the dimension information and selects a measurement element from the candidates in accordance with the user's designation. Specifically, as shown in FIG. 23 , of a pair of measurement elements corresponding to an extension line corresponding to a dimension, a pair of measurement elements located near each extension line are presented as candidate measurement elements. In this way, the measurement element selector 116 presents candidate measurement elements corresponding to the dimension information and can select a measurement element from the candidate measurement elements in accordance with the user's designation. Alternatively, the measurement element selector 116 may automatically select candidate elements near the end of an extension line or leader line by default.
[0102] In step SE3, the user determines whether the selected measurement element is acceptable. If the determination in step SE3 is NO, the process proceeds to step SE4, where the user specifies and selects another measurement element from the candidates. If the determination in step SE3 is YES, the process proceeds to step SE5, where the selected measurement element is linked to a measurement item including dimensions.
[0103] Specifically, the measurement element selector 116 identifies the attributes of the dimensions and the lines used for dimensioning. For example, CAD data has identification information that allows identification of the outline, the lines used for dimensioning, the dimensions, etc., so the measurement element selector 116 can automatically identify the dimensions and the attributes of the lines used for dimensioning using this identification information. After identifying the dimensions and the attributes of the lines used for dimensioning, the measurement element selector 116 automatically links the dimensions to the lines used for dimensioning that correspond to the dimensions.
[0104] In this way, the associating unit 119 of the control unit 110 executes an associating process for associating measurement setting data with a workpiece image visually associated with a workpiece shape included in the drawing data. The associating unit 119 can also associate the workpiece shape included in the drawing data imported by the drawing importing unit 111 with measurement setting data for the workpiece image included in the image generated by the imaging unit 15. The measurement setting data is data generated based on the measurement position and measurement elements.
[0105] FIG. 19 is a flowchart showing the processing of a second example of program creation assistance. The second example can be used when CAD data is imported, and in this second example, when there are multiple measurement elements, these measurement elements can be generated all at once. In step SF1, the user clicks a batch generation button (not shown) displayed on the display unit 101 or the like with the mouse 104. In step SF2, the measurement setting unit 113 generates clickable dimension elements and default selection elements. The clickable dimension elements are dimensions that can be clicked by the user, as described in step SE1 of FIG. 16. The default selection elements are measurement elements selected in the initial settings of step SE2 of FIG. 16. This allows multiple measurement elements to be automatically generated.
[0106] In batch generation, all measurement elements are generated without reflecting the user's intentions, which may result in the generation of unnecessary measurement elements for the user or measurement elements not intended by the user. In such cases, the first example of program creation assistance shown in Figure 16 can be used. In other words, after batch generation of measurement elements, it is possible to delete unnecessary elements or change element candidates extracted from the extension line information of the measurement elements.
[0107] (Automatic Adjustment Function) The image measuring device 1 has an automatic adjustment function that automatically adjusts a plurality of measurement conditions. In conventional image measuring devices, the user not only needs to set the measurement location and measurement content, but also needs to adjust measurement conditions including the type of camera, type of lighting, camera position, image processing parameters, etc. However, in the image measuring device 1 according to this embodiment, an automatic adjustment section 117 that automatically performs such adjustments is provided in the control unit 110.
[0108] The automatic adjustment unit 117 is a part that automatically adjusts the measurement conditions for extracting each measurement element corresponding to each measurement position or measurement item specified by the measurement setting unit 113 for each measurement element. The measurement conditions include a plurality of measurement conditions, such as the illumination conditions of the illumination unit 13, the imaging conditions of the imaging unit 15, and the edge extraction conditions in the edge extraction process performed by the measurement unit 110A. In this embodiment, the automatic adjustment unit 117 automatically adjusts the illumination conditions of the illumination unit 13, the imaging conditions of the imaging unit 15, and the edge extraction conditions. However, the automatic adjustment unit 117 may automatically adjust at least one of the illumination conditions of the illumination unit 13, the imaging conditions of the imaging unit 15, and the edge extraction conditions. The results of automatic adjustment by the automatic adjustment unit 117 include the illumination conditions of the illumination unit 13, the imaging conditions of the imaging unit 15, and the edge extraction conditions, which are stored in the storage unit 120, etc.
[0109] The illumination conditions of the illumination unit 13 include, for example, the illumination type and illumination height. The illumination conditions of the illumination unit 13 include switching between the incident illumination unit 13a, the transmitted illumination unit 13b, and the ring illumination unit 13c. The illumination types include the incident illumination unit 13a, the transmitted illumination unit 13b, the ring illumination unit 13c, and a slit ring illumination unit (not shown), as well as multi-angle illumination that illuminates from multiple directions, illumination from the front, illumination from the back, illumination from the left, illumination from the right, and the like. Furthermore, the illumination types may include multiple types of illumination with different illumination colors. Switching between these illumination types is included in the illumination conditions of the illumination unit 13.
[0110] The illumination unit 13 is capable of adjusting the light intensity and illumination time of each illumination, and for example, the illumination conditions of the incident illumination unit 13a or the transmitted illumination unit 13b include the light intensity and illumination time of the incident illumination unit 13a and the light intensity and illumination time of the transmitted illumination unit 13b. Furthermore, the illumination height includes illumination from a high position and illumination from a low position relative to the workpiece W, and the illumination height can also be adjusted.
[0111] The imaging conditions of the imaging unit 15 include, for example, at least one of the exposure time, the magnification of the optical system 15a of the imaging unit 15, the aperture of the optical system 15a of the imaging unit 15, and the height of the imaging unit 15 from the stage 12. Since the size of the imaging field of view changes by adjusting the magnification of the optical system 15a, it can be said that the size of the imaging field of view is included in the imaging conditions of the imaging unit 15. By changing the magnification of the optical system 15a, the imaging unit 15 can be configured to be able to switch, for example, between a high-precision measurement mode with a narrow field of view and a wide-field measurement mode with a wide field of view. Furthermore, by changing the aperture of the optical system 15a, the imaging unit 15 can be configured to be able to switch, for example, between a first high-precision measurement mode with an open aperture and a second high-precision measurement mode with a closed aperture.
[0112] The height of the imaging unit 15 from the stage 12 can be adjusted by moving the stage 21 in the Z direction using the stage driving unit 12c.
[0113] The edge extraction process executed by the measurement unit 110A will now be described. The edge extraction conditions applied during the edge extraction process include at least one of the following: scan direction, edge direction, priority designation, edge strength threshold, scan interval, and scan width. FIG. 20 illustrates an edge extraction condition setting window 190 displayed during edge extraction condition setting. The edge extraction condition setting window 190 includes, for example, a scan direction setting area 191, an edge direction setting area 192, a priority designation area 193, an edge strength threshold setting area 194, a scan interval setting area 195, and a scan width setting area 196. The scan direction setting area 191 allows for setting whether to scan from the center of the edge extraction area toward the outside or from the outside toward the center. The edge direction setting area 192 allows for setting whether to extract a transition from a bright area to a dark area as an edge or a transition from a dark area to a bright area as an edge. The priority designation area 193 allows for setting, for example, maximum or top. In the edge strength threshold setting area 194, it is possible to set the threshold when extracting an edge, and it is also possible to set the threshold automatically. In the scan interval setting area 195, it is possible to set the scan interval when extracting an edge, and it is also possible to set the scan interval automatically. In the scan width setting area 196, it is possible to set the scan width when extracting an edge.
[0114] FIG. 21 is a diagram illustrating the edge extraction process performed by the measurement unit 110A. The user specifies the measurement position and measurement item for a shape feature on the workpiece image. In the example shown in FIG. 21, a measurement area 300 is arranged superimposed on the workpiece image. The measurement area 300 is composed of a scan area 301 that defines the area where the edge extraction process is performed, and an area center line 302 that indicates the center of the scan area 301 in the width direction.
[0115] When the measurement unit 110A executes the edge extraction process, it acquires pixel values on a scan line 303 perpendicular to the area center line 302, and calculates the position of an edge point 304 based on the acquired pixel values. The pixel values on the scan line 303 are arranged in the direction in which the scan line 303 extends and differentiated to form an edge intensity graph 305, and the measurement unit 110A generates the edge intensity graph 305.
[0116] The measurement unit 110A generates edge points 304 at positions on the scan line 303 where the edge intensity graph 305 takes on an extreme value. There can be multiple extreme values on the edge intensity graph 305, and it is possible to set which extreme value to select. Here, a method is adopted in which an edge intensity lower threshold 306 is set, extreme values on the edge intensity graph 305 are examined along the direction in which the scan line 303 extends, and only the extreme value whose intensity exceeds the edge intensity lower threshold 306 is selected. By this method, one edge point 304 is generated from one scan line 303. By performing this process on multiple scan lines 303, multiple edge points 304 are generated, and a line 307 is calculated by fitting these edge points 304, and the line 307 is used as the edge. Edges can be obtained in a similar manner for circles and arcs.
[0117] Next, the flow of automatic adjustment by the automatic adjustment unit 117 will be described. FIG. 22 is a flowchart showing the flow of automatic adjustment by the automatic adjustment unit 117. In step SG1, the automatic adjustment unit 117 accepts measurement positions and measurement items specified by the user on the workpiece image as measurement elements. For example, the display screen generation unit 115 generates a setting user interface screen 310 as shown in FIG. 23 and displays it on the display unit 101, etc. The setting user interface screen 310 is provided with a workpiece image display area 311 that displays the workpiece image, a drawing data display area 312 that displays drawing data, and a measurement setting area 313. The measurement setting area 313 displays measurement tools for measuring, for example, the distance between lines, the distance between a line and a circle, the distance between points, the distance between circles, etc., and a measurement tool for measuring angles. 23 shows the case where the distance between a circle and a line and the distance between circles are measured, and the measurement position can be automatically specified by the drawing data displayed in the drawing data display area 312, or can be specified by the user on the workpiece image displayed in the workpiece image display area 311. When the measurement position and measurement item instructions are received by the automatic adjustment unit 117, "[1] Circle-line distance" is displayed in the workpiece image display area 311 as a measurement tool for measuring the distance between a circle and a line, and "[2] Circle-circle distance" is displayed in the workpiece image display area 311 as a measurement tool for measuring the distance between circles.
[0118] The setting user interface screen 310 has an automatic adjustment button 314. After specifying the measurement positions and measurement items, the user presses the automatic adjustment button 314, proceeding to step SG2 shown in FIG. 22, where the automatic adjustment unit 117 automatically adjusts the illumination conditions, imaging conditions, and edge extraction conditions for each measurement element. In this way, when the automatic adjustment unit 117 receives a measurement item instruction on the workpiece image or drawing data, it automatically adjusts multiple types of measurement conditions. When multiple measurement positions are received as shown in FIG. 23, the automatic adjustment unit 117 can automatically adjust multiple types of measurement conditions for multiple measurement positions all at once.
[0119] After the automatic adjustment unit 117 performs automatic adjustment, first to third icons 311a, 311b, and 311c indicating the automatically adjusted measurement elements are displayed in the workpiece image display area 311 of the setting user interface screen 310, as shown in FIG. The first to third icons 311a, 311b, and 311c are displayed in the workpiece image display area 311 by the display screen generation unit 115. The first to third icons 311a, 311b, and 311c are displayed near the automatically adjusted measurement elements, allowing the user to understand, by simply looking at the workpiece image display area 311, which measurement elements have had their measurement conditions automatically adjusted and which measurement elements have not had their measurement conditions automatically adjusted. Instead of or in addition to the first to third icons 311a, 311b, and 311c, letters or symbols indicating the automatically adjusted measurement elements may be displayed. Furthermore, the display screen generating unit 115 may generate a display screen that displays, in different modes, measurement elements whose measurement conditions have been automatically adjusted and measurement elements whose measurement conditions have not been automatically adjusted.
[0120] 22, the user confirms and corrects the results of the automatic adjustment. Specifically, the user selects an icon from the first to third icons 311a, 311b, and 311c that corresponds to the measurement element that the user wants to confirm. An example of an operation for selecting an icon is to click on the icon.
[0121] When the first icon 311a is selected, the display screen generation unit 115 generates a detailed display user interface screen 320 shown in FIG. 25 and displays it on the display unit 101 or the like. The detailed display user interface screen 320 includes a workpiece image display area 321 that displays a workpiece image, a detailed display area 322, and an adjustment result display area 323. The detailed display area 322 displays a partially enlarged image of the workpiece image displayed in the workpiece image display area 321. In this example, since the icon 311a in FIG. 24 is selected, a portion including the measurement element (circle) corresponding to the icon 311a is displayed in the detailed display area 322 as an enlarged image. The range displayed in the detailed display area 322 is indicated by a frame 321a in the workpiece image display area 321. The detailed display area 322 in FIG. 25 displays the measurement element extracted by the automatic adjustment unit 117 as the measurement element corresponding to the measurement position. The measurement element extracted by the automatic adjustment unit 117 is, for example, at least one of a line, a circle, and an arc. When extracting measurement elements, the automatic adjustment unit 117 extracts the measurement elements based on edges extracted within element tools such as dimensions. By superimposing a color that is not actually included in the workpiece image on the workpiece image, the user can grasp the parts extracted as edges.
[0122] 24 is selected, a portion including the measurement element (circle) corresponding to the second icon 311b is displayed as an enlarged image in the detail display area 322. Furthermore, when the third icon 311c is selected, a portion including the measurement element (line) corresponding to the third icon 311c is displayed as an enlarged image in the detail display area 322. In this way, the display screen generating unit 115 generates a display screen that displays whether or not an edge has been extracted by the measuring unit 110A for each measurement element.
[0123] The user checks the partially enlarged image displayed in the detail display area 322, and if the portion extracted as the edge is correct, completes the automatic adjustment. Upon completion of the automatic adjustment, the data generation unit 118 generates measurement setting data based on the measurement position and measurement element, and the measurement conditions automatically adjusted by the automatic adjustment unit 117.
[0124] On the other hand, if the portion extracted as the edge is incorrect, it can be corrected. The adjustment result display area 323 displays a list of other candidate lighting conditions. In other words, if an edge is erroneously extracted under the currently selected lighting conditions, it is considered that a lighting condition other than the currently selected lighting condition is suitable for extracting the edge. In this case, by presenting other candidate lighting conditions to the user, the user can select a lighting condition suitable for extracting the edge. When the user selects a lighting condition from the candidate lighting conditions displayed in the adjustment result display area 323, the candidate lighting condition is accepted by the measurement setting unit 113. The measurement setting unit 113 applies the accepted lighting condition to cause the imaging unit 15 to generate a workpiece image. The measurement unit 110A performs edge extraction processing on the new workpiece image generated by the imaging unit 15.
[0125] In the above example, candidate lighting conditions are presented to the user, but the present invention is not limited to this. Alternatively, candidate imaging conditions or candidate edge extraction conditions may also be presented to the user. In this manner, the automatic adjustment unit 117 presents other candidate measurement conditions of the same type and accepts the user's selection of a candidate measurement condition. The same type refers to, for example, measurement conditions classified as illumination conditions, measurement conditions classified as imaging conditions, and measurement conditions classified as edge extraction conditions.
[0126] If the portion extracted as an edge is incorrect, the automatic adjustment unit 117 can accept a user input of the edge position on the image generated by the imaging unit 15 and automatically adjust the measurement conditions so that an edge similar to the input edge position is extracted. For example, in the detailed display area 322 of FIG. 25 , the circle 322b, which is the second circle from the innermost circle 322a, is extracted as an edge. If the correct edge is the innermost circle 322a, the user inputs an operation to specify the innermost circle 322a. For example, by clicking three points on the innermost circle 322a, the circle 322a is determined to be the edge position, and the automatic adjustment unit 117 accepts the user's input. In this case, the automatic adjustment unit 117 adjusts the lighting conditions, imaging conditions, and edge extraction conditions so that the circle 322a is extracted as an edge. The same applies to lines and arcs.
[0127] If the portion extracted as the edge is incorrect, the user can manually adjust the lighting conditions, imaging conditions, and edge extraction conditions.
[0128] When there are multiple parts extracted as edges, the image measuring device 1 can be operated in a mode in which the user can specify the parts extracted as edges one by one and check and correct them, or in a mode in which all measurement elements can be checked and corrected consecutively. The user can switch between these modes.
[0129] (Logic of Automatic Adjustment) Next, the specific logic of automatic adjustment by the automatic adjustment unit 117 will be described. As shown in FIG. 23 , the automatic adjustment unit 117 starts automatic adjustment when the measurement position and measurement item have been specified by the user. In the following description, for convenience, a distinction will be made between transmitted illumination and other illumination conditions, and all illumination other than transmitted illumination will be referred to as epi-illumination. In the case of transmitted illumination, edge detection is relatively easy because the image resembles a shadow puppet. On the other hand, in the case of epi-illumination, adjustment is difficult because the edge position varies depending on the focal position and illumination conditions, and the edge position varies depending on the edge extraction process that selects a target edge from multiple edge candidates.
[0130] FIG. 26 is an automatic adjustment flowchart in which conditions are determined for each measurement element. This flowchart shows the automatic adjustment for a measurement element for which epi-illumination has been determined as the illumination condition. In step SL1, the automatic adjustment unit 117 performs automatic exposure adjustment for the target measurement element. This automatic exposure adjustment provisionally determines at least one parameter related to the brightness of the resulting workpiece image, such as the exposure time of the imaging unit 15, the brightness of the epi-illumination, and the gain for the workpiece image data. In step SL2, a workpiece image is acquired based on the parameters provisionally determined in step SL1, and the automatic adjustment unit 117 roughly detects the height of the stage 12, i.e., the imaging height of the measurement element of the workpiece W and its surroundings. This rough detection obtains a height profile of the measurement element and its surroundings. After step SL2, the illumination conditions, imaging conditions, and edge extraction conditions are changed in multiple ways and combined to search for optimal conditions (step SL3). However, since precise detection of the imaging height requires a long time if the search range is wide, the search conditions for the imaging height may be determined based on the height profile of the measurement element and the surrounding area of the measurement element obtained by the rough detection in step SL2. Specifically, the limited search range for the imaging height is determined based on the height profile. The height pitch used to search for the imaging height may be set in advance or may be determined based on the height profile. Furthermore, the type of epi-illumination and the height position of the epi-illumination to be searched for may be set in advance or may be determined based on the height profile. Furthermore, the type of edge extraction condition to be searched for may be set in advance or may be determined based on the height profile.
[0131] In step SL3, the automatic adjustment unit 117 performs automatic exposure adjustment for the target measurement element at a height based on the height profile acquired by the rough detection in step SL2. Based on the results of the search described above, the automatic adjustment unit 117 determines optimal conditions. The automatic exposure adjustment determines at least one parameter related to the brightness of the resulting workpiece image, such as the exposure time of the imaging unit 15, the brightness of the epi-illumination, and the gain for the workpiece image data. The automatic adjustment unit 117 sequentially applies a set of candidates from multiple imaging height candidates and multiple lighting candidates for lighting type and lighting height, and sequentially acquires workpiece images under different conditions based on the parameters determined by the automatic exposure adjustment. The automatic adjustment unit 117 performs edge extraction processing on the workpiece images sequentially acquired under different conditions to extract edge candidates. The automatic adjustment unit 117 applies predetermined evaluation criteria to the extracted edge candidates to evaluate whether an optimal edge has been extracted. The evaluation criteria include the straightness (circularity) of the extracted edge, the variation of each point constituting the edge, edge strength, dimensional proximity, and a weighted combination thereof. The automatic adjustment unit 117 determines optimal conditions based on the evaluation results of the edge candidates and the imaging height, lighting conditions, and edge extraction conditions when the edge candidates were acquired. The edge candidates extracted by the edge extraction process can be optimized for edge position, for example, near the edge of a step or near the center line of an area, and edge robustness can be achieved based on edge strength and edge position variation. Regarding edge position optimization, the edge position to be adopted can be switched depending on the situation. For example, if the measurement element was manually created by a user looking at a workpiece image, the edge near the center line of the area is adopted. However, if the measurement element was automatically generated from DXF data or a drawing, the edge near the edge of the step is adopted because the position of the center line of the area is likely to be misaligned.
[0132] 27 shows an example of the adjustment order of multiple measurement conditions. In step SK1, the automatic adjustment unit 117 provisionally determines the illumination condition to be either transmitted illumination or incident illumination. If transmitted illumination is determined, the process proceeds to step SK2. If incident illumination is determined, the process proceeds to the flowchart for incident illumination, which will be described later.
[0133] In step SK2, the automatic adjustment unit 117 determines the camera magnification. In step SK3, the automatic adjustment unit 117 determines the height of the stage 12, i.e., the imaging height of the workpiece W. In step SK4, the automatic adjustment unit 117 determines the illumination conditions to be either transmitted illumination or epi-illumination. If transmitted illumination is selected, the process proceeds to step SK5, whereas if epi-illumination is selected, the process proceeds to the epi-illumination flowchart described below. In step SK5, the edge extraction conditions are determined.
[0134] The adjustment results obtained by the automatic adjustment process shown in the flowcharts of Figures 26 and 27 may not only select one optimal candidate, but may also select several other candidates that are highly likely to be correct. When multiple candidates are selected, they can be presented to the user by being displayed, for example, in the adjustment result display area 323 of the user interface screen 320 shown in Figure 25.
[0135] The automatic adjustment process shown in the flowcharts of Figures 26 and 27 is for one measurement element. Performing automatic adjustment for multiple measurement elements may result in a long adjustment time. Therefore, to shorten the time required for automatic adjustment for multiple measurement elements, common processing may be used for parts that can be processed simultaneously. For example, the same image is used to determine whether measurement elements fall within the same field of view when captured during transmitted illumination for transmitted light or reflected light determination in steps SK1 and SK4 of Figure 27. Furthermore, the same transmitted illumination image stack is used to process measurement elements within the same field of view when a transmitted illumination image stack is acquired and the best focus height is calculated. To maximize the time saved by these optimization processes, the range and position of the imaging field of view are calculated so that as many measurement elements as possible fall within the same field of view, and then imaging is performed by the imaging unit 15.
[0136] (Backgrounding the Automatic Adjustment Process) In order to shorten the waiting time while the automatic adjustment process is being executed, the automatic adjustment process can be performed in the background. For example, during the automatic adjustment process, another user interface screen can be displayed on the display unit 101 or the like, allowing various input operations, selection operations, and the like, thereby shortening the actual waiting time.
[0137] For example, as shown in Figure 28A, if background automatic adjustment is not performed when creating the measurement settings, after the measurement elements are created, automatic adjustment processing is performed on the created measurement elements, and after the automatic adjustment processing is completed, the user will check and correct the settings, and this process will be repeated the number of times equal to the number of measurement elements (N).
[0138] On the other hand, if background automatic adjustment is performed when creating a measurement setting, after creating the first measurement element, the second, third, fourth, and so on measurement elements can be created while the automatic adjustment process is being performed on the first measurement element. After the automatic adjustment process on the first measurement element is completed, the user checks and corrects the results. While the user is checking and correcting the results, the automatic adjustment process is performed on the second measurement element.
[0139] 28B shows another example of background automatic adjustment. As shown in this figure, depending on the relationship between the time required for user-operated measurement element creation, confirmation, and correction and the time required for the automatic adjustment process, the user can perform the operation without being aware of the waiting time for the automatic adjustment process.
[0140] (Operation of the Image Measuring Device) Next, operation of the image measuring device 1 will be described with reference to the flowchart shown in Fig. 29. In step SM1, the measurement unit 110A reads the measurement setting data. The measurement setting data includes the measurement elements set by the measurement setting unit 113 and the measurement conditions automatically adjusted by the automatic adjustment unit 117, and therefore includes the measurement positions and measurement items set for the workpiece image included in the image generated by the imaging unit 15.
[0141] In step SM2, the user places the workpiece W on the stage 12. In step SM3, the user operates the measurement start button included in the operation unit 14. In step SM4, the measurement unit 110A measures the workpiece in accordance with measurement setting data generated based on the measurement position and measurement elements set by the measurement setting unit 113 and the measurement conditions automatically adjusted by the automatic adjustment unit 117. For example, the measurement unit 110A acquires the measurement items and measurement elements set by the measurement setting unit 113 and the measurement conditions automatically adjusted by the automatic adjustment unit 117, extracts edges from the workpiece image generated by the imaging unit 15 based on the acquired measurement items, measurement elements, and measurement conditions, and measures the measurement elements using the extracted edges. In other words, the measurement unit 110A is a part that controls the measurement of the workpiece W based on the measurement position or measurement items and measurement elements reflected by the measurement setting unit 113 and the measurement conditions automatically adjusted by the automatic adjustment unit 117, and is an example of a measurement control unit. The measurement unit 110A acquires measurement results in accordance with the measurement setting data.
[0142] The association unit 119 of the control unit 110 associates the measurement results with the workpiece image visually associated with the workpiece shape included in the drawing data on the display screen generated by the display screen generation unit 115. The association unit 119 also associates the workpiece shape included in the drawing data imported by the drawing import unit 111 with the measurement results for the workpiece image included in the image generated by the imaging unit 15. This allows the measurement results acquired by the measuring unit 110A to be displayed in association with the measurement elements. The association unit 119 can also associate the measurement results with the workpiece image visually associated with the workpiece shape located at the center of the imaging field of view of the paper drawing.
[0143] When the measurement for each measurement element is completed, the process proceeds to step SM5, where the measurement unit 110A compares the measurement result obtained in step SM4 with the judgment threshold, and judges the measurement result as "good" if it does not exceed the judgment threshold, and judges the measurement result as "bad" if it exceeds the judgment threshold.
[0144] After obtaining the determination results in step SM5, the process proceeds to step SM6. In step SM6, measurement unit 110A creates and outputs a report summarizing the measurement results obtained in step SM5 and the determination results obtained in step SM6. The report is created in a predetermined format and may be output as data or printed output.
[0145] (Configuration Support Device for Vision Measuring Device) Figure 30 shows, as another aspect of an embodiment of the present invention, a configuration support device 400 for a vision measuring device that supports the user in configuring the vision measuring device 1. The vision measuring device 1 includes the device main body 2 of the above embodiment and a measuring unit 110A. The measuring unit 110A may be configured by a separate arithmetic processing device or the like, or may be physically separated from the device main body 2.
[0146] The setting support device 400 for an image measuring device has the drawing capture section 111, drawing reception section 112, measurement setting section 113, matching section 114, display screen generation section 115, measurement element selection section 116, automatic adjustment section 117, data generation section 118 and association section 119 of the control unit 110, as well as a memory section 120, keyboard 103, mouse 104 and display section 101. The operation of each section is as described above.
[0147] Therefore, when the user performs the above-mentioned operations, the setting support device 400 for the image measuring device executes a setting process so that the measuring unit 110A extracts an edge from the work image generated by the imaging unit 15 based on the measurement position or measurement item reflected by the measurement setting unit 113, the measurement element, and the measurement conditions automatically adjusted by the automatic adjustment unit 117, and uses the extracted edge to measure the measurement element.
[0148] 31 is a flowchart showing an example of offline program creation processing. "Offline" means creating a measurement setting without using an actual workpiece W. When creating a measurement setting offline, the actual workpiece W is not used, and therefore the device main body 2 is not used. It is also possible to create a measurement setting online, in which case the measurement setting is created using the actual workpiece W. When creating a measurement setting online, the actual workpiece W is used, and therefore the device main body 2 is also used.
[0149] Online, the measurement setting unit 113 can set at least one of a plurality of measurement positions or one or more measurement items as measurement elements for the workpiece W displayed on the display unit 101. The measurement setting unit 113 sets at least one of a plurality of measurement positions or one or more measurement items as measurement elements by reflecting setting information set for the workpiece W displayed on the display unit 101 in the workpiece image included in the image generated by the imaging unit 15.
[0150] Meanwhile, offline, the measurement setting unit 113 executes a storage process to save setting information in which at least one of a plurality of measurement positions or one or more measurement items for a workpiece image is set as a measurement element. The location where the setting information is saved is not particularly limited, but may be, for example, the memory unit 120. The measurement setting unit 113 reads the setting information saved by the storage process and reflects the read setting information in the workpiece image included in the image generated by the imaging unit 15. This allows at least one of a plurality of measurement positions or one or more measurement items to be set as a measurement element for the workpiece image.
[0151] In step S101 after the start, drawing data including workpiece shape and dimensional information is acquired by the drawing acceptance unit 112. Fig. 32 shows a user interface screen 600 that displays an image based on the drawing data acquired by the drawing acceptance unit 112. The user interface screen 600 is generated by the display screen generation unit 115 and displayed on the display unit 101.
[0152] The user interface screen 600 is provided with a first display area 601 that displays an image based on the drawing data acquired by the drawing acceptance unit 112, and a second display area 602 that displays, for example, operation procedures, etc. The drawing data acquired by the drawing acceptance unit 112 includes workpiece shape and dimensional information, so the first display area 601 displays the workpiece shape, dimension lines, and values.
[0153] In step S102 shown in Fig. 31, the user selects the import range of the drawing data imported in step S101. Specifically, while viewing the drawing data on the user interface screen 600 displayed on the display unit 101, the user operates the mouse 104 or the like to specify a range so that the area requiring dimensional measurement is included in the import range. In Fig. 33, the specified range is indicated by a rectangular frame 603. The drawing import unit 111 imports the drawing data within the range specified by the user's import instruction. Examples of the range specification operation include a drag operation. Step S102 can be omitted, in which case the entire drawing data will be imported.
[0154] As shown in Fig. 33, the second display area 602 is provided with a "Next" button 602a. After the user selects the import range, the import range is confirmed by operating the "Next" button 602a. After the import range is confirmed, the drawing data within the range instructed to be imported is displayed in the first display area 601, as shown in Fig. 34. Furthermore, the second display area 602 is displayed in a manner that allows drawing correction operations to be accepted, and displays, for example, a contour correction tool 602b and a fill tool 602c.
[0155] 35 shows a state in which a desired portion has been filled in using the fill tool 602c. Specifically, the user deletes unnecessary portions of the drawing data and fills in the shaded portions. To delete unnecessary portions, the user performs a delete operation and selects the unnecessary portions on the drawing data displayed on the screen. To fill in the shaded portions, the user performs a fill operation and selects the portions to be filled in on the drawing data displayed on the screen, thereby filling in the shaded portions.
[0156] When the fill process is executed using the fill tool 602c, a YES determination is made in step S103 of Fig. 31 and the process proceeds to step S104. In step S104, shooting conditions are set using a fill process setting window 610 as shown in Fig. 36. The fill process setting window 610 is generated by the display screen generation unit 115 and displayed on the display unit 101 when it is detected that the fill tool 602c has been operated.
[0157] The fill processing setting window 610 has a pattern image setting area 611. In the pattern image setting area 611, it is possible to set whether to use a wide-field image or a high-precision image as the pattern image, as well as to set the reference height and the maximum height of the object to be measured (workpiece W). When an "OK" button 610a provided in the fill processing setting window 610 is operated, the settings are reflected.
[0158] When the "OK" button 610a in the fill processing setting window 610 is operated, the process proceeds to step S105 in Fig. 31. In step S105, a program is created. In step S105, the display screen generation unit 115 generates a user interface screen 630 capable of dual screen display as shown in Fig. 37, and causes the display unit 101 to display it.
[0159] The user interface screen 630, which can display two screens, has a normal mode display area 631 and a drawing mode display area 632. The normal mode display area 631 displays the workpiece shape. The normal mode can be used when measuring dimensions of the workpiece W directly without using drawing data. For example, it can be used when measuring dimensions that are not included in the drawing data. On the other hand, the drawing mode display area 632 displays drawing data within the range instructed to be imported in step S102. The drawing mode can be used when measuring dimensions included in the drawing data.
[0160] The user specifies a measurement position or measurement item on the drawing data displayed in the drawing mode display area 632. Specifically, as shown in FIG. 38 , when measuring the distance (dimension) between two lines (measurement elements), the user uses the mouse 104 or the like to select a measurement point on the drawing data displayed in the drawing mode display area 632. When the measurement point is selected, two lines corresponding to the measurement point are identified, and the two identified lines and the dimensions are displayed in a correlated form. The selection example in FIG. 38 is merely an example, and it is also possible to select another measurement point included in the drawing data. The identification unit 110B may also identify the correspondence between the dimension and the line used for dimensioning. In the case of CAD data, the identification can be performed using, for example, known identification information for the dimension contained in the CAD data and the line used for dimensioning. In the case of non-CAD data, the identification can be performed based on, for example, the distance between the dimension read by OCR or the like and the line used for dimensioning. When a dimension is selected on the drawing data, the display screen generation unit 115 can integrally display the selected dimension and the corresponding line used for dimensioning based on the correspondence specified by the selected specifying unit. Here, "integrally displaying" means displaying the dimension and the line used for dimensioning in an associated manner, such as by enlarging the dimension and the line used for dimensioning, displaying them in the same color, or displaying them surrounded by an object. Furthermore, when a line used for dimensioning on the drawing data is selected, the display screen generation unit 115 can integrally display the selected line used for dimensioning and the corresponding dimension based on the correspondence specified by the selected specifying unit. This is effective in that the user can grasp the corresponding line or dimension used for dimensioning by selecting a dimension or a line used for dimensioning.
[0161] Furthermore, when the drawing import unit 111 imports non-CAD data, the identification unit 110B can identify the correspondence between the measurement elements and the dimensional information based on the measurement elements of the workpiece shape included in the drawing data read by OCR or the like and the dimensional information including the dimensions and the lines used for dimensioning that have also been read. For example, the correspondence may be identified based on the positional relationship between the dimensional information including the dimensions and the lines used for dimensioning and the measurement elements of the workpiece shape in the drawing data. If there are multiple candidate measurement elements identified based on the positional relationship, the candidate with the closest distance between the measurement element and the line used for dimensioning may be displayed as the candidate, or multiple candidates may be presented on the user interface screen 630, and one measurement element may be identified based on a user selection. Displaying the candidate with the closest distance between the measurement element and the line used for dimensioning is effective in automatically identifying the measurement element, thereby eliminating the need for a user selection operation, and accepting the user's selection prevents the user from selecting an unintended measurement element.
[0162] 45, the control unit 110 includes an identification unit 110B that identifies the correspondence between measurement features in the workpiece shape and dimensional information. The identification unit 110B acquires the dimensional information included in the drawing data. When a measurement feature in the workpiece shape is identified by the user, the identification unit 110B can acquire the dimensional information corresponding to the measurement feature.
[0163] As shown in Figure 38, two lines and a dimension as measurement elements are also displayed in the normal mode display area 631. In addition to selecting a dimension, it is also possible to perform an operation such as combining two lines into a single line by dragging, for example. The line shown in the figure is an example of an element type, and element types include not only lines but also circles, arcs, and the like. The element type to be measured can be selected from these element types. When a measurement element is selected, the position of the selected measurement element (element position) is also identified.
[0164] In this way, the display screen generating unit 115 generates a display screen as shown in Fig. 38 that displays, on the drawing data, figures and dimensional information corresponding to candidates for measurement elements corresponding to the instruction, based on the reception of a selection operation for figures or dimensional information corresponding to measurement elements in the workpiece shape and the correspondence relationship identified by the identifying unit 110B.
[0165] The user interface screen 630 has a detail display area 633 where element details are displayed. The detail display area 633 displays the element name, first element, second element, etc., as well as tolerance setting (design value, upper limit, and lower limit) input fields, etc. If the tolerance can be read from the drawing data, the read tolerance is reflected, but if it cannot be read or is not entered, the tolerance is automatically input based on the tolerance table. When the user operates an "OK" button 630a provided on the user interface screen 630, which can display two screens, the setting of the measurement position or measurement item is confirmed.
[0166] In addition to generating measurement positions or measurement items individually, they can also be generated all at once. For example, when the user operates a "generate all at once" button 630b provided on a user interface screen 630 capable of displaying two screens as shown in Fig. 37, all measurement positions or measurement items included in the drawing data are generated all at once.
[0167] In this way, the image measuring device 1 has the function of generating measurement items and measurement elements all at once based on predetermined rules, which eliminates the need for the user to generate multiple measurement items and measurement elements, thereby reducing the burden on the user. On the other hand, there may be cases where unnecessary measurement items or unwanted measurement elements are generated, resulting in a measurement program that is not what the user intended.
[0168] In response to this, the present embodiment is provided with a setting reception unit 110E shown in FIG. 45. The setting reception unit 110E is a part that receives setting information including shape information regarding the shape of the workpiece W, measurement elements for the shape of the workpiece W, and measurement items related to the measurement elements. When there are multiple measurement elements, the setting reception unit 110E can receive setting information including multiple measurement elements and measurement items related to the measurement elements. This allows only the measurement elements that the user requests to measure to be received, preventing the creation of unnecessary measurement items or unwanted measurement elements, and making it possible to create a measurement program as intended by the user.
[0169] In step S106 shown in Fig. 31, a pattern image registration process is executed to register a pattern image for pattern search. In the pattern registration process, the display screen generation unit 115 generates a user interface screen 640 for pattern registration as shown in Fig. 39 and displays it on the display unit 101.
[0170] The pattern registration user interface screen 640 is provided with an image display area 641 and a registration setting area 642. The image display area 641 displays an image captured by the imaging unit 15, as well as a first frame 641a indicating the search range within which a pattern search is to be performed, and a second frame 641b for specifying a pattern area including a characteristic portion. The user can place the second frame 641b at any position on the image and in any size by operating the mouse 104 or the like.
[0171] The registration setting area 642 is provided with a selection field for selecting whether to generate a wide-field image or a high-precision image, a selection field for selecting a layer to register, a selection field for selecting whether to capture a search range or automatically capture the image as the capture method, and a mask registration field for masking patterns to be ignored. When an "OK" button 640a provided on the pattern registration user interface screen 640 is operated, the pattern search settings are reflected. The order of step S106 and step S105 shown in FIG. 31 may be reversed.
[0172] On the other hand, if the determination in step S103 shown in Fig. 31 is NO and there is no fill, the process proceeds to step S107. In step S107, a program is created in the same way as in step S105. Fig. 40 shows a user interface screen 630 capable of displaying two screens when there is no fill. Fig. 41 shows a case where a dimension is selected on the user interface screen 630 when there is no fill.
[0173] In step S108 shown in FIG. 31, the program created in step S105 and the program created in step S107 are stored in the storage unit 120, for example.
[0174] In this way, a program can be created offline. A program created offline can be read online into the image measuring device 1 and adjusted. Below, a process for reading a program created offline into the image measuring device 1 online and adjusting it will be described.
[0175] 42 is a flowchart showing an example of processing when a program created offline is loaded online into the image measuring device 1. In step S201 after starting, the file of the program created offline is loaded. For example, a button for starting loading, such as an edit button, is displayed on the display unit 101, and when the user operates the button for starting loading, the file of the desired program is loaded.
[0176] When there is a fill and a pattern image for pattern search is registered, the pattern image and drawing data are displayed on a user interface screen 630 capable of displaying two screens, as shown in FIG.
[0177] 44 shows a screen 650 for superimposing a created program on a workpiece W placed on a stage, which is generated by the display screen generation unit 115 and displayed on the display unit 101. The superimposition screen 650 has an overlay display area 651 and an operation area 652. The operation area 652 has a positioning guide display button 652a for displaying a guide for guiding the workpiece W to a predetermined placement location, a pattern search execution button 652b, and a manual adjustment button 652c. A pattern search is executed by operating the pattern search execution button 652b. If the drawing is filled, the pattern search executes pattern matching of the filled portion, and if there is no filling, it executes pattern matching to best fit the outline of the drawing and the outline of the workpiece W.
[0178] If the pattern search is successful, the drawing data is matched with the workpiece image. This is the pattern search overlay process in step S202. This process can be executed by the measurement setting unit 113, thereby allowing the measurement positions or measurement items associated with the workpiece shape included in the drawing data to be reflected as measurement positions or measurement items for the workpiece image. More specifically, if there are multiple candidate measurement elements, the measurement setting unit 113 displays the multiple candidate measurement elements on the screen. The measurement setting unit 113 can accept a measurement element selected by the user from the multiple candidates displayed on the screen. The measurement setting unit 113 reflects the element type, element position, and measurement item corresponding to the measurement element selected by the user in the measurement settings.
[0179] After the pattern search and superposition process in step S202, the process proceeds to step S205, where the automatic adjustment unit 117 performs automatic adjustment to automatically adjust a plurality of measurement conditions, such as the illumination conditions of the illumination unit 13, the imaging conditions of the imaging unit 15, and the edge extraction conditions in the edge extraction process performed by the measurement unit 110A. Here, automatic adjustment of the measurement conditions is performed for each measurement element. After the automatic adjustment by the automatic adjustment unit 117, in step S206, the automatically adjusted measurement program is saved.
[0180] If alignment by the pattern search in step S202 is not possible, the process proceeds to step S203, where manual overlay processing can be performed. In manual overlay processing, the user manually adjusts the position so that the dimensions and dimension lines match the workpiece image. This position adjustment can be performed by the user operating the operation unit 14. After manual overlay processing by the user, the process proceeds to step S205, where the automatic adjustment unit 117 performs automatic adjustment to automatically adjust multiple measurement conditions. After the automatic adjustment, in step S206, the program after automatic adjustment is saved.
[0181] If alignment by the pattern search in step S202 is not possible, the process may proceed to step S204, where coordinate system superposition processing is performed. In other words, if there is a misalignment between the drawing data and the workpiece image, the user sets a reference coordinate system. By setting this reference coordinate system, it becomes possible to correct the position of the measurement point based on the reference coordinate system, so that if the workpiece W moves slightly, the position of the measurement point can be quickly corrected and the measurement point can be measured. Furthermore, the coordinate system superposition processing and pattern search may be combined. By combining the coordinate system superposition processing and pattern search, more stable position correction can be performed.
[0182] When setting the reference coordinates, for example, two lines may be specified on the drawing data side to set the reference coordinates, or a line and a point may be specified to set the reference coordinates. A coordinate system can also be set on the workpiece image side in a similar manner. Then, elements for the coordinate system are specified on the workpiece image side.
[0183] After the reference coordinates are set, the coordinate system of the drawing data and the coordinate system of the workpiece image are superimposed. Specifically, the user operates the operation unit 14 or the like to specify the same location on the drawing data as the element specified on the workpiece image. After the user has specified, the superposition is performed, and the processing of step S204 is completed. Then, the process proceeds to step S205, where the automatic adjustment unit 117 performs automatic adjustment to automatically adjust multiple measurement conditions. After the automatic adjustment, in step S206, the automatically adjusted program is saved.
[0184] 45, the imaging unit 15 sequentially captures images of the workpiece W, and sequentially acquires images including the workpiece images sequentially generated as updated images. The multiple updated images have different measurement conditions from one another.
[0185] Furthermore, the setting image acquisition unit 110D acquires an image relating to the shape of the workpiece W as a setting image. In this case, the measurement setting unit 113 can read the setting image acquired by the setting image acquisition unit 110D. The measurement setting unit 113 sets a plurality of measurement elements for the shape of the workpiece W and measurement items relating to the measurement elements based on the setting image acquired by the setting image acquisition unit 110D.
[0186] The inspection information of the workpiece W includes measurement elements. That is, there is a workpiece W whose inspection information includes at least one of multiple measurement positions or one or more measurement items as measurement elements. In this case, setting information is set for the workpiece whose inspection information includes at least one of multiple measurement positions or one or more measurement items as measurement elements. The measurement setting unit 113 reflects the setting information set for the workpiece whose inspection information includes at least one of multiple measurement positions or one or more measurement items as measurement elements in the workpiece image included in the image generated by the imaging unit 15. This allows the measurement setting unit 113 to set at least one of multiple measurement positions or one or more measurement items as measurement elements for the workpiece image.
[0187] When the imaging unit 15 generates multiple images, it can generate a composite image by combining the multiple images. In this case, the setting information includes at least one of multiple measurement positions or one or more measurement items set as measurement elements for the workpiece image included in the composite image generated by combining the images generated by the imaging unit 15. The measurement setting unit 113 reflects the setting information, in which at least one of multiple measurement positions or one or more measurement items set as measurement elements for the workpiece image included in the composite image generated by combining the images generated by the imaging unit 15, in the workpiece image included in the image generated by the imaging unit 15. This allows the measurement setting unit 113 to set at least one of multiple measurement positions or one or more measurement items as measurement elements for the workpiece image. The composite image can be generated by the control unit 110.
[0188] The automatic adjustment unit 117 acquires updated images having different measurement conditions that are sequentially acquired by the updated image acquisition unit 110C. The automatic adjustment unit 117 automatically adjusts multiple types of measurement conditions, such as illumination conditions, imaging conditions, and edge extraction conditions, for each measurement element based on the updated images and each measurement element set by the measurement setting unit 113.
[0189] When the measuring unit 110A receives a measurement instruction from the user, it acquires an image including a workpiece image generated by capturing an image of the workpiece W using the imaging unit 15. The measuring unit 110A controls measurement of the workpiece image based on the acquired image including the workpiece image and the element type, element position, and measurement item reflected in the measurement settings by the measurement setting unit 113. The measuring unit 110A can extract edges from the image generated by the imaging unit 15 and identify the measurement elements using the edges, for example, based on the measurement elements set by the measurement setting unit 113 and the measurement conditions automatically adjusted by the automatic adjustment unit 117. Then, it performs measurement of the measurement items in the setting information based on the identified measurement elements.
[0190] In addition, in the setting support device 400 for the image measuring device, the setting process can be performed so that the measurement unit 110A controls the measurement of the workpiece W based on an image including a workpiece image and the element type, element position, and measurement items reflected in the measurement setting by the measurement setting unit 113.
[0191] The above-described embodiments are merely examples in all respects and should not be construed as limiting. Furthermore, all modifications and variations within the scope of the claims are within the scope of the present invention.
[0192] As described above, the present invention can be used to measure the dimensions of various parts of a workpiece.
[0193] 1 Image measuring device 12 Stage (mounting table) 12a Light-transmitting plate 13a Incident illumination unit 13b Transmitted illumination unit 15 Imaging unit 101 Display unit 111 Drawing capture unit 112 Drawing reception unit 113 Measurement setting unit 114 Matching unit 115 Display screen generation unit 117 Automatic adjustment unit 118 Data generation unit 119 Correspondence unit 110A Measurement unit
Claims
1. A vision measuring device comprising: a mounting table having a light-transmitting plate and on which a workpiece is placed on a first surface of the light-transmitting plate; a transmitted illumination unit provided below the light-transmitting plate and irradiating the workpiece placed on the light-transmitting plate with transmitted illumination light; a reflected illumination unit provided above the light-transmitting plate and irradiating the workpiece placed on the light-transmitting plate with reflected illumination light; an imaging unit provided above the mounting table and imaging the workpiece placed on the mounting table to generate an image including a workpiece image; a measurement setting unit that sets at least one of a plurality of measurement positions or one or more measurement items for the workpiece image included in the image generated by the imaging unit as measurement elements; an automatic adjustment unit that automatically adjusts measurement conditions for each measurement element, including the imaging conditions of the imaging unit for the measurement elements set by the measurement setting unit; and a measurement unit that extracts edges from the image generated by the imaging unit based on the measurement elements set by the measurement setting unit and the measurement conditions automatically adjusted by the automatic adjustment unit, and performs measurement of the measurement elements using the edges.
2. An image measuring device according to claim 1, wherein the automatic adjustment unit automatically adjusts a plurality of measurement conditions, including the imaging conditions of the imaging unit for the measurement elements set by the measurement setting unit, for each measurement element.
3. An image measuring device according to claim 1, comprising: an update image acquisition section for sequentially acquiring images containing sequentially generated workpiece images using the imaging section, as update images; and a setting image acquisition section for acquiring images relating to the shape of the workpiece as setting images, wherein the measurement setting section sets at least one of a plurality of measurement positions or one or more measurement items relating to the shape of the workpiece as measurement elements based on the setting images acquired by the setting image acquisition section; the automatic adjustment section automatically adjusts the measurement conditions for each measurement element based on the update images, each having different measurement conditions, acquired sequentially by the update image acquisition section and the measurement elements set by the measurement setting section; and a measurement section that extracts edges from the images generated by the imaging section based on the measurement elements set by the measurement setting section and the measurement conditions automatically adjusted by the automatic adjustment section, identifies the measurement elements using the edges, and performs measurements of the measurement items set by the measurement setting section based on the measurement elements.
4. An image measuring device according to claim 1, comprising: an update image acquisition section for sequentially capturing images of a workpiece using the imaging section, and sequentially acquiring images containing the sequentially generated workpiece images as updated images; and a setting reception section for receiving shape information relating to the shape of the workpiece and setting information including, as measurement elements, at least one of a plurality of measurement positions or one or more measurement items for the shape of the workpiece, wherein the measurement setting section sets setting elements in the workpiece image included in the image generated by the imaging section based on the setting information received by the setting reception section; and the automatic adjustment section automatically adjusts multiple types of measurement conditions for each measurement element based on the updated images, each having different measurement conditions, sequentially acquired by the update image acquisition section and each measurement element set by the measurement setting section; and a measurement section that extracts edges from the image generated by the imaging section based on the measurement elements of the setting information and the measurement conditions automatically adjusted by the automatic adjustment section, identifies the measurement elements using the edges, and performs measurements of the measurement items of the setting information based on the measurement elements.
5. An image measuring device according to any one of claims 1 to 3, wherein the measurement setting section presents other measurement condition candidates of the same type and accepts a user's selection of a measurement condition candidate.
6. An image measuring device according to any one of claims 1 to 3, wherein the automatic adjustment unit receives input from a user of an edge position on an image generated by the imaging unit, and automatically adjusts the measurement conditions so that an edge similar to the edge position for which input has been received is extracted.
7. An image measuring device according to any one of claims 1 to 3, further comprising a display screen generation unit that generates a user interface screen including a drawing data display area that displays drawing data including the shape of the workpiece, and a workpiece image display area that displays the workpiece image, wherein the measurement setting unit accepts instructions for measurement items on the drawing data displayed in the drawing data display area, and reflects the measurement items in the workpiece image displayed in the workpiece image display area.
8. An image measuring device according to claim 7, wherein the automatic adjustment unit automatically adjusts a plurality of types of measurement conditions when it receives an instruction for a measurement item on the drawing data.
9. An image measuring device according to any one of claims 1 to 3, further comprising a display screen generation unit that generates a user interface screen including drawing data including the shape of the workpiece and an overlapping display area in which the workpiece image is displayed overlappingly, and wherein the measurement setting unit receives instructions for measurement items on the drawing data displayed in the overlapping display area and reflects the measurement items on the workpiece image displayed in the overlapping display area.
10. An image measuring device according to any one of claims 1 to 3, wherein the measurement setting unit sets a plurality of measurement positions and one or more measurement items for a workpiece image contained in an image generated by the imaging unit, and the automatic adjustment unit automatically adjusts, for each measurement element, a plurality of types of measurement conditions including imaging conditions for the measurement unit to extract the edge of each measurement element corresponding to each of the plurality of measurement positions set by the measurement setting unit.
11. An image measuring device according to any one of claims 1 to 3, wherein the measurement setting unit sets at least one of a plurality of measurement positions or one or more measurement items as a measurement element by reflecting setting information, in which at least one of a plurality of measurement positions or one or more measurement items for a work image included in a composite image obtained by combining images generated by the imaging unit, in the work image included in the image generated by the imaging unit.
12. An image measuring device according to any one of claims 1 to 3, wherein the measurement setting unit sets at least one of a plurality of measurement positions or one or more measurement items as measurement elements for the workpiece displayed on the display unit, and reflects the set setting information in the workpiece image contained in the image generated by the imaging unit, thereby setting at least one of a plurality of measurement positions or one or more measurement items as measurement elements.
13. An image measuring device according to any one of claims 1 to 3, wherein the measurement setting unit stores setting information in which at least one of a plurality of measurement positions or one or more measurement items for the workpiece image is set as a measurement element, and sets at least one of a plurality of measurement positions or one or more measurement items as a measurement element by reflecting the stored setting information in the workpiece image included in the image generated by the imaging unit.
14. An image measuring device according to any one of claims 1 to 4, wherein the automatic adjustment unit automatically adjusts multiple types of measurement conditions for multiple measurement elements all at once.
15. An image measuring device according to any one of claims 1 to 4, wherein the automatic adjustment unit includes in the measurement conditions at least one of the illumination conditions of the transmitted illumination unit or the incident illumination unit and the edge extraction conditions in the edge extraction process executed by the measurement unit.
16. An image measuring device according to claim 15, wherein the automatic adjustment unit automatically adjusts at least one of the illumination conditions: irradiation time, switching between the transmitted illumination unit and the incident illumination unit, and illumination type.
17. An image measuring device according to claim 15, wherein the automatic adjustment unit automatically adjusts at least one of the scan direction, edge direction, and edge strength threshold as the edge extraction conditions.
18. An image measuring device according to claim 15, wherein the automatic adjustment unit automatically adjusts the imaging conditions, the illumination conditions, and the edge extraction conditions.
19. An image measuring device according to any one of claims 1 to 4, wherein the automatic adjustment unit automatically adjusts at least one of the imaging conditions: exposure time, magnification of the optical system of the imaging unit, aperture of the optical system, and height of the imaging unit from the mounting table.
20. An image measuring device according to any one of claims 1 to 4, further comprising a display screen generating unit that generates a display screen that displays whether or not an edge has been extracted by the measuring unit for each measurement element.
21. An image measuring device according to any one of claims 1 to 4, wherein the measurement unit measures the workpiece in accordance with measurement setting data generated based on the measurement position and measurement elements set by the measurement setting unit and the measurement conditions automatically adjusted by the automatic adjustment unit.
22. An image measuring device according to claim 21, wherein the measurement setting unit sets at least one of a plurality of measurement positions or one or more measurement items as a measurement element by reflecting setting information set for a workpiece, the inspection information of which includes at least one of a plurality of measurement positions or one or more measurement items as a measurement element, in a workpiece image included in an image generated by the imaging unit.
23. A setting support device for a vision measuring device that supports the setting of a vision measuring device comprising: a placing table having a light-transmitting plate on a first surface of the light-transmitting plate; a transmitted illumination unit provided below the light-transmitting plate for irradiating the work placed on the light-transmitting plate with transmitted illumination light; a reflected illumination unit provided above the light-transmitting plate for irradiating the work placed on the light-transmitting plate with reflected illumination light; an imaging unit provided above the placing table for imaging the work placed on the placing table to generate an image including a work image; and a measurement unit that performs measurement of measurement elements, the setting support device comprising: a measurement setting unit that sets at least one of a plurality of measurement positions or one or more measurement items for the work image included in the image generated by the imaging unit as measurement elements; and an automatic adjustment unit that automatically adjusts, for each measurement position, a plurality of types of measurement conditions including the imaging conditions of the imaging unit for the measurement elements set by the measurement setting unit, A setting support device for an image measuring device that extracts edges from an image generated by the imaging unit based on the measurement elements set by the measurement setting unit and the measurement conditions automatically adjusted by the automatic adjustment unit, and performs setting processing so that the measurement unit measures the measurement elements using the extracted edges.
Citation Information
Patent Citations
Picture superimposing type measuring system
JP1998047935A
Image measuring device and method thereof
JP1999063922A
Image measuring device, image measuring method, and computer program
JP2009300124A
Methods and computer programs for improving the acquisition of object dimensions
JP2011519419A
Dimension measuring device, dimension measuring method, and program for dimension measuring device
JP2012159410A