Image measuring machine and program
Patent Information
- Application Number
- JP2024102435
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-08-01
- Filing Date
- 2024-06-25
- Publication Date
- 2025-02-14
AI Technical Summary
【0019】 本発明の画像測定機及びプログラムによれば、オペレータが表示部に表示された画像をなぞるという直感的な操作でエッジを検出することができるため、エッジ検出作業を軽減することができる。
Smart Images

Figure 2025022760000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to an image measuring instrument and a program that realize efficient edge detection. [Background technology]
[0002] An image measuring instrument is a device that takes an image of a measurement object and measures the dimensions of a measurement point on the measurement object by analyzing the image (see, for example, Patent Document 1). [Prior art documents] [Patent documents]
[0003] [Patent Document 1] JP 2010-169584 A Summary of the Invention [Problem to be solved by the invention]
[0004] Conventionally, when performing image measurement, an operator selects an edge to be measured from an image of the object to be measured, and detects the edge by applying an edge detection tool that matches the shape of the edge. For example, when measuring the length between two edges, the operator must first detect the two edges and then measure the length between the edges. In other words, the operator must repeatedly select an edge from the image, apply the edge detection tool, and detect two or more edges while closely checking the edge positions.
[0005] An object of the present invention is to provide an image measuring instrument and a program capable of reducing the work of detecting edges. [Means for solving the problem]
[0006] The image measuring instrument of the present invention is an image measuring instrument that captures an image of a measurement object and measures the dimensions of a measurement point on the measurement object by analyzing the image, and is equipped with a display unit on which the image of the measurement object is displayed, an input unit that accepts input of a path traced by an operator on the image displayed on the display unit, an edge detection unit that detects edges based on the path traced on the image, and a measurement execution unit that performs measurement based on one or more edges detected by the edge detection unit.
[0007] The edge detection section may detect edges that exist in an area along the center line of the trajectory.
[0008] The edge detection section may detect edges that exist within an area surrounded by the locus.
[0009] The edge detection section may detect an edge having a shape similar to the shape of the trajectory.
[0010] The edge detection unit may determine whether the shape to which the trajectory point cloud data resembles is a straight line by least-squares fitting a straight line to the trajectory point cloud data and calculating an RMSE (Root Mean Squared Error), and if it is determined that the shape is not a straight line, may determine whether the shape to which the trajectory point cloud data resembles is a circle or an arc by least-squares fitting a circle to the trajectory point cloud data and calculating an RMSE (Root Mean Squared Error), and if it is determined that the shape is a circle or an arc, may determine whether the shape to which the trajectory point cloud data resembles is a circle or an arc by calculating the distance between the center of gravity of the trajectory point cloud data and the center of an optimal circle, which is a circle least-squares fitted to the trajectory point cloud data.
[0011] The point cloud data of the trajectory may be obtained by thinning an image of the trajectory using a thinning algorithm, and converting the resulting thin lines into point cloud data.
[0012] When the shape similar to the point cloud data of the trajectory is identified as a straight line, straight lines within a predetermined detection range based on the trajectory in the image of the object to be measured are extracted whose angle with an optimal line, which is a line obtained by least squares fitting to the point cloud data of the trajectory, is equal to or less than a predetermined threshold, and a reference line to be used as a reference is determined from the extracted straight lines according to a predetermined rule. Of the extracted straight lines other than the reference line, the distance of a perpendicular line from the midpoint to an extension of the reference line is equal to or less than a predetermined threshold, and the resulting line is detected as an element to be subjected to edge detection.
[0013] When the shape similar to the point cloud data of the trajectory is identified as a circle, circles within a predetermined detection range based on the trajectory in the image of the object to be measured are extracted, and the distance between the center of the circle and the center of the optimal circle is equal to or less than a predetermined threshold value. From the extracted circles, a circle to be used as an element for edge detection may be determined according to a predetermined rule.
[0014] When the shape similar to the point cloud data of the trajectory is identified as an arc, or when the shape similar to the point cloud data of the trajectory is identified as a circle and there is no circle within a detection range predetermined based on the trajectory, where the distance between the center of the circle and the center of the optimal circle is equal to or less than a predetermined threshold, arcs within the detection range predetermined based on the trajectory in the image of the object to be measured, where the distance between the center of the circle containing the arc and the center of the optimal circle is equal to or less than a predetermined threshold, are extracted, and a reference arc is determined as a reference arc from among the extracted arcs, and an extracted arc other than the reference arc, where the difference between the radius of the circle containing the extracted arc and the radius of the reference arc is equal to or less than a predetermined threshold, is connected to the reference arc, and the resulting arc or circle is detected as an element to be subjected to edge detection.
[0015] The edge detection unit may execute edge detection when the input of the trajectory to the input unit is interrupted.
[0016] The edge detection unit may perform detection of undetected edges at each certain extension of the trajectory while the trajectory continues to be input to the input unit.
[0017] The display unit may be a touch panel display integrated with the input unit.
[0018] The functions of the image measuring machine of the present invention may be realized by writing the functions of the image measuring machine of the present invention in a program and having a computer execute the program. Effect of the Invention
[0019] According to the image measuring instrument and the program of the present invention, an operator can detect edges by an intuitive operation of tracing an image displayed on a display unit, thereby reducing the edge detection work. [Brief description of the drawings]
[0020] [Figure 1] 1 is a diagram showing an example of the appearance of an image measuring instrument 1 of the present invention. [Diagram 2] 1 is a schematic diagram showing the internal structure of an image measuring instrument 1. FIG. [Diagram 3] FIG. 2 is a functional block diagram of the image measuring instrument 1. [Figure 4] FIG. 2 is a diagram showing an example of an image of a measurement object. [Diagram 5] FIG. 13 is a diagram showing how an image of a measurement object is traced. [Figure 6] FIG. 13 is a diagram showing an example of a display of detected edges. [Figure 7] FIG. 11 is another diagram showing how the image of the object to be measured is traced. [Figure 8] FIG. 11 is another diagram showing an example of a display of detected edges. [Figure 9] FIG. 13 is a diagram showing an example of a display of measurement results. [Figure 10] 11A and 11B are diagrams for explaining a case where the entire shape of the measurement object cannot be traced. [Figure 11] 11A and 11B are diagrams for explaining how to deal with a case where the entire shape of a measurement object cannot be traced. [Figure 12] 11A and 11B are diagrams for explaining how to deal with a case where the shape of the measurement object has a chip or a protrusion. [Figure 13]11A and 11B are diagrams illustrating a method for acquiring point cloud data of a trajectory. [Figure 14] FIG. 13 is a diagram illustrating a method for identifying the shape of a trajectory. [Figure 15] 13A to 13C are diagrams illustrating a procedure for detecting elements when a specified shape is a straight line. [Figure 16] 13A and 13B are diagrams illustrating a procedure for detecting elements when the identified shape is a circular arc. [Figure 17] 13A and 13B are diagrams illustrating an element detection procedure in a case where the identified shape is a circle and the circle is extracted from the detection range. [Figure 18] 13A and 13B are diagrams illustrating a procedure for detecting an element when the specified shape is a circle and a circular arc is extracted from the detection range. [Figure 19] 11A and 11B are diagrams illustrating a procedure for detecting individual elements when a plurality of elements are traced integrally. [Figure 20] 13A to 13C are diagrams illustrating a procedure for detecting one element when the element is divided into a plurality of parts and traced. [Figure 21] 11A and 11B are diagrams illustrating a procedure for detecting individual elements when multiple trajectories are input together. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0021] Hereinafter, an embodiment of the present invention will be described with reference to the drawings. In the following description and drawings, the same functional units are denoted by the same reference numerals, and the description of functional units that have already been described will be omitted or will be described only to the extent necessary.
[0022] Fig. 1 is a schematic diagram showing an example of the appearance of an image measuring instrument 1 of the present invention. Fig. 2 is a schematic diagram showing an example of the internal structure of the image measuring instrument 1. Fig. 3 is a functional block diagram of the image measuring instrument 1. Note that in this embodiment, a case where a coaxial epi-illumination method is adopted as the illumination method will be described as an example, but the illumination method is not important as long as it is possible to capture an image of a measurement target.
[0023] The image measuring instrument 1 includes a mounting table 2, an imaging unit 3, a control and calculation unit 4, a storage unit 5, a display unit 6, a telecentric optical system 7, an illumination unit 8, and an input unit 10.
[0024] The mounting table 2 is a table on which a measurement object (not shown) is placed.
[0025] The imaging unit 3 is provided facing the mounting table 2, and captures an image of the measurement object placed on the mounting table 2 by receiving light from the direction of the mounting table 2. The imaging unit 3 includes an image sensor, and converts the brightness of the image formed on the light receiving surface into an electrical signal to generate image data. The image sensor may be a semiconductor solid-state imaging element such as a Charge-Coupled Device (CCD) or Complementary Metal Oxide Semiconductor (CMOS).
[0026] The storage unit 5 is any storage means capable of storing digital data.
[0027] The display unit 6 is any display means, and displays an image of the object to be measured captured by the imaging unit 3, etc.
[0028] The telecentric optical system 7 includes an objective lens 71 that collects light from the direction of the mounting table 2, and an imaging lens 72 that forms an image of the light that has reached the objective lens 71 on the light receiving surface of the imaging unit 3. The objective lens 71 and the imaging lens 72 may each be provided on multiple surfaces.
[0029] The illumination unit 8 is a coaxial epi-illumination means including a light source 81 that emits illumination light, and a beam splitter 82 that causes the illumination light from the light source 81 to be split into the telecentric optical system 7 and irradiated toward the mounting table 2 as coaxial epi-illumination light whose optical axis coincides with the optical axis of the imaging unit 3. The illumination unit 8 may include transmitted illumination and side illumination in addition to the coaxial epi-illumination for the purpose of clarifying an image, etc.
[0030] The input unit 10 accepts input of a path traced by an operator on the image of the object to be measured displayed on the display unit 6. For example, when a touch panel display integrally configured with the display unit 6 is used, the input of a path traced by the operator's finger is accepted. Also, when a mouse is used, the input of a path along which the operator moves a pointer is accepted.
[0031] As shown in Fig. 10, if the measurement target is large and a part of it is missing from the image, making it impossible to trace the entire shape of the measurement target, the image may be reduced as shown in Fig. 11, and the part of the contour not shown in the image may be virtually traced in the resulting blank space on the display, thereby accepting input of the entire shape. In this case, since the accuracy of tracing the shape is poor in the virtually traced part, the RMSE calculation described below may be performed by weighting the point cloud data within the image range.
[0032] Also, when a part of a line or circle is missing, as in the examples shown in Figures 12(a) and (b), it is possible to continuously trace the missing part as well, as in the examples shown in Figures 12(c) and (d).
[0033] Also, when a line or circle has a protruding portion as in the example shown in FIG. 12(e), it may be traced continuously as if it were not protruding as in the example shown in FIG. 12(f).
[0034] The control and calculation unit 4 controls each unit within the image measuring instrument 1 and performs necessary calculation processing in order to realize image capture and image measurement by the image measuring instrument 1.
[0035] In the present invention, the control and calculation unit 4 includes an edge detection unit 41 and a measurement execution unit .
[0036] The edge detection unit 41 detects edges based on a trajectory traced on the image of the object to be measured, which is received by the input unit 10 and displayed on the display unit 6. At this time, the detected edges may be superimposed on the image of the object to be measured. For example, when there is an image of the object to be measured as shown in FIG. 4, if a portion on the image where an edge is to be detected is traced as shown in FIG. 5, the edge is detected as shown in FIG. 6.
[0037] The traced trajectory may be used as the edge detection range as it is, or, for example, an area along the center line of the trajectory, more specifically, an area of a certain width from the center line of the trajectory may be used as the detection range. Also, an area surrounded by the trajectory may be used as the detection range. By using an area surrounded by the trajectory as the detection range, for example, when edges exist in a concentric shape, they can be detected all at once.
[0038] Edge detection can be performed more accurately by applying a detection processing method according to the shape of the edge to be detected. Therefore, the edge detection unit 41 specifies the shape of the traced trajectory as one of the most similar shapes from among a straight line, an arc, a circle, etc. The shape of the trajectory is specified by fitting the point cloud data of the trajectory to a straight line or a circle.
[0039] The point cloud data of the locus may be acquired as point cloud data PC of a locus T traced by a finger or a mouse pointer, for example, as shown in Fig. 13(a). When tracing with a finger, the locus T has a width, so it can be acquired as point cloud data of the locus coordinates of the midpoint in the width direction or the locus point cloud data of the locus coordinates of the center of gravity of the contact area of the finger, for example. In addition, when an image of the locus is created separately using paint software or the like and then loaded and used, coordinate data cannot be obtained, so the image M of the locus may be thinned by the Zhang-Suen algorithm or the like, and the obtained thin line TL may be converted into point cloud data, as shown in Fig. 13(b).
[0040] The point cloud data of the trajectory thus obtained is fitted with a line or a circle by the following procedure, and classified into each shape based on statistical processing. In order to improve the accuracy of the fitting, outliers may be removed prior to the fitting by RANSAC (random sample consensus).
[0041] First, a straight line is fitted to the point cloud data by least squares fitting, and the resulting RMSE (Root Mean Squared Error: error value indicated by the square root of the mean square of the residuals) is calculated. This may be converted to line RMSE per unit length by dividing it by the length of the straight line fitted to the point cloud data (hereinafter referred to as the "optimal straight line"). When the line RMSE calculated in this way is equal to or less than a predetermined value, the shape of the trajectory that is similar is determined to be a straight line.
[0042] If the line RMSE is greater than a predetermined value, a circle is fitted to the point cloud data by least squares fitting, and the RMSE at that time, the circle RMSE, is calculated. This may be converted to the circle RMSE per unit radius by dividing it by the radius of the circle fitted to the point cloud data (hereinafter referred to as the "optimum circle"). If the circle RMSE calculated in this way is equal to or less than a predetermined value, it is determined that the shape to which the trajectory resembles is a circle or a circular arc. On the other hand, if the circle RMSE is greater than the predetermined value, it is determined that the shape of the trajectory is other than a straight line, a circle, or a circular arc.
[0043] FIG. 14(a) shows a diagram summarizing the rules for classifying shapes of similar trajectory point cloud data into straight lines, circles and circular arcs, and others according to the values of line RMSE and circle RMSE.
[0044] If it is determined that the shape to which the trajectory resembles is a circle or an arc, it is further determined whether or not the distance between the center of gravity of the point cloud data and the center of the optimal circle is equal to or less than a predetermined distance. It may be determined whether or not the ratio of the distance between the center of gravity of the point cloud data and the center of the optimal circle to the radius of the optimal circle is equal to or less than a predetermined value. If it is equal to or less than the predetermined distance or equal to or less than a predetermined value, it is determined that the shape of the trajectory is a circle. If not, it is determined that the shape of the trajectory is an arc. For example, as shown in FIG. 14(b), if the distance D1 between the center of gravity of the point cloud data PC and the center of the optimal circle FC is equal to or less than a predetermined distance S, it is determined that the shape to which the point cloud data PC resembles is a circle. Also, as shown in FIG. 14(c), if the distance D1 between the center of gravity of the point cloud data PC and the center of the optimal circle FC is greater than the predetermined distance S, it is determined that the shape to which the point cloud data PC resembles is an arc.
[0045] Then, the edges of the specified shape are detected from the image in the detection range by applying a detection processing method corresponding to the shape. At this time, if there are multiple edges that correspond to the specified shape, multiple edges may be detected. The example in FIG. 6 shows an example in which two edges are detected. Also, when there are multiple edges that correspond to the specified shape, an edge that is more similar to the specified shape may be detected in a limited manner. Also, when an edge is discontinuous but forms the specified shape as a whole, it may be detected as an edge of the specified shape.
[0046] For example, a certain area along an optimum straight line or an optimum circle, or the range of an image of a trajectory is set as a detection range, and edges of the specified shape are detected by the following procedure.
[0047] When the specified shape is a straight line, first, from among the straight lines in a predetermined detection range DA shown in FIG. 15(a) of the image of the measurement object, a straight line whose angle with the optimal straight line FL is equal to or smaller than a predetermined threshold is extracted as shown in FIG. 15(b). Next, from among the extracted straight lines (hereinafter referred to as "extracted straight lines EL"), a reference straight line (hereinafter referred to as "reference straight line BEL") is determined according to a predetermined rule as shown in FIG. 15(c). The reference straight line BEL is determined based on, for example, the length of the straight line or the proximity to the optimal straight line. Next, for each of the extracted straight lines other than the reference straight line, a distance D2 of a perpendicular line drawn from the midpoint to a line extending the reference straight line is calculated, and an extracted straight line SEL whose distance D2 is equal to or smaller than a predetermined threshold is specified as shown in FIG. 15(d). Next, the extracted straight line SEL is connected to the reference straight line BEL, and detected as a straight line element LE to be subjected to edge detection as shown in FIG. 15(e). When connecting, the extracted straight line SEL to be connected is moved to an extension of the reference straight line BEL, and if there is a gap between the extracted straight line SEL and the reference straight line BEL, the gap is filled and the connection is performed. Then, a straight line edge detection tool is applied to the detected straight line element LE to detect edges.
[0048] When the detection range includes multiple straight line elements, multiple reference lines may be determined, and for each reference line, the distance between the extracted line and the reference line may be calculated. The extracted lines whose distance is less than or equal to a threshold may be connected to the reference line to detect the resulting lines as elements.
[0049] When the specified shape is a circular arc, first, from among the circular arcs in a predetermined detection range DA of the image of the measurement object as shown in FIG. 16(a), an arc in which the distance between the center of the circle containing the circular arc and the center of the optimal circle FC is equal to or less than a predetermined threshold is extracted as shown in FIG. 16(b). Next, from among the extracted circular arcs (hereinafter referred to as "extracted circular arcs EA"), a reference circular arc (hereinafter referred to as "reference circular arc BEA") is determined according to a predetermined rule as shown in FIG. 16(c). The reference circular arc BEA is determined based on, for example, the length of the circular arc, the closeness to the center of the optimal circle FC, and the smallness of the difference in radius from the optimal circle FC. Next, from among the extracted circular arcs EA other than the reference circular arc BEA, an extracted circular arc SEA in which the difference D3 between the radius of the circle containing the extracted circular arc EA and the radius of the reference circular arc is equal to or less than a predetermined threshold is specified as shown in FIG. 16(d). Next, the extracted arc SEA is connected to the reference arc BEA and detected as an arc element AE for edge detection, as shown in Fig. 16(e). When connecting, the extracted arc SEA to be connected is moved onto a circle that contains the reference arc BEA, and if there is a gap between it and the reference arc BEA, gaps other than the largest gap are filled and connected. Then, an arc edge detection tool is applied to the detected arc element AE to detect edges.
[0050] If the identified shape is a circle, first, from the circles and arcs within a predetermined detection range DA of an image of the object to be measured, such as those shown in Figures 17(a) and 18(a), circles whose center is less than a predetermined threshold and arcs whose center is less than a predetermined threshold and the distance between the center of the optimal circle FC and the center of the circle containing the arc are extracted.
[0051] When a circle is extracted as shown in Fig. 17(b), a reference circle (hereinafter referred to as "reference circle BEC") is determined from the extracted circles (hereinafter referred to as "extracted circle EC") according to a predetermined rule as shown in Fig. 17(c). The reference circle BEC is determined based on, for example, its proximity to the center of the optimum circle FC and the smallness of the difference in radius from the optimum circle FC. The reference circle BEC is then detected as a circular element CE for edge detection as shown in Fig. 17(d), and a circular edge detection tool is applied to this circular element CE to detect edges.
[0052] When a circle is not extracted and an arc is extracted as shown in FIG. 18(b), a reference arc BEA is determined from the extracted arc EA according to a predetermined rule as shown in FIG. 18(c). The reference arc BEA is determined based on, for example, the closeness to the center of the optimal circle FC, the smallness of the difference in radius from the optimal circle FC, and the like. The reference arc BEA is determined based on, for example, the length of the arc, the closeness to the center of the optimal circle FC, and the smallness of the difference in radius from the optimal circle FC. Next, among the extracted arcs EA other than the reference arc BEA, an extracted arc SEA in which the difference D3 between the radius of the circle containing the extracted arc EA and the radius of the reference arc is equal to or smaller than a predetermined threshold value is specified as shown in FIG. 18(d). Next, the extracted arc SEA is connected to the reference arc BEA and detected as a circular element CE to be subjected to edge detection as shown in FIG. 18(e). When connecting, the extracted circular arc SEA to be connected is moved onto a circle that contains the reference circular arc BEA, and if there is a gap between it and the reference circular arc BEA, the gap is filled and the connection is made. Then, a circular edge detection tool is applied to the detected circular element CE to detect edges.
[0053] When the detection range includes a plurality of circular or arc-shaped edges, a plurality of reference circles or reference arcs may be determined, and when the reference circles have been determined, each of the determined reference circles may be detected as an element of the edge detection target. In the case of reference arcs, for each reference arc, a circle or arc obtained by connecting an extracted arc, in which the difference between the radius of a circle containing the extracted arc and the radius of the reference arc is equal to or smaller than a threshold value, to the reference arc may be detected as an element of the edge detection target.
[0054] It should be noted that even if multiple connected elements are traced together, the multiple elements can be detected individually. For example, when each point of the point cloud data obtained by tracing is fitted to each shape, it is evaluated whether it is located within the threshold of RANSAC, and if the number of points within the threshold is less than a predetermined number, the point cloud data is divided by a binary tree method or the like, and each point cloud data is fitted to each shape and evaluated by RANSAC. If the number of points within the threshold is equal to or greater than a predetermined number, the division is completed, and thus, element detection processing can be performed for each of the two point cloud data based on the specified shape. On the other hand, if the number of points within the threshold is less than a predetermined number, the division may be repeated until the number of points within the threshold is equal to or greater than a predetermined number.
[0055] For example, suppose that the trajectory T of the linear elements E1 and E2 continuously traced by a finger is shown in FIG. 19(a), and point cloud data PC of the trajectory T shown in FIG. 19(b) is obtained. At this time, first, as shown in FIG. 19(c), the optimal line FL and the optimal circle FC are fitted to the point cloud data PC, respectively, and evaluated by RANSAC. As a result of the evaluation, if the number of points within the threshold is less than a predetermined number, the point cloud data PC is divided into point cloud data PC1 and point cloud data PC2, as shown in FIG. 19(d). Next, the point cloud data PC1 is fitted to the optimal line FL1 and evaluated by RANSAC, and the point cloud data PC2 is fitted to the optimal line FL2 and evaluated by RANSAC. As a result, if the number of points within the threshold is equal to or greater than the predetermined number for both, the division is completed, and element detection processing can be performed for each of the two point cloud data based on the specified shape.
[0056] Conversely, even if one element is divided into several parts and traced, it is possible to detect the element as a whole. For example, when fitting each point of the point cloud data of the first traced trajectory to each shape, it is evaluated whether or not it is located within the RANSAC threshold in each shape, and if the number of points within the threshold in any shape is a predetermined number or more, the shape of the point cloud data is identified for the time being. However, when fitting each point of one or more continuously traced trajectories to each shape together with the point cloud data of the first traced trajectory, it is evaluated whether or not it is located within the RANSAC threshold in each shape, and if the number of points within the threshold in any shape is greater than when evaluated using the point cloud data of a fewer trajectory, the shape is identified by continuously tracing and combining the point cloud data of two or more trajectories. This makes it possible to detect one element as a whole even if it is divided into several parts and traced.
[0057] For example, suppose that a circular element E is divided into two and traced with a finger, as shown in FIG. 20(a), and point cloud data PC1 and PC2 of the trajectories T1 and T2 shown in FIG. 20(b) are obtained. In this case, as shown in FIG. 20(c), if the number of points within the threshold is greater than a predetermined number as a result of fitting an optimal circle FC to only the point cloud data PC1 and evaluating it by RANSAC, the shape of the point cloud data is initially specified as a circle or an arc. However, as shown in FIG. 20(d), if the number of points within the threshold is greater than when only the point cloud data PC1 is used as a result of fitting an optimal circle FC by adding the point cloud data PC2 and evaluating it by RANSAC, the shape of the combined point cloud data PC1 and point cloud data PC2 is specified as a circle.
[0058] The detection of edges and the display on the screen may be performed when the input of a trajectory into the input unit 10 is interrupted after the input has started, or the detection of undetected edges and the display on the screen may be performed in real time while the input of the trajectory is continuing and each time the trajectory is extended to a certain extent.
[0059] The input of the trajectory from the input unit 10 and the detection of edges in the edge detection unit 41 are repeated until the detection of edges necessary for the measurement of the desired measurement point is completed. For example, when the edge of a certain measurement point is detected after the edge of the certain measurement point is detected as shown in Fig. 6, the edge existing at the other measurement point is detected by tracing the other measurement point on the image as shown in Fig. 7, as shown in Fig. 8.
[0060] Note that instead of processing multiple elements for each input of a locus, multiple loci may be input together and then processed.
[0061] For example, when six trajectories are input and point cloud data PC1 to PC6 corresponding to the first to sixth trajectories are obtained as shown in FIG. 21, first, the first trajectory is focused on and the number of points within the threshold in RANSAC is calculated using only the point cloud data PC1. Then, the number of points within the threshold is calculated similarly using the point cloud data PC1 and PC2 of the first and second trajectories. Then, the number of points within the threshold is calculated similarly using the point cloud data PC1 to PC3 of the first to third trajectories. This is repeated up to the point cloud data PC1 to PC6 of the first to sixth trajectories to calculate the number of points within the threshold. Then, the first element can be detected by performing the above-mentioned process on the point cloud data in the case where the number of points within the threshold is the largest. If one straight line or circle is traced at once, generally, the number of points within the threshold is the largest when only the point cloud data of the first trajectory is used. That is, one element is detected by one trajectory. On the other hand, if one line or circle is divided into m parts and traced, generally, the number of points within the threshold will be the largest when the point cloud data of the 1st to mth loci is used, that is, one element is detected based on the m loci. For example, even if a circle is traced with two loci, each half circle, it can be detected as a circle.
[0062] After the first element has been detected, the second and subsequent elements are detected in the same manner as the first element detection, using point cloud data excluding the point cloud data used to detect the first element. For example, when the second element is to be detected after the first element has been detected using the first and second trajectories, the third trajectory is focused on, and the number of points within the threshold in RANSAC is found using only the point cloud data of the third trajectory. This is repeated up to the point cloud data of the third to sixth trajectories to find the number of points within the threshold, and the above-mentioned process is performed on the point cloud data with the largest number of points within the threshold to detect the second element.
[0063] If an element cannot be detected using this method, it is possible to further assume that one trajectory contains two or more elements, divide the point cloud data as described above, and evaluate each point cloud data using RANSAC to attempt to extract two or more elements.
[0064] The measurement execution unit 42 executes measurement based on one or more edges detected by the edge detection unit 41. Measurement items such as length dimensions and angle dimensions may be specified when executing the measurement, or may be specified before executing the measurement.
[0065] Fig. 9 is a diagram showing an example of a measurement result when the measurement item is the length dimension between two edges superimposed on an image showing the edge detection result in Fig. 8. The measurement may be performed and the measurement results may be displayed sequentially from a point where the edge detection required for the measurement of the measurement item is completed, or after the edge detection for a plurality of points is completed, the measurement may be performed and the measurement results may be displayed collectively for the plurality of points. Taking the cases of Figs. 5 to 8 as an example, when the measurement is performed and the measurement results are displayed sequentially, the measurement is performed and the measurement results are displayed at a certain measurement point when two edges are detected as shown in Fig. 6, and then the measurement is performed and the measurement results are displayed at another measurement point when two edges are detected as shown in Fig. 8.
[0066] In the present invention, the control calculation unit 4 may be configured with a CPU, and each function may be realized by having the CPU execute a program describing the functions of the edge detection unit 41 and the measurement execution unit 42, and the functions of controlling the imaging unit 3, the illumination unit 8, etc. The program may be read out from the memory unit 5, or may be read out from another storage means. The control calculation unit 4 and the memory unit 5 may be provided in the main body of the image measuring instrument 1, or may be provided in a device such as a personal computer connected to the main body of the image measuring instrument 1 so as to be able to communicate with it.
[0067] According to the image measuring instrument of the present invention described above, the operator can detect edges by an intuitive operation of tracing the image displayed on the display unit, thereby reducing the edge detection work.
[0068] The present invention is not limited to the above-mentioned embodiment and modified examples. The above-mentioned embodiment and modified examples are merely examples, and anything that has substantially the same configuration as the technical idea described in the claims of the present invention and exhibits similar effects is included in the technical scope of the present invention. In other words, appropriate modifications are possible within the scope of the technical idea expressed in the present invention, and forms with such modifications and improvements are also included in the technical scope of the present invention. [Explanation of symbols]
[0069] 1...Image measuring device 2…Placement table 3. Imaging unit 4...Control and calculation section 5...Storage section 6…Display section 7...Telecentric optical system 8…Lighting section 10...Input section 41...Edge detection section 42…Measurement execution unit AE...Arc element BEA...Reference arc BEC: base yen BEL…Reference straight line CE: Circle element D1, D2, S…distance D3: Radius difference DA…Detection range E, E1, E2... elements EA…Extracted arc EC…Extraction circle EL…Extracted straight line FC: Optimal circle FL, FL1, FL2...Best fit line LE: Linear element M…Trajectory image PC, PC1 to PC6: Point cloud data SEA: Extracted arcs with radius difference D3 below a threshold SEL: Extraction of straight lines whose distance D2 is equal to or less than the threshold T, T1, T2…Trajectory TL…Thin line
Claims
1. An image measuring device that captures an image of a measurement object and measures dimensions of a measurement point of the measurement object by analyzing the image, A display unit on which an image of the measurement object is displayed; an input unit that receives an input of a path traced by an operator on the image displayed on the display unit; an edge detection unit that detects edges based on the traced trajectory on the image; a measurement execution unit that executes a measurement based on the detected one or more edges; An image measuring machine comprising:
2. The image measuring device according to claim 1 , wherein the edge detection unit detects edges present in an area along a center line of the trajectory.
3. The image measuring device according to claim 1 , wherein the edge detection unit detects edges that exist within an area surrounded by the trajectory.
4. The image measuring device according to claim 1 , wherein the edge detection unit detects an edge having a shape similar to the shape of the locus.
5. 5. The image measuring device according to claim 4, wherein the edge detection unit determines whether the shape to which the point cloud data of the trajectory resembles is a straight line by least-squares fitting a straight line to the point cloud data of the trajectory and calculating an RMSE (Root Mean Squared Error), and if it is determined that the shape is not a straight line, determines whether the shape to which the point cloud data of the trajectory resembles is a circle or an arc by least-squares fitting a circle to the point cloud data of the trajectory and calculating an RMSE (Root Mean Squared Error), and if it is determined that the shape is a circle or an arc, determines whether the shape to which the point cloud data of the trajectory resembles is a circle or an arc by calculating a distance between a center of gravity position of the point cloud data of the trajectory and a center of an optimal circle that is a circle least-squares fitted to the point cloud data of the trajectory.
6. 6. The image measuring instrument according to claim 5, wherein the point cloud data of the trajectory is obtained by thinning the image of the trajectory using a thinning algorithm, and converting the thin line obtained into point cloud data.
7. 6. The image measuring instrument according to claim 5, wherein, when the shape similar to the point cloud data of the trajectory is identified as a straight line, from among straight lines within a predetermined detection range based on the trajectory in the image, those having an angle with an optimal line that is a line obtained by least-squares fitting to the point cloud data of the trajectory that is equal to or less than a predetermined threshold value are extracted, a reference line to be used as a reference is determined from the extracted extracted straight lines according to a predetermined rule, and a straight line obtained by connecting, to the reference line, those extracted straight lines other than the reference line, whose distance of a perpendicular line from a midpoint to an extension of the reference line is equal to or less than a predetermined threshold value, is detected as an element to be subjected to edge detection.
8. 6. The image measuring machine according to claim 5, wherein, when the shape similar to the point cloud data of the trajectory is identified as a circle, circles within a predetermined detection range in the image based on the trajectory, the distance between the center of the circle and the center of the optimal circle is equal to or less than a predetermined threshold, are extracted, and from the extracted circles, circles to be used as elements for edge detection are determined according to predetermined rules.
9. 6. The image measuring instrument according to claim 5, wherein when a shape similar to the point cloud data of the trajectory is identified as an arc, or when a shape similar to the point cloud data of the trajectory is identified as a circle and there is no circle within a detection range predetermined based on the trajectory, the distance between the center of the circle and the center of an optimal circle is equal to or less than a predetermined threshold, the image measuring instrument extracts, from among the arcs within a detection range predetermined based on the trajectory in the image, arcs for which a distance between a center of a circle containing the arc and a center of the optimal circle is equal to or less than a predetermined threshold, determines a reference arc as a reference arc from among the extracted arcs, and detects, as an element to be subjected to edge detection, an arc or a circle obtained by connecting, to the reference arc, the extracted arc, among the extracted arcs other than the reference arc, the difference between a radius of a circle containing the extracted arc and a radius of the reference arc is equal to or less than a predetermined threshold.
10. The image measuring instrument according to claim 1 , wherein the edge detection section detects the edge when the input of the trajectory to the input section is interrupted.
11. 2. The image measuring device according to claim 1, wherein the edge detection section executes detection of an undetected edge each time the path extends to a certain extent while the path continues to be input to the input section.
12. The image measuring instrument according to claim 1 , wherein the display unit is a touch panel display integrated with the input unit.
13. A program for causing a computer to function as the image measuring device according to any one of claims 1 to 12.
Citation Information
Patent Citations
Image measuring device and computer program
JP2010169584A