CN111932570A - Edge detection method, device, medium and equipment based on grid data - Google Patents

Edge detection method, device, medium and equipment based on grid data Download PDF

Info

Publication number
CN111932570A
CN111932570A CN202010944149.0A CN202010944149A CN111932570A CN 111932570 A CN111932570 A CN 111932570A CN 202010944149 A CN202010944149 A CN 202010944149A CN 111932570 A CN111932570 A CN 111932570A
Authority
CN
China
Prior art keywords
vertex
neighborhood
point
data structure
searching
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.)
Granted
Application number
CN202010944149.0A
Other languages
Chinese (zh)
Other versions
CN111932570B (en
Inventor
高磊
田希文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Delisai Technology Co ltd
Original Assignee
Seizet Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Seizet Technology Shenzhen Co Ltd filed Critical Seizet Technology Shenzhen Co Ltd
Priority to CN202010944149.0A priority Critical patent/CN111932570B/en
Publication of CN111932570A publication Critical patent/CN111932570A/en
Application granted granted Critical
Publication of CN111932570B publication Critical patent/CN111932570B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/20Finite element generation, e.g. wire-frame surface description, tesselation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/73Deblurring; Sharpening
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10028Range image; Depth image; 3D point clouds

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a 3D disordered point cloud edge detection method, a device, equipment and a medium based on a 5D texture grid data structure, which comprises the following steps of (1) converting 3D disordered point cloud data into a 5D texture grid data structure; (2) neighborhood access, for any vertex S in a 5D texture grid data structuremnIs obtained by SmnAll neighborhood points N within the range of the center and the radius rS(ii) a (3) Gaussian blur, with each vertex SmnIs assigned to said vertex SmnCorresponding to all neighborhood points NSWeighted average of the RGB values of (a); (4) acquiring gray gradient gi and gradient direction di of the 5D texture grid data structure after Gaussian blur; (5) the gradient image is subjected to non-maximum value suppression, and S is outputmnThe corresponding value Ti; (6) searching for edges of a foursquare grid MAnd after the outline is converted into a 5D texture grid data structure, the unordered point cloud also has quick neighborhood access capability, so that the edge detection of the 3D unordered point cloud data is realized.

Description

Edge detection method, device, medium and equipment based on grid data
Technical Field
The invention belongs to the technical field of computer graphics and computer vision, and particularly relates to an edge detection method of disordered point cloud data.
Background
In the field of machine vision, visual features can be applied to scenes such as object identification, pose estimation, SLAM and the like, wherein edge contours of objects, such as texture contours of surface patterns, are common visual features. For the edge detection of 2D images, mature algorithms such as Canny operator exist, however, the 2D images cannot completely represent three-dimensional objects. The 3D point cloud contains more three-dimensional pose information of the object, and has wider application value aiming at the edge detection of the 3D point cloud.
The edge detection method for 3D point cloud generally includes the following parts: (1) carrying out fuzzy processing on an object original point cloud acquired by a 3D camera; (2) generating a gray point cloud by using the RGB values of the point cloud; (3) searching contour points conforming to the edge definition according to the gray gradient of the gray point cloud; (4) all edge contour points are output.
The 3D point cloud edge detection method is the popularization of the 2D image edge detection method, but is only suitable for ordered point clouds. The 3D point cloud is divided into an ordered point cloud and a disordered point cloud, wherein the ordered point cloud is the 3D point cloud which is arranged according to the row and column sequence and is collected by a 3D camera, filtering is usually carried out to remove invalid points, and the ordering of the point cloud is difficult to ensure; in addition, many common 3D vision algorithms, such as the following sampling, easily destroy the order of ordered point clouds and then convert them into unordered point clouds. The disordered point cloud is a more common existing form of the 3D point cloud, and the mature 2D edge detection method is difficult to popularize to the disordered point cloud.
Disclosure of Invention
The invention aims to provide an edge detection method based on Seizet ColorMesh (5D texture grid data structure), which converts disordered point cloud into a 5D texture grid data structure to ensure that the disordered point cloud also has quick neighborhood access capability, and then realizes the edge detection of the disordered point cloud data through treatments such as Gaussian blur, non-maximum inhibition and the like so as to popularize a mature 2D edge detection method to 3D unordered point cloud.
In order to achieve the aim, the invention provides a 3D disordered point cloud edge detection method based on SeizetColormesh, which comprises the following steps:
(1) converting 3D disordered point cloud data into a 5D texture grid data structure (SeizetcColormesh), wherein the 5D texture grid data structure comprises a plurality of half-side four-corner grids which are connected in a topological manner, and each half-side four-corner grid comprises a four-corner surface piece and a four-corner surface pieceFour vertexes Smn,Sm,n+1.Sm+1,n,Sm+1,n+1And a plurality of halves, wherein, based on any point P in the point cloud dataiAnd PiThe three adjacent points of the point cloud data acquire four corresponding vertexes, and each vertex stores a corresponding point P in the point cloud dataiThe 3D position coordinates (x, y, z), normal vectors, colors, and pointer information of the halves of which are the starting vertex, each half storing pointers or indices of the starting vertex, the ending vertex, the adjoining surface, the upper half, the lower half, the opposite half;
(2) for any vertex S in the 5D texture grid data structuremnObtained by said SmnAll neighborhood points N within a range of radius r as the centerSWherein the vertex S ismnStarting the neighborhood visit of this time as an initial vertex to acquire all corresponding neighborhood points NSThe method comprises the following steps: judging whether the initial vertex is a boundary point, and returning to be empty if the initial vertex is the boundary point; if the initial vertex is not the boundary point, searching all neighborhood points in a grid data structure with an access radius r by taking the initial vertex as a center;
(3) performing Gaussian blur on the 5D texture grid data structure, and enabling each vertex SmnIs assigned to said vertex SmnCorresponding to all neighborhood points NSWeighted average of the RGB values of (a);
(4) acquiring gray gradient gi and gradient direction di of the 5D texture grid data structure after Gaussian blur; for any vertex SmnObtaining said vertex S based on neighborhood visitsmnIf the 8 connected neighborhood point set is empty, gi = -1, and di = 0; if the 8-connected neighborhood point set is not empty, recording each neighborhood point as Nk(k=0~7,Nk∈NS) Based on said vertex SmnCorresponding 8 connected neighborhood points NkDetermining the vertex SmnThe corresponding gray gradient gi and the gradient direction di, and discretizing the gradient direction di;
(5) the gradient image is subjected to non-maximum value suppression, and S is outputmnThe corresponding temporary variable value Ti;
(6) searching the edge profile of the four-corner grid M and outputting the edge profile.
Preferably, in the step (2), all neighborhood points with the radius from 1 to r are obtained layer by taking the initial vertex as a center, and 8 × r vertexes are obtained by neighborhood visit of each layer; the neighborhood access of each layer comprises the following steps: obtaining a half Hi of an initial vertex and obtaining a termination vertex Ni of the half Hi based on the 5D texture grid data structure, wherein the initial vertex is an initial vertex or a first vertex obtained by last-layer access:
I) searching upwards for r times from Ni, and then sequentially searching leftwards for 2r times, downwards for 2r times, rightwards for 2r times and upwards for r-1 times to obtain 8r vertexes of each layer;
or II) searching downwards r times from Ni, and then sequentially searching leftwards for 2r times, upwards for 2r times, rightwards for 2r times and downwards for r-1 times to obtain 8r vertexes of each layer.
Further, the step I) of searching up r times from Ni includes: obtaining a first vertex searched upwards at this time: obtaining the upper half H of the opposite half of Ni based on the 5D texture grid data structurei+1Said H isi+1Starting vertex N ofi+1The first vertex searched upwards at this time; acquiring subsequent r-1 vertexes, wherein the subsequent r-1 vertex searching comprises the following steps: and acquiring a half-out edge corresponding to the next vertex, and taking the initial vertex corresponding to the half-out edge as the next vertex, wherein the half-out edge corresponding to the next vertex is acquired based on the last half edge of the opposite half edge of the last vertex.
And/or when the step I) searches leftwards for 2r times, searches downwards for 2r times, searches rightwards for 2r times and searches upwards for r-1 times, each search respectively comprises the following steps: obtaining a first vertex of the search: acquiring the last half of the last vertex determined by the last search based on the 5D texture grid data structure, wherein the initial vertex corresponding to the last half of the last vertex is the first vertex of the search; obtaining other vertexes of the search, wherein the subsequent search of each other vertex comprises the following steps: and acquiring a half-out side corresponding to the next vertex, and taking the initial vertex corresponding to the half-out side as the next vertex, wherein the half-out side corresponding to the next vertex is acquired based on the upper half side of the opposite half side of the upper vertex.
And/or, the step II) of searching downwards r times from Ni comprises the following steps: obtaining a first vertex of the search: II-A) obtaining the next half H of Hi based on the 5D texture grid data structurei+1Said H isi+1Terminating vertex N ofi+1For the first vertex of the downward search, the subsequent r-1 vertices are obtained: for subsequent r-1 searches, each vertex search includes: II-B) obtaining a middle half corresponding to the next vertex, wherein a termination vertex corresponding to the middle half is used as the next vertex, and the middle half corresponding to the next vertex is obtained based on the next half of the opposite half of the next half of the previous vertex.
And/or in II), when searching for 2r times to the left, searching for 2r times to the up, searching for 2r times to the right and searching for r-1 times to the down, each search respectively comprises the following steps: II-C) obtaining the first vertex of the search: acquiring the next half of the last top point searched for the previous time, and taking the termination top point corresponding to the next half of the last top point as the first top point searched for this time; acquiring other vertexes of the search: each subsequent vertex search comprises the following steps: II-B) obtaining a middle half corresponding to the next vertex, and taking a termination vertex corresponding to the middle half as the next vertex, wherein the middle half corresponding to the next vertex is obtained based on the next half of the opposite half of the next half of the previous vertex.
Preferably, the step (3) of gaussian blurring the 5D texture grid data structure includes:
(3.1) traverse vertex SmnNeighborhood point N ofSObtaining the vertex SmnTo each neighborhood point NSSpatial distance dijTo determine the Gaussian kernel weight wij
Figure 171124DEST_PATH_IMAGE001
Wherein the content of the first and second substances,
Figure 813499DEST_PATH_IMAGE002
is a pending parameter other than 0, NSTo adopt the SmnA neighborhood point with a center and a radius of r;
(3.2) placing the vertex SmnIs assigned to the corresponding neighborhood point NSWeighted average of the RGB values of (1), the weight corresponding to wij
Figure 593236DEST_PATH_IMAGE003
Wherein, RGBSmnIs a vertex SmnRGB value of (g, b)NsIs SmnCorresponding to neighborhood point NSThe RGB value of (a).
Preferably, the obtaining of the gray gradient gi and the gradient direction di of the 5D texture grid data structure after gaussian blurring in step (4) includes: (4.1) graying the four-corner grid M to obtain SmnCorresponding RGBi values;
traversing points S in the set S of vertices of the tetragonal meshmnAnd for each vertex S based on the following formulamnGraying treatment:
Figure 926129DEST_PATH_IMAGE004
wherein, Ri, Gi and Bi are respectively RGBsmnThe corresponding numerical value of the three channels of middle red, green and blue, ar、ag、abIs taken to satisfy ar+ag+ab=1, ar>0,ag>0, ab>0;
(4.2) for an arbitrary vertex SmnObtaining the vertex S based on the neighborhood access in the step (2)mnIf the 8 connected neighborhood point set is empty, gi = -1, and di = 0; if the 8 connected neighborhood point set is not empty, based on the placeThe vertex SmnCorresponding 8 connected neighborhood points NkDetermining the vertex SmnThe corresponding gray scale gradient gi and gradient direction di include:
Figure 740501DEST_PATH_IMAGE005
Figure 235067DEST_PATH_IMAGE006
Figure 502101DEST_PATH_IMAGE007
wherein the above is determined based on the values of RGBi acquired in step (4.1)
Figure 904263DEST_PATH_IMAGE008
Magnitude of (1), GxAnd GyIs a vertex SmnGray scale gradients in the x and y directions;
(4.3) discretizing the gradient direction di, dividing-pi to pi into 4 regions at ± i pi/8 (i =1,3,5, 7):
di =0 if di falls in the region [ - π/8, π/8 ]. sup. [ - π, -7 π/8 ]. sup. [7 π/8, π ];
if di falls in the region (π/8, 3 π/8) U (-7 π/8, -5 π/8), then di = π/4;
if di falls in the region [3 π/8, 5 π/8] < U [ -5 π/8, -3 π/8], then di = π/2;
if di falls in the region (5 π/8, 7 π/8) U (-3 π/8, - π/8), then di =3 π/4.
Preferably, in the step (5), the gradient image is subjected to non-local maximum suppression, and S is outputmnThe corresponding values Ti include: for any vertex Smn,If the gray gradient gi is judged to be smaller than a preset low threshold thres _ low, Ti = 0; if the gray gradient gi is greater than the low threshold thres _ low, the vertex S is determinedmnWhether the corresponding 8-connected neighborhood point set is empty or not is judged, if the neighborhood point set is empty, Ti =0 is judged, and if the neighborhood point set is not empty, the judgment is made if the neighborhood point set is emptySmnIf the gray scale gradient gi and the gradient direction di satisfy one of the following 4 conditions, Ti = gi if the gray scale gradient gi and the gradient direction di satisfy, otherwise Ti = 0:
a)Smndi =0, and SmnIs larger than the gray gradients of both N0 and N4;
b)Smndi = π/4, and SmnIs larger than the gray gradients of both N1 and N5;
c)Smndi = π/2, and SmnIs larger than the gray gradients of both N2 and N6;
d)Smndi =3 pi/4, and SmnIs larger than the gray gradients of both N3 and N7.
Preferably, the searching for the edge contour of the tetragonal grid M using the Canny operator in step (6) includes:
(6.1) for any point Ti, if Ti is judged to be larger than high threshold thres _ high and corresponding vertex SmnNot marked as an edge point, then S ismnMarking as an edge point and executing (6.2), wherein a high threshold thres _ high is a preset value;
(6.2) determination of SmnWhether the corresponding 8-connected neighborhood points are edge points or not; otherwise, skipping Ti and continuing to execute (6.1); obtaining the vertex S corresponding to TimnJudging whether the 8 connected neighborhood point set is empty or not, if so, skipping Ti and continuing to execute (6.1); if the 8 connected neighborhood point set is not empty, every point N in the 8 connected neighborhood point set is subjected tokRespectively executing the step (6.3);
(6.3) if NkCorresponding Ti value equal to 0 or NkIf the marked edge point is marked, skipping the neighborhood point and continuing to execute (6.2); otherwise, the neighborhood point N is usedkMarking as an edge point, and obtaining NkUntil N, recursively (6.3)kThe 8 neighborhood access result is empty and continues to execute (6.2);
and (6.4) after the traversal of (6.1) is finished, outputting all points marked as edge points in the corresponding four-corner grid M vertex set, namely the edge contour to be obtained.
The invention also provides a 3D disordered point cloud edge detection device based on SeizetColormesh, and a 5D texture grid data structure conversion module for converting the 3D disordered point cloud data into a 5D texture grid data structure, wherein the 5D texture grid data structure comprises a plurality of half-side four-corner grids which are in topological connection, each half-side four-corner grid comprises a four-corner surface patch and four vertexes S arranged on the four-corner surface patchmn,Sm,n+1.Sm+1,n,Sm+1,n+1And a plurality of halves, wherein, based on any point P in the point cloud dataiAnd PiThe three adjacent points of the point cloud data acquire four corresponding vertexes, and each vertex stores a corresponding point P in the point cloud dataiThe 3D position coordinates (x, y, z), normal vectors, colors, and pointer information of the halves of which are the starting vertex, each half storing pointers or indices of the starting vertex, the ending vertex, the adjoining surface, the upper half, the lower half, the opposite half;
a neighborhood accessing module for S for any vertex in the 5D texture grid data structuremnWith said vertex SmnStarting the neighborhood visit of this time as an initial vertex to acquire all corresponding neighborhood points NSThe method comprises the following steps: judging whether the initial vertex is a boundary point, and returning to be empty if the initial vertex is the boundary point; if the initial vertex is not the boundary point, searching all neighborhood points in a grid data structure with an access radius r by taking the initial vertex as a center;
a Gaussian blur module for performing Gaussian blur on the 5D texture grid data structure and performing Gaussian blur on each vertex SmnIs assigned to said vertex SmnCorresponding to all neighborhood points NSWeighted average of the RGB values of (1), where NSTo adopt the SmnA neighborhood point with a center and a radius of r;
the gray gradient gi and gradient direction di acquisition module is used for acquiring the gray gradient gi and the gradient direction di of the 5D texture grid data structure after Gaussian blur; for any vertex SmnObtaining the vertex S based on a neighborhood access modulemnIf the 8 connected neighborhood point set is empty, gi = -1, and di = 0; if the 8-connected neighborhood point set is not empty, recording each neighborhood point as Nk(k =0 to 7) and determining a vertex S based on each of neighborhood points N0 to N7mnThe corresponding gray gradient gi and the gradient direction di, and discretizing the gradient direction di; a non-maximum value suppression module for performing non-maximum value suppression on the gradient image and outputting SmnThe corresponding temporary variable value Ti; and the edge contour output module is used for searching the edge contour of the four-corner grid M and outputting the edge contour.
In order to achieve the above object, the present invention also provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the aforementioned method when executing the computer program.
In order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the aforementioned method.
According to the edge detection method, device, storage medium and computer equipment based on the Seizet ColorMesh (5D texture grid data structure), after the disordered point cloud is converted into the 5D texture grid data structure, the disordered point cloud also has the rapid neighborhood access capability, and then after the steps of Gaussian blur, non-maximum suppression and the like, the edge contour of the four-corner grid M is searched to realize the edge detection of the disordered point cloud data, so that the mature 2D edge detection method is popularized to 3D disordered point cloud.
Drawings
FIG. 1 is a schematic structural diagram of an embodiment of a 5D texture grid data structure;
FIG. 2 is a schematic structural diagram of an embodiment of a half-square grid;
FIG. 3 is a schematic flow chart of a method for generating a 5D texture grid data structure of a disordered point cloud;
FIG. 4 is a schematic view of neighborhood method access directions of a 5D texture grid data structure;
fig. 5 is a diagram illustrating an embodiment of a counterclockwise neighborhood access method when r = 2;
fig. 6 is a schematic diagram of an embodiment of a clockwise neighborhood access method when r = 1;
FIG. 7 is a schematic flow chart of an edge detection method based on SeizetColormesh;
FIG. 8 is a schematic flow chart of non-maximum suppression;
FIG. 9 is a schematic flow chart of Canny operator search edge contour;
FIG. 10 is a carton raw point cloud;
FIG. 11(a) is a schematic diagram of the structure of the carton after converting the original point cloud into Seizet Colormesh;
FIG. 11(b) is an enlarged view of the structure within the dashed box in FIG. 11 (a);
FIG. 12 is a schematic diagram of an edge detection result obtained by an edge detection method based on SeizetColormesh;
FIG. 13 is a block diagram of an embodiment of a 3D chaotic point cloud edge detection apparatus based on SeizetColormesh;
FIG. 14 is a diagram of the hardware architecture of one embodiment of the computer apparatus of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the scope of the invention in any way.
It should be noted that the features of the embodiments and examples of the present application may be combined with each other without conflict.
5D texture grid data Structure (SeizetColormesh)
The 5D texture grid data structure uses the connection relation of vertex, half edge and four corner surface patches for indexing and is used for reconstructing the four corner grids of point cloud data, and after the point cloud is represented based on the data of the data structure of the 5D texture grid, the point cloud is in a topological structure and can effectively represent the omnibearing information of a three-dimensional object.
As shown in fig. 1The 5D texture grid data structure comprises a plurality of half-edge four-corner grids, wherein each half-edge four-corner grid comprises a four-corner surface patch and four vertexes S arranged on the four-corner surface patchmn,Sm,n+1.Sm+1,n,Sm+1,n+1And a plurality of halves, wherein the point cloud data P is based oniAnd PiThe three adjacent points of each half-side four-corner mesh acquire four vertexes corresponding to each half-side four-corner mesh, each vertex stores 3D position coordinates (x, y, z), normal vectors, colors of corresponding points Pi in the point cloud data and pointer information of the half side taking the normal vectors, the colors and the half side as an initial vertex, and each half side stores pointers or indexes of the initial vertex, an end vertex, an adjacent surface, a previous half side, a next half side and an opposite half side.
As shown in fig. 2, each half four-corner mesh generated based on the point cloud data includes vertex 1), half 2), and four-corner patches 3), for convenience of description, vertices S (1,0), S (1,1), S (2,1), and S (2,0) are simplified to vertex A, B, C, D, where AB, BC, CD, and DA are all half and ABCD is a four-corner patch.
The Vertex (Vertex) A, B, C, D stores therein a corresponding point Pi and three adjacent points P to Pij、Pk、Pq3D coordinates, normal vectors, colors, etc.; half Edge (Half Edge) is a directed line between vertices whose terminating and originating vertices are recorded by Terminate Vertex and Origin Vertex pointers, respectively, the terminating and originating vertices of Half Edge AB in fig. 2 being B and a, respectively.
The half part records the next half part and the last half part of the half part through NextHalfEdge and PrevHalfEdge pointers respectively, and the next half part and the last half part of the half part AB in the graph 2 are BC and DA respectively; the opposite half of the half is recorded by an OpPoSmentEhfEdge pointer, and the opposite half of the half AB in the graph 2 is BA; recording four-corner patches adjacent to the half edge through an AdjacentFace pointer, wherein the four-corner patches adjacent to the half edge AB in the graph 2 are ABCD; the vertices are recorded out half and in half by the OutgoingHalfEdge and IncominingHalfEdge pointers, respectively, and the out half and in half of vertex A in FIG. 2 are AB and BA, respectively.
The four-corner surface patch (Quad Face) consists of 4 half edges connected in sequence, and the ABCD of the four-corner surface patch in FIG. 2 consists of half edges AB, BC, CD and DA; the four corner patches have their outer and inner halves recorded by OuterHalfEdge and InnerHalfEdge pointers, and the outer and inner halves of the four corner patches ABCD in FIG. 2 are BA and AB, respectively.
(II) 5D texture grid data structure generation method of disordered point cloud
As described above, the unordered point cloud is a more common existing form of the 3D point cloud, but due to the lack of orderliness of the unordered point cloud data, the mature 2D edge detection method is difficult to be popularized to the unordered point cloud, the 3D unordered point cloud data is converted into the 5D texture grid data structure according to the present application, so that the specific spatial topological structure of the 3D unordered point cloud is obtained, as shown in fig. 3, the method for generating the 5D texture grid data structure of the unordered point cloud specifically includes the following steps:
s1, acquiring a disordered point cloud of a workpiece to be scanned;
s2 for any point P in the disordered point cloudiAdding said PiAnd PiTo obtain the vertex S, the 3D position coordinates (x, y, z), the normal vector and the color informationmnEstablishing said PiAnd the vertex SmnThe index relationship is in one-to-one correspondence;
s3, ordering the disordered point cloud data, and obtaining each point P in the disordered point cloudiSorting by rows and sorting by columns;
s4 traversing the point cloud data to any point P in the point cloud dataiSearching P in the unordered point cloud according to the index rules in the row ordering and the column orderingiAdjacent point P ofj、Pk、Pq
S5 obtaining P according to the index relationi, Pj、Pk、PqFour vertexes S corresponding to each other respectivelymn,Sm,n+1.Sm+1,n,Sm+1,n+1
S6 adding a four-corner patch Q and adding the 4 vertexes Smn,Sm,n+1.Sm+1,n,Sm+1,n+1Added to the vertex positions of the corresponding quad patch Q to generate a half quad mesh, where each vertex SmnStoring point cloudsCorresponding point P in the dataiThe 3D position coordinates (x, y, z), normal vectors, colors, and pointer information of the halves of which are the starting vertex, each half storing pointers or indices of the starting vertex, the ending vertex, the adjoining surface, the upper half, the lower half, the opposite half;
s7 traversing the PiOr the vertex SmnObtaining all of said PiOr the vertex SmnAnd outputting a 5D texture grid data structure corresponding to the disordered point cloud by using the corresponding half-side four-corner grid.
In step S1, an original disordered point cloud of the object to be detected may be obtained by a 3D-based camera, where the point cloud data is recorded in the form of points for the object to be detected, and each point includes 3D position coordinates (x, y, z), color information, and a normal vector. More specifically, the color information is usually obtained by a camera to obtain a color image, and then the color information of the pixel at the corresponding position is assigned to the corresponding point in the point cloud; regarding the normal vector of each point Pi in the disordered point cloud, if any point P in the disordered point cloudiOnly 3D position coordinates (x, y, z), then PiThe normal vector of (a) can be determined by the 3D position coordinates (x, y, z) of the neighborhood points; and if the normal vector information contained in the disordered point cloud data is available, directly reading.
In step S2, as an optimal solution, a vertex set S is established, and each point P of the unordered point cloud C is traversediBased on PiAnd corresponding 3D coordinate, normal vector and color information acquisition vertex SmnThen, each vertex S is putmnTo the set of vertices S. The vertex set S is a vertex set of a 5D texture grid data structure (SeizetColorMesh) M.
In step S3, in order to facilitate the subsequent search of adjacent points, the unordered point cloud data is first sorted, and the row sorting and the column sorting of the unordered point cloud data are respectively obtainediAnd (6) sorting.
The acquisition in line sequence comprises the following steps: comparing the y/z values of any two points in the disordered point cloud, arranging the points with larger y/z values behind the points, and comparing the x/z values if the y/z values of the two points are the same, and arranging the points with larger x/z values behind the points; and if the x/z values of the two are the same, deleting one point to obtain the row ordering. Specifically, using std:, map class creates an empty container V1, then traverses each point Pi of the original unordered point cloud C with coordinates (x, y, z), sorts according to x/z and y/z, and stores into a container V1, the sort rule is: if the y/z value is larger, the values are arranged at the back; if the y/z values are the same, the row with the larger x/z value is behind, and if the x/z values are the same, one of the rows is deleted. After all the points in the disordered point cloud are sorted according to the above rule, the container V1 is output, and the container V1 is actually a matrix with one row and multiple columns, wherein the total number of columns is the number of corresponding points in the disordered point cloud (if there are no repeated points according to the sorting rule).
The obtaining of the rank ordering comprises the following steps: comparing the x/z values of any two points in the disordered point cloud, arranging the point with the larger x/z value behind the point, and comparing the y/z values if the x/z values of the two points are the same, and arranging the point with the larger y/z value behind the point; and if the y/z values of the two are the same, deleting one point to obtain the column ordering. Specifically, using std:: map class to create an empty container V2, traversing each point Pi of the original unordered point cloud C with coordinates (x, y, z), sorting and storing in the container V2 according to the size of x/z and y/z, the sorting rule is: if the x/z value is larger, the X/z values are arranged at the back; if the x/z values are the same, the row with the larger y/z value is in the back. If the y/z values are the same, one of the points is deleted. After all the points in the disordered point cloud are sorted according to the above rule, the container V2 is output, and the container V2 is also a matrix with one row and multiple columns, wherein the total number of columns is the number of corresponding points in the disordered point cloud (if there are no repeated points according to the sorting rule).
In step S4, as a preferable scheme, for any point PiSearching P in the unordered point cloud according to the index rules in the row ordering and the column orderingiAdjacent point P ofj、Pk、PqThe method comprises the following steps: determining the PiPosition in the sort by row, and PiThe latter point in the line ordering being taken asThe P isiAdjacent point P ofj(ii) a Determining the PjPosition in the rank ordering, and the PjThe latter point in the rank ordering as the PiAdjacent point P ofk(ii) a Determining PiPosition in said rank ordering, and PiThe latter point in the rank ordering as the PiAdjacent point Pq
In this embodiment, each point Pi of the unordered point cloud C is traversed, an empty container F is created, and for any point PiFirst, P is addediStoring the data into F; find P in the container V1iPosition of P after Pi in V1jStoring the data into F; find P in the container V2jPosition of (2) P in V2jThe latter point PkStoring the data into F; finding the position of Pi in the container V2, and taking the Pi in V2 as a later point PqAnd storing the data into F.
In addition, if any one of the 3 searching steps is unsuccessful, skipping the searching of the serial number i, and searching the adjacent point of the next point in the unordered point cloud data. Noting the number of the vertexes in the vertex set S as Ns, traversing the sequence number i (i =0 …, Ns), and for any point Smn in S, searching the corresponding point P in the container V1iThen the latter point P of Pi is looked up in the container V1jLooking up P in the container V2jLast point P ofkLooking up P in the container V2iLast point P ofq(ii) a If the 3 searching steps are successful, confirming the adjacent point P according to the index relationj、Pk、PqRespectively corresponding vertexes Smn,Sm,n+1.Sm+1,n,Sm+1,n+1And establishing a topological relation of the 4 vertexes, namely adding a new four-corner patch Q to the grid M, wherein the vertexes of Q are S in sequencemn,Sm,n+1.Sm+1,n,Sm+1,n+1。
In step S6, when adding a four-corner patch Q, if it is determined that the side length of the four-corner patch exceeds the threshold, the four-corner patch having the side length exceeding the threshold is deleted.
By the method for generating the 5D texture grid data structure by the 5D texture grid data structure and the corresponding 3D unordered point cloud, the 3D point cloud can be stored in a SeizetColormesh form, as shown in FIG. 10, which is a carton original point cloud; FIG. 11(a) is a schematic diagram of the structure of the carton after converting the original point cloud into Seizet Colormesh; fig. 11(b) is an enlarged view.
(III) neighborhood access method of 5D texture grid data structure
The invention further provides a neighborhood access method of the 5D texture grid data structure, so as to realize efficient neighborhood search.
After point cloud data is expressed based on a 5D texture grid data structure, the point cloud data is of a topological structure and can effectively represent all-dimensional information of a three-dimensional object, and a stronger perception identification effect is realized for processing of normal calculation, model rendering, feature extraction, data simplification, data smoothing, curved surface reconstruction and the like of subsequent point clouds, so that a data structure foundation is laid for a robot to grab a large number of workpieces in a disordered state, the invention provides a neighborhood access method of the 5D texture grid data structure, which comprises the following steps:
for any vertex S in the 5D texture grid data structuremnWith said vertex SmnWhen the initial vertex starts the neighborhood access of this time, each neighborhood access comprises the following steps: judging whether the initial vertex is a boundary point, and returning to be empty if the initial vertex is the boundary point; and if the initial vertex is not the boundary point, searching all neighborhood points Ns in the grid data structure with the access radius r by taking the initial vertex as the center.
When neighborhood access is carried out, all neighborhood points of a 5D texture grid data structure need to be searched for realizing efficient processing of subsequent point clouds, and the sequence of the neighborhood access is limited in the embodiment so as to ensure that all the neighborhood points are effectively searched, and meanwhile, the searching efficiency can be improved as much as possible.
In this embodiment, preferably, the initial vertex is used as the center,acquiring all neighborhood points with the radius from 1 to r layer by layer, acquiring 8 x r vertexes from neighborhood access of each layer, directly searching 8 neighborhood points with the initial vertex as the center and the radius of 1 when judging that r =1, and acquiring the initial vertex S layer by layer if r is more than or equal to 2mnCentered, all neighborhood points from radius 1 to r.
The neighborhood access method of the 5D texture grid data structure disclosed by the invention is used for judging the initial vertex SmnAfter not being a boundary point, firstly determining the size of the access radius r of a given neighborhood, and if the radius r is 1, directly searching for an initial vertex SmnCentered, radius 1, neighborhood point, i.e. taken with the initial vertex SmnAs a central 8 vertexes Nk(k =0 to 1, N)kE Ns); if the neighborhood access radius r is larger than or equal to 2, the number of neighborhood points is (2r +1) according to the 5D texture grid data structure 21, as shown in FIG. 4, using a recursive algorithm, first of all to find the initial vertex SmnAs a center, the radius is 1, namely the first layer has 8 × 1 neighborhood points in total, and then the initial vertex S is continuously searchedmnAs the center, radius is 2, namely 8 × 2 neighborhood points of the second layer, until finding 8 × r neighborhood points of the r-th layer with initial vertex Smn as the center and radius r, all the vertexes obtained by searching the above layers are obtained, namely initial vertex SmnAll vertices in the range of the center and radius r.
In the access process, if the initial vertex has no half or the half of the initial vertex has no adjacent four-corner patches, the initial vertex is determined to be a boundary point. In addition, when in the access process, if the radius is m (m)<r) field Access Return result, the number of vertexes is not (2m +1)21, indicating that the access result of one layer may be problematic, and returning null in order to avoid not being able to obtain all neighborhood points.
In order to further improve the access efficiency, the neighborhood access method of the 5D texture grid data structure disclosed by the invention also limits the search sequence of each layer of vertexes. As a preferred solution, the neighborhood access of each layer comprises the following steps: firstly, acquiring a half Hi of an initial vertex based on a 5D texture grid data structure, and acquiring a half HiEnd point Ni(NiE.ns), the initial vertex is the initial vertex or the first vertex obtained by the last layer access; then, as shown in fig. 4, searching and accessing any layer of vertexes in a counterclockwise direction, i.e. I) searching upwards for r times from Ni, and then sequentially searching leftwards for 2r times, downwards for 2r times, rightwards for 2r times and upwards for r-1 times to obtain 8r vertexes; in addition, the search of any layer of vertexes can also be carried out along the clockwise direction, namely II) the downward search is carried out for r times from Ni, and then the leftward search is carried out for 2r times, the upward search is carried out for 2r times, the rightward search is carried out for 2r times, and the downward search is carried out for r-1 times in sequence, so that 8r vertexes are obtained.
When searching any layer of vertex along the counterclockwise direction, the step of searching from Ni upwards r times comprises the following steps: I-A) obtaining the first vertex of the upward search: obtaining the upper half H of the opposite half of Ni based on a 5D texture grid data structurei+1,Hi+1Starting vertex N ofi+1(Ni+1e.Ns) is the first vertex searched upwards at the time; I-B) acquiring subsequent r-1 vertexes, wherein the subsequent r-1 vertex searching comprises the following steps: and acquiring a half-out side corresponding to the next vertex, and taking an initial vertex corresponding to the half-out side as the next vertex, wherein the half-out side corresponding to the next vertex is acquired based on the last half of the opposite half of the last vertex.
I) In the method, when searching for left for 2r times, searching for down for 2r times, searching for right for 2r times and searching for up for r-1 times, the searching for each vertex respectively comprises the following steps: I-C) obtaining a first vertex of the search: acquiring the last half of the last vertex determined by the last search based on the 5D texture grid data structure, wherein the initial vertex corresponding to the last half of the last vertex is the first vertex of the search; I-B) acquiring other vertexes of the search: the subsequent search for each other vertex comprises the following steps: and acquiring a half-out side corresponding to the next vertex, and taking an initial vertex corresponding to the half-out side as the next vertex, wherein the half-out side corresponding to the next vertex is acquired based on the upper half side of the opposite half side of the upper vertex.
As shown in fig. 5, the following describes in further detail the vertex search and access in the counterclockwise direction with the radius r = 2.
The method comprises the following steps: first get 8 neighborhood visits for r = 1: judging whether the initial vertex is a boundary point, if so, judging SmnIf the boundary point is the boundary point, returning to null; wherein, if S is generated in the mesh data structuremnWithout a half-cut, or SmnIf the half edge of the sheet is not adjacent to the four-corner surface sheet, S is judgedmnIs a boundary point; if SmnIf not, the points S are sequentially obtainedmn8 neighborhood points.
As shown in fig. 5, the initial vertex S is setmnAs an initial vertex for the present level search, an initial vertex S is obtained based on a 5D texture grid data structuremnAnd after acquiring the terminating vertex N0 of the half Hi, searching from N0 for 1 time upwards, then searching for 2 times leftwards, searching for 2 times downwards and searching for twice rightwards.
Where 1 search up, starting from N0, includes I-a) finding the starting vertex N1 of H1 using the top half H1 of the opposite half of Hi.
Searching from N1 to the left 2 times includes: I-C) finding the starting vertex N2 of H2 by using the upper half H2 of H1; I-B) find the H3 starting vertex N3 using the upper half H3 of the opposite half of the upper half of H2; search down 2 times starting from N3, including I-C) find the H4 starting vertex N4 using the top half H4 of H3; I-B) find the starting vertex N5 of H5 using the upper half H5 of the opposite half of the upper half of H4; searching right 2 times starting from N5 includes I-C) finding the starting vertex N6 of H6 using the top half H6 of H5; I-B) Using the upper half H7 of the opposite half of the upper half of H6, the starting vertex N7 of H7 is found to this end, SmnThe counterclockwise 8 neighbor visit result of (a) is N0-N7.
Step two: based on a recursive algorithm, all neighborhood points with a radius of 2 are obtained: taking the first vertex N0 obtained by the previous layer search as an initial vertex, obtaining the half H8 of the N0 based on the 5D texture grid data structure, finding the terminal vertex N8 of the H8, then searching upwards 1 time from N8, and then sequentially searching leftwards 4 times, downwards 4 times, rightwards 4 times and upwards 2 times to obtain 16 (8 x 2) vertices of the layer.
Wherein searching up 2 times starting from N8, including I-C) finding the starting vertex N9 of H9 using the top half H9 of the opposite half of H8; I-B) found the starting vertex N10 of H10 using the upper half H10 of the opposite half of the upper half of H9.
Search left 4 times starting from N10, including I-C) find the starting vertex N11 of H11 using the top half H11 of H10; I-B) find the starting vertex N12 of H12 using the upper half H12 of the opposite half of the upper half of H11; I-B) find the starting vertex N13 of H13 using the upper half H13 of the opposite half of the upper half of H12; I-B) found the starting vertex N14 of H14 using the upper half H14 of the opposite half of the upper half of H13.
Search down 4 times starting from N14, including I-C) find the starting vertex N15 of H15 using the top half H15 of H14; I-B) find the starting vertex N16 of H16 using the upper half H16 of the opposite half of the upper half of H15; I-B) find the starting vertex N17 of H17 using the upper half H17 of the opposite half of the upper half of H16; I-B) found the starting vertex N18 of H18 using the upper half H18 of the opposite half of the upper half of H17.
Search right 4 times starting from N18, including I-C) find the starting vertex N19 of H19 using the top half H19 of H18; I-B) find the starting vertex N20 of H20 using the upper half H20 of the opposite half of the upper half of H19; I-B) find the starting vertex N21 of H21 using the upper half H21 of the opposite half of the upper half of H20; I-B) found the starting vertex N22 of H22 using the upper half H22 of the opposite half of the upper half of H21.
Search 1 up from N22, including I-C) find the starting vertex N23 of H23 using the top half H23 of H22. To this end, SmnRadius r =2 counterclockwise neighborhood visit results N0-N23.
When searching any layer of vertex along the clockwise direction, the step of searching downwards r times from Ni comprises the following steps:
II-A) obtaining the first vertex of the search: obtaining the next half H of Hii+1 ,Hi+1Terminating vertex N ofi+1Is the first vertex searched downward; II-B) obtaining the subsequent r-1 vertexes: for subsequent r-1 searches, each vertex search includes: and acquiring a middle half corresponding to the next vertex, wherein the termination vertex corresponding to the middle half is used as the next vertex, and the middle half corresponding to the next vertex is acquired based on the next half of the opposite half of the next half of the previous vertex.
When searching for 2r times to the left, searching for 2r times to the down, searching for 2r times to the right and searching for r-1 times to the up, each search respectively comprises the following steps:
II-C) acquiring the next half of the last top point searched for the previous time, and taking the terminating top point corresponding to the next half of the last top point as the first top point searched for this time; II-B) obtaining other vertexes of the search: each subsequent vertex search comprises the following steps: and acquiring a middle half corresponding to the next vertex, and taking an end vertex corresponding to the middle half as the next vertex, wherein the middle half corresponding to the next vertex is acquired based on the next half of the opposite half of the next half of the previous vertex.
The following describes the clockwise vertex search with the radius r = 1.
As shown in fig. 6, the initial vertex S is setmnAs an initial vertex for the present level search, an initial vertex S is obtained based on a 5D texture grid data structuremnAnd after the terminating vertex N0 of the half Hi is obtained, the search is performed 1 time downwards from N0, then 2 times leftwards, 2 times upwards and twice rightwards.
Search down 1 time starting from N0, including II-a) find the terminating vertex N7 of H0 with the next half H0 of Hi.
Search 2 times to the left starting from N7, including: II-C) finding the terminating vertex N6 of H7, using the next half H7 of H0; I-B) the terminating vertex N5 of H6 was found using the next half H6 (middle half) of the opposite half of the next half of H7.
Search up 2 times starting from N5, including II-C) find the terminating vertex N4 of H5 using the next half H5 of H6; I-B) find H4 terminating vertex N3 using the next half H4 (middle half) of the opposite half of the next half H5;
search right 2 times starting from N3, including II-C) find the terminating vertex N2 of H3 using the next half H3 of H4; II-B) the next half H2 (middle half) of the opposite half of the next half H3 was used to find the terminating vertex N1 of H2.
To this end, the product obtained is SmnClockwise visit results N0-N7 of the 8 neighbors at the center.
(IV) 3D disordered point cloud edge detection method based on SeizetColormesh
On the basis of the (I), (II) and (III), the invention provides a 3D disordered point cloud edge detection method based on SeizetColormesh, which comprises the following steps: as shown in fig. 7, the method comprises the following steps:
(1) converting the 3D disordered point cloud data into a 5D texture grid data structure, wherein the 5D texture grid data structure comprises a plurality of half-side four-corner grids which are topologically connected, and each half-side four-corner grid comprises a four-corner surface patch and four vertexes S arranged on the four-corner surface patchmn,Sm,n+1.Sm+1,n,Sm+1,n+1And a plurality of halves, wherein, based on any point P in the point cloud dataiAnd PiThe three adjacent points of the point cloud data acquire four corresponding vertexes, and each vertex stores a corresponding point P in the point cloud dataiThe 3D position coordinates (x, y, z), the normal vector, the color, and pointer information of the half with the start vertex as it is, each half storing pointers or indexes of the start vertex, the end vertex, the adjacent surface, the upper half, the lower half, the opposite half.
(2) For any vertex S in the 5D texture grid data structuremnObtained by said SmnAll neighborhood points N within a range of radius r as the centerSWherein the vertex S ismnStarting the neighborhood visit of this time as an initial vertex to acquire all corresponding neighborhood points NSThe method comprises the following steps: judging whether the initial vertex is a boundary point, and returning to be empty if the initial vertex is the boundary point; if the initial vertex is notAnd if the initial vertex is the boundary point, searching all neighborhood points in the grid data structure with the access radius r by taking the initial vertex as the center.
(3) Performing Gaussian blur on the 5D texture grid data structure, and enabling each vertex SmnIs assigned to said vertex SmnCorresponding to all neighborhood points NSWeighted average of the RGB values.
In this embodiment, the gaussian blurring of the 5D texture grid data structure includes the following steps:
(3.1) traversing the center point SmnCorresponding neighborhood point NSObtaining the center point SmnTo each neighborhood point NSSpatial distance dijWith dijComputing the Gaussian kernel weight wij
Figure 573142DEST_PATH_IMAGE009
Wherein the content of the first and second substances,
Figure 737145DEST_PATH_IMAGE002
is an undetermined parameter not equal to 0, and adjusts the parameter according to the actual condition, NSTo adopt the SmnAs a central, neighborhood point of radius r, S for any vertex in the 5D texture grid data structure as described in (iii)mnWith said vertex SmnStarting the neighborhood visit of this time as an initial vertex to acquire all corresponding neighborhood points NSThe method comprises the following steps: judging whether the initial vertex is a boundary point, and returning to be empty if the initial vertex is the boundary point; and if the initial vertex is not the boundary point, searching all neighborhood points in the grid data structure with the access radius r by taking the initial vertex as the center.
(3.2) placing the vertex SmnIs assigned to the corresponding neighborhood point NSWeighted average of the RGB values of (1), the weight corresponding to wijI.e. by
Figure 491474DEST_PATH_IMAGE010
Wherein, RGBSmnIs a vertex SmnRGB value of (g, b)NsIs SmnCorresponding to neighborhood point NSThe RGB value of (a).
(4) Acquiring gray gradient gi and gradient direction di of the 5D texture grid data structure after Gaussian blur;
the step (4) of obtaining the gray gradient gi and the gradient direction di of the 5D texture grid data structure after Gaussian blur comprises the following steps:
(4.1) graying the four-corner grid M to obtain SmnCorresponding RGBi values;
traversing points S in the set S of vertices of the tetragonal meshmnAnd for each vertex S based on the following formulamnGraying treatment:
Figure 431748DEST_PATH_IMAGE004
wherein, Ri, Gi and Bi are respectively RGBsmnThe corresponding numerical value of the three channels of middle red, green and blue, ar、ag、abIs taken to satisfy ar+ag+ab=1, ar>0,ag>0, abIs greater than 0; as a preferred option, a weighted average may be selected and applied to each vertex SmnGraying processing to obtain SmnCorresponding RGBi values; namely, it is
Figure 955133DEST_PATH_IMAGE011
(4.2) for an arbitrary vertex SmnObtaining the vertex S based on the neighborhood access in the step (2)mnIf the 8 connected neighborhood point set is empty, gi = -1, and di = 0; if the 8 connected neighborhood point set is not empty, based on the vertex SmnCorresponding 8 connected neighborhood points NkDetermining the vertex SmnThe corresponding gray scale gradient gi and gradient direction di include:
Figure 322661DEST_PATH_IMAGE005
Figure 564286DEST_PATH_IMAGE006
Figure 511514DEST_PATH_IMAGE012
wherein the above is determined based on the values of RGBi acquired in step (4.1)
Figure 154985DEST_PATH_IMAGE008
Magnitude of (1), GxAnd GyIs a vertex SmnGradation gradients in the x and y directions, i.e. vertex SmnGray scale gradients in the horizontal and vertical directions.
(4.3) discretizing the gradient direction di, consisting of dividing-pi to pi into 4 regions at ± i pi/8 (i =1,3,5, 7):
di =0 if di falls in the region [ - π/8, π/8 ]. sup. [ - π, -7 π/8 ]. sup. [7 π/8, π ];
if di falls in the region (π/8, 3 π/8) U (-7 π/8, -5 π/8), then di = π/4;
if di falls in the region [3 π/8, 5 π/8] < U [ -5 π/8, -3 π/8], then di = π/2;
if di falls in the region (5 π/8, 7 π/8) U (-3 π/8, - π/8), then di =3 π/4.
(5) The gradient image is subjected to non-maximum value suppression, and S is outputmnThe corresponding temporary variable value Ti;
preferably, in step (5), as shown in fig. 8, the gradient image is subjected to non-local maximum suppression, and S is outputmnThe corresponding value Ti comprises setting a low threshold thres _ low and creating an empty container T, traversing the vertices Smn
For any vertex Smn,If the gray gradient gi is judged to be smaller than a preset low threshold thres _ low, Ti = 0; if the gray gradient gi is greater than the low threshold thres _ low, the vertex S is determinedmnWhether the corresponding 8-connected neighborhood point set is empty or not, if the neighborhood point set is empty, Ti =0, and if the neighborhood point set is empty, Ti =0If the sum is not null, then judging if SmnIf yes, then Ti = gi, otherwise Ti = 0:
a)Smndi =0, and SmnIs larger than the gray gradients of both N0 and N4;
b)Smndi = π/4, and SmnIs larger than the gray gradients of both N1 and N5;
c)Smndi = π/2, and SmnIs larger than the gray gradients of both N2 and N6;
d)Smndi =3 pi/4, and SmnIs larger than the gray gradients of both N3 and N7.
(6) The edge profile of the four-corner grid M is searched.
Preferably, as shown in fig. 9, step (6) searches the edge contour of the four-corner grid M using Canny operator.
(6.1) for any point Ti, if Ti is judged to be larger than high threshold thres _ high and corresponding vertex SmnNot marked as an edge point, then S ismnMarking as an edge point, and performing (6.2) a judgment SmnWhether the corresponding 8-connected neighborhood points are edge points or not; otherwise, skipping Ti and continuing to execute (6.1), wherein the high threshold thres _ high is a preset value;
(6.2) obtaining the vertex S corresponding to TimnJudging whether the 8 connected neighborhood point set is empty or not, if so, skipping Ti and continuing to execute (6.1); if the 8 connected neighborhood point set is not empty, every point N in the 8 connected neighborhood point set is subjected tokRespectively executing the step (6.3);
(6.3) if NkCorresponding Ti value equal to 0 or NkIf the marked edge point is marked, skipping the neighborhood point and continuing to execute (6.2); otherwise, the neighborhood point N is usedkMarking as an edge point; obtaining NkUntil N, recursively (6.3)kThe 8 neighborhood access result is empty and continues to execute (6.2);
and (6.4) after the traversal of (6.1) is finished, outputting all points marked as edge points in the corresponding four-corner grid M vertex set, namely the edge contour to be obtained.
By the method, the edge detection of the 3D disordered point cloud is realized. Taking the original point cloud of the carton shown in fig. 10 as an example, the number of the point cloud is 14.1 ten thousand, the generated SeizetColorMesh is shown in fig. 11(a) and 11(b), the blur radius is set to be 2 in the gaussian blur process, the low threshold is set to be 60 in the non-maximum suppression process, the high threshold is set to be 90 in the Canny operator, the edge detection result is shown in fig. 12, and the algorithm consumes the following time:
algorithm function Generating a mesh Gaussian blur Sobel operator Non-maximum suppression Canny operator
Time consuming (ms) 106.2 44.5 14.0 1.6 2.4
The edge detection method based on the Seizet ColorMesh (5D texture grid data structure) enables disordered point cloud to have rapid neighborhood access capability after the disordered point cloud is converted into the 5D texture grid data structure, then searches the edge contour of a four-corner grid M after the disordered point cloud is processed by the steps of Gaussian blur, non-maximum suppression and the like to realize edge detection of disordered point cloud data, and therefore the mature 2D edge detection method is popularized to 3D disordered point cloud.
Fifth, 3D unordered point cloud edge detection device based on SeizetColormesh
As shown in fig. 13, the present invention further discloses a 3D unordered point cloud edge detection apparatus 10 based on seietcolormesh, including: a 5D texture grid data structure conversion module 11, configured to convert 3D unordered point cloud data into a 5D texture grid data structure, where the 5D texture grid data structure includes a plurality of half-square four-corner grids that are topologically connected, and each half-square four-corner grid includes a four-corner surface patch and four vertexes S disposed on the four-corner surface patchmn,Sm,n+1.Sm+1,n,Sm+1,n+1And a plurality of halves, wherein, based on any point P in the point cloud dataiAnd PiThe three adjacent points of the point cloud data acquire four corresponding vertexes, and each vertex stores a corresponding point P in the point cloud dataiThe 3D position coordinates (x, y, z), the normal vector, the color, and pointer information of the half with the start vertex as it is, each half storing pointers or indexes of the start vertex, the end vertex, the adjacent surface, the upper half, the lower half, the opposite half.
A neighborhood accessing module 12 for accessing any vertex S in the 5D texture grid data structuremnWith said vertex SmnStarting the neighborhood visit of this time as an initial vertex to acquire all corresponding neighborhood points NSThe system comprises a boundary point judgment submodule and a neighborhood access submodule, wherein the boundary point judgment submodule is used for judging whether the initial vertex is a boundary point, and if the initial vertex is the boundary point, returning to be null; and if the initial vertex is not the boundary point, jumping to a neighborhood access submodule, wherein the neighborhood access submodule is used for searching all neighborhood points in the grid data structure with the access radius r by taking the initial vertex as the center.
A gaussian blurring module 13 for performing gaussian blurring on the 5D texture grid data structure to obtain each vertex SmnIs assigned to said vertex SmnCorresponding to all neighborhood points NSWeighted average of the RGB values of (1), where NSTo adopt the SmnIs a neighborhood point with a center and a radius r.
A gray gradient gi and gradient direction di obtaining module 14, configured to obtain a gray gradient gi and a gradient direction di of the 5D texture grid data structure after gaussian blurring; for any vertex SmnObtaining the vertex S based on a neighborhood access modulemnIf the 8 connected neighborhood point set is empty, gi = -1, and di = 0; if the 8 connected neighborhood point set is not empty, the vertex S is connectedmnThe corresponding 8 connected neighborhood points are respectively marked as Nk(k=0~7, Nk∈NS) Based on said vertex SmnCorresponding 8 connected neighborhood points NkDetermining the vertex SmnAnd the gradient direction di, and discretizing the gradient direction di.
A non-maximum value suppression module 15 for performing non-maximum value suppression on the gradient image and outputting SmnThe corresponding temporary variable value Ti;
and an edge contour output module 16, configured to search for an edge contour of the four-corner grid M, and output the edge contour.
As a preferred scheme, in the neighborhood accessing submodule, all neighborhood points with the radius from 1 to r are acquired layer by taking the initial vertex as a center, and 8 × r vertexes are acquired by neighborhood accessing of each layer.
As a preferred scheme, the neighborhood access submodule comprises a counterclockwise access unit or a clockwise access unit; the counterclockwise access unit is used for acquiring a half Hi of an initial vertex based on the 5D texture grid data structure, acquiring a termination vertex Ni of the half Hi, searching for r times upwards from Ni, sequentially searching for 2r times leftwards, 2r times downwards, 2r times rightwards and r-1 times upwards to acquire 8r vertexes; the clockwise access unit is used for acquiring a half Hi of an initial vertex based on the 5D texture grid data structure, acquiring a termination vertex Ni of the half Hi, searching downwards r times from Ni, and sequentially searching leftwards for 2r times, upwards for 2r times, rightwards for 2r times and downwards for r-1 times to acquire 8r vertexes.
Furthermore, the counter-clockwise access unit comprises a first type vertex acquisition subunit, a second type vertex acquisition subunit and a second type vertex acquisition subunit; a vertex fetch subunit of a first type for fetching a first vertex searched upward starting from Ni, wherein a top half H of an opposite half of Ni is fetched based on a 5D texture mesh data structurei+1,Hi+1Starting vertex N ofi+1The first vertex searched upwards at this time; the second-class vertex acquisition subunit is used for acquiring a first vertex in left search 2r times, downward search 2r times, right search 2r times and upward search r-1 times, wherein the last half of the last vertex determined in the last search is acquired based on a 5D texture grid data structure, and an initial vertex corresponding to the last half of the last vertex is the first vertex in the search; the second-class vertex obtaining subunit is configured to obtain subsequent r-1 vertices searched upward from Ni and obtain other vertices in the left search 2r times, the down search 2r times, the right search 2r times, and the upward search r-1 times, where a first half corresponding to a next vertex is obtained, a starting vertex corresponding to the first half is used as the next vertex, and a first half corresponding to the next vertex is obtained based on a first half of an opposite half of the first vertex.
The second vertex acquisition subunit can also be split into two independent vertex acquisition units to respectively acquire subsequent r-1 vertexes searched from Ni upwards, and acquire other vertexes searched 2r times leftwards, 2r times downwards, 2r times rightwards and r-1 times upwards.
Furthermore, the clockwise access unit comprises a first type vertex fetching subunit 'and a second type vertex fetching subunit': the vertex fetch subunit of the first type' is used to fetch the first vertex searched downward starting from Ni, where the next half H of Hi is fetchedi+1 ,Hi+1Terminating vertex N ofi+1For searching downwardsA first apex of the cord; the second-class vertex acquisition subunit' is used for acquiring a first vertex in leftward search for 2r times, downward search for 2r times, rightward search for 2r times and upward search for r-1 times, acquiring the next half of the last vertex in the previous search, and taking a terminating vertex corresponding to the next half of the last vertex as the first vertex in the current search; the vertex acquisition subunit of the second type is configured to acquire the remaining r-1 vertices searched downward from Ni and acquire other vertices searched leftward for 2r times, downward for 2r times, rightward for 2r times, and upward for r-1 times, where a middle half corresponding to a next vertex is acquired, an end vertex corresponding to the middle half is used as the next vertex, and a middle half corresponding to the next vertex is acquired based on a next half of an opposite half of the next half of the previous vertex. In addition, the three types of vertex acquisition units' can also be split into two independent vertex acquisition units to respectively acquire the remaining r-1 vertices searched downwards from Ni and other vertices searched leftwards for 2r times, downwards for 2r times, rightwards for 2r times and upwards for r-1 times.
Preferably, the neighborhood accessing module further comprises an error reporting sub-module for determining if the radius is m (m)<r) field Access Return result, the number of vertexes is not (2m +1)2-1, return empty.
Further, in the boundary point determination submodule, if the initial vertex Si has no half or the half of the initial vertex Si has no adjacent four-corner patches, the initial vertex Si is determined to be a boundary point.
Preferably, the Gaussian blur module comprises a Gaussian kernel weight determination submodule and RGBSmnA sub-module is determined.
The Gaussian kernel weight determination submodule is used for traversing the vertex SmnNeighborhood point N ofSObtaining the vertex SmnTo each neighborhood point NSSpatial distance dijTo determine the Gaussian kernel weight wij
Figure 191949DEST_PATH_IMAGE009
Wherein the content of the first and second substances,
Figure 920870DEST_PATH_IMAGE002
is a pending parameter other than 0, NSTo adopt the SmnIs a neighborhood point with a center and a radius r.
RGBSmnDetermining a sub-module for using the vertex SmnIs assigned to the corresponding neighborhood point NSIs weighted average of the RGB values of (a),
Figure 671788DEST_PATH_IMAGE013
wherein, RGBSmnIs a vertex SmnRGB value of (g, b)NsIs SmnCorresponding to neighborhood point NSThe RGB value of (a).
Preferably, the gray gradient gi and gradient direction di determining module includes a graying sub-module, a gray gradient gi and gradient direction di obtaining sub-module, and a gradient direction discrete sub-module.
The graying submodule is used for graying the four-corner grid M to obtain SmnCorresponding RGBi values; traversing points S in the set S of vertices of the tetragonal meshmnAnd for each vertex SmnGraying treatment:
Figure 169766DEST_PATH_IMAGE004
wherein, Ri, Gi and Bi are respectively RGBsmnThe corresponding numerical value of the three channels of middle red, green and blue, ar、ag、abIs taken to satisfy ar+ag+ab=1, ar>0,ag>0, ab>0;
The gray gradient gi and gradient direction di acquisition sub-module is used for any vertex SmnObtaining the vertex S based on a neighborhood access modulemnAfter the corresponding 8 connected neighborhood points, if the 8 connected neighborhood point set is judged to be empty, gi =1, and di = 0; if the 8-connected neighborhood point set is not empty, recording each neighborhood point as Nk(k=0~7, Nk∈NS) Determining the vertex S based on each neighborhood point N0-N7mnThe magnitude of the corresponding gray gradient gi and gradient direction di:
Figure 879096DEST_PATH_IMAGE014
Figure 829734DEST_PATH_IMAGE015
Figure 915502DEST_PATH_IMAGE016
wherein the above is determined based on the RGBi values obtained in the graying sub-module
Figure 438625DEST_PATH_IMAGE008
The numerical value of (c).
A gradient direction di discretization submodule for discretizing the gradient direction di into 4 regions with a pi to pi division by ± i pi/8 (i =1,3,5, 7):
di =0 if di falls in the region [ - π/8, π/8 ]. sup. [ - π, -7 π/8 ]. sup. [7 π/8, π ];
if di falls in the region (π/8, 3 π/8) U (-7 π/8, -5 π/8), then di = π/4;
if di falls in the region [3 π/8, 5 π/8] < U [ -5 π/8, -3 π/8], then di = π/2;
if di falls in the region (5 π/8, 7 π/8) U (-3 π/8, - π/8), then di =3 π/4.
The non-maximum suppression module is used for any vertex Smn,If the gray gradient gi is judged to be smaller than a preset low threshold thres _ low, Ti = 0; if the gray gradient gi is greater than the low threshold thres _ low, the vertex S is determinedmnWhether the corresponding 8-connected neighborhood point set is empty or not is judged, if the neighborhood point set is empty, Ti =0 is judged, and if the neighborhood point set is not empty, S is judgedmnIf the gray scale gradient gi and the gradient direction di satisfy one of the following 4 conditions, Ti = gi if the gray scale gradient gi and the gradient direction di satisfy, otherwise Ti = 0:
a)Smnthe gradient direction of (d) di =0,and SmnIs larger than the gray gradients of both N0 and N4;
b)Smndi = π/4, and SmnIs larger than the gray gradients of both N1 and N5;
c)Smndi = π/2, and SmnIs larger than the gray gradients of both N2 and N6;
d)Smndi =3 pi/4, and SmnIs larger than the gray gradients of both N3 and N7.
The edge profile output module includes:
a first type edge point determining unit for determining any point Ti if Ti is greater than the high threshold thres _ high and corresponding to the vertex SmnNot marked as an edge point, then S ismnMarking the edge points as edge points, and transferring the edge points to a second type edge point judgment unit, wherein a high threshold thres _ high is a preset value; a second type edge point judgment unit for judging SmnWhether the corresponding 8-connected neighborhood points are edge points or not; otherwise, skipping over Ti and transferring to a first type edge point judging unit; if yes, the vertex S corresponding to Ti is obtainedmnThe 8 connected neighborhood point set is judged whether the 8 connected neighborhood point set is empty, if the 8 connected neighborhood point set is empty, Ti is skipped and the first type of edge point judgment unit is switched to; if the 8 connected neighborhood point set is not empty, every point N in the 8 connected neighborhood point set is subjected tokRespectively switching to a third type edge point judging unit; a third type of edge point determination unit for determining if N iskCorresponding Ti value equal to 0 or NkIf the marked edge points are the edge points, skipping the neighborhood points and transferring to a second type edge point judgment unit; otherwise, the neighborhood point N is usedkMarking as an edge point; obtaining NkRecursively executes the judgment of the third type edge point judgment unit until N is reachedkWhen the 8-neighborhood access result is empty, continuing switching to a second-class edge point judgment unit; an output module for judging all vertexes S in the unit to be judged for the first kind of edge pointsmnAfter the traversal is finished, all the points marked as edge points in the corresponding four-corner grid M vertex set are output, and the points are the edge contour to be obtained.
The edge detection device based on the SeizetColorMesh (5D texture grid data structure) converts the disordered point cloud into the 5D texture grid data structure, so that the disordered point cloud also has the rapid neighborhood access capability, and then searches the edge contour of the four-corner grid M after the treatment of Gaussian blur, non-maximum suppression and the like to realize the edge detection of the disordered point cloud data, thereby popularizing the mature 2D edge detection method to the 3D disordered point cloud.
Sixthly, computer equipment
Fig. 14 is a schematic structural diagram of a computer device according to an embodiment of the present invention, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack-mounted server, a blade server, a tower server, or a rack-mounted server (including an independent server or a server cluster formed by multiple servers) that can execute programs. The computer device 20 of the present embodiment includes at least, but is not limited to: a memory 21 and a processor 22 which can be communicatively connected to each other by a system bus, as shown in fig. 14. It is noted that fig. 14 only shows a computer device 20 with components 21-22, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
In this embodiment, the memory 21 (i.e., the readable storage medium) includes a Flash memory, a hard disk, a multimedia Card, a Card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), and a Programmable Read Only Memory (PROM) memory 21, and the memory 21 may also be an external storage device of the computer device 20, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), and the like provided on the computer device 20. Of course, the memory 21 may also include both internal and external storage devices of the computer device 20. In this embodiment, the memory 21 is generally used to store an operating system and various types of application software installed in the computer device 20, such as program codes of the 3D unordered point cloud edge detection apparatus in the method embodiment. Further, the memory 21 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 22 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 22 is typically used to control the overall operation of the computer device 20. In this embodiment, the processor 22 is configured to run a program code stored in the memory 21 or process data, for example, run a 3D unordered point cloud edge detection apparatus, so as to implement the 3D unordered point cloud edge detection method in the method embodiment.
Seventh, a computer readable storage medium
The present application also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer-readable storage medium of this embodiment is used to store a 3D disordered point cloud edge detection apparatus, and when executed by a processor, implements the 3D disordered point cloud edge detection method of the method embodiment.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A3D disordered point cloud edge detection method based on a 5D texture grid data structure is characterized by comprising the following steps: the method comprises the following steps:
(1) converting 3D (three-dimensional) disordered point cloud data into a 5D texture grid data structure, wherein the 5D texture grid data structure comprises a plurality of half-side four-corner grids which are in topological connection, and each half-side four-corner grid comprises a four-corner surface piece and four vertexes S arranged on the four-corner surface piecemn,Sm,n+1.Sm+1,n,Sm+1,n+1And a plurality of halves, wherein, based on any point P in the point cloud dataiAnd PiThe three adjacent points of the point cloud data acquire four corresponding vertexes, and each vertex stores a corresponding point P in the point cloud dataiThe 3D position coordinates (x, y, z), normal vectors, colors, and pointer information of the halves of which are the starting vertex, each half storing pointers or indices of the starting vertex, the ending vertex, the adjoining surface, the upper half, the lower half, the opposite half;
(2) neighborhood access, for any vertex S in a 5D texture grid data structuremnObtained by said SmnAll neighborhood points N within a range of radius r as the centerSWherein the vertex S ismnStarting the neighborhood visit of this time as an initial vertex to acquire all corresponding neighborhood points NSThe method comprises the following steps: judging whether the initial vertex is a boundary point, and returning to be empty if the initial vertex is the boundary point; if the initial vertex is not the boundary point, all neighborhood points N in the grid data structure with the access radius r are searched by taking the initial vertex as the centerS
(3) Performing Gaussian blur on the 5D texture grid data structure, and enabling each vertex SmnIs assigned to said vertex SmnCorresponding to all neighborhood points NSWeighted average of the RGB values of (a);
(4) acquiring gray gradient gi and gradient direction di of the 5D texture grid data structure after Gaussian blur; for any vertex SmnObtaining the vertex S based on the neighborhood access in the step (2)mnIf the 8 connected neighborhood point set is empty, gi = -1, and di = 0; if the 8 connected neighborhood point set is not empty, the vertex S is connectedmnThe corresponding 8 connected neighborhood points are respectively marked as Nk(k=0~7, Nk∈NS) Based on said vertex SmnCorresponding 8 connected neighborhood points NkDetermining the vertex SmnThe corresponding gray gradient gi and the gradient direction di, and discretizing the gradient direction di;
(5) the gradient image is subjected to non-maximum value suppression, and S is outputmnThe corresponding temporary variable value Ti;
(6) searching the edge profile of the four-corner grid M and outputting the edge profile.
2. The 3D disordered point cloud edge detection method of claim 1, characterized in that: in the step (2), all neighborhood points with the radius from 1 to r are obtained layer by taking the initial vertex as a center, and 8 × r vertexes are obtained by neighborhood access of each layer;
the neighborhood access of each layer comprises the following steps: obtaining a half Hi of an initial vertex and obtaining a termination vertex Ni of the half Hi based on the 5D texture grid data structure, wherein the initial vertex is an initial vertex or a first vertex obtained by last-layer access:
I) searching upwards for r times from Ni, and then sequentially searching leftwards for 2r times, downwards for 2r times, rightwards for 2r times and upwards for r-1 times to obtain 8r vertexes of each layer;
or II) searching downwards r times from Ni, and then sequentially searching leftwards for 2r times, upwards for 2r times, rightwards for 2r times and downwards for r-1 times to obtain 8r vertexes of each layer.
3. The 3D disordered point cloud edge detection method of claim 2, characterized in that: in the step I), the step of searching from Ni upwards r times comprises the following steps: obtaining a first vertex searched upwards at this time: obtaining the upper half H of the opposite half of Ni based on the 5D texture grid data structurei+1Said H isi+1Starting vertex N ofi+1The first vertex searched upwards at this time; acquiring subsequent r-1 vertexes, wherein the subsequent r-1 vertex searching comprises the following steps: obtaining the half-out edge corresponding to the next vertex and obtaining the half-out edgeTaking the initial vertex corresponding to the half as a next vertex, wherein a half-out corresponding to the next vertex is obtained based on the upper half of the opposite half of the upper vertex;
and/or in the step I), when searching for left for 2r times, searching for down for 2r times, searching for right for 2r times and searching for up for r-1 times, each search respectively comprises the following steps: obtaining a first vertex of the search: acquiring the last half of the last vertex determined by the last search based on the 5D texture grid data structure, wherein the initial vertex corresponding to the last half of the last vertex is the first vertex of the search; obtaining other vertexes of the search, wherein the subsequent search of each other vertex comprises the following steps: acquiring a half-out side corresponding to a next vertex, and taking an initial vertex corresponding to the half-out side as a next vertex, wherein the half-out side corresponding to the next vertex is acquired based on a last half side of an opposite half side of the last vertex;
and/or, in the step II), the step of searching downwards r times from Ni comprises the following steps: obtaining a first vertex of the search: II-A) obtaining the next half H of Hi based on the 5D texture grid data structurei+1Said H isi+1Terminating vertex N ofi+1For the first vertex of the downward search, the subsequent r-1 vertices are obtained: for subsequent r-1 searches, each vertex search includes: II-B) acquiring a middle half corresponding to a next vertex, wherein a termination vertex corresponding to the middle half is used as the next vertex, and the middle half corresponding to the next vertex is acquired based on the next half of the opposite half of the next half of the previous vertex;
and/or in the step II), when searching for left for 2r times, searching for up for 2r times, searching for right for 2r times and searching for down for r-1 times, each search respectively comprises the following steps: II-C) obtaining the first vertex of the search: acquiring the next half of the last top point searched for the previous time, and taking the termination top point corresponding to the next half of the last top point as the first top point searched for this time; acquiring other vertexes of the search: each subsequent vertex search comprises the following steps: II-B) obtaining a middle half corresponding to the next vertex, and taking a termination vertex corresponding to the middle half as the next vertex, wherein the middle half corresponding to the next vertex is obtained based on the next half of the opposite half of the next half of the previous vertex.
4. The 3D disordered point cloud edge detection method of claim 1, characterized in that: the step (3) of performing Gaussian blur on the 5D texture grid data structure comprises the following steps:
(3.1) traverse vertex SmnCorresponding neighborhood point N ofSObtaining the vertex SmnTo each neighborhood point NSSpatial distance dijTo determine the Gaussian kernel weight wij
Figure 381967DEST_PATH_IMAGE001
Wherein the content of the first and second substances,
Figure 819901DEST_PATH_IMAGE002
is a pending parameter other than 0;
(3.2) placing the vertex SmnIs assigned to the corresponding neighborhood point NSWeighted average of the RGB values of (1), the weight corresponding to wij
Figure 676737DEST_PATH_IMAGE003
Wherein, RGBSmnIs a vertex SmnRGB value of (g, b)NsIs SmnCorresponding to neighborhood point NSThe RGB value of (a).
5. The 3D disordered point cloud edge detection method of claim 4, characterized in that: the step (4) of obtaining the gray gradient gi and the gradient direction di of the 5D texture grid data structure after Gaussian blur comprises the following steps:
(4.1) graying the four-corner grid M to obtain SmnCorresponding RGBi values;
traversing points S in the set S of vertices of the tetragonal meshmnAnd for each vertex S based on the following formulamnGraying treatment:
Figure 149306DEST_PATH_IMAGE004
wherein, Ri, Gi and Bi are respectively RGBsmnThe corresponding numerical value of the three channels of middle red, green and blue, ar、ag、abIs taken to satisfy ar+ag+ab=1, ar>0,ag>0, ab>0;
(4.2) for an arbitrary vertex SmnObtaining the vertex S based on the neighborhood access in the step (2)mnIf the 8 connected neighborhood point set is empty, gi = -1, and di = 0; if the 8 connected neighborhood point set is not empty, based on the vertex SmnCorresponding 8 connected neighborhood points NkDetermining the vertex SmnThe corresponding gray scale gradient gi and gradient direction di include:
Figure 200439DEST_PATH_IMAGE005
Figure 1036DEST_PATH_IMAGE006
Figure 225344DEST_PATH_IMAGE007
wherein the above is determined based on the values of RGBi acquired in step (4.1)
Figure 723059DEST_PATH_IMAGE008
Magnitude of (1), GxAnd GyIs a vertex SmnGray scale gradients in the x and y directions;
(4.3) discretizing the gradient direction di, dividing-pi to pi into 4 regions at ± i pi/8 (i =1,3,5, 7):
di =0 if di falls in the region [ - π/8, π/8 ]. sup. [ - π, -7 π/8 ]. sup. [7 π/8, π ];
if di falls in the region (π/8, 3 π/8) U (-7 π/8, -5 π/8), then di = π/4;
if di falls in the region [3 π/8, 5 π/8] < U [ -5 π/8, -3 π/8], then di = π/2;
if di falls in the region (5 π/8, 7 π/8) U (-3 π/8, - π/8), then di =3 π/4.
6. The 3D disordered point cloud edge detection method of claim 5, characterized in that: in the step (4), the gradient image is subjected to non-maximum suppression, and S is outputmnThe corresponding values Ti include: for any vertex SmnComparing the gray gradient gi with a preset low threshold thres _ low, and if the gray gradient gi is judged to be smaller than the low threshold thres _ low, then Ti = 0; if the gray gradient gi is greater than the low threshold thres _ low, the vertex S is determinedmnWhether the corresponding 8-connected neighborhood point set is empty or not is judged, if the 8-connected neighborhood point set is empty, Ti =0 is judged, and if the 8-connected neighborhood point set is not empty, S is further judgedmnWhether the gray gradient gi and the gradient direction di meet one of the following 4 conditions, if yes, then Ti = gi, otherwise Ti = 0;
Smndi =0, and SmnIs greater than the corresponding gray scale gradients of N0 and N4;
Smndi = π/4, and SmnIs greater than the corresponding gray scale gradients of N1 and N5;
Smndi = π/2, and SmnIs greater than the corresponding gray scale gradients of N2 and N6;
Smndi =3 pi/4, and SmnIs larger than the corresponding gray scale gradients of N3 and N7.
7. The 3D disordered point cloud edge detection method of claim 6, characterized in that: in the step (6), Canny operator is adopted to search the edge contour of the four-corner grid M, and the method comprises the following steps:
(6.1) comparing and judging the size of Ti with the high threshold thres _ high, if Ti is judged to be larger than the high threshold thres _ high and corresponding to the vertex SmnNot marked as an edge point, then S ismnMarking as an edge point and executing (6.2), wherein a high threshold thres _ high is a preset value;
(6.2) determination of SmnWhether the corresponding 8 connected neighborhood points are edge points or not: obtaining the corresponding vertex S of TimnJudging whether the 8 connected neighborhood point set is empty or not, if so, skipping Ti and continuing to execute (6.1); if the 8 connected neighborhood point set is not empty, every point N in the 8 connected neighborhood point set is subjected tokRespectively executing the step (6.3);
(6.3) if NkCorresponding Ti value equal to 0 or NkIf the marked edge point is marked, skipping the neighborhood point and continuing to execute (6.2); otherwise, the neighborhood point N is usedkMarking as an edge point, and obtaining NkUntil N, recursively (6.3)kThe 8 neighborhood access result is empty and continues to execute (6.2);
and (6.4) after the traversal in the step (6.1) is finished, outputting all points marked as edge points in the corresponding four-corner grid M vertex set, namely the edge contour to be obtained.
8. The utility model provides a 3D unordered point cloud edge detection device based on 5D texture mesh data structure which characterized in that:
a 5D texture grid data structure conversion module for converting 3D unordered point cloud data into a 5D texture grid data structure, wherein the 5D texture grid data structure comprises a plurality of half-side four-corner grids in topological connection, and each half-side four-corner grid comprises a four-corner surface patch and four vertexes S arranged on the four-corner surface patchmn,Sm,n+1.Sm+1,n,Sm+1,n+1And a plurality of halves, wherein, based on any point P in the point cloud dataiAnd PiObtain four corresponding vertexes, each of whichThe vertex stores a corresponding point P in the point cloud dataiThe 3D position coordinates (x, y, z), normal vectors, colors, and pointer information of the halves of which are the starting vertex, each half storing pointers or indices of the starting vertex, the ending vertex, the adjoining surface, the upper half, the lower half, the opposite half;
a neighborhood accessing module for S for any vertex in the 5D texture grid data structuremnWith said vertex SmnStarting the neighborhood visit of this time as an initial vertex to acquire all corresponding neighborhood points NSThe method comprises the following steps: judging whether the initial vertex is a boundary point, and returning to be empty if the initial vertex is the boundary point; if the initial vertex is not the boundary point, searching all neighborhood points in a grid data structure with an access radius r by taking the initial vertex as a center;
a Gaussian blur module for performing Gaussian blur on the 5D texture grid data structure and performing Gaussian blur on each vertex SmnIs assigned to said vertex SmnCorresponding to all neighborhood points NSWeighted average of the RGB values of (1), where NSTo adopt the SmnA neighborhood point with a center and a radius of r;
the gray gradient gi and gradient direction di acquisition module is used for acquiring the gray gradient gi and the gradient direction di of the 5D texture grid data structure after Gaussian blur; for any vertex SmnObtaining the vertex S based on a neighborhood access modulemnIf the 8 connected neighborhood point set is empty, gi = -1, and di = 0; if the 8 connected neighborhood point set is not empty, the vertex S is connectedmnThe corresponding 8 connected neighborhood points are respectively marked as Nk(k=0~7, Nk∈NS) Based on said vertex SmnCorresponding 8 connected neighborhood points NkDetermining the vertex SmnThe corresponding gray gradient gi and the gradient direction di, and discretizing the gradient direction di;
a non-maximum value suppression module for performing non-maximum value suppression on the gradient image and outputting SmnThe corresponding temporary variable value Ti;
and the edge contour output module is used for searching the edge contour of the four-corner grid M and outputting the edge contour.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented by the processor when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202010944149.0A 2020-09-10 2020-09-10 Edge detection method, device, medium and equipment based on grid data Active CN111932570B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010944149.0A CN111932570B (en) 2020-09-10 2020-09-10 Edge detection method, device, medium and equipment based on grid data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010944149.0A CN111932570B (en) 2020-09-10 2020-09-10 Edge detection method, device, medium and equipment based on grid data

Publications (2)

Publication Number Publication Date
CN111932570A true CN111932570A (en) 2020-11-13
CN111932570B CN111932570B (en) 2021-01-19

Family

ID=73308701

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010944149.0A Active CN111932570B (en) 2020-09-10 2020-09-10 Edge detection method, device, medium and equipment based on grid data

Country Status (1)

Country Link
CN (1) CN111932570B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113487633A (en) * 2021-08-17 2021-10-08 熵智科技(深圳)有限公司 Point cloud contour extraction method and device, computer equipment and storage medium
CN113627548A (en) * 2021-08-17 2021-11-09 熵智科技(深圳)有限公司 Planar workpiece template matching method, device, medium and computer equipment
CN113792653A (en) * 2021-09-13 2021-12-14 山东交通学院 Method, system, equipment and storage medium for cloud detection of remote sensing image
WO2022052893A1 (en) * 2020-09-10 2022-03-17 熵智科技(深圳)有限公司 5d texture grid data structure
CN117972944A (en) * 2024-04-01 2024-05-03 季华实验室 Stamping die initial auxiliary rib grid generation method and related equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150070354A1 (en) * 2013-09-10 2015-03-12 Fu Tai Hua Industry (Shenzhen) Co., Ltd. Computing device and method for reconstructing curved surface of point cloud data
CN107369161A (en) * 2017-07-19 2017-11-21 无锡信捷电气股份有限公司 A kind of workpiece point cloud segmentation method at random based on the European cluster of improvement
CN108830931A (en) * 2018-05-23 2018-11-16 上海电力学院 A kind of laser point cloud compressing method based on dynamic grid k neighborhood search
CN110458174A (en) * 2019-06-28 2019-11-15 南京航空航天大学 A kind of unordered accurate extracting method of cloud key feature points

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150070354A1 (en) * 2013-09-10 2015-03-12 Fu Tai Hua Industry (Shenzhen) Co., Ltd. Computing device and method for reconstructing curved surface of point cloud data
CN107369161A (en) * 2017-07-19 2017-11-21 无锡信捷电气股份有限公司 A kind of workpiece point cloud segmentation method at random based on the European cluster of improvement
CN108830931A (en) * 2018-05-23 2018-11-16 上海电力学院 A kind of laser point cloud compressing method based on dynamic grid k neighborhood search
CN110458174A (en) * 2019-06-28 2019-11-15 南京航空航天大学 A kind of unordered accurate extracting method of cloud key feature points

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022052893A1 (en) * 2020-09-10 2022-03-17 熵智科技(深圳)有限公司 5d texture grid data structure
CN113487633A (en) * 2021-08-17 2021-10-08 熵智科技(深圳)有限公司 Point cloud contour extraction method and device, computer equipment and storage medium
CN113627548A (en) * 2021-08-17 2021-11-09 熵智科技(深圳)有限公司 Planar workpiece template matching method, device, medium and computer equipment
CN113792653A (en) * 2021-09-13 2021-12-14 山东交通学院 Method, system, equipment and storage medium for cloud detection of remote sensing image
CN113792653B (en) * 2021-09-13 2023-10-20 山东交通学院 Method, system, equipment and storage medium for cloud detection of remote sensing image
CN117972944A (en) * 2024-04-01 2024-05-03 季华实验室 Stamping die initial auxiliary rib grid generation method and related equipment
CN117972944B (en) * 2024-04-01 2024-05-28 季华实验室 Stamping die initial auxiliary rib grid generation method and related equipment

