A large skin edge defect detection method based on multi-scale neighborhood

Through multi-scale neighborhood analysis and local mask feature detection, the accuracy and reliability problems of skin edge detection in the existing technology are solved, and efficient and accurate edge defect detection of three-dimensional point cloud images is achieved, which is suitable for large-scale skin. Precision detection.

CN114565629BActive Publication Date: 2024-09-06HUNAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210189810.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-28
Publication Date
2024-09-06
Estimated Expiration
2042-02-28

AI Technical Summary

Technical Problem

Existing skin edge detection methods are mainly based on artificial vision, which is difficult to quantify. The detection process is labor-intensive and reliability cannot be guaranteed. Moreover, the edge extraction method of two-dimensional images cannot clearly express the pose of the three-dimensional skin edge, and the accuracy is limited by the image resolution. , it is difficult to meet the edge defect detection requirements of large skins.

Method used

Using a large-scale skin edge defect detection method based on multi-scale neighborhoods, by obtaining three-dimensional point cloud coordinates, calculating multi-scale neighborhood neighbor point sets, performing two-dimensional projection vector calculation and space vacancy percentage analysis, clustering and ordering points Cloud uses local one-dimensional masks to detect angle changes of feature vectors to achieve large-scale skin edge defect detection.

Benefits of technology

It improves the operating efficiency of 3D image edge recognition, improves the recognition success rate, and achieves more accurate edge defect detection in point cloud images. It has high algorithm robustness and is suitable for precision detection fields with large scale and complex structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114565629B
    Figure CN114565629B
Patent Text Reader

Abstract

The present invention discloses a large-scale skin edge defect detection method based on multi-scale neighborhood. The method constructs a multi-scale spatial search method to better judge the spatial information of the corresponding key points, and optimizes the search direction and identifies the edge points of the three-dimensional point cloud based on this, which greatly improves the operating efficiency of the three-dimensional image edge recognition and improves the recognition success rate; at the same time, the extracted boundary points are ordered, and the defects are detected by mask feature value changes. The method can realize the edge defect detection of point cloud images more accurately in a shorter time, has extremely high algorithm robustness, and can be applied to large-scale, complex-structured and high-efficiency precision detection fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of defect detection, and in particular relates to a large skin edge defect detection method based on multi-scale neighborhood. Background Art

[0002] With the rapid development of science and technology, image acquisition equipment has been able to obtain more and more accurate point cloud images with increasingly large data volumes. In the aerospace intelligent manufacturing system, non-contact high-precision defect detection methods based on three-dimensional machine vision algorithms have always been a research direction focused on by scholars. Defect detection methods based on point cloud images have a decisive role in promoting the development of aerospace intelligent manufacturing technology.

[0003] As an important part of the aircraft body, large skin is a key part for maintaining normal cabin air pressure and a certain body rigidity. During the skin assembly and daily maintenance process, the thickness, splicing gap, drilling accuracy, etc. of the skin have strict precision requirements. The existing edge detection method of the skin is mainly based on manual visual inspection. Its detection standard is difficult to quantify, and the detection process consumes manpower and reliability cannot be guaranteed; and large-sized skin is difficult to measure on a special aircraft. Therefore, the proposed vision-based edge detection method is of great significance for high-precision detection of large skins.

[0004] Currently, the most widely used edge extraction method is the Laplacian operator edge extraction method based on two-dimensional images, which uses the second-order derivatives of two-dimensional images in two directions to obtain image change values. The pixels of the edge extraction method of two-dimensional images cannot clearly represent the edge position of the three-dimensional skin. The accuracy is limited by the image resolution, and one dimension of information is lost. In actual industrial surface reconstruction, noise, lighting, system parameter correction, etc. often make the algorithm difficult to be effective, and cannot achieve good detection and adaptability to a wide range of industrial implementations. When applied to specific objects, it can only guarantee an ideal two-dimensional edge detection, which is difficult to meet the requirements of edge defect detection of large skins. Summary of the invention

[0005] In view of the above technical problems, the present invention provides a large skin edge defect detection method based on multi-scale neighborhood.

[0006] The technical solution adopted by the present invention to solve the technical problem is:

[0007] A large skin edge defect detection method based on multi-scale neighborhood, the method comprising the following steps:

[0008] Step S100: obtaining the three-dimensional point cloud coordinates of the large skin, and calculating the multi-scale neighborhood neighbor point set according to the three-dimensional point cloud coordinates;

[0009] Step S200: at each scale, calculate the two-dimensional projection vectors of the neighborhood neighbor point set on three preset reference planes, calculate and arrange the angles of all adjacent vectors on the projection feature planes of each preset reference plane, obtain the maximum angle corresponding to each projection feature plane from the angles of all adjacent vectors after arrangement corresponding to each projection feature plane, and obtain the spatial vacancy percentage of each projection plane according to the maximum angle;

[0010] Step S300: obtaining the sum eigenvalue of the three projection planes according to the spatial vacancy percentage of each projection plane and a preset hyperparameter threshold, and obtaining a point cloud boundary point set according to the sum eigenvalue of the three projection planes;

[0011] Step S400: clustering and ordering the point cloud according to the point cloud boundary point set and the view direction search mechanism, and outputting a plurality of ordered point cloud class sets with marked points;

[0012] Step S500: Utilize the ordered point cloud class set in step S400, add a local one-dimensional mask, calculate the angle change value of the feature vector before and after the mask, take the marker point interval segment point set whose angle change value of the feature vector is less than the preset angle threshold, measure the defect parameters of the interval segment, and realize large skin edge defects.

[0013] Preferably, step S100 is specifically:

[0014] At point P0, take the neighborhood radius r of P0 n All point sets in , specifically:

[0015] Srn={Pi|||P i -P0||∈r n}

[0016]

[0017] Among them, r n (n=1, 2, ..., L, L is a natural number) The radii at multiple scales are: r<r1, r1<r<r2, ..., rL-1<r<rL, (xpi, ypi, zpi) are the three-dimensional point cloud coordinates of point Pi, and (xp0, yp0, zp0) are the three-dimensional point cloud coordinates of point P0.

[0018] Preferably, in step S200, at each scale, the two-dimensional projection vectors of the neighborhood neighbor point set on three preset reference planes are calculated, specifically:

