A two-dimensional size measurement algorithm and device based on a non-telecentric system

By using a two-dimensional dimension measurement algorithm and device based on a non-telecentric system, the problems of low efficiency in traditional measurement and high cost of telecentric lenses are solved, achieving high-precision and high-efficiency measurement of small parts and reducing industrial costs.

CN115293975BActive Publication Date: 2025-11-28WUHAN TEXTILE UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210697383.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-20
Publication Date
2025-11-28
Estimated Expiration
2042-06-20

AI Technical Summary

Technical Problem

Traditional methods of measuring part dimensions are inefficient and unreliable. Furthermore, the use of telecentric lenses is costly and results in large systems. Existing technologies are ineffective in measuring parts such as arcs.

Method used

A two-dimensional dimension measurement algorithm based on a non-telecentric system is adopted, including the following steps: capturing an image of the part to be measured, performing distortion correction and preprocessing, extracting pixel-level edges, using the integral median algorithm and the least squares method to perform sub-pixel-level edge detection and fitting, and combining a two-dimensional dimension measurement device with a non-telecentric lens.

Benefits of technology

It enables high-precision and high-efficiency two-dimensional measurement of small, regular-shaped parts, reduces industrial costs, and provides a new measurement approach.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115293975B_ABST
    Figure CN115293975B_ABST
Patent Text Reader

Abstract

The application discloses a two-dimensional size measurement algorithm and device based on a non-telecentric system, wherein the algorithm comprises the following steps: S1, taking an image of a part to be measured; S2, performing distortion correction processing and preprocessing on the image taken in the step S1; S3, performing edge extraction on the processed image, and specifically comprising the following steps: S3a, first, extracting the image edge at the pixel level to obtain corresponding edge coordinate data; S3b, then, performing processing on the edge coordinate data obtained by using the integral mean value algorithm to extract the edge coordinate data at the sub-pixel level; S3c, next, performing edge connection, and connecting the edge sub-pixel contour points by using the extracted edge coordinate data at the sub-pixel level; S3d, finally, fitting the result after the edge connection by using the least square method to fit the edge into a plurality of straight lines to obtain the fitted edge at the sub-pixel level; and S4, performing size measurement on the edge at the sub-pixel level obtained in the step S3d.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data measurement, in particular to a two-dimensional size measurement algorithm and device based on a non-telecentric system. BACKGROUND

[0002] With the development of social science and technology, the manufacturing industry has gradually increased the requirements for detection technology, and part size measurement is an indispensable part of the manufacturing industry. The traditional part size measurement mostly relies on manual detection, which has problems such as low efficiency, poor reliability, high cost, etc. Moreover, some sizes are difficult to detect, such as the radius of a circular arc, the distance between the centers of two circles, etc. The measurement method based on machine vision is widely used in various industrial fields due to its high precision, low time consumption, real-time data acquisition, etc. In order to pursue non-distorted image quality, some vision measurement projects use telecentric lenses, but telecentric lenses have problems such as high cost, large size, and heavy weight. For example, the size is 200mm, and the accuracy requirement is 0.02mm (1 / 10000 measurement accuracy requires sub-pixel positioning). At this time, if a telecentric lens is used, the aperture of the telecentric lens must be greater than 200mm, resulting in a large system and high cost. SUMMARY

[0003] In order to solve the problems in the background art, the purpose of the present application is to provide a two-dimensional size measurement algorithm based on a non-telecentric system.

[0004] To achieve the above purpose, the technical scheme adopted by the present application is as follows: a two-dimensional size measurement algorithm based on a non-telecentric system, comprising the following steps:

[0005] S1, taking an image of a part to be measured;

[0006] S2, performing distortion correction processing and preprocessing on the image taken in step S1;

[0007] S3, performing edge extraction on the image processed in step S2, and specifically comprising the following steps:

[0008] S3a, first, extract the image edge at the pixel level to obtain corresponding edge coordinate data;

[0009] S3b, then, use the integral median algorithm to process the edge coordinate data obtained in step S3a to extract edge coordinate data at the sub-pixel level;

