CN118037690A - Multi-objective weighted measurement method based on characteristic edge geometric relationship error - Google Patents
Multi-objective weighted measurement method based on characteristic edge geometric relationship error Download PDFInfo
- Publication number
- CN118037690A CN118037690A CN202410246151.9A CN202410246151A CN118037690A CN 118037690 A CN118037690 A CN 118037690A CN 202410246151 A CN202410246151 A CN 202410246151A CN 118037690 A CN118037690 A CN 118037690A
- Authority
- CN
- China
- Prior art keywords
- feature
- image
- edge
- pixel
- detected
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000691 measurement method Methods 0.000 title claims abstract description 9
- 238000004364 calculation method Methods 0.000 claims abstract description 28
- 238000007781 pre-processing Methods 0.000 claims abstract description 8
- 238000000034 method Methods 0.000 claims description 45
- 238000005259 measurement Methods 0.000 claims description 37
- 238000000605 extraction Methods 0.000 claims description 23
- 238000001914 filtration Methods 0.000 claims description 20
- 238000009826 distribution Methods 0.000 claims description 14
- 238000002474 experimental method Methods 0.000 claims description 9
- 239000011159 matrix material Substances 0.000 claims description 9
- 238000003384 imaging method Methods 0.000 claims description 7
- 230000003287 optical effect Effects 0.000 claims description 6
- 238000009499 grossing Methods 0.000 claims description 5
- 235000002566 Capsicum Nutrition 0.000 claims description 4
- 239000006002 Pepper Substances 0.000 claims description 4
- 235000016761 Piper aduncum Nutrition 0.000 claims description 4
- 235000017804 Piper guineense Nutrition 0.000 claims description 4
- 235000008184 Piper nigrum Nutrition 0.000 claims description 4
- 238000012937 correction Methods 0.000 claims description 4
- 238000013178 mathematical model Methods 0.000 claims description 4
- 150000003839 salts Chemical class 0.000 claims description 4
- 238000013519 translation Methods 0.000 claims description 3
- 244000203593 Piper nigrum Species 0.000 claims 1
- 238000004458 analytical method Methods 0.000 description 10
- 239000006185 dispersion Substances 0.000 description 4
- 230000000007 visual effect Effects 0.000 description 4
- 241000722363 Piper Species 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000011218 segmentation Effects 0.000 description 3
- 230000003044 adaptive effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000035772 mutation Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 210000003734 kidney Anatomy 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000003908 quality control method Methods 0.000 description 1
- 238000013139 quantization Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/12—Edge-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/66—Analysis of geometric attributes of image moments or centre of gravity
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30164—Workpiece; Machine component
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Geometry (AREA)
- Quality & Reliability (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a multi-order weighted measurement method based on characteristic edge geometric relationship errors, which comprises the following steps: acquiring a plurality of single-frame images, and preprocessing the single-frame images to obtain images with the edges of the sub-pixels of the features to be detected; based on the image with the sub-pixel edge of the feature to be detected, obtaining a local line segment angle set of the feature, dividing the feature contour through the local line segment angle set of the feature, and constructing a theoretical error model; and (3) carrying out weight calculation through theoretical error model guidance, determining an optimal constant index of weight calculation, and guiding calculation of characteristic weights based on the optimal constant index. The invention is capable of measuring multiple features simultaneously within a common field of view.
Description
Technical Field
The invention relates to the technical field of computer industrial vision, in particular to a multi-objective weighting measurement method based on characteristic edge geometric relationship errors.
Background
In quality control tasks in the fields of aerospace, automobile manufacturing and the like, the positioning and measurement of features has become a hot topic in the field of vision applications. Theoretically, by extracting the corresponding keypoints at the feature edges on each image, the feature parameters can be calculated uniquely based on the camera calibration parameters. However, the extraction accuracy of the key points is affected by factors such as pixel dispersion, image noise, and mismatching, so that measurement deviation of the feature size and the center distance is caused. The extraction precision of the corresponding key points in each image is reasonably evaluated, and weights are distributed, so that the method has important significance for improving the positioning and measuring precision of the features.
The measurement system may be classified into a monocular system, a binocular system, and a multi-ocular system according to the number of cameras. In a monocular system, only the internal parameters of the camera need be calibrated. However, during the measurement, the geometrical positional relationship with the feature needs to be strictly ensured, which makes it unsuitable for real-time measurement. In binocular systems, features of arbitrary positions and angles in the field of view can be measured directly by the principle of optical triangulation. However, the system may suffer from occlusion, matching ambiguity, and inaccuracy in keypoint extraction, which reduces the accuracy and robustness of the measurement. Redundant information is introduced into the multi-view system, constraint conditions are increased, reconstruction accuracy and robustness are improved, and the multi-view system is widely applied to three-dimensional measurement tasks such as object reconstruction and accuracy measurement.
In the traditional field of multi-vision, many students develop different multi-vision systems to measure features and position points in space according to their measurement needs. However, the feature measurement methods proposed by them default have the same contribution value, and in practice, the contribution values of different cameras should be related to factors such as imaging quality, accuracy of extracting key points, and accuracy of calibrating the cameras. In recent years, a plurality of scholars construct a theoretical error model of binocular vision and multi-view vision through theoretical analysis, and the researchers fully analyze measurement errors caused by the geometric structure, pixel quantization precision and camera calibration precision of a camera system, so that higher reconstruction precision is realized. However, more researches remain in the theoretical precision improvement, and it can be known through real scene experiments that in an actual measurement scene, the extraction precision of key points in an image greatly influences the measurement precision of feature shapes and positions, the adoption of a theoretical formula for weighting distribution can lead to the problems of complex deduction, low efficiency and the like, and the key point extraction errors caused by factors such as camera calibration errors, edge noise and the like in the real scene cannot be considered, so that a high-efficiency, simple and convenient weighting measurement method needs to be further researched.
Disclosure of Invention
In order to solve the technical problems, the invention provides a multi-order weighted measurement method based on characteristic edge geometric relation errors, which can realize non-contact measurement, has high precision and speed, has large visual field and can simultaneously measure a plurality of characteristics in a common visual field.
In order to achieve the above object, the present invention provides a method for measuring a multi-objective weighting based on a feature edge geometry error, comprising:
Acquiring a plurality of single-frame images, and preprocessing the single-frame images to obtain images with the edges of the sub-pixels of the features to be detected;
based on the local line segment angle set of the image acquisition feature with the feature sub-pixel edge to be detected, segmenting the feature profile through the local line segment angle set of the feature, and constructing a theoretical error model;
and guiding to perform weight calculation through the theoretical error model, determining an optimal constant index of weight calculation, and guiding calculation of characteristic weights based on the optimal constant index.
Preferably, acquiring the plurality of single frame images includes:
And adjusting shooting exposure time of the camera by means of empirical adjustment and camera self-adaptive exposure, setting a shooting exposure interval, and obtaining a single-frame image with higher imaging quality of the edge of the feature to be detected.
Preferably, preprocessing the single frame image includes:
firstly, carrying out distortion correction on an image, and then respectively filtering salt and pepper noise in the image and smoothing the characteristic edge to be detected through median filtering and Gaussian filtering operation;
the median filtering is carried out by locating the characteristic edge, selecting a neighborhood, arranging all pixel light intensity values in the neighborhood, and then selecting a median as a substitute of a central pixel;
The Gaussian filtering is to smooth edge pixels around the central pixel by adopting a Gaussian kernel function, eliminate noise, then binarize the single frame image by adopting a self-adaptive image binarization threshold method, position the pixel-level edge of the feature to be detected by adopting a Canny edge extraction method, and finally extract the sub-pixel high-precision edge of the feature to be detected in the image range by adopting a sub-pixel edge extraction method based on Zernike gray scale moment, so as to obtain the image with the sub-pixel edge of the feature to be detected.
Preferably, acquiring the local line segment angle set includes:
Randomly selecting contour points of sub-pixel levels in the image with the sub-pixel edges of the feature to be detected as a starting point, and determining a zero degree reference; presetting a fixed step length; starting from a starting point, connecting new points obtained after step calculation, calculating the included angles of the starting point, the new points and the zero-degree direction, and continuously iterating the process until the whole contour line is covered, so as to obtain a local line segment angle set of the feature;
If the change of the continuous angle exceeds a preset threshold value, isolating a point set with obvious angle change by setting a dividing point.
Preferably, the feature contour is segmented by analyzing the angle change of the local line segment of the feature, a plurality of geometric primitives are obtained, and the theoretical error model is built through the geometric primitives.
Preferably, the method for calculating the weight through the theoretical error model comprises the following steps:
for the measurement of rectangular features, the method for weight distribution is as follows:
For the measurement of the waist slot shape characteristics, the weight distribution method comprises the following steps:
In the method, in the process of the invention, And/>Referring to the angular deviations of the length and width of the rectangle in image i, respectively, n represents a constant index, and w i is the weight assigned by the feature in camera i.
Preferably, determining the optimal constant index for the weight calculation includes:
Establishing a key point multi-mesh weighted least square reconstruction mathematical model, and obtaining a projection relation of a space point P on an image i according to a pinhole projection model;
Calculating an actual edge geometric relationship error, fixing a constant index, calculating the weight of the feature in each camera by adopting a weight distribution method, and obtaining a geometric parameter measurement value of the feature to be measured based on a weighted least square method;
and continuously and incrementally changing constant indexes through experiments, continuously comparing the geometric parameter measured value with the characteristic true value, taking the constant index corresponding to the average error minimum value of all the characteristic measurements as the optimal constant index calculated by the weight, and guiding calculation of the characteristic weight by using the optimal constant index.
Preferably, the projection relationship is:
Wherein lambda i represents a homogeneous term, Representing homogeneous coordinates of the projected points, a i representing a camera internal parameter matrix, R i representing a rotation matrix of external parameters, T i representing an external parameter translation vector, and P representing spatial coordinates of the point P in a world coordinate system;
the projection relation is represented by a weighted least square method:
Where Λ represents a vector composed of homogeneous term values of the corresponding keypoints, C represents a vector composed of optical center coordinates, B is composed of L i in each image, W represents a diagonal matrix composed of weights of each image, and T is a transposed symbol.
Compared with the prior art, the invention has the following advantages and technical effects:
The invention has the advantages of non-contact measurement, high precision, high speed and large visual field, and can simultaneously measure a plurality of characteristics in a common visual field. The method can be generalized to any number of cameras measuring features that have a theoretical geometric relationship in projection.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
FIG. 1 is a schematic diagram of feature segmentation using a local line angle model according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a theoretical and practical edge fitting model of an embodiment of the invention;
FIG. 3 is a schematic diagram of a simplified model of theoretical and practical edge fitting in accordance with an embodiment of the present invention;
Fig. 4 is a schematic view of an actual projection model of multi-view vision according to an embodiment of the present invention.
Detailed Description
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
The invention provides a multi-order weighted measurement method based on characteristic edge geometric relationship errors, which comprises the following steps:
acquiring a plurality of single-frame images, and preprocessing the single-frame images to acquire images with the edges of the sub-pixels of the features to be detected;
Specifically, the shooting exposure time of the camera is adjusted by means of empirical adjustment and camera self-adaptive exposure, and the shooting exposure time is set in a reasonable cell to obtain five Shan Zhen images with high imaging quality of the edge of the feature to be detected. The single frame image with higher image quality of the edge of the feature to be detected is an image with higher edge-background contrast without more obvious overexposure phenomenon.
Acquiring a local line segment angle set based on an image with a feature sub-pixel edge to be detected, and dividing a feature contour through the local line segment angle set to construct a theoretical error model;
Randomly selecting contour points of sub-pixel levels in an image with a feature to be detected as a starting point, and determining a zero degree reference; presetting a fixed step length; starting from a starting point, connecting new points obtained after step calculation, calculating the included angles of the starting point, the new points and the zero-degree direction, and continuously iterating the process until the whole contour line is covered to obtain a local line segment angle set;
if the change of the continuous angle exceeds a preset threshold value, isolating a point set with obvious angle change by setting a division point.
And (3) carrying out weight calculation through theoretical error model guidance, determining an optimal constant index of weight calculation through experiments, and guiding calculation of characteristic weights based on the optimal constant index.
Preprocessing a single frame image, including:
Firstly, carrying out distortion correction on the image, and then respectively filtering salt and pepper noise in the image and smoothing the characteristic edge to be detected through median filtering and Gaussian filtering operation. The median filtering is carried out by locating the characteristic edge, selecting a neighborhood size, arranging all pixel light intensity values of the neighborhood size, and then selecting the median as the substitute of the central pixel. Gaussian filtering is to further smooth the edge pixels around the center pixel using a gaussian kernel function to eliminate most of the noise. Then, an adaptive image binarization threshold technology (such as the Ojin method) is adopted to binarize the five Shan Zhen images, a Canny edge extraction algorithm is adopted to position the pixel-level edge of the feature to be detected, so that the workload of sub-pixel edge traversal extraction is reduced, and then a sub-pixel high-precision edge of the feature to be detected is extracted in an image range by using a sub-pixel edge extraction algorithm based on a Zernike gray scale moment based on pixel-level edge traversal.
The method for acquiring the local line segment angle set specifically comprises the following steps:
first, a contour point of a sub-pixel level is selected as a starting point, with zero degree reference in the right horizontal direction. Then, a fixed step length is preset, the step length is determined by the characteristic size in a self-adaptive mode, new points obtained after step length step calculation are connected from a starting point, and the included angle between the two points and the zero-degree direction is calculated. This process is iterated until the entire contour is covered. If the turning points are not passed between the step sizes, the adjacent angles are relatively consistent; and once passing through the turning point, the adjacent angle changes suddenly. If the change in the successive angles exceeds a set threshold, a split point is considered between the two segments. The present method improves the accuracy of line segment and curve fitting by isolating those point sets that vary significantly in angle, rather than just finding intersection or tangent points.
And dividing the contour by analyzing the angle change of the local line segment to obtain a plurality of geometric primitives, and constructing a theoretical error model through the geometric primitives.
After the local line segment angle set is acquired, the contour is segmented. For rectangular and kidney-shaped feature contours, including elliptical arcs and straight lines, they are segmented into individual geometric elements. The connection of these elements falls into two categories: straight line and straight line, straight line and elliptic arc. By analyzing the angle change of the local line segment, the accurate segmentation of different types of contours can be realized, and the specific analysis steps are as follows:
(1) From straight line to straight line: when two straight lines intersect, the local line segment angle change curve can show obvious step mutation at two sides of the dividing point.
(2) From straight line to elliptical arc: in the case where a straight line is connected to an elliptical arc, there are two different situations of tangency and intersection. Consider first the case where a straight line is cut into an elliptical arc, in which case the local segment angle curves of the elliptical arc change obliquely, while the angle curves of the straight line portions remain horizontal, with their dividing points appearing at the inflection points of the curves. Then, the elliptic arc is intersected with the straight line, wherein the angle curve of the elliptic arc is inclined as well, the angle curve of the straight line is kept horizontal, but obvious angle jump occurs between the elliptic arc and the straight line, and the dividing point is located at the jump point. On the kidney-shaped feature, the connection form of the straight line and the elliptical arc is tangent.
The method for calculating the weight through the theoretical error model comprises the following steps:
First, edge geometry errors are analyzed by creating a theoretical error model. In accordance with the perspective projection model of the camera, the two parallel lines in space should ideally also remain parallel to the image. However, in practice, due to factors such as the pixel dispersion, the image noise, and the camera calibration error, the obtained projection lines are often not strictly parallel, and the theoretical error model is shown in fig. 2. Wherein the edges represented by the broken lines are theoretical edges, and the edges represented by the solid lines are actual edges. To facilitate analysis and calculation of weights, the theoretical model in fig. 2 is simplified to fig. 3.
And secondly, calculating the weight by taking the theoretical error model as a basis. Through theoretical analysis, the proportional relationship between the extraction error and the angle error of the key points in the image can be deduced.
Determining an optimal constant index for weight calculation, comprising:
Establishing a key point multi-mesh weighted least square reconstruction mathematical model, and obtaining a projection relation of a space point P on an image i according to a pinhole projection model;
Calculating an actual edge geometric relationship error, fixing a constant index, calculating the weight of the feature in each camera by adopting a weight distribution method, and obtaining a geometric parameter measurement value of the feature to be measured based on a weighted least square method;
And continuously increasing and changing constant indexes through experiments, continuously comparing the geometric parameter measured value with the characteristic true value, taking the constant index corresponding to the average error minimum value of all the characteristic measurements as the optimal constant index for calculating the weight, and applying the optimal constant index to guide the calculation of the characteristic weight. The feature truth value is the nominal size of the feature on the standard component or the real size obtained by measurement of high-precision measuring equipment such as a CMM three-coordinate measuring machine.
In order to more clearly express the technical scheme of the present invention, the following provides a scheme description of specific embodiments:
And adjusting the shooting exposure time of the camera to obtain better imaging quality of the feature to be detected. And progressively performing monocular, binocular and polycular calibration on the five-eye camera to obtain high-precision calibration parameters. And then acquiring workpiece images with a plurality of features with edge geometric relationships to be detected by using a five-eye camera system, extracting edges of the features to be detected in each image by using a high-precision sub-pixel edge extraction algorithm, taking rectangular features and waist-groove features as examples, analyzing key point extraction errors of the features in the images by theory, simplifying the key point extraction errors, and calculating a simplified model key point extraction error formula. And taking the key point extraction error formula as a theoretical basis, developing a weighted measurement formula of rectangular features and waist-groove features based on the edge geometric relationship error, and carrying out weight self-adaptive adjustment and accuracy verification through a large number of experiments.
An image processing section:
First, an image is acquired. The shooting exposure time of the camera is adjusted by means of empirical adjustment and camera self-adaptive exposure, and the shooting exposure time is set in a reasonable cell to obtain five Shan Zhen images with better imaging quality of the edge of the feature to be detected.
And secondly, preprocessing the image. Firstly, carrying out distortion correction on the image, and then respectively filtering salt and pepper noise in the image and smoothing the characteristic edge to be detected through median filtering and Gaussian filtering operation. The median filtering is carried out by locating the characteristic edge, selecting a neighborhood size, arranging all pixel light intensity values of the neighborhood size, and then selecting the median as the substitute of the central pixel. Gaussian filtering is to further smooth the edge pixels around the center pixel using a gaussian kernel function to eliminate most of the noise. Then, an adaptive image binarization threshold technology (such as the Ojin method) is adopted to binarize the five Shan Zhen images, a Canny edge extraction algorithm is adopted to position the pixel-level edge of the feature to be detected, so that the workload of sub-pixel edge traversal extraction is reduced, and then a sub-pixel high-precision edge of the feature to be detected is extracted in an image range by using a sub-pixel edge extraction algorithm based on a Zernike gray scale moment based on pixel-level edge traversal.
And thirdly, constructing a local line segment angle model. First, a contour point of a sub-pixel level is selected as a starting point, with zero degree reference in the right horizontal direction. Then, a fixed step length is preset, the step length is determined by the characteristic size in a self-adaptive mode, new points obtained after step length step calculation are connected from a starting point, and the included angle between the two points and the zero-degree direction is calculated. This process is iterated until the entire contour is covered. If the turning points are not passed between the step sizes, the adjacent angles are relatively consistent; and once passing through the turning point, the adjacent angle changes suddenly. If the change in the successive angles exceeds a set threshold, a split point is considered between the two segments. The present method improves the accuracy of line segment and curve fitting by isolating those point sets that vary significantly in angle, rather than just finding intersection or tangent points. Assuming that the feature profile consists of N points, the method for calculating and processing the local line segment angles of the profile is as follows:
(a) The step size (proportional to the number of feature points) required to calculate the local segment angle is determined. A starting contour point is selected, and the length of a local line segment of a calculated angle is set, wherein the length corresponds to the number of sub-pixel points on the local contour line segment.
(B) The angle (in radians) is calculated. The local segment angle from the first point to the second point is calculated in a counter-clockwise (or clockwise) direction with reference to the starting point.
(C) And (5) smoothing the angle data. In view of the fluctuation of angle calculation that may be caused by pixel dispersion, the angle data needs to be smoothed to remove noise to ensure accuracy of further analysis.
And fourthly, after the local line segment angle set is obtained, segmenting the contour. For rectangular and kidney-shaped feature contours, including elliptical arcs and straight lines, they are segmented into individual geometric elements. The connection of these elements falls into two categories: straight line and straight line, straight line and elliptic arc. By analyzing the angle change of the local line segment, the accurate segmentation of different types of contours can be realized, and the specific analysis steps are as follows:
(a) From straight line to straight line: when two straight lines intersect, the local line segment angle change curve can show obvious step mutation at two sides of the dividing point.
(B) From straight line to elliptical arc: in the case where a straight line is connected to an elliptical arc, there are two different situations of tangency and intersection. Consider first the case where a straight line is cut into an elliptical arc, in which case the local segment angle curves of the elliptical arc change obliquely, while the angle curves of the straight line portions remain horizontal, with their dividing points appearing at the inflection points of the curves. Then, the elliptic arc is intersected with the straight line, wherein the angle curve of the elliptic arc is inclined as well, the angle curve of the straight line is kept horizontal, but obvious angle jump occurs between the elliptic arc and the straight line, and the dividing point is located at the jump point. On the kidney-shaped feature, the connection form of the straight line and the elliptical arc is tangent.
Fifth, a theoretical model with edge geometry characteristics is analyzed, taking rectangle and waist groove as examples, as shown in fig. 1. After the fourth step of separating the geometric primitives, a numerical stabilization method is used to fit the straight line and the ellipse. For rectangular features, the fitted straight lines intersect at four corner points (key points). For the kidney-shaped feature, the center line intersects the two elliptical segments at two key points at the left and right ends. Through the reconstruction of the key points, the characteristic parameters of rectangular and waist-groove characteristics can be calculated.
Weight distribution algorithm flow based on error analysis:
First, edge geometry errors are analyzed by creating a theoretical error model. In accordance with the perspective projection model of the camera, the two parallel lines in space should ideally also remain parallel to the image. However, in practice, due to factors such as the pixel dispersion, the image noise, and the camera calibration error, the obtained projection lines are often not strictly parallel, and the theoretical error model is shown in fig. 2. The edge indicated by the blue dotted line is a theoretical edge, and the edge indicated by the red solid line is an actual edge. To facilitate analysis and calculation of weights, the theoretical model in fig. 2 is simplified to fig. 3.
As can be seen from an analysis of fig. 3, theoretically, the extraction error of the rectangular length and width can be represented by the following equation:
wherein Δl 1 and Δl 2 are errors of the length and width of the rectangle, L 1 and L 2 are the length and width of the rectangle, and θ 1 and θ 2 are the inclination angles of the length and width of the rectangle.
Since the angular deviation is small in practice, the positional deviation of the key points of the rectangle and the waist groove can be expressed as follows:
ΔLi≈(L1-L2)*tanθi≈(L1-L2)*θi(rectangle) (3)
ΔL=sqrt((ΔL3)2+(ΔL4)2)≈kRθ(oval shape) (4)
wherein Δl 3 and Δl 4 represent the length and width errors of the waist groove shape, respectively, k is an angle coefficient, R is the radius of the waist groove shape semicircle, and θ is the offset angle of the waist groove shape center line.
And secondly, calculating the weight by taking the theoretical error model as a basis. Through theoretical analysis, the proportional relationship between the extraction error and the angle error of the key points in the image can be deduced. Based on this, for the measurement of rectangular features, the following formula is used for weight distribution:
Wherein, And/>Referring to the angular deviations of the length and width of the rectangle in the image i, respectively, n represents a constant index. This weight distribution formula is based on the error expression of formula (3) and follows the principle that lower errors correspond to higher weights. The purpose of setting the constant index entries is to dynamically find the optimal weight allocation strategy.
For the measurement of the kidney slot shape feature, the following formula is used for weight distribution:
where θ i represents the angular deviation of the center line in the image i, and n represents a constant index.
The weight distribution formula is formulated according to the error expression in the formula (4) and is based on the principle that lower errors correspond to higher weights. The constant index is set to efficiently explore and determine the optimal weight distribution strategy.
Key point reconstruction flow based on multi-mesh weighting:
And firstly, establishing a key point multi-order weighted least square reconstruction mathematical model. According to the pinhole projection model, the projection of a spatial point P on an image i has the following relationship:
Wherein lambda i represents the homogeneous term, Representing homogeneous coordinates of the projected points, a i represents a camera internal parameter matrix, R i represents a rotation matrix of external parameters, T i represents an external parameter translation vector, and P represents spatial coordinates of the point P in the world coordinate system.
Equation (7) can be transformed as follows:
Wherein C i=-Ri -1Ti denotes an optical center coordinate in the world coordinate system, The direction from the optical center C i to the imaging point p i is shown.
Due to inaccuracy in extracting keypoints from images, projection lines of five cameras cannot intersect at unique points in space, resulting in a non-unique solution, as shown in fig. 4, a weighted least squares mathematical expression can be represented by the following formula:
Where Λ represents a vector consisting of homogeneous term values of the corresponding keypoints and C represents a vector consisting of optical center coordinates. B is composed of L i in each image, W represents a diagonal matrix composed of weights for each image, as follows:
W=[diag([w1,w1,w1],…,[w5,w5,w5])] (10)
where w 1,w2,……,w5 represents the weight of each image.
And secondly, determining an optimal constant index calculated by the weights through a plurality of experiments. A standard sheet metal part with 6 slotted holes and 7 rectangular holes on the surface is used for measurement experiments, and 15 groups of single-frame images are acquired through a five-eye measuring system for measurement. And increasing the constant index from 1 to 100, taking the root mean square error of the measured center distance and the measured size as an optimization object, obtaining the optimal constant index of different characteristic parameter weighted measurement, and fixing the constant index in actual application to guide calculation of the characteristic weight.
The method can realize non-contact measurement, has high precision, high speed and large view field, and can simultaneously measure a plurality of characteristics in a common view field. Experiment results show that compared with the traditional method, the root mean square error of rectangular length, width and center distance measurement is reduced by 4.4597%, 5.0217% and 3.3777% respectively, the root mean square error of waist-groove-shaped length, width and center distance measurement is reduced by 3.2606%, 10.6931% and 2.6270% respectively, and meanwhile, the measurement stability is improved greatly.
The present application is not limited to the above-mentioned embodiments, and any changes or substitutions that can be easily understood by those skilled in the art within the technical scope of the present application are intended to be included in the scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims (8)
1. A multi-order weighted measurement method based on characteristic edge geometric relation errors is characterized by comprising the following steps:
Acquiring a plurality of single-frame images, and preprocessing the single-frame images to obtain images with the edges of the sub-pixels of the features to be detected;
based on the local line segment angle set of the image acquisition feature with the feature sub-pixel edge to be detected, segmenting the feature profile through the local line segment angle set of the feature, and constructing a theoretical error model;
and guiding to perform weight calculation through the theoretical error model, determining an optimal constant index of weight calculation, and guiding calculation of characteristic weights based on the optimal constant index.
2. The method of claim 1, wherein obtaining the plurality of single frame images comprises:
And adjusting shooting exposure time of the camera by means of empirical adjustment and camera self-adaptive exposure, setting a shooting exposure interval, and obtaining a single-frame image with higher imaging quality of the edge of the feature to be detected.
3. The method of claim 2, wherein preprocessing the single frame image comprises:
firstly, carrying out distortion correction on an image, and then respectively filtering salt and pepper noise in the image and smoothing the characteristic edge to be detected through median filtering and Gaussian filtering operation;
the median filtering is carried out by locating the characteristic edge, selecting a neighborhood, arranging all pixel light intensity values in the neighborhood, and then selecting a median as a substitute of a central pixel;
The Gaussian filtering is to smooth edge pixels around the central pixel by adopting a Gaussian kernel function, eliminate noise, then binarize the single frame image by adopting a self-adaptive image binarization threshold method, position the pixel-level edge of the feature to be detected by adopting a Canny edge extraction method, and finally extract the sub-pixel high-precision edge of the feature to be detected in the image range by adopting a sub-pixel edge extraction method based on Zernike gray scale moment, so as to obtain the image with the sub-pixel edge of the feature to be detected.
4. The method of claim 1, wherein obtaining the local segment angle set comprises:
Randomly selecting contour points of sub-pixel levels in the image with the sub-pixel edges of the feature to be detected as a starting point, and determining a zero degree reference; presetting a fixed step length; starting from a starting point, connecting new points obtained after step calculation, calculating the included angles of the starting point, the new points and the zero-degree direction, and continuously iterating the process until the whole contour line is covered, so as to obtain a local line segment angle set of the feature;
If the change of the continuous angle exceeds a preset threshold value, isolating a point set with obvious angle change by setting a dividing point.
5. The method for multi-objective weighted measurement based on feature edge geometry relation errors according to claim 1, wherein the feature contours are segmented by analyzing the angular variation of local line segments of features to obtain a number of geometric primitives, and the theoretical error model is constructed by the geometric primitives.
6. The method for multi-objective weighted measurement of feature-edge geometry error of claim 5, wherein the method for weight calculation by the theoretical error model comprises:
for the measurement of rectangular features, the method for weight distribution is as follows:
For the measurement of the waist slot shape characteristics, the weight distribution method comprises the following steps:
In the method, in the process of the invention, And/>Referring to the angular deviations of the length and width of the rectangle in image i, respectively, n represents a constant index, and w i is the weight assigned by the feature in camera i.
7. The method of claim 1, wherein determining an optimal constant index for the weight calculation comprises:
Establishing a key point multi-mesh weighted least square reconstruction mathematical model, and obtaining a projection relation of a space point P on an image i according to a pinhole projection model;
Calculating an actual edge geometric relationship error, fixing a constant index, calculating the weight of the feature in each camera by adopting a weight distribution method, and obtaining a geometric parameter measurement value of the feature to be measured based on a weighted least square method;
and continuously and incrementally changing constant indexes through experiments, continuously comparing the geometric parameter measured value with the characteristic true value, taking the constant index corresponding to the average error minimum value of all the characteristic measurements as the optimal constant index calculated by the weight, and guiding calculation of the characteristic weight by using the optimal constant index.
8. The method of claim 7, wherein the projection relationship is:
Wherein lambda i represents a homogeneous term, Representing homogeneous coordinates of the projected points, a i representing a camera internal parameter matrix, R i representing a rotation matrix of external parameters, T i representing an external parameter translation vector, and P representing spatial coordinates of the point P in a world coordinate system;
the projection relation is represented by a weighted least square method:
Where Λ represents a vector composed of homogeneous term values of the corresponding keypoints, C represents a vector composed of optical center coordinates, B is composed of L i in each image, W represents a diagonal matrix composed of weights of each image, and T is a transposed symbol.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410246151.9A CN118037690A (en) | 2024-03-05 | 2024-03-05 | Multi-objective weighted measurement method based on characteristic edge geometric relationship error |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410246151.9A CN118037690A (en) | 2024-03-05 | 2024-03-05 | Multi-objective weighted measurement method based on characteristic edge geometric relationship error |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118037690A true CN118037690A (en) | 2024-05-14 |
Family
ID=90987561
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410246151.9A Pending CN118037690A (en) | 2024-03-05 | 2024-03-05 | Multi-objective weighted measurement method based on characteristic edge geometric relationship error |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118037690A (en) |
-
2024
- 2024-03-05 CN CN202410246151.9A patent/CN118037690A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106408609B (en) | A kind of parallel institution end movement position and posture detection method based on binocular vision | |
CN102750697B (en) | Parameter calibration method and device | |
CN112053432B (en) | Binocular vision three-dimensional reconstruction method based on structured light and polarization | |
CN111223133B (en) | Registration method of heterogeneous images | |
CN103530880B (en) | Based on the camera marking method of projection Gaussian network pattern | |
CN113610917B (en) | Circular array target center image point positioning method based on blanking points | |
CN108876749A (en) | A kind of lens distortion calibration method of robust | |
CN104266608B (en) | Field calibration device for visual sensor and calibration method | |
CN106651942A (en) | Three-dimensional rotation and motion detecting and rotation axis positioning method based on feature points | |
CN105783786B (en) | Part chamfering measuring method and device based on structured light vision | |
CN109711321B (en) | Structure-adaptive wide baseline image view angle invariant linear feature matching method | |
CN109523595A (en) | A kind of architectural engineering straight line corner angle spacing vision measuring method | |
CN114255286A (en) | Target size measuring method based on multi-view binocular vision perception | |
CN111105452B (en) | Binocular vision-based high-low resolution fusion stereo matching method | |
CN112288758A (en) | Infrared and visible light image registration method for power equipment | |
CN109523492A (en) | The irregular distortion universe bearing calibration of wide angle camera | |
CN108182705A (en) | A kind of three-dimensional coordinate localization method based on machine vision | |
CN105423915A (en) | Accurate positioning method of planar target for ground laser scanning data registration | |
CN110838146A (en) | Homonymy point matching method, system, device and medium for coplanar cross-ratio constraint | |
CN117974492B (en) | Optimal control method and system for intelligent milling machine | |
CN116883590A (en) | Three-dimensional face point cloud optimization method, medium and system | |
CN118261835A (en) | Handheld calibration-free image distortion correction method and system | |
CN115187612A (en) | Plane area measuring method, device and system based on machine vision | |
CN113744324A (en) | Stereo matching method combining multiple similarity measures | |
CN110458951B (en) | Modeling data acquisition method and related device for power grid pole tower |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |