Projection deviation measuring method of industrial laser projector
By using a binocular vision system and computer analysis, the high cost and low efficiency of the cross-mark micrometer method were solved, achieving efficient and reliable projection deviation measurement and reducing the skill requirements for operators.
Patent Information
- Application Number
- CN202411053977.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-11-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods for measuring projection deviation using the cross-scale micrometer method are costly, inefficient, have low reliability, and require highly skilled operators, thus affecting measurement accuracy.
Images are acquired using a binocular vision system. Combined with Gaussian filtering, multi-target image segmentation algorithms, and adaptive target center position extraction algorithms, the three-dimensional spatial coordinates of the marker points and projection points are calculated through computer analysis. The projection deviation is solved using the camera's intrinsic and extrinsic parameters.
It reduces measurement costs, improves measurement efficiency and result reliability, reduces the difficulty of manual operation, and avoids the impact of equipment vibration and human movement.
Smart Images

Figure CN118980496A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of photogrammetry, and in particular to a method for measuring projection deviation of an industrial laser projector. Background Art
[0002] Projectors can accurately project existing CAD 3D digital models onto real objects or scenes in the form of laser contour lines, so they are widely used in high-precision manufacturing. The level of projection accuracy has a decisive influence on accurate positioning and measurement, so it is necessary to measure the projection deviation of the projector.
[0003] The existing implementation scheme is to measure the projection figure by the cross-scale micrometer method, embed the cross-scale plate in the identification point and identification line of the projection receiving surface, and use the industrial microscope system to read the scale of the cross-scale plate, so as to realize the measurement of the projection deviation. However, there are many shortcomings in the existing implementation scheme. First, the cross-scale micrometer method requires the use of an industrial microscope system to read the scale. The industrial microscope system is a high-end professional equipment. Due to its advanced technology and complex manufacturing process, it is expensive, resulting in very high measurement costs; secondly, it usually takes a long time to measure using the cross-scale micrometer method. The operator needs to repeatedly adjust the microscope and the scale plate. In this process, the accuracy of the measurement is easily affected by environmental factors or human factors, thereby affecting the reliability of the measurement results; finally, the cross-scale micrometer method requires the operator to have a high level of skills and experience. Correctly aligning the target object with the scale of the cross-scale plate requires certain skills and training, and requires high manual precision and eye observation of the operator. Lack of experience or insufficient skills may lead to an increase in measurement errors and affect the accuracy of the measurement results. Summary of the invention
[0004] 1. Technical issues to be solved
[0005] In view of the shortcomings of existing measurement methods, the present invention provides a projection deviation measurement method for an industrial laser projector, which solves the problems of high measurement cost, low measurement efficiency, low reliability of measurement results, and high demand for manual operation of the current cross-scale micrometer method.
[0006] (II) Technical solution
[0007] In order to achieve the above-mentioned purpose, the present invention specifically adopts the following technical solutions:
[0008] A method for measuring projection deviation of an industrial laser projector, the method comprising the following steps:
[0009] S1: Use a binocular vision system to simultaneously collect the mark points on the deviation measurement target and the projection point image projected onto the target by the projector;
[0010] S2: Image preprocessing: Use Gaussian filtering to smooth the image and reduce noise while retaining the overall structure and edge information of the image;
[0011] S3: Multi-target image segmentation algorithm: Based on the grayscale histogram of the image, according to the large difference in grayscale values of the landmark point, projection point, and background, iteratively searches for two thresholds, T1 and T2, between the three peaks, and achieves segmentation of the landmark point, projection point, and background based on these two thresholds;
[0012] S4: Adaptive target center position extraction algorithm: Adaptive edge extraction is performed on the segmented image based on the two thresholds T1 and T2, and the obtained edge information is ellipse fitted to calculate the center coordinates of the landmark point and the projection point in the image;
[0013] S5: Combining the internal and external parameters of the camera, the three-dimensional spatial coordinates of the marker point and the center of the projection point are solved using the collinear equation, and the projection deviation is measured by comparing the actual projection point position solved with the theoretical projection point position.
[0014] Furthermore, in S1, the binocular vision system includes:
[0015] Binocular camera: The binocular camera faces the deviation measurement target, is placed horizontally, has a baseline distance of 850 mm, and an angle of 75° between the camera optical axis and the baseline;
[0016] Camera controller: It has two high-precision synchronous square wave output signals. The synchronization deviation of the two output signals is less than 10ns. Its integrated hardware interface provides power for the binocular camera, and its Ethernet port can communicate with the computer.
[0017] Furthermore, in S1, marking points and hemispheres, etc., which are cooperative targets for detection by the binocular vision system and the projector, should be arranged on the deviation measurement target body. The number of marking points should be no less than 3, and the number of hemispheres should be no less than 4.
[0018] Furthermore, in S1, the projection point is a corresponding cooperative target on the projector detection deviation measurement target body, and after obtaining the conversion relationship between the target body coordinate system and the projector coordinate system, the projection point is projected to a designated point in the target body coordinate system according to the conversion relationship.
[0019] Furthermore, in S2, the image preprocessing method is Gaussian filtering, and the formula of the two-dimensional Gaussian function is:
[0020]
[0021] Where: σ is the standard deviation. In order to reduce noise while retaining the overall structure and edge information of the image, σ is set to 2.0.
[0022] Furthermore, in S3, the specific method of the multi-objective image segmentation algorithm is as follows:
[0023] Calculate the grayscale histogram of the image and find the two valley values on the left and right of each peak. Since the valley between peaks is too flat, two conditions are used to limit the selection of valley values: the number of pixels corresponding to the valley value should be less than a pixel number threshold V obtained by pre-statistics. T , V T =0.00025%; the difference between the number of pixels corresponding to the valley value and the adjacent gray level is greater than the pre-defined threshold ε, ε=0.0001%.
[0024] The middle value of the left peak right valley value and the right peak left valley value of the adjacent peaks is taken as one of the initial interval endpoints, and the valley value with the largest grayscale difference from the middle value is taken as the other interval endpoint. The Otsu method is applied within this interval to obtain the intermediate threshold. Next, this intermediate threshold is used to change the effective interval of the Otsu method, and it is refined by repeated iterations until the threshold no longer changes, and finally the two thresholds T1 and T2 are obtained.
[0025] The main algorithm is described as follows:
[0026] ⑴
[0027] ⑵In the interval (V 3R ,T1′) use Otsu method to obtain the threshold value T2 and record it with variables;
[0028] ⑶In the interval (T2,V 1L ) Use Otsu's method to obtain the threshold value T1 and record it with variables. The termination condition is that T1 and T2 no longer change. If the termination condition is not met, go to (2), otherwise exit.
[0029] Where V represents the valley value, subscripts 1, 2, and 3 represent the corresponding peaks, L and R represent left and right, T1 and T2 represent the obtained thresholds, and T1′ represents the threshold obtained in the intermediate step. Image segmentation is performed based on these two thresholds to achieve the segmentation of landmark points, projection points, and background images.
[0030] Further, in said S4, the adaptive target center position extraction algorithm includes: adaptive edge extraction algorithm, least squares ellipse fitting method, grayscale square weighted centroid method;
[0031] The segmented image is subjected to adaptive edge extraction using the Canny operator, and the high threshold value of the operator is adjusted by combining the obtained T1 and T2 thresholds to achieve adaptive edge extraction. The obtained edge information is calculated using the least squares ellipse fitting method and the grayscale square weighted centroid method to obtain the center coordinates of the landmark points and projection points in the image.
[0032] Further, in the step S4, the specific method included in the adaptive edge extraction algorithm is as follows:
[0033] The Canny operator performs a differential operation on the image to obtain a gradient map, then uses the non-maximum suppression algorithm to find the possible edge points in the image, and finally recursively finds the edge points of the image through double threshold values. The recursive tracking process is controlled by two thresholds, denoted as h1 and h2 respectively, and h1 < h2. The tracking process only starts when the value of the current pixel point is greater than h2, and the tracking is carried out in two directions of the pixel point neighborhood until the value of the corresponding pixel position is lower than the threshold h1. Usually, h1 is 0.5 times of h2. Combining the two thresholds T1 and T2 obtained, using T1 and T2 as the high threshold value selection for the edge extraction of the marker point and the projection point respectively, the image is adaptively edge-extracted.
[0034] Further, in the step S4, the specific method included in the least squares ellipse fitting method is as follows:
[0035] The general equation of a planar ellipse is:
[0036] x 2 + 2Bxy + Cy 2 + 2Dx + 2Ey + F = 0
[0037] When there are many edge points, according to the least squares principle, the fitting objective function is:
[0038]
[0039] Taking partial derivatives of the above formula with respect to B, C, D, E, and F respectively, and setting each sub-formula to zero, a system of equations containing 5 equations and 5 unknowns can be obtained. Using methods such as matrix inversion or Gaussian column main element elimination, the 5 coefficient parameters B, C, D, E, and F of the ellipse equation can be obtained. The calculation formula for the ellipse center coordinates (x0, y0) is as follows:
[0040]
[0041] Since the light intensity of the projection point is relatively large, it will have a certain impact on the high-precision center extraction of the marker point. Therefore, a second fitting of the edge is performed: after the first fitting, the residual of each edge point is calculated, and the points with a relatively large residual of 3% are removed, and then a second ellipse fitting is performed on the remaining points to calculate the ellipse center coordinates.
[0042] Further, in the step S4, the specific method included in the gray square weighted centroid method is as follows:
[0043] Taking the gray value of the pixel as the weight, squaring the weight value of the gray, and calculating the weighted average value of all pixel coordinates in the projection point image. The calculation formula is:
[0044]
[0045] Where (x0, y0) is the center coordinate of the projection point; W i,j is the weight, that is, the gray value of pixel (i, j); S is the image area of the projection point.
[0046] Furthermore, in S5, the specific method for solving the three-dimensional space coordinates of the center point is:
[0047] Assume that the image space coordinate system O-xyz of the left camera coincides with the object coordinate system, the image plane coordinate system is O-X1Y1, the effective focal length is f1, and the image space coordinate system O of the right camera is r -x r y r z r , the image plane coordinate system is O2-X r Y r , the effective focal length is f r Assume that the coordinates of the object point P in O-xyz are (X, Y, Z), the coordinates of the corresponding image point p in the left photo in O-xyz are (x, y, -f1), and the coordinates of the corresponding image point p in the right photo are (x, y, -f1). r In O r -x r y r z r The coordinates in (x r ,y r ,-f r ).
[0048] From the collinear equation we can get:
[0049]
[0050] From the calibrated internal and external parameters of the camera, we can know are O-xyz coordinate system and O r -x r y r z r The rotation matrix and translation matrix between the coordinate systems are:
[0051]
[0052] Combining the two formulas, we can get the three-dimensional space coordinates of the center point.
[0053] Furthermore, in S5, the specific method of calculating the projection deviation includes:
[0054] When the binocular vision system detects the marker points on the deviation measurement target and solves the coordinate system conversion relationship, the coordinate information of the marker points used comes from the target coordinate system, so the actual target reference coordinate system detected is consistent with the theoretical target coordinate system. After establishing the conversion relationship between the target coordinate system and the binocular coordinate system, the projection point measurement result is converted to the target coordinate system, and the projection deviation is measured by calculating the difference between the actual projection point coordinates and the theoretical projection point coordinates.
[0055] Furthermore, in S1, the surface color of the deviation measurement target body can be selected to be black, and the gray level of the black background is greatly different from the gray levels of the marker points and the projection points, so as to improve the accuracy of multi-target image segmentation.
[0056] (III) Beneficial effects
[0057] Compared with the prior art, the present invention provides a method for measuring projection deviation of an industrial laser projector, which has the following beneficial effects:
[0058] The present invention realizes co-detection of the mark points attached to the deviation measurement target body and the projection points projected onto the target body by the projector through a binocular vision system with a wide range of applications and economical and practicality, and converts the three-dimensional space and time passage in the real world into the spatial position and static time point in the two-dimensional image, thereby realizing synchronization in measurement time and avoiding the influence caused by equipment vibration or human movement during the measurement process; the two-dimensional image is analyzed by a computer, so that the difficulty of manual operation is greatly reduced; the three-dimensional space coordinates of the mark points and the projection points are analyzed and calculated by using a multi-target image segmentation algorithm and an adaptive target center position extraction algorithm, so as to improve the measurement efficiency and the reliability of the measurement result. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A flowchart of the steps of the method for measuring the projection deviation of an industrial laser projector according to the present invention;
[0060] Figure 2 This is a schematic diagram of the projection deviation measured by the present invention.
[0061] In the figure: 1. Marking point; 2. Actual position of the deviation measurement target; 3. Actual projection point position; 4. Theoretical projection point position; 5. Hemisphere. DETAILED DESCRIPTION
[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0063] Example
[0064] like Figure 1 and 2 As shown, an embodiment of the present invention provides a method for measuring projection deviation of an industrial laser projector, and the method specifically includes steps S1-S5:
[0065] S1: Use a binocular vision system to simultaneously collect the mark points on the deviation measurement target and the projection point image projected onto the target by the projector;
[0066] In S1, the binocular vision system includes:
[0067] Binocular camera: The binocular camera faces the deviation measurement target, is placed horizontally, has a baseline distance of 850 mm, and an angle of 75° between the camera optical axis and the baseline;
[0068] Camera controller: It has two high-precision synchronous square wave output signals, and the synchronization deviation of the two output signals is less than 10ns; its integrated hardware interface provides power for the binocular camera; its Ethernet port can communicate with the computer.
[0069] See also Figure 2 , which is a schematic diagram of the measured projection deviation: the deviation measurement target body should be arranged with marker points and hemispheres for cooperation targets detected by the binocular vision system and the projector. The number of marker points should be no less than 3, and the number of hemispheres should be no less than 4. The projection point is the corresponding cooperation target on the deviation measurement target body detected by the projector. After obtaining the conversion relationship between the target body coordinate system and the projector coordinate system, the projection point is projected to a specified point in the target body coordinate system according to the conversion relationship; the surface color of the deviation measurement target body in S1 can be selected as black, and the grayscale of the black background is quite different from the grayscale of the marker points and the projection points, so as to improve the accuracy of multi-target image segmentation.
[0070] S2: Image preprocessing: Use Gaussian filtering to smooth the image and reduce noise while retaining the overall structure and edge information of the image;
[0071] In S2, the image preprocessing method is Gaussian filtering, and the formula of the two-dimensional Gaussian function is:
[0072]
[0073] Where: σ is the standard deviation. In order to reduce noise while retaining the overall structure and edge information of the image, σ is set to 2.0.
[0074] S3: Multi-target image segmentation algorithm: Based on the grayscale histogram of the image, according to the large difference in grayscale values of the landmark point, projection point, and background, iteratively searches for two thresholds, T1 and T2, between the three peaks, and achieves segmentation of the landmark point, projection point, and background based on these two thresholds;
[0075] In S3, the specific methods of the multi-objective image segmentation algorithm include:
[0076] Calculate the grayscale histogram of the image and find the two valley values on the left and right of each peak. Since the valley between peaks is too flat, two conditions are used to limit the selection of valley values: the number of pixels corresponding to the valley value should be less than a pixel number threshold V obtained by pre-statistics. T , V T =0.00025%; the difference between the number of pixels corresponding to the valley value and the adjacent gray level is greater than the pre-defined threshold ε, ε=0.0001%.
[0077] The middle value of the left peak right valley value and the right peak left valley value of the adjacent peaks is taken as one of the initial interval endpoints, and the valley value with the largest grayscale difference from the middle value is taken as the other interval endpoint. The Otsu method is applied within this interval to obtain the intermediate threshold. Next, this intermediate threshold is used to change the effective interval of the Otsu method, and it is refined by repeated iterations until the threshold no longer changes, and finally the two thresholds T1 and T2 are obtained.
[0078] The main algorithm is described as follows:
[0079] ⑴
[0080] ⑵In the interval (V 3R ,T1′) use Otsu method to obtain the threshold value T2 and record it with variables;
[0081] ⑶In the interval (T2,V 1L ) Use Otsu's method to obtain the threshold value T1 and record it with variables. The termination condition is that T1 and T2 no longer change. If the termination condition is not met, go to (2), otherwise exit.
[0082] Where V represents the valley value, subscripts 1, 2, and 3 represent the corresponding peaks, L and R represent left and right, T1 and T2 represent the obtained thresholds, and T1′ represents the threshold obtained in the intermediate step. Image segmentation is performed based on these two thresholds to achieve the segmentation of landmark points, projection points, and background images.
[0083] S4: Adaptive target center position extraction algorithm: Adaptive edge extraction is performed on the segmented image based on the two thresholds T1 and T2, and the obtained edge information is ellipse fitted to calculate the center coordinates of the landmark point and the projection point in the image;
[0084] In S4, the adaptive target center position extraction algorithm includes: an adaptive edge extraction algorithm, a least squares ellipse fitting method, and a gray square weighted centroid method;
[0085] Perform adaptive edge extraction on the segmented image using the Canny operator, and adjust the high threshold value of the operator by combining the two thresholds T1 and T2 obtained, so as to achieve adaptive edge extraction. Calculate the central coordinates of the landmark points and projection points in the image through the least squares ellipse fitting method and the gray square weighted centroid method respectively for the obtained edge information.
[0086] In S4, the specific method included in the adaptive edge extraction algorithm is:
[0087] The Canny operator performs a differential operation on the image to obtain a gradient map, then uses the non-maximum suppression algorithm to find the possible edge points in the image, and finally recursively finds the image edge points through double threshold values. The recursive tracking process is controlled by two thresholds, denoted as h1 and h2 respectively, and h1 < h2. The tracking process only starts when the value of the current pixel point is greater than h2, and the tracking is carried out in two directions of the pixel point neighborhood until the value of the corresponding pixel position is lower than the threshold h1. Usually, h1 is 0.5 times of h2. Combine the two thresholds T1 and T2 obtained, and use T1 and T2 as the high threshold value selection for edge extraction of the landmark points and projection points respectively to perform adaptive edge extraction on the image.
[0088] In S4, the specific method included in the least squares ellipse fitting method is:
[0089] The general equation of a planar ellipse is:
[0090] x 2 + 2Bxy + Cy 2 + 2Dx + 2Ey + F = 0
[0091] When there are many edge points, according to the least squares principle, the objective function for fitting is:
[0092]
[0093] Take partial derivatives of the above formula with respect to B, C, D, E, and F respectively, and set each sub-formula to zero, then a system of equations containing 5 equations and 5 unknowns can be obtained. Use methods such as matrix inversion or Gaussian column main element elimination to obtain the 5 coefficient parameters B, C, D, E, F of the ellipse equation. The calculation formula for the ellipse center coordinates (x0, y0) is as follows:
[0094]
[0095] Since the light intensity of the projection point is relatively large, it will have a certain impact on the high-precision center extraction of the landmark point. Therefore, a secondary fitting is performed on the edge: after the first fitting, the residual of each edge point is calculated, and the points with a larger residual of 3% are removed. Then a second ellipse fitting is performed on the remaining points to calculate the coordinates of the center of the ellipse.
[0096] In S4, the specific methods of the grayscale square weighted centroid method include:
[0097] The gray value of the pixel is used as the weight, the gray weight is squared, and the weighted average value of all pixel coordinates in the projection point image is calculated. The calculation formula is:
[0098]
[0099] Where (x0, y0) is the center coordinate of the projection point; W i,j is the weight, that is, the gray value of pixel (i, j); S is the image area of the projection point.
[0100] S5: Combining the internal and external parameters of the camera, the three-dimensional spatial coordinates of the marker point and the center of the projection point are solved using the collinear equation, and the projection deviation is measured by comparing the actual projection point position solved with the theoretical projection point position.
[0101] In S5, the specific method for solving the three-dimensional spatial coordinates of the center point is as follows:
[0102] Assume that the image space coordinate system O-xyz of the left camera coincides with the object coordinate system, the image plane coordinate system is O-X1Y1, the effective focal length is f1, and the image space coordinate system O of the right camera is r -x r y r z r , the image plane coordinate system is O2-X r Y r , the effective focal length is f r Assume that the coordinates of the object point P in O-xyz are (X, Y, Z), the coordinates of the corresponding image point p in the left photo in O-xyz are (x, y, -f1), and the coordinates of the corresponding image point p in the right photo are (x, y, -f1). r In O r -x r y r z r The coordinates in (x r ,y r ,-f r ).
[0103] From the collinear equation we can get:
[0104]
[0105] From the calibrated internal and external parameters of the camera, we can know are O-xyz coordinate system and O r -x r y r z r The rotation matrix and translation matrix between the coordinate systems are:
[0106]
[0107] Combining the two formulas, we can get the three-dimensional space coordinates of the center point.
[0108] In S5, the specific method of calculating the projection deviation includes:
[0109] When the binocular vision system detects the marker points on the deviation measurement target and solves the coordinate system conversion relationship, the coordinate information of the marker points used comes from the target coordinate system, so the actual target reference coordinate system detected is consistent with the theoretical target coordinate system. After establishing the conversion relationship between the target coordinate system and the binocular coordinate system, the projection point measurement result is converted to the target coordinate system, and the projection deviation is measured by calculating the difference between the actual projection point coordinates and the theoretical projection point coordinates.
[0110] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for measuring projection deviation of an industrial laser projector, characterized in that: The method comprises the following steps: S1: Use a binocular vision system to simultaneously collect the mark points on the deviation measurement target and the projection point image projected onto the target by the projector; S2: Image preprocessing: Use Gaussian filtering to smooth the image and reduce noise while retaining the overall structure and edge information of the image; S3: Multi-target image segmentation algorithm: Based on the grayscale histogram of the image, according to the large difference in grayscale values of the landmark point, projection point, and background, iteratively searches for two thresholds, T1 and T2, between the three peaks, and achieves segmentation of the landmark point, projection point, and background based on these two thresholds; S4: Adaptive target center position extraction algorithm: Adaptive edge extraction is performed on the segmented image based on the two thresholds T1 and T2, and the obtained edge information is ellipse fitted to calculate the center coordinates of the landmark point and the projection point in the image; S5: Combining the internal and external parameters of the camera, the three-dimensional spatial coordinates of the marker point and the center of the projection point are solved using the collinear equation, and the projection deviation is measured by comparing the actual projection point position solved with the theoretical projection point position.
2. The method for measuring projection deviation of an industrial laser projector according to claim 1, characterized in that: The S1, binocular vision system, comprises: Binocular camera: The binocular camera faces the deviation measurement target, is placed horizontally, has a baseline distance of 850 mm, and an angle of 75° between the camera optical axis and the baseline; Camera controller: It has two high-precision synchronous square wave output signals. The synchronization deviation of the two output signals is less than 10ns. Its integrated hardware interface provides power for the binocular camera, and its Ethernet port can communicate with the computer. In S1, the deviation measurement target body should be arranged with marking points and hemispheres for cooperation with the binocular vision system and the projector for detection. The number of marking points should be no less than 3, and the number of hemispheres should be no less than 4. In S1, the surface color of the deviation measurement target body can be selected to be black, and the gray level of the black background is greatly different from the gray levels of the marker points and the projection points, so as to improve the accuracy of multi-target image segmentation; In S1, the projection point is the corresponding cooperative target on the projector detection deviation measurement target body. After obtaining the conversion relationship between the target body coordinate system and the projector coordinate system, the projection point is projected to a designated point in the target body coordinate system according to the conversion relationship.
3. The method for measuring projection deviation of an industrial laser projector according to claim 1, characterized in that: In S2, the image preprocessing method is Gaussian filtering, and the formula of the two-dimensional Gaussian function is: Where: σ is the standard deviation. In order to reduce noise while retaining the overall structure and edge information of the image, σ is set to 2.
0.
4. The method for measuring projection deviation of an industrial laser projector according to claim 1, characterized in that: In S3, the specific method of the multi-objective image segmentation algorithm is as follows: Calculate the grayscale histogram of the image and find the two valley values on the left and right of each peak. Since the valley between peaks is too flat, two conditions are used to limit the selection of valley values: the number of pixels corresponding to the valley value should be less than a pixel number threshold V obtained by pre-statistics. T , V T =0.00025%; the difference between the number of pixels corresponding to the valley value and the adjacent gray level is greater than the pre-defined threshold ε, ε = 0.0001%; The middle value of the left peak right valley value and the right peak left valley value of the adjacent peaks is taken as one of the initial interval endpoints, and the valley value with the largest grayscale difference from the middle value is taken as the other interval endpoint. The Otsu method is applied within this interval to obtain the intermediate threshold value. Next, this intermediate threshold value is used to change the effective interval of the Otsu method, and the iterative refinement is repeated until the threshold value no longer changes, and finally the two threshold values of T1 and T2 are obtained; The main algorithm is described as follows: ⑵In the interval (V 3R ,T1′) use Otsu method to obtain the threshold value T2 and record it with variables; ⑶In the interval (T2,V 1L ) Use Otsu's method to find the threshold value T1 and record it with variables. The termination condition is that T1 and T2 no longer change. If the termination condition is not met, go to (2), otherwise exit. Where V represents the valley value, the subscripts 1, 2, and 3 represent the corresponding peaks, L and R represent left and right, T1 and T2 represent the obtained thresholds, and T1′ represents the threshold obtained in the intermediate step. Image segmentation is performed according to these two thresholds, thereby realizing the segmentation of the landmark points, projection points, and background image.
5. The method for measuring projection deviation of an industrial laser projector according to claim 1, characterized in that: In the step S4, the adaptive target center position extraction algorithm includes: an adaptive edge extraction algorithm, a least squares ellipse fitting method, and a gray square weighted centroid method; Perform adaptive edge extraction on the segmented image using the Canny operator, and adjust the high threshold value of the operator by combining the two thresholds T1 and T2 obtained, thereby realizing adaptive edge extraction. Calculate the center coordinates of the landmark points and projection points in the image through the least squares ellipse fitting method and the gray square weighted centroid method respectively for the obtained edge information.
6. The method for measuring projection deviation of an industrial laser projector according to claim 5, characterized in that: In the step S4, the specific method included in the adaptive edge extraction algorithm is: The Canny operator performs a differential operation on the image to obtain a gradient map, then uses the non-maximum suppression algorithm to find the possible edge points in the image, and finally recursively finds the edge points in the image through double threshold values. The recursive tracking process is controlled by two thresholds, denoted as h1 and h2 respectively, and h1 < h2. The tracking process only starts when the value of the current pixel point is greater than h2, and the tracking is performed in two directions of the pixel neighborhood until the value of the corresponding pixel position is lower than the threshold h1. Usually, h1 is 0.5 times of h2. Combine the two thresholds T1 and T2 obtained, and use T1 and T2 as the high threshold value selections for edge extraction of the landmark points and projection points respectively to perform adaptive edge extraction on the image.
7. The method for measuring projection deviation of an industrial laser projector according to claim 5, characterized in that: In the step S4, the specific method included in the least squares ellipse fitting method is: The general equation of a planar ellipse is: x 2 +2Bxy+Cy 2 +2Dx+2Ey+F=0 When there are many edge points, according to the least squares principle, the fitting objective function is: Take partial derivatives of the above formula with respect to B, C, D, E, and F respectively, and set each sub-formula to zero, and a system of equations containing 5 equations and 5 unknowns can be obtained. The 5 coefficient parameters B, C, D, E, and F of the ellipse equation can be obtained by using methods such as matrix inversion or Gaussian column main element elimination. The calculation formula for the ellipse center coordinates (x0, y0) is as follows: Since the light intensity of the projection point is relatively large, it will have a certain impact on the high-precision center extraction of the landmark points. Therefore, perform secondary fitting on the edge: after the first fitting, calculate the residuals of each edge point, remove the points with relatively large residuals of 3%, and then perform a second ellipse fitting on the remaining points to calculate the ellipse center coordinates.
8. The method for measuring projection deviation of an industrial laser projector according to claim 5, characterized in that: In the step S4, the specific method included in the gray square weighted centroid method is: Taking the gray value of the pixel as the weight, square the weight value of the gray level, and calculate the weighted average value of all pixel coordinates in the projection point image. The calculation formula is: Where (x0, y0) is the center coordinate of the projection point; W i,j is the weight, that is, the gray value of pixel (i, j); S is the image area of the projection point.
9. The method for measuring projection deviation of an industrial laser projector according to claim 1, characterized in that: In the step S5, the specific method included in the calculation of the three-dimensional space coordinates of the center point is: Assume that the image space coordinate system O-xyz of the left camera coincides with the object coordinate system, the image plane coordinate system is O-X1Y1, the effective focal length is f1, and the image space coordinate system O of the right camera is r -x r y r z r , the image plane coordinate system is O2-X r Y r , the effective focal length is f r , let the coordinates of the object point P in O-xyz be (X, Y, Z), the coordinates of the corresponding image point p in the left photo in O-xyz be (x, y, -f1), and the coordinates of the corresponding image point p in the right photo r In O r -x r y r z r The coordinates in (x r ,y r ,-f r ); From the collinearity equation, it can be obtained: From the calibrated internal and external parameters of the camera, we can know are O-xyz coordinate system and O r -x r y r z r The rotation matrix and translation matrix between the coordinate systems are: Combining the two equations can obtain the three-dimensional space coordinates of the center point.
10. The method for measuring projection deviation of an industrial laser projector according to claim 1, characterized in that: In the step S5, the specific method included in the projection deviation calculation is: When the binocular vision system detects the marker points on the deviation measurement target and solves the coordinate system conversion relationship, the marker point coordinate information used comes from the target coordinate system. Therefore, the actual target reference coordinate system detected is consistent with the theoretical target coordinate system. After establishing the conversion relationship between the target coordinate system and the binocular coordinate system, the projection point measurement result is converted to the target coordinate system, and the projection deviation is measured by calculating the difference between the actual projection point coordinates and the theoretical projection point coordinates.
Citation Information
Cited By
Method, device, equipment and medium for detecting installation precision of detector installation guide rail
CN120890372A
Method, device, equipment and medium for detecting installation accuracy of detector mounting rail
CN120890372B