[0010] S3c, next, perform edge connection through a linking algorithm, and connect the edge sub-pixel contour points using the edge coordinate data at the sub-pixel level extracted in step S3b;

[0011] S3d, finally, the results of edge connection in step S3c are fitted using the least square method to fit the edges into several straight lines to obtain the fitted sub-pixel level edges;

[0012] S4, the sub-pixel level edges obtained in step S3d are measured in size.

[0013] In some embodiments, in step S1, when taking the image of the part to be measured, a calibration plate in different poses is also placed in the field of view of the camera lens; in step S2, when the image is processed for distortion correction, the image is corrected for distortion using the Halcon calibration method.

[0014] In some embodiments, in step S2, when the image is preprocessed, the image is specifically processed for multi-frame fusion, image contrast enhancement and Gaussian filtering.

[0015] In some embodiments, in step S3a, the Sobel algorithm is used to extract the pixel-level image edges.

[0016] In some embodiments, in step S3b, the step of processing the edge coordinate data obtained in step S3a using the integral median algorithm specifically includes:

[0017] For any pixel-level image edge point, the integral median corresponding to the coordinate value is taken as the sub-pixel level edge coordinate data according to the gradient direction of its gray value;

[0018] Repeat the above steps to extract all the sub-pixel level edge coordinate data.

[0019] In some embodiments, in step S3c, before the edge connection, the sub-pixel level edge coordinate data extracted in step S3b is processed for smoothing filtering to remove noise points in the data.

[0020] Another aspect of the present application provides a two-dimensional size measurement device based on a non-telecentric system, which uses the above-mentioned two-dimensional size measurement algorithm based on a non-telecentric system to realize two-dimensional size measurement of the part to be measured, and includes an industrial computer, a camera, a spherical integral light source, a support, a bottom backlight and a stage;

[0021] The support and the bottom backlight are both mounted on the stage;

[0022] The spherical integral light source is mounted on the support, and the bottom of the spherical integral light source is opposite to the bottom backlight;

[0023] The camera is mounted in the middle of the spherical integral light source, and the camera is electrically connected with the industrial computer, so that the image data can be transmitted to the industrial computer for processing;

[0024] In work, the part to be measured is placed on the object table and located in the middle of the bottom backlight.

[0025] Compared with the prior art, the present application has the following advantages:

[0026] The two-dimensional size measurement algorithm and device based on a non-telecentric system provided by the present application solve the problems of low precision and low efficiency in two-dimensional size measurement of small regular-shaped parts, are suitable for measurement occasions with high precision requirements, and further realize efficient measurement. BRIEF DESCRIPTION OF DRAWINGS

[0027] Figure 1 The step flowchart of the two-dimensional size measurement algorithm based on a non-telecentric system provided by the present application is shown in the figure.

[0028] Figure 2 The schematic diagram of the two-dimensional size measurement device based on a non-telecentric system provided by the present application is shown in the figure.

[0029] Figure 3 The simulated gray scale distribution curve graph of the gray scale gradient direction in one specific embodiment is shown in the figure.

[0030] Figure 4 The gray scale value discrete model graph of the gray scale gradient direction in one specific embodiment is shown in the figure. DETAILED DESCRIPTION

[0031] In order to make the technical means, creative features, purposes and effects achieved by the present application easy to understand, the following further describes how the present application is implemented in combination with the drawings and specific embodiments.

[0032] Referring to Figure 1 The present application provides a two-dimensional size measurement algorithm based on a non-telecentric system, which comprises the following steps:

[0033] S1, taking an image of the part to be measured;

[0034] S2, performing distortion correction processing and preprocessing on the image taken in step S1;

[0035] S3, performing edge extraction on the image processed in step S2, and specifically comprising the following steps:

[0036] S3a, first, extract the image edge at the pixel level to obtain corresponding edge coordinate data;

[0037] S3b, then, use the integral median algorithm to process the edge coordinate data obtained in step S3a to extract edge coordinate data at the sub-pixel level;