Also Published As

Publication number Publication date
CN111932570B (en) 2021-01-19

Similar Documents

Publication Publication Date Title
CN111932570B (en) Edge detection method, device, medium and equipment based on grid data
Bailo et al. Efficient adaptive non-maximal suppression algorithms for homogeneous spatial keypoint distribution
Wu et al. Stereo matching with fusing adaptive support weights
CN108805261B (en) Convolutional neural network based on octree
CN110852349A (en) Image processing method, detection method, related equipment and storage medium
CN111079801A (en) Method, medium, terminal and device for quickly searching closest point based on point cloud matching
CN112002015B (en) Method, device, equipment and medium for generating grid data structure by using disordered point cloud
CN111553946A (en) Method and device for removing ground point cloud and obstacle detection method and device
CN114241388A (en) Video instance segmentation method and segmentation device based on space-time memory information
CN116934907A (en) Image generation method, device and storage medium
Ahmad et al. 3D capsule networks for object classification from 3D model data
CN113487633A (en) Point cloud contour extraction method and device, computer equipment and storage medium
CN116227209A (en) Multi-dimensional linear difference method for point cloud data, terminal equipment and storage medium
CN112825199A (en) Collision detection method, device, equipment and storage medium
CN111260596A (en) Anti-noise rapid image super-pixel automatic generation method, device and readable storage medium
CN114581331A (en) Point cloud noise reduction method and device suitable for multiple scenes
CN113935925A (en) Pneumatic optical effect space-variant blurred image restoration method and system
CN114373110A (en) Method and device for detecting target of input image and related products
CN111161348A (en) Monocular camera-based object pose estimation method, device and equipment
CN116468838B (en) Regional resource rendering method, system, computer and readable storage medium
CN117058554A (en) Power equipment target detection method, model training method and device
Mitchel et al. Echo: Extended convolution histogram of orientations for local surface description
CN111815691B (en) Neighborhood access method, device, equipment and medium for grid data structure
CN115205361A (en) Depth image completion method, device, equipment and storage medium
CN115690439A (en) Feature point aggregation method and device based on image plane and electronic equipment

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230926

Address after: Room 1726, Building 1, Rongsheng Business Center, No. 135 Wangdun Road, Suzhou Industrial Park, Suzhou City, Jiangsu Province, 215000

Patentee after: Suzhou Pavel Intelligent Technology Co.,Ltd.

Address before: 518034 703, 7th floor, Zhongdian Difu building, Zhenhua Road, Fuqiang community, Huaqiang North Street, Futian District, Shenzhen City, Guangdong Province

Patentee before: SHANGZHI TECHNOLOGY (SHENZHEN) Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240403

Address after: Office No. (7), 4th Floor, Unit B, Building 8, Phase II, Block 104, No. 9 Gaoxin Second Road, Donghu New Technology Development Zone, Wuhan City, Hubei Province, 430000, China

Patentee after: Wuhan Delisai Technology Co.,Ltd.

Country or region after: China

Address before: Room 1726, Building 1, Rongsheng Business Center, No. 135 Wangdun Road, Suzhou Industrial Park, Suzhou City, Jiangsu Province, 215000

Patentee before: Suzhou Pavel Intelligent Technology Co.,Ltd.

Country or region before: China

TR01 Transfer of patent right