CN112325809A - Method for detecting flatness of flange - Google Patents
Method for detecting flatness of flange Download PDFInfo
- Publication number
- CN112325809A CN112325809A CN202110010364.8A CN202110010364A CN112325809A CN 112325809 A CN112325809 A CN 112325809A CN 202110010364 A CN202110010364 A CN 202110010364A CN 112325809 A CN112325809 A CN 112325809A
- Authority
- CN
- China
- Prior art keywords
- point cloud
- flange
- flatness
- detection
- point
- 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
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/30—Measuring arrangements characterised by the use of optical techniques for measuring roughness or irregularity of surfaces
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
The invention discloses a method for detecting the flatness of a flange, which comprises a stage of driving a 3D camera to acquire a surface profile of the flange by a hardware system and a stage of calculating the flatness by a software system, wherein the stage of calculating the flatness by the software system comprises the following steps: s1, preprocessing to generate point cloud; s2, spatial three-dimensional point cloud polar coordinate transformation; s3, point cloud denoising; s4, extracting detection sites; s5, fitting a flange reference plane; s6, calculating the flatness of the flange; compared with the prior art, the flatness detection method of the flange, disclosed by the invention, has the advantages that the flatness calculation is carried out according to the mass 3D point cloud data, the calculated flatness result is more scientific and reasonable than that of the flatness calculated by manually dotting and acquiring data by adopting a laser planometer manually at present, and the detection efficiency and the detection accuracy of the flange flatness are improved.
Description
Technical Field
The invention relates to the technical field of intelligent detection, in particular to a method for detecting the flatness of a flange.
Background
The high-precision measurement of the flatness is an important link in the process of machining, debugging and detecting, the diameter of a large-size circular ring type part is in the order of several meters, and the precision measurement of the flatness is always a difficult point. For example, large-size flanges are widely used in the wind power equipment industry, flatness of flanges at the top of a welded tower of a wind turbine generator system is required to be 0.5mm, flatness of flanges on a foundation ring is required to be 1.5mm, flatness of other flanges is required to be 2mm, and flatness values of the flanges are key points for manufacturing the tower. The detection method commonly used in the current industry is to use an imported laser leveling instrument for detection, and has the problems of complicated detection method, overlong detection time, potential safety hazard in a detection mode and the like.
Disclosure of Invention
The invention aims to provide a method for detecting the flatness of a flange, which is used for solving the technical problem.
The method for detecting the flatness of the flange comprises a stage of driving a 3D camera to acquire a surface profile diagram of the flange by a hardware system and a stage of calculating the flatness by a software system, wherein the stage of calculating the flatness by the software system comprises the following steps:
s1, preprocessing to generate point cloud: preprocessing a flange surface contour map acquired by a 3D camera and generating a rectangular strip-shaped point cloud;
s2, spatial three-dimensional point cloud polar coordinate transformation:
s21, translating the rectangular strip point cloud generated in the S1 to the positive direction of the y axis to enable the rectangular strip point cloud to be located above the y axis;
s22, converting the rectangular coordinates of each point on the rectangular strip-shaped point cloud into polar coordinates, and expressing the converted polar coordinates by using the rectangular coordinates;
s23, restoring the rectangular strip-shaped points into a point cloud in a circular ring shape according to the polar coordinates;
s3, point cloud denoising:
s31, setting an Euclidean distance segmentation threshold;
s32, dividing the point cloud into different parts according to an Euclidean distance threshold value;
s33, acquiring characteristics of different part point clouds;
s34, selecting a main point cloud of the flange according to the segmented model characteristics;
s4, detection site extraction:
s41, obtaining a rendering image of the flange point cloud under the two-dimensional image;
s42, extracting a detection site on the rendering map;
s5, fitting a flange reference plane:
s51, mapping the position extracted according to the detection position obtained in the step S42 to the three-dimensional point cloud to extract the detected point cloud;
s52, fitting the detection point cloud into a plane by using a least square method to obtain a reference plane;
s6, calculating the flatness of the flange:
s61, calculating the distance from each detection point to a reference plane;
s62, obtaining the absolute value of the difference between the maximum value and the minimum value of all the distances, wherein the value is the planeness.
According to an embodiment of the present invention, the step of preprocessing the contour map acquired by the 3D camera and generating the rectangular strip-shaped point cloud in S1 includes the following steps:
S11.3D camera SDK acquires the collected profile data;
s12, performing median filtering on the acquired contour map by using a 3D camera API;
s13, performing smooth filtering on the image subjected to median filtering by using a 3D camera API;
and S14, generating point cloud data by using the 3D camera API.
According to an embodiment of the present invention, in S22, the x and y coordinates of the point cloud are transformed, and the value of the z coordinate is not changed.
According to an embodiment of the present invention, the transformation method of the point cloud rectangular coordinates and the polar coordinates in S22 is as follows:
setting the length of the rectangular strip-shaped point cloud generated in the step S1 as L, and the rectangular coordinates of any point M on the rectangular strip-shaped point cloud in the rectangular coordinate system as (a, b);
if M points are set to correspond to M 'in polar coordinates, and M' has polar coordinates (θ, ρ) in polar coordinates, then in the polar coordinate diagram:
after M' (θ, ρ) is obtained, it is converted to a representation of rectangular coordinates (x, y):
then the original point M (x, y, z) is transformed from the rectangular coordinate system to the polar coordinate system to obtain M' ((X, Y, Z)),,z)。
According to an embodiment of the invention, the method for point cloud conversion in S22 is implemented by using a PCL algorithm, traversing all point clouds according to the width and height of the contour map converted into the point clouds, determining the x-direction distance of the actual point cloud according to the product of the x-axis resolution of the point cloud and the height of the contour map during calculation, and then implementing the conversion of the point cloud data according to a conversion calculation formula.
According to an embodiment of the present invention, the method of point cloud conversion in S22 is implemented using HALCON algorithm, receiving the values of x, y, z of the point cloud in an array form of HTuple type, and then generating a three-dimensional data model.
According to an embodiment of the present invention, the model feature in S34 is a number feature or a maximum diagonal length of a minimum bounding rectangle.
According to an embodiment of the present invention, the method of extracting the detection site in S42 is to extract the inner and outer ring detection sites at a midpoint position between the two flange holes.
According to an embodiment of the present invention, the algorithm for fitting the detection point cloud to the reference plane using the least square method in S52 is as follows:
Assume that n points need to be fitted: (x)i,yi,zi) I =1,2, … n, the sum of the distances of the n points to the fitting plane is s, then:
Then there are:
the following can be obtained:
the matrix can be represented as:
and obtaining the values of a, b and c by calculating the matrix, obtaining the normal vector of the fitting plane as (a, b, -1), and obtaining the reference plane according to the normal vector of the fitting plane.
According to an embodiment of the present invention, the method of calculating the distance from each detection point to the reference plane in S61 is as follows:
acquiring the point cloud of each detection position, and calculating the mean coordinate of the point cloud of each detection position () Setting the distance from each mean coordinate to the fitted reference plane as d, according to the formula:
and calculating the distance from each mean coordinate to the fitted reference plane.
Compared with the prior art, the flatness detection method of the flange has the following advantages:
according to the flange flatness detection method, flatness calculation is carried out according to mass 3D point cloud data, the calculated flatness result is more scientific and reasonable than that of the flatness calculated by manually dotting and collecting data through a laser planometer at present, and the flange flatness detection efficiency and the flange flatness detection accuracy are improved.
Drawings
FIG. 1 is a flow chart of a method of detecting flatness of a flange according to the present invention;
FIG. 2 is a schematic view of an actual flange shape;
FIG. 3 is a schematic diagram of the shape of the acquired point cloud;
FIG. 4 is a schematic diagram of a point cloud shape transformation relationship;
FIG. 5 is a rendering of a flange under a two-dimensional image;
FIG. 6 is a schematic view of the detection sites of the flange extracted from the rendering;
the implementation and advantages of the functions of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
In the following description, for purposes of explanation, numerous implementation details are set forth in order to provide a thorough understanding of the various embodiments of the present invention. It should be understood, however, that these implementation details are not to be interpreted as limiting the invention. That is, in some embodiments of the invention, such implementation details are not necessary. In addition, some conventional structures and components are shown in simplified schematic form in the drawings.
It should be noted that all the directional indicators (such as up, down, left and right, front and back … …) in the embodiment of the present invention are only used to explain the relative position relationship between the components, the movement situation, etc. in a specific posture (as shown in the figure), and if the specific posture is changed, the directional indicator is changed accordingly.
In addition, the descriptions related to the first, the second, etc. in the present invention are only used for description purposes, do not particularly refer to an order or sequence, and do not limit the present invention, but only distinguish components or operations described in the same technical terms, and are not understood to indicate or imply relative importance or implicitly indicate the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present invention.
For a further understanding of the contents, features and effects of the present invention, the following examples are illustrated in the accompanying drawings and described in the following detailed description:
the first embodiment is as follows:
referring to fig. 1, fig. 1 is a flowchart illustrating a method for detecting a flatness of a flange according to an embodiment of the present invention. As shown in fig. 1, the method for detecting the flatness of the flange includes a stage in which a hardware system drives a 3D camera to acquire a surface profile of the flange and a stage in which a software system performs flatness calculation, the hardware system used in the stage in which the hardware system drives the 3D camera to acquire the surface profile of the flange includes a rotation driving device and a rotating arm, the rotating arm is connected with the rotation driving device, the 3D camera is disposed on the rotating arm, when the stage in which the surface profile of the flange is acquired is performed, a rotation center of the rotating arm is aligned with a center of the flange to be detected, then the rotation driving device drives the rotating arm to rotate, the rotating arm drives the 3D camera to rotate around the flange to scan the surface of the flange and obtain a profile of the surface of the flange, the rotation driving device and the rotating arm used in; the software system carries out the planeness calculation stage and comprises the following steps:
s1, preprocessing to generate point cloud:
due to the problems of illumination or hardware and the like, individual abnormal points may exist in a contour map directly acquired by a 3D camera, the abnormal points will affect the stability of a detection result, and median filtering is a nonlinear signal processing technology capable of effectively suppressing noise based on a sorting statistical theory, in this embodiment, a median filtering method is used to effectively remove the abnormal points, and then smooth filtering is used to improve the robustness of detection, and the contour map preprocessed by the median filtering and the smooth filtering can directly generate a point cloud according to the API of the 3D camera for subsequent processing, which specifically includes the following steps:
S11.3D camera SDK acquires the collected profile data;
s12, performing median filtering on the acquired contour map by using a 3D camera API;
s13, performing smooth filtering on the image subjected to median filtering by using a 3D camera API;
s14, generating point cloud data by using a 3D camera API;
s2, spatial three-dimensional point cloud polar coordinate transformation:
referring to fig. 2 and 3, fig. 2 is a schematic view of an actual flange shape; fig. 3 is a schematic diagram of the shape of the acquired point cloud. As shown in fig. 2 and 3, the data collected by the 3D camera is performed by a rotational scanning manner, so that the obtained data is a rectangular strip after a circular ring is expanded, which is equivalent to converting the circular ring in a polar coordinate system into a rectangular shape in a rectangular coordinate, and performing flatness detection on the obtained point cloud, the rectangular strip-shaped point cloud needs to be restored to the shape of the circular ring, please refer to fig. 4, fig. 4 is a schematic diagram of a point cloud shape conversion relationship, as shown in fig. 4, the three-dimensional point cloud polar coordinate conversion specifically includes the following steps:
s21, translating the rectangular strip point cloud generated in S1 to the positive direction of the y axis to enable the rectangular strip point cloud to be located above the y axis, wherein the point cloud is obtained half way along the y axis, the point cloud is required to be translated to the y axis to transform the point cloud, and the translation point cloud does not influence detection data, so that the translation is only required to enable the rectangular strip point cloud to be located above the y axis;
s22, converting the rectangular coordinates of each point on the rectangular strip-shaped point cloud into polar coordinates, and expressing the converted polar coordinates by using the rectangular coordinates;
s23, restoring the rectangular strip-shaped points into a point cloud in a circular ring shape according to the polar coordinates;
s3, point cloud denoising:
the method comprises the following steps of obtaining complete flange shape point cloud after S2 transformation, wherein the scanned data not only contains the point cloud on the flange surface, but also has some discrete points generated in the flange hole or at the edge, and the discrete points need to be removed before detection, and the distances of the point cloud data scanned on the flange surface are uniformly distributed, and the distances between the discrete points and the main point cloud are different, so that Euclidean distance segmentation is used in the embodiment, the point cloud is segmented into different parts according to Euclidean distance threshold values, and the characteristics of the point cloud of different parts can be obtained after segmentation, and the method specifically comprises the following steps:
s31, setting an Euclidean distance segmentation threshold;
s32, dividing the point cloud into different parts according to an Euclidean distance threshold value;
s33, acquiring characteristics of different part point clouds;
s34, selecting main point clouds of the flanges according to the number characteristics after the segmentation;
s4, detection site extraction:
referring to fig. 5 and 6, fig. 5 is a rendering diagram of a flange under a two-dimensional image; fig. 6 is a schematic diagram of detection sites of a flange extracted from a rendering, as shown in fig. 5 and 6, the surface of the flange is relatively uniform, a specific deviation value of a detection position needs to be known, uniform sampling point extraction detection is used, the detection sites need to be selected according to two-dimensional flange image features, therefore, a rendering of a flange point cloud under a two-dimensional image needs to be obtained first, the detection position is extracted from the two-dimensional image, the detection position is located between an inner ring and an outer ring of the flange, and the surface of the flange is porous, so that the detection position needs to avoid the position of the hole, the distribution of the hole is uniform, and therefore, a midpoint position between the two holes is selected to extract the inner ring and outer ring detection sites, which specifically includes:
s41, obtaining a rendering image of the flange point cloud under the two-dimensional image;
s42, extracting inner and outer ring detection sites at the midpoint position between two flange holes on the rendering map;
s5, fitting a flange reference plane:
the flatness detection is based on reference plane detection, so a reference plane needs to be fitted for detecting the flatness before detecting the flatness, and the fitting of the reference plane comprises the following steps:
s51, mapping the position extracted according to the detection position obtained in the step S42 to the three-dimensional point cloud to extract the detected point cloud;
s52, fitting the detection point cloud into a plane by using a least square method to obtain a reference plane;
s6, calculating the flatness of the flange:
after obtaining the reference plane, the flatness of the flange may be calculated, the upper and lower planes parallel to the reference plane include all the measurement points on the flange in space, the minimum distance between the two planes is the flatness, since the distance from the point above the reference plane to the reference plane is a positive value, and the distance from the point below the reference plane to the reference plane is a negative value, the minimum distance between the two planes is calculated by calculating the distance from each detection point to the reference plane, and obtaining the absolute value of the difference between the maximum value and the minimum value of all the distances, and the absolute value of the difference between the maximum value and the minimum value is the sum of the absolute values of the distances from the two points to the reference plane, which is the flatness, specifically including the following steps:
s61, calculating the distance from each detection point to a reference plane;
s62, obtaining the absolute value of the difference between the maximum value and the minimum value of all the distances, wherein the value is the planeness.
In this embodiment, in S22, the x and y coordinates of the point cloud are transformed, and the value of the z coordinate is not changed.
In the specific detection, the conversion method of the point cloud rectangular coordinate and the polar coordinate in the S22 is as follows:
referring to fig. 4 again, as shown in fig. 4, the length of the rectangular strip-shaped point cloud generated in S1 is set to be L, and the rectangular coordinate of any point M on the rectangular strip-shaped point cloud in the rectangular coordinate system is set to be (a, b);
if M points are set to correspond to M 'in polar coordinates, and M' has polar coordinates (θ, ρ) in polar coordinates, then in the polar coordinate diagram:
after M' (θ, ρ) is obtained, it is converted to a representation of rectangular coordinates (x, y):
then the original point M (x, y, z) is transformed from the rectangular coordinate system to the polar coordinate system to obtain M' ((X, Y, Z)),,z)。
In this embodiment, the method for point cloud conversion in S22 is implemented by using a PCL algorithm, traversing all the point clouds according to the width and height of the contour map converted into the point clouds, determining the distance in the x direction of the actual point cloud according to the product of the x-axis resolution of the point cloud and the height of the contour map during calculation, and then implementing the conversion of the point cloud data according to the conversion calculation formula.
In the present embodiment, the algorithm for fitting the detection point cloud to the reference plane using the least square method in S52 is as follows:
Assume that n points need to be fitted: (x)i,yi,zi) I =1,2, … n, the sum of the distances of the n points to the fitting plane is s, then:
Then there are:
the following can be obtained:
the matrix can be represented as:
and obtaining the values of a, b and c by calculating the matrix, obtaining the normal vector of the fitting plane as (a, b, -1), and obtaining the reference plane according to the normal vector of the fitting plane.
In the present embodiment, the method of calculating the distance from each detection point to the reference plane in S61 is as follows:
acquiring the point cloud of each detection position, and calculating the mean coordinate of the point cloud of each detection position () Setting the distance from each mean coordinate to the fitted reference plane as d, according to the formula:
and calculating the distance from each mean coordinate to the fitted reference plane.
Example two:
referring back to fig. 1 to 6, as shown in fig. 1 to 6, the method for detecting the flatness of the flange includes a stage in which a hardware system drives a 3D camera to acquire a surface profile of the flange and a stage in which a software system performs flatness calculation, the hardware system used in the stage in which the hardware system drives the 3D camera to acquire the surface profile of the flange includes a rotation driving device and a rotation arm, the rotation arm is connected to the rotation driving device, the 3D camera is disposed on the rotation arm, when the stage in which the surface profile of the flange is acquired is performed, a rotation center of the rotation arm is aligned with a center of the flange to be detected, then the rotation driving device drives the rotation arm to rotate, and the rotation arm drives the 3D camera to rotate around the flange to scan the surface; the software system carries out the planeness calculation stage and comprises the following steps:
s1, preprocessing to generate point cloud:
S11.3D camera SDK acquires the collected profile data;
s12, performing median filtering on the acquired contour map by using a 3D camera API;
s13, performing smooth filtering on the image subjected to median filtering by using a 3D camera API;
s14, generating point cloud data by using a 3D camera API;
s2, spatial three-dimensional point cloud polar coordinate transformation:
s21, translating the rectangular strip point cloud generated in the S1 to the positive direction of the y axis to enable the rectangular strip point cloud to be located above the y axis;
s22, converting the rectangular coordinates of each point on the rectangular strip-shaped point cloud into polar coordinates, and expressing the converted polar coordinates by using the rectangular coordinates;
in this embodiment, in S22, the x and y coordinates of the point cloud are transformed, and the value of the z coordinate is not changed.
In the specific detection, the conversion method of the point cloud rectangular coordinate and the polar coordinate in the S22 is as follows:
referring to fig. 4 again, as shown in fig. 4, the length of the rectangular strip-shaped point cloud generated in S1 is set to be L, and the rectangular coordinate of any point M on the rectangular strip-shaped point cloud in the rectangular coordinate system is set to be (a, b);
if M points are set to correspond to M 'in polar coordinates, and M' has polar coordinates (θ, ρ) in polar coordinates, then in the polar coordinate diagram:
after M' (θ, ρ) is obtained, it is converted to a representation of rectangular coordinates (x, y):
then the original point M (x, y, z) is transformed from the rectangular coordinate system to the polar coordinate system to obtain M' ((X, Y, Z)),,z)。
In specific application, the method for converting the point cloud is realized by using HALCON algorithm, the values of x, y and z of the point cloud are received in an array form of HTuple type, and then a three-dimensional data model is generated.
S23, restoring the rectangular strip-shaped points into a point cloud in a circular ring shape according to the polar coordinates;
s3, point cloud denoising:
s31, setting an Euclidean distance segmentation threshold;
s32, dividing the point cloud into different parts according to an Euclidean distance threshold value;
s33, acquiring characteristics of different part point clouds;
s34, selecting a main point cloud of the flange according to the maximum diagonal length of the partitioned minimum external rectangle;
s4, detection site extraction:
s41, obtaining a rendering image of the flange point cloud under the two-dimensional image;
s42, extracting inner and outer ring detection sites at the midpoint position between two flange holes on the rendering map;
s5, fitting a flange reference plane:
s51, mapping the position extracted according to the detection position obtained in the step S42 to the three-dimensional point cloud to extract the detected point cloud;
s52, fitting the detection point cloud into a plane by using a least square method to obtain a reference plane;
the algorithm for fitting the detection point cloud to the reference plane using the least squares method is as follows:
Assume that n points need to be fitted: (x)i,yi,zi) I =1,2, … n, the sum of the distances of the n points to the fitting plane is s, then:
Then there are:
the following can be obtained:
the matrix can be represented as:
and obtaining the values of a, b and c by calculating the matrix, obtaining the normal vector of the fitting plane as (a, b, -1), and obtaining the reference plane according to the normal vector of the fitting plane.
S6, calculating the flatness of the flange:
s61, calculating the distance from each detection point to a reference plane;
in the present embodiment, the method of calculating the distance from each detection point to the reference plane in S61 is as follows:
acquiring the point cloud of each detection position, and calculating the mean coordinate of the point cloud of each detection position () Setting the distance from each mean coordinate to the fitted reference plane as d, according to the formula:
and calculating the distance from each mean coordinate to the fitted reference plane.
S62, obtaining the absolute value of the difference between the maximum value and the minimum value of all the distances, wherein the value is the planeness.
Example three:
referring to fig. 1 to 6, as shown in fig. 1 to 6, the present embodiment describes a method for detecting flatness by taking a flange with a diameter of 1 meter as an example:
the hardware system drives the 3D camera to acquire the surface profile of the flange:
aligning the rotation center of the rotating arm with the center of the flange to be detected, driving the rotating arm to rotate by the rotation driving device, and driving the 3D camera to rotate around the flange by the rotating arm to scan the surface of the flange and obtain a contour map of the surface of the flange;
the software system carries out a planeness calculation stage:
s1, preprocessing to generate point cloud:
S11.3D camera SDK acquires the collected profile data;
s12, performing median filtering on the acquired contour map by using a 3D camera API;
s13, performing smooth filtering on the image subjected to median filtering by using a 3D camera API;
s14, generating point cloud data by using a 3D camera API;
s2, spatial three-dimensional point cloud polar coordinate transformation:
s21, translating the rectangular strip point cloud generated in S1 to the positive direction of the y axisThe distance of (2) is such that the rectangular strip point cloud is located above the y-axis;
s22, converting the rectangular coordinates of each point on the rectangular strip-shaped point cloud into polar coordinates, and expressing the converted polar coordinates by using the rectangular coordinates;
in this embodiment, in S22, the x and y coordinates of the point cloud are transformed, and the value of the z coordinate is not changed.
In the specific detection, the conversion method of the point cloud rectangular coordinate and the polar coordinate in the S22 is as follows:
referring to fig. 4 again, as shown in fig. 4, the length of the rectangular strip-shaped point cloud generated in S1 is set to be L, and the rectangular coordinate of any point M on the rectangular strip-shaped point cloud in the rectangular coordinate system is set to be (a, b);
if M points are set to correspond to M 'in polar coordinates, and M' has polar coordinates (θ, ρ) in polar coordinates, then in the polar coordinate diagram:
after M' (θ, ρ) is obtained, it is converted to a representation of rectangular coordinates (x, y):
then the original point M (x, y, z) is transformed from the rectangular coordinate system to the polar coordinate system to obtain M' ((X, Y, Z)),,z)。
In specific application, the method for converting the point cloud is realized by using HALCON algorithm, the values of x, y and z of the point cloud are received in an array form of HTuple type, and then a three-dimensional data model is generated.
S23, restoring the rectangular strip-shaped points into a point cloud in a circular ring shape according to the polar coordinates;
s3, point cloud denoising:
s31, setting an Euclidean distance segmentation threshold, wherein the threshold is set to be 0.5 in the embodiment;
the Euclidean distance has the following counting formula:
taking a flanged point cloud segmentation with a diameter of 1 meter as an example, the resolution of the point cloud obtained by the method is 0.3925 in the x direction (the distance between adjacent points in the x direction is 0.3925 mm), and the resolution of the point cloud obtained in the y direction is 0.364 (the distance between adjacent points in the y direction is 0.364 mm), so that about 130 ten thousand points can be obtained. Assuming that all points are on a plane (i.e. z has equal value), the minimum distance between two points is 0.364 and the maximum distance is 0.3925, if the euclidean distance segmentation threshold is set to be greater than 0.3925 (maximum distance), which means that the distances between adjacent points are within the threshold, all points are in a set; if the euclidean distance segmentation threshold is set to less than 0.364 (minimum distance) then all points are segmented and each point is a separate set. In practical situations, the values of adjacent points z have differences, especially the difference between the values of discrete points z is significant, so that discrete points can be separated by setting the threshold value to 0.5. The higher the threshold, the faster the split time, with a 1 meter diameter flange containing 130 ten thousand points, and with a threshold of 0.5, the split time required was 1.1 s.
S32, dividing the point cloud into different parts according to an Euclidean distance threshold value;
s33, acquiring characteristics of different part point clouds;
s34, selecting a main point cloud of the flange according to the maximum diagonal length of the partitioned minimum external rectangle; the diameter of the flange with the diameter of 1 meter is 1000mm, so that the flange body with the diameter of 1 meter can be confirmed by setting the maximum diagonal length of the minimum circumscribed rectangle to be 800, namely more than 800;
s4, detection site extraction:
s41, obtaining a rendering image of the flange point cloud under the two-dimensional image;
s42, extracting inner and outer ring detection sites at the midpoint position between two flange holes on the rendering map; referring to fig. 5 and 6, as shown in the figure, the flange with a diameter of 1 m has 30 holes, and the size of the detection position is calculated according to the size of the hole, so that the total number of all the extracted position points is about 15 ten thousand points;
s5, fitting a flange reference plane:
s51, mapping the position extracted according to the detection position obtained in the step S42 to the three-dimensional point cloud to extract the detected point cloud;
s52, fitting the detection point cloud into a plane by using a least square method to obtain a reference plane;
the algorithm for fitting the detection point cloud to the reference plane using the least squares method is as follows:
Assume that n points need to be fitted: (x)i,yi,zi) I =1,2, … n, the sum of the distances of the n points to the fitting plane is s, then:
Then there are:
the following can be obtained:
the matrix can be represented as:
and obtaining the values of a, b and c by calculating the matrix, obtaining the normal vector of the fitting plane as (a, b, -1), and obtaining the reference plane according to the normal vector of the fitting plane.
S6, calculating the flatness of the flange:
s61, calculating the distance from each detection point to a reference plane;
in the present embodiment, the method of calculating the distance from each detection point to the reference plane in S61 is as follows:
acquiring the point cloud of each detection position, and calculating the mean coordinate of the point cloud of each detection position () Setting the distance from each mean coordinate to the fitted reference plane as d, according to the formula:
and calculating the distance from each mean coordinate to the fitted reference plane.
S62, obtaining the absolute value of the difference between the maximum value and the minimum value of all the distances, wherein the value is the planeness.
The present invention is not limited to the above preferred embodiments, and any modification, equivalent replacement or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (8)
1. The method for detecting the flatness of the flange comprises a stage of driving a 3D camera to acquire a surface profile of the flange by a hardware system and a stage of calculating the flatness by a software system, and is characterized in that the stage of calculating the flatness by the software system comprises the following steps:
s1, preprocessing to generate point cloud: preprocessing a flange surface contour map acquired by a 3D camera and generating a rectangular strip-shaped point cloud;
s2, spatial three-dimensional point cloud polar coordinate transformation:
s21, translating the rectangular strip point cloud generated in the S1 to the positive direction of the y axis to enable the rectangular strip point cloud to be located above the y axis;
s22, converting the rectangular coordinates of each point on the rectangular strip-shaped point cloud into polar coordinates, and expressing the converted polar coordinates by using the rectangular coordinates;
s23, restoring the rectangular strip-shaped points into a point cloud in a circular ring shape according to the polar coordinates;
s3, point cloud denoising:
s31, setting an Euclidean distance segmentation threshold;
s32, dividing the point cloud into different parts according to an Euclidean distance threshold value;
s33, acquiring characteristics of different part point clouds;
s34, selecting a main point cloud of the flange according to the segmented model characteristics;
s4, detection site extraction:
s41, obtaining a rendering image of the flange point cloud under the two-dimensional image;
s42, extracting a detection site on the rendering map;
s5, fitting a flange reference plane:
s51, mapping the position extracted according to the detection position obtained in the step S42 to the three-dimensional point cloud to extract the detected point cloud;
s52, fitting the detection point cloud into a plane by using a least square method to obtain a reference plane;
s6, calculating the flatness of the flange:
s61, calculating the distance from each detection point to a reference plane;
s62, obtaining the absolute value of the difference between the maximum value and the minimum value of all the distances, wherein the value is the planeness.
2. The method for detecting the flatness of the flange according to claim 1, wherein the step of preprocessing the contour map acquired by the 3D camera and generating the rectangular strip-shaped point cloud in S1 comprises the steps of:
S11.3D camera SDK acquires the collected profile data;
s12, performing median filtering on the acquired contour map by using a 3D camera API;
s13, performing smooth filtering on the image subjected to median filtering by using a 3D camera API;
and S14, generating point cloud data by using the 3D camera API.
3. The method for detecting the flatness of the flange according to claim 1, wherein x and y coordinates of the point cloud are transformed in S22, and a value of the z coordinate is not changed.
4. The flatness detecting method of a flange according to claim 3, wherein a transformation method of a point cloud rectangular coordinate and a polar coordinate in S22 is as follows:
setting the length of the rectangular strip-shaped point cloud generated in the step S1 as L, and the rectangular coordinates of any point M on the rectangular strip-shaped point cloud in the rectangular coordinate system as (a, b);
if M points are set to correspond to M 'in polar coordinates, and M' has polar coordinates (θ, ρ) in polar coordinates, then in the polar coordinate diagram:
after M' (θ, ρ) is obtained, it is converted to a representation of rectangular coordinates (x, y):
5. The flange flatness detecting method according to claim 4, wherein the method of point cloud conversion in S22 is implemented by using PCL algorithm, traversing all the point clouds according to the width and height of the outline map converted into the point clouds, determining the distance in the x direction of the actual point clouds according to the product of the x-axis resolution of the point clouds and the height of the outline map during calculation, and then implementing the conversion of the point cloud data according to the conversion calculation formula.
6. The method for detecting the flatness of the flange according to claim 4, wherein the method for point cloud conversion in S22 is implemented by using HALCON algorithm, and the values of x, y and z of the point cloud are received in array form of HTuple type, and then a three-dimensional data model is generated.
7. The flatness detecting method of a flange according to claim 4, wherein the model feature in S34 is a number feature or a maximum diagonal length of a minimum bounding rectangle.
8. The method for detecting the flatness of a flange according to claim 1, wherein the method for extracting the detection sites in S42 is to extract the inner and outer detection sites at a midpoint position between two flange holes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110010364.8A CN112325809A (en) | 2021-01-06 | 2021-01-06 | Method for detecting flatness of flange |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110010364.8A CN112325809A (en) | 2021-01-06 | 2021-01-06 | Method for detecting flatness of flange |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112325809A true CN112325809A (en) | 2021-02-05 |
Family
ID=74302493
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110010364.8A Pending CN112325809A (en) | 2021-01-06 | 2021-01-06 | Method for detecting flatness of flange |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112325809A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113959375A (en) * | 2021-08-25 | 2022-01-21 | 广东技术师范大学 | Image acquisition method of tower drum flange flatness detection equipment |
CN114018183A (en) * | 2021-10-21 | 2022-02-08 | 湖南恒岳重钢钢结构工程有限公司 | Device and method for measuring flatness of tower barrel |
CN114353733A (en) * | 2022-03-15 | 2022-04-15 | 深圳市信润富联数字科技有限公司 | Method and device for detecting flatness of hub flange, storage medium and electronic equipment |
CN115143866A (en) * | 2021-03-31 | 2022-10-04 | 广东博智林机器人有限公司 | Measuring device, coordinate obtaining method and flatness and verticality measuring method |
WO2022262809A1 (en) * | 2021-06-17 | 2022-12-22 | 中交疏浚技术装备国家工程研究中心有限公司 | Calculation method for measuring flatness of cross-section of tunnel segment based on spatial point-to-plane relation |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05312554A (en) * | 1992-05-08 | 1993-11-22 | Toshiba Corp | Instrument for measuring flatness of sealed surface |
CN102980550A (en) * | 2012-11-26 | 2013-03-20 | 青岛港湾职业技术学院 | High-precision detection instrument for measuring flatness of large machine part and measurement method thereof |
CN104515481A (en) * | 2014-12-17 | 2015-04-15 | 中国科学院长春光学精密机械与物理研究所 | Device and method for measuring planeness of large-diameter torus |
CN108898672A (en) * | 2018-04-27 | 2018-11-27 | 厦门维斯云景信息科技有限公司 | A kind of semi-automatic cloud method making three-dimensional high-definition mileage chart lane line |
CN109405755A (en) * | 2018-12-13 | 2019-03-01 | 西安交通大学 | A kind of large scale tube sheet aperture and pitch measurement device and measurement method |
CN109556540A (en) * | 2018-11-07 | 2019-04-02 | 西安电子科技大学 | A kind of contactless object plane degree detection method based on 3D rendering, computer |
CN110186363A (en) * | 2018-12-25 | 2019-08-30 | 中国船舶重工集团公司第七一五研究所 | A kind of flatness inspection devices and measurement method |
CN111365200A (en) * | 2020-04-11 | 2020-07-03 | 湖南恒岳重钢钢结构工程有限公司 | Flatness detection method for tower flange of wind generating set |
-
2021
- 2021-01-06 CN CN202110010364.8A patent/CN112325809A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05312554A (en) * | 1992-05-08 | 1993-11-22 | Toshiba Corp | Instrument for measuring flatness of sealed surface |
CN102980550A (en) * | 2012-11-26 | 2013-03-20 | 青岛港湾职业技术学院 | High-precision detection instrument for measuring flatness of large machine part and measurement method thereof |
CN104515481A (en) * | 2014-12-17 | 2015-04-15 | 中国科学院长春光学精密机械与物理研究所 | Device and method for measuring planeness of large-diameter torus |
CN108898672A (en) * | 2018-04-27 | 2018-11-27 | 厦门维斯云景信息科技有限公司 | A kind of semi-automatic cloud method making three-dimensional high-definition mileage chart lane line |
CN109556540A (en) * | 2018-11-07 | 2019-04-02 | 西安电子科技大学 | A kind of contactless object plane degree detection method based on 3D rendering, computer |
CN109405755A (en) * | 2018-12-13 | 2019-03-01 | 西安交通大学 | A kind of large scale tube sheet aperture and pitch measurement device and measurement method |
CN110186363A (en) * | 2018-12-25 | 2019-08-30 | 中国船舶重工集团公司第七一五研究所 | A kind of flatness inspection devices and measurement method |
CN111365200A (en) * | 2020-04-11 | 2020-07-03 | 湖南恒岳重钢钢结构工程有限公司 | Flatness detection method for tower flange of wind generating set |
Non-Patent Citations (1)
Title |
---|
徐玉冰等: "一种圆环内斑点分割的新方法", 《无线互联科技》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115143866A (en) * | 2021-03-31 | 2022-10-04 | 广东博智林机器人有限公司 | Measuring device, coordinate obtaining method and flatness and verticality measuring method |
WO2022262809A1 (en) * | 2021-06-17 | 2022-12-22 | 中交疏浚技术装备国家工程研究中心有限公司 | Calculation method for measuring flatness of cross-section of tunnel segment based on spatial point-to-plane relation |
CN113959375A (en) * | 2021-08-25 | 2022-01-21 | 广东技术师范大学 | Image acquisition method of tower drum flange flatness detection equipment |
CN113959375B (en) * | 2021-08-25 | 2023-07-07 | 广东技术师范大学 | Image acquisition method of tower flange flatness detection equipment |
CN114018183A (en) * | 2021-10-21 | 2022-02-08 | 湖南恒岳重钢钢结构工程有限公司 | Device and method for measuring flatness of tower barrel |
CN114353733A (en) * | 2022-03-15 | 2022-04-15 | 深圳市信润富联数字科技有限公司 | Method and device for detecting flatness of hub flange, storage medium and electronic equipment |
CN114353733B (en) * | 2022-03-15 | 2022-06-28 | 深圳市信润富联数字科技有限公司 | Method and device for detecting flatness of hub flange, storage medium and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112325809A (en) | Method for detecting flatness of flange | |
CN109945853B (en) | Geographic coordinate positioning system and method based on 3D point cloud aerial image | |
CN108389250B (en) | Method for rapidly generating building section map based on point cloud data | |
KR20190082062A (en) | Method and apparatus for determining a matching relationship between point cloud data | |
JP5699788B2 (en) | Screen area detection method and system | |
CN103632366B (en) | A kind of parameter identification method of ellipse target | |
CN104766302B (en) | A kind of method and system using unmanned plane image optimization Point Cloud of Laser Scanner | |
CN101303768B (en) | Method for correcting circle center error of circular index point when translating camera perspective projection | |
CN110672020A (en) | Stand tree height measuring method based on monocular vision | |
CN107767456A (en) | A kind of object dimensional method for reconstructing based on RGB D cameras | |
CN108225184A (en) | A kind of shield tunnel Point Cloud Data from Three Dimension Laser Scanning removes the method made an uproar | |
CN110807772B (en) | Bounding box-based irrelevant point cloud eliminating method in component size detection | |
CN109345471B (en) | Method for measuring and drawing high-precision map data based on high-precision track data | |
CN112648976B (en) | Live-action image measuring method and device, electronic equipment and storage medium | |
CN112907601B (en) | Automatic extraction method and device for tunnel arch point cloud based on feature transformation | |
CN106056121A (en) | Satellite assembly workpiece fast-identification method based on SIFT image feature matching | |
CN114677435A (en) | Point cloud panoramic fusion element extraction method and system | |
Yang et al. | Auto-recognition Method for Pointer-type Meter Based on Binocular Vision. | |
CN114241018A (en) | Tooth point cloud registration method and system and readable storage medium | |
CN116844147A (en) | Pointer instrument identification and abnormal alarm method based on deep learning | |
CN116524109A (en) | WebGL-based three-dimensional bridge visualization method and related equipment | |
CN111815580B (en) | Image edge recognition method and small module gear module detection method | |
CN112767459A (en) | Unmanned aerial vehicle laser point cloud and sequence image registration method based on 2D-3D conversion | |
Zhu et al. | A fast and accurate algorithm for chessboard corner detection | |
JP2013186655A (en) | Road sign detection device and program |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210205 |
|
RJ01 | Rejection of invention patent application after publication |