[0038] S3c, next, edge connection is performed by a linking algorithm, and the edge sub-pixel contour points are connected by using the edge coordinate data extracted in step S3b;

[0039] S3d, finally, the least square method is used to fit the result after edge connection in step S3c, so as to fit the edge as several straight lines, and obtain the fitted sub-pixel edge;

[0040] S4, the sub-pixel edge obtained in step S3d is subjected to size measurement.

[0041] Preferably, in step S1, when taking the image of the part to be measured, a calibration plate with different poses is also placed in the field of view of the camera lens; in step S2, when the image is subjected to distortion correction processing, the Halcon calibration method is used to correct the distortion of the image.

[0042] In the present application, after calibration using the Halcon calibration method, the intrinsic parameters of the camera and the pose parameters of the image can be obtained, the radial distortion can be eliminated by the intrinsic parameters, and the pose of the image can be mapped to the standard measurement plane by the pose parameters, so as to eliminate the tangential distortion, and finally the image is converted from the pixel coordinate system to the world coordinate system, so that the image processing can be directly performed.

[0043] Preferably, in step S2, when the image is preprocessed, the image is subjected to multi-frame fusion, image contrast enhancement and Gaussian filtering processing. Through the preprocessing step, the image edge detection is more accurate, and the influence of Gaussian noise points is effectively eliminated.

[0044] Preferably, in step S3a, the Sobel algorithm is used to extract the pixel-level image edge. The pixel-level image edge obtained is "sawtooth-shaped", and the edge transition is extremely not smooth. In the application of visual measurement, the error value brought by the edge cannot be ignored. Therefore, in order to obtain more accurate and smoother edge, sub-pixel edge extraction is performed on the basis of the edge in the present application.

[0045] Preferably, in step S3b, the step of processing the edge coordinate data obtained in step S3a using the integral median algorithm specifically includes:

[0046] For any pixel-level image edge point, the integral median corresponding to the coordinate value is taken as the sub-pixel edge coordinate data according to the gradient direction of the gray value of the pixel-level image edge point; the above steps are repeated to extract all the sub-pixel edge coordinate data.

[0047] Preferably, in step S3c, before the edge connection, the sub-pixel edge coordinate data extracted in step S3b is subjected to smoothing filtering processing to remove the noise points in the data.

[0048] In one embodiment, in step S3b, for any one pixel-level edge point coordinate obtained from the Sobel algorithm, a simulated gray scale distribution curve is obtained along the direction of its gray scale gradient, as shown in Figure 3 The horizontal coordinate is the coordinate value of the pixel point, and the vertical coordinate is the gray scale value corresponding to the pixel point.

[0049] Figure 3 In the formula, x1 is the coordinate position of the pixel-level edge point. As can be seen, in the direction of the gray scale gradient, the gray scale value increases from low to high. The x0 to x4 range around x1 is integrated. It is assumed that the best sub-pixel edge position is reached at position x2, and the vertical coordinate corresponding to x2 is y2. It can be equivalently understood that the integral area of the gray scale value from the x0 position to the x4 position is equal to the area of a rectangle with a length from the x0 position to the x4 position and a width y2. The mathematical model satisfies the integral mean value theorem, and therefore, the above-mentioned x2 must exist. As described above, the integral area of the gray scale value from the x0 position to the x4 position is equal to the area of the above-mentioned rectangle, that is, the integral mean value y2 is equal to the integral area divided by the length from the x0 position to the x4 position. Therefore, as long as a number of points on the edge gray scale gradient are selected for integration equivalence, the integral area is calculated, and then the integral mean value y2 can be calculated.

[0050] For digital image processing, it is necessary to convert from an analog model to a discrete model, and therefore, as shown in Figure 4 , the horizontal coordinate represents the coordinate value of the pixel point, and the vertical coordinate represents the gray scale value of the pixel point. Figure 3 Figure 4 In the formula, x1 also represents the coordinate position of the pixel-level edge point, x2 is the best sub-pixel edge position, and x3 is the coordinate of the next pixel point of x1.

[0051] In the triangle ABC in Figure 4 , there are:

[0052]

[0053] Since x3 is the coordinate of the next pixel point of x1, x3-x1 is a unit pixel. The value of y2 has been calculated, y1 and y3 are the gray scale values corresponding to x1 and x3, respectively, and are known values. Therefore, it is inherent that:

[0054]

[0055]

[0056] Therefore, the sub-pixel position coordinate x2 corresponding to the integral mean value y2 can be obtained.

[0057] ​In the algorithm provided by the present application, each edge point of the pixel-level edge is a pixel point, when sub-pixel edge detection is performed, the entire picture does not need to be calculated, only integral calculation in the direction of the pixel-level edge point gray gradient is needed, so that the calculation efficiency and accuracy are improved.

[0058] In the prior art, common sub-pixel edge detection algorithms include Zernike moments and gray moments. The principle of sub-pixel edge detection of the Zernike moments is to calculate four edge parameters by using the rotation invariant characteristic of the Zernike moments, and compare the four edge parameters with an artificially set step threshold value, so as to accurately locate the image edge. The gray moment sub-pixel edge detection method refers to edge detection of an image according to the gray moment invariance principle, that is, assuming that the gray moment of the edge distribution in the actual image and the ideal step edge model is consistent, the consistency is used to locate the sub-pixel edge. However, these existing sub-pixel edge detection algorithms have good accuracy for detecting pixel edges of industrial parts, but through experimental comparison, it is found that the above algorithms will affect the industrial manufacturing efficiency due to high time consumption.

[0059] Compared with other sub-pixel detection algorithms, the algorithm provided by the present application not only has high measurement accuracy, but also can greatly improve the calculation efficiency. Therefore, from the perspective of industrial application, the scheme of adopting the Sobel algorithm combined with the integral median method in the present application has higher "performance price ratio" and can better meet the general industrial measurement needs.

[0060] In addition, in step S4, when the size measurement is performed, each edge of the sub-pixel edge can be fitted respectively, the vertices of the edges intersecting with adjacent edges are solved, and finally all sizes of the measured part are obtained by a preset formula, such as the length of each edge of the part, the angle between two adjacent edges, the distance between points, the distance between a point and an arc, the distance between edges, etc.

[0061] Taking a regular rectangular measured part as an example, the image is first positioned "coarsely" by the pixel-level edge detection algorithm, so when the "coarse" edge of the image is positioned, the edge can be calculated separately, divided into four edges of upper, lower, left and right, and then the sub-pixel coordinates of the four edges are solved. In this way, the operation amount is reduced, and when the linking algorithm is performed, it is relatively simple to sequentially link the four sub-pixel edges from top to bottom or from left to right.

[0062] Finally, the least square method is used to fit the sub-pixel edge into four straight lines, and the two-dimensional size of the target object can be obtained.

[0063] Reference Figure 2As shown, another aspect of the present application provides a two-dimensional size measurement device based on a non-telecentric system, which uses the above-mentioned two-dimensional size measurement algorithm based on a non-telecentric system to realize two-dimensional size measurement of a measured part 5, and comprises an industrial computer 1, a camera 2, a spherical integral light source 3, a support 4, a bottom backlight 6 and a stage 7.

[0064] The support 4 and the bottom backlight 6 are both mounted on the stage 7; the spherical integral light source 3 is mounted on the support, and the bottom of the spherical integral light source 3 is opposite to the bottom backlight 6; the camera 2 is mounted in the middle of the spherical integral light source 3, and the camera 2 is electrically connected with the industrial computer 1 (the camera 2 can be electrically connected with the industrial computer 1 through a hub 8), so as to transmit image data to the industrial computer 1 for processing; in working, the measured part 5 is placed on the stage 7, and is located in the middle of the bottom backlight 6.