[0019] For the neighborhood point set S rn ={Pi|||Pi-P0||∈r n All points P in i Take P0 as the origin to establish a new point set with relative distance, specifically:

[0020] P i_new =P i -P0,P i_new ∈R 3x1

[0021] Among them, R 3x1 represents a 3-by-1 real field vector;

[0022] P i_new =(x i ,y i , z i ) is abbreviated as P ni ;

[0023] The three preset reference planes are: the xy reference plane with vectors through the vector group (a, b) = {a = (1, 0, 0), b = (0, 1, 0)}, the xz reference plane with vectors through the vector group (a, b) = {a = (1, 0, 0), b = (0, 0, 1)}, and the yz reference plane with vectors through the vector group (a, b) = {a = (0, 1, 0), b = (0, 0, 1)};

[0024] The vector of the neighborhood point set projected on the corresponding reference plane is recorded as:

[0025] (a j , b j )=(P ni .*a,P ni ·*b)

[0026] Among them, (a j , b j ) represents the vector of the neighborhood point set projected onto the corresponding reference plane, and .* represents the vector dot product.

[0027] Preferably, in step S200, the angles of all adjacent vectors are calculated and arranged on each projection feature plane, the maximum angle corresponding to each projection feature plane is obtained from the angles of all adjacent vectors after the arrangement of each projection feature plane, and the spatial vacancy percentages of three preset reference planes are obtained according to the maximum angle, including:

[0028] Step S210: Taking the two-dimensional vector after the projection of the first vector of the vector group (a, b) of each projection feature plane as the reference vector, calculate the point P in the concentration of all neighboring points in the neighborhood ni The angle α between the projected vector on the corresponding projection feature plane and the reference vector j , specifically:

[0029] α j =tan(b j / a j )| j∈(1,2,...,m)

[0030] Among them, m is the number of points in the field;

[0031] Step S220: Set all {α j}| j∈(1,2,...,m) According to α j Arrange the values ​​in ascending order to obtain {α1, α2, ..., α m}, and obtain the angle difference of adjacent projection vectors {θ1, θ2, ..., θ m}={α2-α1, α3-α2,...,α m -α m-1 , α1- αm+2π;

[0032] Step S230: Obtain the maximum angle corresponding to each projection feature plane from the angles of all adjacent vectors arranged corresponding to each projection feature plane, specifically:

[0033] θ max = max{θ1, θ2, ..., θ m}

[0034] The spatial vacancy percentages of the three preset reference planes are obtained according to the maximum angle, specifically:

[0035]

[0036] Preferably, step S300 includes:

[0037] Step S310: Screening points whose percentage of vacant space on the projection plane is greater than a preset hyperparameter threshold, and setting the projection plane feature value corresponding to the point to 1;

[0038] Step S320: Obtain the sum of the three projection plane eigenvalues ​​according to the eigenvalues ​​of each projection plane corresponding to the point, and take the point whose sum of the three projection plane eigenvalues ​​is 3 as the point cloud boundary point with the largest space gap. The boundary point set is recorded as S edge , where the sum eigenvalue of the three projection planes ranges from (0, 1, 2, 3).

[0039] Preferably, step S400 includes:

[0040] Step S410: edge The Kdtree is built and the nearest T neighbors are taken for each point;

[0041] Step S420: Randomly select edge Select a point P from the set s As a starting point, P s The T nearest neighbors from near to far are represented as Pneighbor = {P1, P2, ..., P T}, with Ps The initial point record is the current ordered point cloud class C;

[0042] Step S430: Get P s The nearest point P1 is used as the next starting point P s_new , P s_new Add the current ordered point cloud class sequence C, specifically: {C→P s_new}, where {→} is the direction of the ordered point cloud series, defining the displacement vector V=P between the current starting point and the previous starting point s_new -P s , when S edge When it is empty, jump to S460;

[0043] Step S440: Remove P neighbor = {P1, P2, ..., P T}, the starting point that already exists in the current ordered point cloud class sequence C, takes the current displacement vector V as a reference, and moves from P neighbor In the search, the next starting point is searched from near to far according to the distance, and a new displacement vector is calculated. new The angle between the displacement vector and the current displacement vector V is obtained, and the point where the displacement vector angle is greater than the preset angle threshold th_v is marked as a marked point;

[0044] Step S450: When P neighbor When it is empty, in S edge The current ordered point cloud class C is deleted from the collection, and the process returns to step S420, otherwise, the process returns to step S430;

[0045] Step S460: End the iteration and output the ordered point cloud sequence set with marked points after clustering.

[0046] Preferably, step S440 further includes:

[0047] When the displacement vector angle is less than the preset angle threshold th_v, the corresponding point is set as the new starting point, and the new displacement vector is recorded as the current displacement vector V; when the displacement vector angles corresponding to all neighboring points are greater than the preset angle threshold th_v, the vector (V new *V) The maximum point is taken as the new starting point, and the new starting point is incorporated into the set of marked points.

[0048] Preferably, step S500 includes:

[0049] Step S510: selecting the top N categories of the ordered point cloud class sequence set with marked points output in step S400 according to the principle of point quantity;

[0050] Step S520: In each category, a rectangular window function is applied to the point cloud between all two marked points to cover the point set of the corresponding interval segment, and the angle between the weighted total displacement vectors at both ends is calculated to obtain the feature vector angle change value;

[0051] Step S530: output a point cloud set between marker points whose feature vector angle change value is less than a preset angle threshold th_v, measure defect parameters of the corresponding area, and realize large-scale skin defect detection.

[0052] Preferably, step S520 includes:

[0053] Step S521: In each category, take the set of landmark point interval segments, expressed as:

[0054] {P z1-k , P z1-k+1 , ..., P z1 , P z1+1 , P z1+2 , ..., P z2-1 , P z2 , P z2+1 , ..., P z2+k}, where (P z1 , P z2 ) is a landmark point;

[0055] Step S522: Mask {P z1+1 , P z1+2 , ..., P z2-1} interval segment ordered point cloud set, respectively calculate {P z1-k , P z1-k+1 , ..., P z1},{P z2 , P z2+1 , ..., P z2+k The weighted displacement vector V of the segment z1 , V z2 , specifically:

[0056]

[0057] Among them, the weight is determined by the number of distance landmark points, which are Each weight corresponds from left to right {[P z1-k →P z1-k+1 ],[P z1-k+1 →P z1-k+2 ],...,[P z1-1 →P z1 ]} and {[P z2+k-1 → P z2+k ],[P z2+k-2 →P z2+k-1 ],...,[Pz2 →P z2+1 ]};

[0058] Step S523: According to the weighted displacement vector V z1 , V z2 The angle between the weighted total displacement vectors at both ends is calculated to obtain the eigenvector angle change value.

[0059] The above-mentioned large-scale skin edge defect detection method based on multi-scale neighborhood constructs a multi-scale spatial search method to better judge the spatial information of the corresponding marking points, and uses this as a basis to optimize the search direction and identify the edge points of the three-dimensional point cloud, which greatly improves the operating efficiency of three-dimensional image edge recognition and improves the recognition success rate; at the same time, the extracted boundary points are ordered, and defects are detected by using changes in mask eigenvalues, which can realize edge defect detection of point cloud images more accurately in a shorter time. It has extremely high algorithm robustness and can be applied to large-scale, complex-structured and high-efficiency precision detection fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 A flow chart of a large skin edge defect detection method based on multi-scale neighborhood provided by an embodiment of the present invention;

[0061] Figure 2 It is a projection demonstration diagram of a neighborhood point set on three reference planes in one embodiment of the present invention;

[0062] Figure 3 1 is a diagram illustrating the calculation of the feature angle of a neighborhood point set on a projection feature plane in one embodiment of the present invention. DETAILED DESCRIPTION

[0063] In order to enable those skilled in the art to better understand the technical solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings.

[0064] In one embodiment, Figure 1 As shown, a large skin edge defect detection method based on multi-scale neighborhood includes the following steps:

[0065] Step S100: obtaining the three-dimensional point cloud coordinates of the large skin, and calculating a multi-scale neighborhood neighbor point set according to the three-dimensional point cloud coordinates.

[0066] Specifically, Kdtree neighbor relationships are established for all point clouds at multiple scale radii r n (n=1, 2, ..., k) to obtain the neighbor point set Srn={Pi|||P i -P0||∈r n}.

[0067] In one embodiment, step S100 is specifically as follows:

[0068] At point P0, take the neighborhood radius r of P0 n All point sets in , specifically:

[0069] Srn={Pi|||P i -P0||∈r n}

[0070]

[0071] Among them, r n (n=1, 2, ..., L, L is a natural number) The radii at multiple scales are: r<r1, r1<r<r2, ..., rL-1<r<rL, (xpi, ypi, zpi) are the three-dimensional point cloud coordinates of point Pi, and (xp0, yp0, zp0) are the three-dimensional point cloud coordinates of point P0.

[0072] Specifically, a total of L scales of neighbor point sets are included. In this example, k=3, r1=0.005, r2=0.010, and r3=0.015.

[0073] Step S200: At each scale, calculate the two-dimensional projection vectors of the neighborhood neighbor point set on three preset reference planes, calculate and arrange the angles of all adjacent vectors on the projection feature planes of each preset reference plane, obtain the maximum angle corresponding to each projection feature plane from the angles of all adjacent vectors after arrangement corresponding to each projection feature plane, and obtain the spatial vacancy percentage of each projection plane based on the maximum angle.

[0074] In one embodiment, in step S200, at each scale, the two-dimensional projection vectors of the neighborhood neighbor point set on three preset reference planes are calculated, specifically:

[0075] For the neighborhood point set S rn ={Pi|||Pi-P0||∈r n All points F in i Take P0 as the origin to establish a new point set with relative distance, specifically:

[0076] P i_new =P i -P0,P i_new ∈R 3x1

[0077] Among them, R 3x1 represents a 3-by-1 real field vector;

[0078] P i_new =(x i ,y i , zi ) is abbreviated as P ni ;

[0079] The three preset reference planes are: the xy reference plane with vectors through the vector group (a, b) = {a = (1, 0, 0), b = (0, 1, 0)}, the xz reference plane with vectors through the vector group (a, b) = {a = (1, 0, 0), b = (0, 0, 1)}, and the yz reference plane with vectors through the vector group (a, b) = {a = (0, 1, 0), b = (0, 0, 1)};

[0080] The vector of the neighborhood point set projected on the corresponding reference plane is recorded as:

[0081] (a j , b j )=(P ni .*a,P ni ·*b)

[0082] Among them, (a j , b j ) represents the vector of the neighborhood point set projected onto the corresponding reference plane, and .* represents the vector dot product.

[0083] In one embodiment, in step S200, the angles of all adjacent vectors are calculated and arranged on each projection feature plane, and the maximum angle corresponding to each projection feature plane is obtained from the angles of all adjacent vectors after the arrangement of each projection feature plane, and the spatial vacancy percentages of three preset reference planes are obtained according to the maximum angle, including:

[0084] Step S210: Taking the two-dimensional vector after the projection of the first vector of the vector group (a, b) of each projection feature plane as the reference vector, calculate the point P in the concentration of all neighboring points in the neighborhood ni The angle α between the projected vector on the corresponding projection feature plane and the reference vector j , specifically:

[0085] α j =tan(b j / a j )| j∈(1,2,...,m)

[0086] Among them, m is the number of points in the field;

[0087] Step S220: Set all {α j}| j∈(1,2,...,m) According to α j Arrange the values ​​in ascending order to obtain {α1, α2, ..., α m}, and obtain the angle difference of adjacent projection vectors {θ1, θ2, ..., θ m}={α2-α1, α3-α2,...,α m -α m-1 , α1- αm+2π;

[0088] Step S230: Obtain the maximum angle corresponding to each projection feature plane from the angles of all adjacent vectors arranged corresponding to each projection feature plane, specifically:

[0089] θ max = max{θ1, θ2, ..., θ m}

[0090] The spatial vacancy percentages of the three preset reference planes are obtained according to the maximum angle, specifically:

[0091]

[0092] Specifically, in this embodiment, the ratio of the maximum included angle radian to the unit circular radian is approximated as the percentage of the empty space on the projection plane.

[0093] Step S300: obtaining the sum eigenvalue of the three projection planes according to the spatial vacancy percentage of each projection plane and a preset hyperparameter threshold, and obtaining a point cloud boundary point set according to the sum eigenvalue of the three projection planes.

[0094] Specifically, the preset hyperparameter threshold is set according to the large skin surface characteristics. In this example, the preset hyperparameter threshold th=27.8%.

[0095] In one embodiment, step S300 includes:

[0096] Step S310: Screening points whose percentage of vacant space on the projection plane is greater than a preset hyperparameter threshold, and setting the projection plane feature value corresponding to the point to 1;

[0097] Step S320: Obtain the sum of the three projection plane eigenvalues ​​according to the eigenvalues ​​of each projection plane corresponding to the point, and take the point whose sum of the three projection plane eigenvalues ​​is 3 as the point cloud boundary point with the largest space gap. The point cloud boundary point set is recorded as S edge , where the sum eigenvalue of the three projection planes ranges from (0, 1, 2, 3).

[0098] Step S400: Based on the point cloud boundary point set, the point cloud is clustered and ordered according to the view direction search mechanism, and a plurality of ordered point cloud class sets with marked points are output.

[0099] In one embodiment, step S400 includes:

[0100] Step S410: establish a Kdtree for the Sedge set, and take the nearest T neighbors for each point;

[0101] Step S420: Randomly select a point P from the Sedge set s As a starting point, P s The T nearest neighbors from near to far are represented as Pneighbor = {P1, P2, ..., P T}, with P s The initial point record is the current ordered point cloud class C;

[0102] Step S430: Get P s The nearest point P1 is used as the next starting point P s_new , P s_new Add the current ordered point cloud class sequence C, specifically: {C→P s_new}, where {→} is the direction of the ordered point cloud series, defining the displacement vector V=P between the current starting point and the previous starting point s_new -P s , when S edge When it is empty, jump to S460;

[0103] Step S440: Remove P neighbor = {P1, P2, ..., P T}, the starting point that already exists in the current ordered point cloud class sequence C, takes the current displacement vector V as a reference, and moves from P neighbor In the search, the next starting point is searched from near to far according to the distance, and a new displacement vector is calculated. new The angle between the displacement vector and the current displacement vector V is obtained, and the point where the displacement vector angle is greater than the preset angle threshold th_v is marked as a marked point;

[0104] Step S450: When P neighbor When it is empty, in S edge The current ordered point cloud class C is deleted from the collection, and the process returns to step S420, otherwise, the process returns to step S430;

[0105] Step S460: End the iteration and output the ordered point cloud sequence set with marked points after clustering.

[0106] Specifically, in this embodiment, the preset angle threshold th_v is 10°.

[0107] In one embodiment, step S440 further includes:

[0108] When the displacement vector angle is less than the preset angle threshold th_v, the corresponding point is set as the new starting point, and the new displacement vector is recorded as the current displacement vector V; when the displacement vector angles corresponding to all neighboring points are greater than the preset angle threshold th_v, the vector (V new*V) The maximum point is taken as the new starting point, and the new starting point is incorporated into the set of marked points.

[0109] Step S500: Utilize the ordered point cloud class set in step S400, add a local one-dimensional mask, calculate the angle change value of the feature vector before and after the mask, take the marker point interval segment point set whose angle change value of the feature vector is less than the preset angle threshold, measure the defect parameters of the interval segment, and realize large skin edge defects.

[0110] In one embodiment, step S500 includes:

[0111] Step S510: selecting the top N categories of the ordered point cloud class sequence set with marked points output in step S400 according to the principle of point quantity;

[0112] Step S520: In each category, a rectangular window function is applied to the point cloud between all two marked points to cover the point set of the corresponding interval segment, and the angle between the weighted total displacement vectors at both ends is calculated to obtain the feature vector angle change value;

[0113] Step S530: output a point cloud set between marker points whose feature vector angle change value is less than a preset angle threshold th_v, detect defect parameters in the corresponding area, and realize large-scale skin defect detection.

[0114] Specifically, N is 2 in this example.

[0115] In one embodiment, step S520 includes:

[0116] Step S521: In each category, take the set of landmark point interval segments, expressed as:

[0117] {P z1-k , P z1-k+1 , ..., P z1 , P z1+1 , P z1+2 , ..., P z2-1 , P z2 , P z2+1 , ..., P z2+k}, where (P z1 , P z2 ) is a landmark point;

[0118] Step S522: Mask {P z1+1 , P z1+2 , ..., P z2-1} interval segment ordered point cloud set, respectively calculate {P z1-k , P z1-k+1 , ..., P z1},{P z2 , P z2+1 , ..., Pz2+k The weighted displacement vector V of the segment z 1. V z2 , specifically:

[0119]

[0120] Among them, the weight is determined by the number of distance landmark points, which are Each weight corresponds from left to right {[P z1-k →P z1-k+1 ],[P z1-k+1 →P z1-k+2 ],...,[P z1-1 →P z1 ]} and {[P z2+k-1 → P z2+k ],[P z2+k-2 →P z2+k-1 ],...,[P z2 →P z2+1 ]};

[0121] Step S523: According to the weighted displacement vector V z1 , V z2 The angle between the weighted total displacement vectors at both ends is calculated to obtain the eigenvector angle change value.

[0122] Specifically, k is 10 in this example.

[0123] The technical effects that can be achieved by adopting the present invention are as follows: the present invention method constructs a multi-scale spatial search method to better judge the spatial information of the corresponding key points, and optimizes the search direction and identifies the edge points of the three-dimensional point cloud based on this, which greatly improves the operating efficiency of the edge recognition of the three-dimensional image and improves the recognition success rate; at the same time, the extracted boundary points are ordered, and the defects are detected by the change of the mask feature value. The method can realize the edge defect detection of the point cloud image more accurately in a shorter time, has extremely high algorithm robustness, and can be applied to the field of precision detection with large scale, complex structure and high efficiency requirements.

[0124] By introducing the concept of an ordered set of boundary points, the algorithm can understand the algorithmic boundary points in the point cloud image. After introducing the concept of landmark points, the weighted feature angle changes of the mask function are used to identify edge defects of large skins, allowing the system to use a non-contact visual measurement system to deal with the current difficult problem of manual skin standards being difficult to quantify and special machine measurements being difficult to achieve large-size skin detection. This further improves the robustness of the algorithm, reduces human factors in the measurement process, and improves the efficiency of large-scale skin defect detection.

[0125] The theory of the present invention is based on the edge defect detection of point cloud images after extracting the boundary. After the initial preprocessing (denoising, etc.), the present invention is aimed at the defect detection on large-scale skins, which is difficult to identify by human power and mainly relies on manual visual detection. Its detection standard is difficult to quantify, and the detection process consumes manpower and reliability cannot be guaranteed. Traditional contact measurement methods such as three-dimensional coordinate measuring machines will cause damage to the skin. The two-dimensional image detection method is difficult to cope with working conditions under complex operating conditions.

[0126] According to the projection characteristics of the three reference planes, the information of all dimensions is retained. While retaining the fast processing advantages of two-dimensional operators, the advantages of point cloud images are combined, and good results have been achieved in the implementation of large-scale skin defect detection.

[0127] The three-reference plane projection and mask-based defect detection methods are both structured tools. Combining the two structured modules to propose a large-scale skin edge defect detection technology framework can quickly and accurately realize edge extraction and defect detection of dense point cloud images, while being able to process larger-scale point cloud images and improving the running speed of the algorithm.

[0128] The above is a detailed introduction to a large skin edge defect detection method based on multi-scale neighborhood provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the core idea of ​​the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A large skin edge defect detection method based on multi-scale neighborhood, characterized in that: The method comprises the following steps: Step S100: obtaining three-dimensional point cloud coordinates of a large skin, and calculating a multi-scale neighborhood neighbor point set according to the three-dimensional point cloud coordinates; Step S200: at each scale, calculating the two-dimensional projection vectors of the neighborhood neighbor point set on three preset reference planes, calculating and arranging the angles of all adjacent vectors on the projection feature planes of each preset reference plane, obtaining the maximum angle corresponding to each projection feature plane from the angles of all adjacent vectors after arrangement corresponding to each projection feature plane, and obtaining the spatial vacancy percentage of each projection plane according to the maximum angle; Step S300: obtaining a sum eigenvalue of three projection planes according to the spatial vacancy percentage of each projection plane and a preset hyperparameter threshold, and obtaining a point cloud boundary point set according to the sum eigenvalue of the three projection planes; Step S400: clustering and ordering the point cloud according to the point cloud boundary point set and the viewing direction search mechanism, and outputting a plurality of ordered point cloud class sets with marked points; Step S500: using the ordered point cloud class set in step S400, adding a local one-dimensional mask, calculating the angle change value of the feature vector before and after the mask, taking the mark point interval segment point set whose angle change value of the feature vector is less than a preset angle threshold, measuring the defect parameters of the interval segment, and realizing large skin edge defects; Step S100 is specifically as follows: At point P0, take the neighborhood radius r of P0 n All point sets in , specifically: Srn={Pi|||P i –P0||∈r n } Among them, r n (n=1,2,…,L, L is a natural number) The radii at multiple scales are: r <r1,r1<r<r2,…,r L-1 <r<r L ,(x pi ,y pi ,z pi ) is the 3D point cloud coordinate of point Pi, (x p0 ,y p0 ,z p0 ) is the three-dimensional point cloud coordinate of point P0; In step S200, at each scale, the two-dimensional projection vectors of the neighborhood neighbor point set on three preset reference planes are calculated, specifically: For the neighborhood point set S rn ={Pi|||Pi–P0||∈r n All points P in i Take P0 as the origin to establish a new point set with relative distance, specifically: P i_new =P i –P0,P i_new ∈R 3x1 Among them, R 3x1 represents a 3-by-1 real field vector; P i_new =(x i ,y i ,z i ) is abbreviated as P ni ; The three preset reference planes are: an xy reference plane with vectors of the vector group (a, b) = {a = (1, 0, 0), b = (0, 1, 0)}, an xz reference plane with vectors of the vector group (a, b) = {a = (1, 0, 0), b = (0, 0, 1)}, and a yz reference plane with vectors of the vector group (a, b) = {a = (0, 1, 0), b = (0, 0, 1)}; The vector of the neighborhood point set projected on the corresponding reference plane is recorded as: (a j ,b j )=(P ni .*a,P ni .*b) Among them, (a j ,b j ) represents the vector of the neighborhood point set projected on the corresponding reference plane, and .* represents the vector dot product; In step S200, the angles of all adjacent vectors are calculated and arranged on each projection feature plane, the maximum angle corresponding to each projection feature plane is obtained from the angles of all adjacent vectors after the arrangement of each projection feature plane, and the spatial vacancy percentages of the three preset reference planes are obtained according to the maximum angle, including: Step S210: Taking the two-dimensional vector after the projection of the first vector of the vector group (a, b) of each projection feature plane as the reference vector, calculate the point P in the concentration of all neighboring points in the neighborhood ni The angle α between the vector projected on the corresponding projection feature plane and the reference vector j , specifically: α j =tan(b j / maid j )| j∈(1,2,…,m) Among them, m is the number of points in the field; Step S220: Set all α j | j∈1,2,…,m According to α j Arrange the values ​​in ascending order to get α1, α2, …, α m , and obtain the angle difference between adjacent projection vectors θ1, θ2, …, θ m =α2-α1,α3-α2,…,α m -α m-1 ,α1-α m +2π; Step S230: Obtain the maximum angle corresponding to each projection feature plane from the angles of all adjacent vectors arranged corresponding to each projection feature plane, specifically: i max =maxθ1,θ2,…,θ m The spatial vacancy percentages of the three preset reference planes are obtained according to the maximum angle, specifically:

2. The method according to claim 1, characterized in that Step S300 includes: Step S310: screening points whose percentage of vacant space on the projection plane is greater than the preset hyperparameter threshold, and setting the projection plane feature value corresponding to the point to 1; Step S320: Obtain the sum of the three projection plane eigenvalues ​​according to the eigenvalues ​​of each projection plane corresponding to the point, and take the point whose sum of the three projection plane eigenvalues ​​is 3 as the point cloud boundary point with the largest space gap. The boundary point set is recorded as S edge , where the sum eigenvalue of the three projection planes ranges from (0, 1, 2, 3).

3. The method according to claim 2, characterized in that Step S400 includes: Step S410: edge The Kdtree is built and the nearest T neighbors are taken for each point; Step S420: Randomly select edge Select a point P from the set s As a starting point, the P s The T nearest neighbors of neighbor = {P1,P2,…,P T }, with the P s The initial point record is the current ordered point cloud class C; Step S430: Take the P s The nearest point P1 is used as the next starting point P s_new , P s_new Add the current ordered point cloud class sequence C, specifically: {C→P s_new }, where {→} is the direction of the ordered point cloud series, defining the displacement vector V=P between the current starting point and the previous starting point s_new -P s , when the S edge When it is empty, jump to S460; Step S440: Remove P neighbor = {P1,P2,…,P T }, the starting point that already exists in the current ordered point cloud class sequence C, taking the current displacement vector V as a reference, from the P neighbor In the process, the next starting point is searched in order from near to far according to the distance, and a new displacement vector is calculated. new The angle between the displacement vector V and the current displacement vector V is obtained, and the point where the displacement vector angle is greater than a preset angle threshold th_v is marked as a marked point; Step S450: When the P neighbor When it is empty, in the S edge The current ordered point cloud class C is deleted from the collection, and the process returns to step S420, otherwise, the process returns to step S430; Step S460: End the iteration and output the ordered point cloud sequence set with marked points after clustering.

4. The method according to claim 3, characterized in that Step S440 also includes: When the displacement vector angle is less than the preset angle threshold th_v, the corresponding point is set as the new starting point, and the new displacement vector is recorded as the current displacement vector V; when the displacement vector angles corresponding to all neighboring points are greater than the preset angle threshold th_v, the vector (V new *V) The maximum point is taken as the new starting point, and the new starting point is incorporated into the marked point set.

5. The method according to claim 4, characterized in that Step S500 includes: Step S510: selecting the top N categories of the ordered point cloud class sequence set with marked points output in step S400 according to the principle of point quantity; Step S520: In each category, a rectangular window function is applied to the point cloud between all two marked points to cover the point set of the corresponding interval segment, and the angle between the weighted total displacement vectors at both ends is calculated to obtain the feature vector angle change value; Step S530: output the point cloud set between the marker points whose angle change value of the feature vector is less than the preset angle threshold th_v, detect the defect parameters of the corresponding area, and realize large-scale skin defect detection.

6. The method according to claim 5, characterized in that The step S520 includes: Step S521: In each category, take the set of landmark point interval segments, expressed as: {P z1-k ,P z1 -k+1,…,P z1 ,P z1+1 ,P z1+2 ,…,P z2-1 ,P z2 ,P z2+1 ,…,P z2+k }, where (P z1 ,P z2 ) is a landmark point; Step S522: Mask {P z1+1 ,P z1+2 ,…,P z2-1 } interval segment ordered point cloud set, respectively calculate {P z1-k ,P z1 -k+1,…,P z1 },{P z2 ,P z2+1 ,…,P z2+k The weighted displacement vector V of the segment z1 ,V z2 , specifically: Among them, the weight is determined by the number of distance landmark points, which are Each weight corresponds from left to right {[P z1-k →P z1-k+1 ],[P z1-k+1 →P z1-k+2 ],…,[P z1-1 →P z1 ]} and {[P z2+k-1 →P z2+k ],[P z2+k-2 →P z2+k-1 ],…,[P z2 →P z2+1 ]}; Step S523: According to the weighted displacement vector V z1 ,V z2 The angle between the weighted total displacement vectors at both ends is calculated to obtain the eigenvector angle change value.