Measuring and leveling method for telecentric vision system
By performing platform rough adjustment, image acquisition and elliptical fitting in the telecentric vision system, combined with leveling bolt adjustment, the measurement problem caused by the non-parallelity of the camera target surface and the image surface is solved, and efficient and accurate leveling is achieved. Projection measurement in machine vision.
Patent Information
- Application Number
- CN202410980874.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-08
AI Technical Summary
In the telecentric vision system, the camera target surface is not parallel to the image surface, resulting in a difference in the measurement results and the real value, making it difficult to obtain high-quality images and effective measurement results.
Through platform rough adjustment, standard block placement, image acquisition, preprocessing, image profile feature extraction, elliptical fitting and leveling bolt adjustment, parallel adjustment of the camera target surface and image surface can be realized, and the rotation required for leveling bolts is monitored and displayed in real time. Number of circles.
It improves leveling efficiency and accuracy, and can quickly adjust the camera target surface and image surface parallel. It does not require other measurement instruments. It is suitable for projection measurement in machine vision, improving the accuracy of the measurement system.
Smart Images

Figure CN118913633A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of machine vision measurement, and in particular to a telecentric vision system measurement and leveling method. Background Art
[0002] Machine vision is a rapidly developing branch of artificial intelligence, which uses machines to replace human eyes in production activities. It is an indispensable technical support in industrial production. Machine vision products are used to obtain images with target objects and transmit them to a dedicated image processing system to calculate the pixel distribution, brightness, color and other information of the target object in the image, obtain the target object features, and then control the device posture.
[0003] Projection measurement is an important development direction of machine vision. Usually, a telecentric lens and a camera are used to form a telecentric vision system to collect part images. Such as plane dimension measurement of test pieces, two-dimensional digital image correlation measurement, etc. In order to improve the detection accuracy of the telecentric vision system, when arranging the camera, the camera target surface and the image surface should be made as parallel as possible to obtain the accurate pixel size of the feature to be measured. If there is an angle between the camera target surface and the image surface, it is impossible to obtain a high-quality image, which makes the system development difficulty soar, and even the measurement system cannot obtain effective measurement results. Summary of the invention
[0004] The purpose of the present invention is to provide a telecentric vision system measurement and leveling method which can quickly measure the relative relationship between a camera target surface and an image surface and can perform real-time adjustment feedback according to the measurement results.
[0005] The present invention is implemented by the following technical solution: A telecentric vision system measurement and leveling method comprises the following steps:
[0006] (1) Roughly adjust the platform to initially make the image plane parallel to the camera target surface;
[0007] (2) Standard block placement: Place the dedicated standard block on the image plane and confirm that the standard block is within the field of view of the Yuanxin vision system;
[0008] (3) Image acquisition: the host computer controls the telecentric vision system camera to acquire images containing standard blocks;
[0009] (4) Preprocessing the collected images;
[0010] (5) Extracting image contour features from the preprocessed image;
[0011] (6) performing ellipse fitting on the extracted image contour to obtain the lengths of the major axis and the minor axis of the ellipse;
[0012] (7) determining whether the image plane is parallel to the target plane of the telecentric vision system camera based on the difference between the major axis and the minor axis of the acquired ellipse;
[0013] (8) According to the angle between the minor axis of the ellipse and the x-axis of the pixel coordinate system and the length of the major axis, the height of the target surface of the telecentric vision system camera is adjusted by adjusting the leveling bolts;
[0014] (9) Repeat the process from step (3) to step (8) until the target surface of the telecentric vision system camera is parallel to the image plane.
[0015] In order to better implement the method of the present invention, further, in the step (1), the coarse adjustment process of making the image plane parallel to the camera target plane is to make the line of sight perpendicular to the optical axis of the telecentric vision system and rotate the leveling bolt to achieve the coarse adjustment process of making the image plane parallel to the camera target plane.
[0016] In order to better implement the method of the present invention, further, in step (2), the outline shape of the standard block is circular, the diameter of the standard block is one tenth of the short side of the field of view of the telecentric vision system, the color of the standard block is different from the image surface background color and has a certain contrast, and the upper surface of the standard block is parallel to the lower surface.
[0017] In order to better implement the method of the present invention, further, in the step (4), the process of image preprocessing includes grayscale contrast and filtering and denoising of the collected image.
[0018] In order to better implement the method of the present invention, further, in the step (5), the specific process of extracting image contour features from the preprocessed image is as follows:
[0019] (5.1) Obtain the segmentation threshold, that is, divide the pixel value (0,1) into 256 bins, obtain the image histogram, and record the top three pixel values as a, b, and c, where a>b>c;
[0020] (5.2) Taking b as the threshold, the image is binarized to obtain a binary image SRC_N, and taking c as the threshold, the image is binarized to obtain a binary image SRC_W, where the width of the image is w and the height is h;
[0021] (5.3) Extract the contour points of the binary images SRC_N and SRC_W, denoted as point set B and point set C respectively.
[0022] In order to better implement the method of the present invention, further, in the step (5.2), the process of binarizing the image with b as the threshold to obtain the binary image SRC_N is as follows: when the pixel value of the pixel point (u, v) is greater than b, the pixel value of the pixel point (u, v) is set to 1; when the pixel value of the pixel point (u, v) is less than or equal to b, the pixel value of the pixel point (u, v) is set to 0, and the binary image SRC_N is obtained;
[0023] Taking c as the threshold, the process of binarizing the image to obtain the binary image SRC_W is as follows: when the pixel value of the pixel point (u, v) is greater than c, the pixel value of the pixel point (u, v) is set to 1; when the pixel value of the pixel point (u, v) is less than or equal to c, the pixel value of the pixel point (u, v) is set to 0, and the binary image SRC_W is obtained.
[0024] In order to better implement the method of the present invention, further, the specific process of determining whether the image plane of the image is parallel to the camera target plane based on the difference between the major axis and the minor axis of the ellipse in step (7) is as follows: if the difference between the major axis and the minor axis of the ellipse is zero, then it is determined that the image plane of the image is parallel to the camera target plane; if the difference between the major axis and the minor axis of the ellipse is not zero, then it is determined that the image plane of the image is not parallel to the camera target plane, and the process proceeds to step (8) to adjust the height of the camera target plane of the telecentric vision system.
[0025] In order to better implement the method of the present invention, further, in the step (8), the specific process of adjusting the height of the target surface of the telecentric vision system camera is as follows:
[0026] (8.1) Determine the lowest leveling bolt: Create a blank image with a width of w and a height of h, draw point sets B and C in the image coordinate system, draw a straight line L through the coordinates of point P parallel to the minor axis of the ellipse, fit the curve S formed by point sets B and C using the least squares method, and find the intersection points Q1(u1, v1), Q2(u2, v2), and Q3(u3, v3) of L and S, and take the diagonal line with the same slope sign as the slope of the straight line L. The bolt in the direction of ray Q2Qx is the lowest leveling bolt, where x is 1 or 3. When x=1, Q2Q1>Q2Q3, and when x=3, Q2Q1<Q2Q3;
[0027] (8.2) Angle adjustment: raise the lowest leveling bolt until the angle between the minor axis of the fitted ellipse and the u-axis of the pixel coordinate system is 0 degrees or 90 degrees;
[0028] (8.3) Perform height adjustment. When the angle formed by the minor axis of the fitting ellipse and the u axis of the pixel coordinate system is 0, if u decreases along the direction of ray Q2Qx, the two leveling bolts of u=0 are raised at the same time; if it increases, the two leveling bolts of u≠0 are raised at the same time; when the angle formed by the minor axis of the fitting ellipse and the u axis of the pixel coordinate system is 90 degrees, if v increases along the direction of ray Q2Qx, the two leveling bolts of v≠0 are raised at the same time; if it decreases, the two leveling bolts of v=0 are lowered at the same time. The height is adjusted to H=n×t / m, where x is 1 or 3. When x=1, Q2Q1>Q2Q3, when x=3, Q2Q1<Q2Q3, m is the length of the major axis of the fitting ellipse, n is the length of the minor axis of the fitting ellipse, and t is the axial distance of the leveling bolts.
[0029] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0030] (1) The present invention aims to solve the problem that the image plane and the camera target plane in the telecentric vision system are not parallel, resulting in a difference between the measurement result and the true value. The present invention provides a telecentric vision system measurement and leveling method, which can quickly measure the relative relationship between the camera target plane and the image plane, and can perform real-time adjustment feedback according to the measurement result.
[0031] (2) When the method provided by the present invention is used to level the measuring frame platform, a camera can be used for real-time monitoring, and the number of rotations required for the corresponding leveling bolts can be displayed on the camera screen, which can greatly improve the leveling efficiency, thereby achieving a technical effect of fast leveling speed and high efficiency;
[0032] (3) The method provided by the present invention can perform parallel adjustment of the image plane and the target plane of the telecentric vision system without the aid of other measuring instruments, and has high adjustment accuracy. It has a positive promoting effect on the projection measurement of machine vision and is suitable for wide promotion and application. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments with reference to the following drawings:
[0034] Figure 1 is a flow chart of the method of the present invention;
[0035] Figure 2 A schematic diagram of image acquisition in the present invention;
[0036] Figure 3 is a schematic diagram of a binary image SRC_N obtained in the present invention;
[0037] Figure 4 is a schematic diagram of a binary image SRC_W obtained in the present invention;
[0038] Figure 5Schematic diagram of drawing point set B and point set C in the present invention. DETAILED DESCRIPTION
[0039] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0040] In order to make the purpose, process conditions and advantages of the present invention more clearly understood, the present invention is further described in detail in conjunction with the following embodiments, but the embodiments of the present invention are not limited thereto. Without departing from the above-mentioned technical ideas of the present invention, various substitutions and changes are made according to the common technical knowledge and customary means in the field, which should all be included in the scope of the present invention. The specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0041] Embodiment 1:
[0042] This embodiment provides a telecentric vision system measurement and leveling method. The specific process is as follows: Figure 1 As shown, the following steps are included:
[0043] (1) Roughly adjust the platform to initially make the image plane parallel to the camera target surface;
[0044] (2) Standard block placement: Place the dedicated standard block on the image plane and confirm that the standard block is within the field of view of the telecentric vision system; the outline of the standard block is circular, the diameter of the standard block is one tenth of the short side of the field of view of the telecentric vision system, the color of the standard block is different from the background color of the image plane and has a certain contrast, and the upper surface of the standard block is parallel to the lower surface;
[0045] (3) Image acquisition: The host computer controls the telecentric vision system camera to acquire images containing standard blocks. The acquired images are as follows: Figure 2 As shown;
[0046] (4) Preprocessing the collected images;
[0047] (5) Extracting image contour features from the preprocessed image;
[0048] (6) performing ellipse fitting on the extracted image contour to obtain the lengths of the major axis and the minor axis of the ellipse;
[0049] (7) determining whether the image plane is parallel to the target plane of the telecentric vision system camera based on the difference between the major axis and the minor axis of the acquired ellipse;
[0050] (8) According to the angle between the minor axis of the ellipse and the x-axis of the pixel coordinate system and the length of the major axis, the height of the target surface of the telecentric vision system camera is adjusted by adjusting the leveling bolts;
[0051] (9) Repeat the process from step (3) to step (8) until the target surface of the telecentric vision system camera is parallel to the image plane.
[0052] Embodiment 2:
[0053] Based on the above embodiment, this embodiment further defines the coarse adjustment process of making the image plane parallel to the camera target plane in step (1) as making the line of sight perpendicular to the optical axis of the telecentric vision system and rotating the leveling bolt to achieve the coarse adjustment process of making the image plane parallel to the camera target plane. The other parts of this embodiment are the same as the above embodiment and will not be repeated.
[0054] Embodiment 3:
[0055] Based on the above embodiment, this embodiment further defines that in step (4), the process of image preprocessing includes grayscale contrast and filtering and denoising the collected image. The preprocessing process is mainly to reduce the adverse effects of dust, ambient light, etc. The other parts of this embodiment are the same as the above embodiment and will not be repeated.
[0056] Embodiment 4:
[0057] Based on the above embodiment, this embodiment further defines the specific process of extracting image contour features from the preprocessed image in step (5) as follows:
[0058] (5.1) Obtain the segmentation threshold, that is, divide the pixel value (0,1) into 256 bins, obtain the image histogram, and record the top three pixel values as a, b, and c, where a>b>c;
[0059] (5.2) Taking b as the threshold, the image is binarized to obtain a binary image SRC_N, and taking c as the threshold, the image is binarized to obtain a binary image SRC_W, where the width of the image is w and the height is h;
[0060] (5.3) Extract the contour points of the binary images SRC_N and SRC_W, and record them as point set B and point set C respectively. The other parts of this embodiment are the same as those of the above embodiment and will not be described in detail.
[0061] Embodiment 5:
[0062] On the basis of the above embodiment, this embodiment further defines the process of binarizing the image to obtain the binary image SRC_N in step (5.2) with b as the threshold value, as follows: when the pixel value of the pixel point (u, v) is greater than b, the pixel value of the pixel point (u, v) is set to 1; when the pixel value of the pixel point (u, v) is less than or equal to b, the pixel value of the pixel point (u, v) is set to 0, and the binary image SRC_N is obtained, as shown in FIG. Figure 3 As shown;
[0063] Taking c as the threshold, the process of binarizing the image to obtain the binary image SRC_W is as follows: when the pixel value of the pixel point (u, v) is greater than c, the pixel value of the pixel point (u, v) is set to 1; when the pixel value of the pixel point (u, v) is less than or equal to c, the pixel value of the pixel point (u, v) is set to 0, and the binary image SRC_W is obtained, as shown in Figure 4 The other parts of this embodiment are the same as those of the above embodiment and will not be described in detail.
[0064] Embodiment 6:
[0065] On the basis of the above-mentioned embodiment, the present embodiment further defines the specific process of determining whether the image plane of the image is parallel to the camera target plane according to the difference between the major axis and the minor axis of the ellipse in step (7): if the difference between the major axis and the minor axis of the ellipse is zero, the image plane of the image is determined to be parallel to the camera target plane; if the difference between the major axis and the minor axis of the ellipse is not zero, the image plane of the image is determined to be not parallel to the camera target plane. That is, if |mn|=0 holds, the image plane is determined to be parallel to the camera target plane; if |mn|=0 does not hold, step (8) is performed to adjust the height of the camera target plane of the telecentric vision system. m is the length of the major axis of the fitted ellipse, and n is the length of the minor axis of the fitted ellipse. The other parts of the present embodiment are the same as the above-mentioned embodiment and will not be repeated.
[0066] Embodiment 7:
[0067] Based on the above embodiment, this embodiment further defines that in step (8), the specific process of adjusting the height of the target surface of the telecentric vision system camera is as follows:
[0068] (8.1) Determine the lowest leveling bolt: Create a blank image with a width of w and a height of h, draw point sets B and C in the image coordinate system, draw a straight line L through the coordinates of point P parallel to the minor axis of the ellipse, and fit the curve S formed by point sets B and C using the least squares method, as shown in Figure 5 As shown, the intersection points Q1(u1, v1), Q2(u2, v2), Q3(u3, v3) of L and S are obtained, and they are located on the diagonal line with the same slope sign as the straight line L. The bolt in the direction of the ray Q2Qx is the lowest leveling bolt, where x is 1 or 3. When x=1, Q2Q1>Q2Q3, and when x=3, Q2Q1<Q2Q3;
[0069] (8.2) Angle adjustment: raise the lowest leveling bolt until the angle between the minor axis of the fitted ellipse and the u-axis of the pixel coordinate system is 0 degrees or 90 degrees;
[0070] (8.3) Perform height adjustment. When the angle formed by the minor axis of the fitting ellipse and the u axis of the pixel coordinate system is 0, if u decreases along the ray Q2Qx direction, the two leveling bolts of u=0 are raised at the same time, and if u increases, the two leveling bolts of u≠0 are raised at the same time; when the angle formed by the minor axis of the fitting ellipse and the u axis of the pixel coordinate system is 90 degrees, if v increases along the ray Q2Qx direction, the two leveling bolts of v≠0 are raised at the same time, and if v decreases, the two leveling bolts of v=0 are lowered at the same time, and the height is adjusted to H=n×t / m, where x is 1 or 3, when x=1, Q2Q1>Q2Q3, when x=3, Q2Q1<Q2Q3, m is the length of the major axis of the fitting ellipse, n is the length of the minor axis of the fitting ellipse, and t is the axial distance of the leveling bolts. The other parts of this embodiment are the same as the above embodiment and will not be repeated.
[0071] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A telecentric vision system measurement and leveling method, It is characterized in that The following steps are involved: (1) Roughly adjust the platform to initially make the image plane parallel to the camera target surface; (2) Standard block placement: Place the dedicated standard block on the image plane and confirm that the standard block is within the field of view of the Yuanxin vision system; (3) Image acquisition: the host computer controls the telecentric vision system camera to acquire images containing standard blocks; (4) Preprocessing the collected images; (5) Extracting image contour features from the preprocessed image; (6) performing ellipse fitting on the extracted image contour to obtain the lengths of the major axis and the minor axis of the ellipse; (7) determining whether the image plane is parallel to the target plane of the telecentric vision system camera based on the difference between the major axis and the minor axis of the acquired ellipse; (8) According to the angle between the minor axis of the ellipse and the x-axis of the pixel coordinate system and the length of the major axis, the height of the target surface of the telecentric vision system camera is adjusted by adjusting the leveling bolts; (9) Repeat the process from step (3) to step (8) until the target surface of the telecentric vision system camera is parallel to the image plane.
2. A telecentric vision system measurement and leveling method according to claim 1, It is characterized in that In the step (1), the coarse adjustment process of making the image plane parallel to the camera target plane is to make the line of sight perpendicular to the optical axis of the telecentric vision system and rotate the leveling bolt to achieve the coarse adjustment process of making the image plane parallel to the camera target plane.
3. A telecentric vision system measurement and leveling method according to claim 1 or 2, It is characterized in that In step (2), the outline shape of the standard block is circular, the diameter of the standard block is one tenth of the short side of the field of view of the telecentric vision system, the color of the standard block is different from the background color of the image plane and has a certain contrast, and the upper surface of the standard block is parallel to the lower surface.
4. A telecentric vision system measurement and leveling method according to claim 1 or 2, It is characterized in that In the step (4), the image preprocessing process includes grayscale contrast and filtering and denoising of the collected image.
5. A telecentric vision system measurement and leveling method according to claim 1 or 2, It is characterized in that In step (5), the specific process of extracting image contour features from the preprocessed image is as follows: (5.1) Obtain the segmentation threshold, that is, divide the pixel value (0,1) into 256 bins, obtain the image histogram, and record the top three pixel values as a, b, and c, where a>b>c; (5.2) Taking b as the threshold, the image is binarized to obtain a binary image SRC_N, and taking c as the threshold, the image is binarized to obtain a binary image SRC_W, where the width of the image is w and the height is h; (5.3) Extract the contour points of the binary images SRC_N and SRC_W, denoted as point set B and point set C respectively.
6. A telecentric vision system measurement and leveling method according to claim 5, It is characterized in that In the step (5.2), the process of binarizing the image with b as the threshold to obtain the binary image SRC_N is as follows: when the pixel value of the pixel point (u, v) is greater than b, the pixel value of the pixel point (u, v) is set to 1; when the pixel value of the pixel point (u, v) is less than or equal to b, the pixel value of the pixel point (u, v) is set to 0, and the binary image SRC_N is obtained; Taking c as the threshold, the process of binarizing the image to obtain the binary image SRC_W is as follows: when the pixel value of the pixel point (u, v) is greater than c, the pixel value of the pixel point (u, v) is set to 1; when the pixel value of the pixel point (u, v) is less than or equal to c, the pixel value of the pixel point (u, v) is set to 0, and the binary image SRC_W is obtained.
7. A telecentric vision system measurement and leveling method according to claim 1 or 2, It is characterized in that The specific process of determining whether the image plane of the image is parallel to the camera target plane based on the difference between the major axis and the minor axis of the ellipse in step (7) is as follows: if the difference between the major axis and the minor axis of the ellipse is zero, then the image plane of the image is determined to be parallel to the camera target plane; if the difference between the major axis and the minor axis of the ellipse is not zero, then the image plane of the image is determined to be not parallel to the camera target plane, and the process proceeds to step (8) to adjust the height of the camera target plane of the telecentric vision system.
8. A telecentric vision system measurement and leveling method according to claim 5, It is characterized in that In the step (8), the specific process of adjusting the height of the target surface of the telecentric vision system camera is as follows: (8.1) Determine the lowest leveling bolt: Create a blank image with a width of w and a height of h, draw point sets B and C in the image coordinate system, draw a straight line L through the coordinates of point P parallel to the minor axis of the ellipse, fit the curve S formed by point sets B and C using the least squares method, and find the intersection points Q1(u1, v1), Q2(u2, v2), and Q3(u3, v3) of L and S, and take the diagonal line with the same slope sign as the slope of the straight line L. The bolt in the direction of ray Q2Qx is the lowest leveling bolt, where x is 1 or 3. When x=1, Q2Q1>Q2Q3, and when x=3, Q2Q1<Q2Q3; (8.2) Angle adjustment: raise the lowest leveling bolt until the angle between the minor axis of the fitted ellipse and the u-axis of the pixel coordinate system is 0 degrees or 90 degrees; (8.3) Perform height adjustment. When the angle formed by the minor axis of the fitting ellipse and the u axis of the pixel coordinate system is 0, if u decreases along the direction of ray Q2Qx, the two leveling bolts of u=0 are raised at the same time; if it increases, the two leveling bolts of u≠0 are raised at the same time; when the angle formed by the minor axis of the fitting ellipse and the u axis of the pixel coordinate system is 90 degrees, if v increases along the direction of ray Q2Qx, the two leveling bolts of v≠0 are raised at the same time; if it decreases, the two leveling bolts of v=0 are lowered at the same time. The height is adjusted to H=n×t / m, where x is 1 or 3. When x=1, Q2Q1>Q2Q3, when x=3, Q2Q1<Q2Q3, m is the length of the major axis of the fitting ellipse, n is the length of the minor axis of the fitting ellipse, and t is the axial distance of the leveling bolts.