[0065] In use, the measured part 5 is first placed in the middle of the stage 7, the light is taken in the way of combination of the bottom backlight 6 and the spherical integral light source 3, the image of the measured part 5 is taken, and then the image information is transmitted to the industrial computer 1, and the above-mentioned two-dimensional size measurement algorithm based on a non-telecentric system is used for processing.

[0066] In summary, the two-dimensional size measurement algorithm and device based on a non-telecentric system provided by the present application solve the problems of low precision and low efficiency in two-dimensional size measurement of small and regular-shaped parts, are suitable for measurement occasions with high precision requirements, and further realize efficient measurement; and the non-telecentric lens is used, which reduces the industrial cost and provides a new idea for industrial measurement.

[0067] Finally, it should be pointed out that the above embodiments are only used to illustrate the technical solutions of the present application but not limit the present application, although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present application can be modified or replaced equivalently without departing from the purpose and scope of the present application, and all of them should be covered in the scope of the claims of the present application.

Claims

1. A two-dimensional dimensional measurement algorithm based on a non-telecentric system, characterized in that, The method comprises the following steps: S1, taking an image of the part to be measured; S2, performing distortion correction processing and preprocessing on the image taken in step S1; S3, performing edge extraction on the image processed in step S2, and specifically comprising the following steps: S3a, first, extract the pixel-level image edge to obtain the corresponding edge coordinate data; S3b, then, use the integral median algorithm to process the edge coordinate data obtained in step S3a to extract the sub-pixel level edge coordinate data; S3c, next, perform edge connection through a linking algorithm, and connect the edge sub-pixel contour points using the sub-pixel level edge coordinate data extracted in step S3b; S3d, finally, use the least squares method to fit the result of the edge connection in step S3c to fit the edge into several straight lines to obtain the fitted sub-pixel level edge; S4, performing size measurement on the sub-pixel level edge obtained in step S3d; In step S3a, the Sobel algorithm is used to extract the pixel-level image edge; The step of using the integral median algorithm to process the edge coordinate data obtained in step S3a in step S3b specifically comprises: For any pixel-level image edge point, integrate according to the gradient direction of its gray value, and take the coordinate value corresponding to the integral median as its sub-pixel level edge coordinate data; Repeat the above steps to extract all sub-pixel level edge coordinate data.

2. The non-telecentric system based two-dimensional dimensional measurement algorithm according to claim 1, characterized in that, In step S1, when taking the image of the part to be measured, different pose calibration boards are placed in the field of view of the camera lens; in step S2, when performing distortion correction processing on the image, the Halcon calibration method is used to correct the distortion of the image.

3. The non-telecentric system based two-dimensional dimensional measurement algorithm according to claim 1, wherein, In step S2, when preprocessing the image, the image is specifically subjected to multi-frame fusion, image contrast enhancement, and Gaussian filter processing.

4. The non-telecentric system based two-dimensional dimensional measurement algorithm of claim 1, wherein, In step S3c, before performing edge connection, the sub-pixel level edge coordinate data extracted in step S3b is subjected to smoothing filter processing to remove noise points in the data.

5. A two-dimensional size measurement device based on a non-telecentric system, characterized in that The two-dimensional size measurement of the part to be measured (5) is realized by using the two-dimensional size measurement algorithm based on the non-telecentric system according to any one of claims 1-4, and comprises an industrial computer (1), a camera (2), a spherical integral light source (3), a support (4), a bottom backlight source (6), and a stage (7); The support (4) and the bottom backlight source (6) are both mounted on the stage (7); The spherical integral light source (3) is mounted on the support, and the bottom of the spherical integral light source (3) is opposite to the bottom backlight source (6); The camera (2) is mounted in the middle of the spherical integral light source (3), and the camera (2) is electrically connected with the industrial computer (1), so that image data can be transmitted to the industrial computer (1) for processing; When working, the part to be measured (5) is placed on the stage (7) and located in the middle of the bottom backlight source (6).

Citation Information

Patent Citations

  • CCD (Charge Coupled Device)-based high-accuracy measuring method

    CN103499297A

  • Plane part size measurement method based on sub-pixel edge algorithm

    CN104359403A