Three-dimensional space point cloud zooming fusion method, electronic equipment and storage medium
By calculating the range value of the three-dimensional point cloud and scaling and fusion, the problem of object model integration in three-dimensional space is solved, and convenient model processing is achieved.
Patent Information
- Application Number
- CN202411409956.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-01-10
AI Technical Summary
When integrating two independent object models in three-dimensional space, the existing technology cannot directly integrate models in three-dimensional space, and developers are inconvenient to change models.
The scaling and fusion method of three-dimensional spatial point cloud is used to determine the scaling factor by calculating the range value of the point cloud, and the second and third-dimensional point clouds are scaled according to the scaling of the center coordinate point of the three-dimensional point cloud and the offset coordinate point of the first three-dimensional point cloud. Perform replication offsets to achieve point cloud fusion.
The first three-dimensional point cloud and the scaled three-dimensional point cloud are integrated at each relative position, which facilitates developers to process the integrated overall model and meet the actual standard proportional requirements.
Smart Images

Figure CN119295707A_ABST
Abstract
Description
Background Art
[0002] When modeling an object, it is necessary to first collect images of the surface shape of the object, and then model it based on the collected object images. If the models of two independent objects are to be integrated, it is necessary to first collect the overall image of the two objects after integration, and then model it. The models of the two objects cannot be integrated in three-dimensional space, which makes it inconvenient for developers to change the models. Summary of the invention
[0003] In view of the above technical problems, the technical solution adopted by the present invention is:
[0004] According to one aspect of the present application, a three-dimensional point cloud scaling and fusion method is provided, comprising the following steps:
[0005] Step S100, obtaining a range value of the first three-dimensional point cloud in three-dimensional space and a range value of the second three-dimensional point cloud in three-dimensional space according to the coordinates of each first three-dimensional coordinate point included in the first three-dimensional point cloud and the coordinates of each second three-dimensional coordinate point included in the second three-dimensional point cloud; the three-dimensional coordinate system corresponding to the first three-dimensional point cloud and the three-dimensional coordinate system corresponding to the second three-dimensional point cloud are the same three-dimensional coordinate system;
[0006] Step S200, determining a scaling factor corresponding to the second three-dimensional point cloud according to a range value of the first three-dimensional point cloud and a range value of the second three-dimensional point cloud;
[0007] Step S300: scaling each second three-dimensional coordinate point included in the second three-dimensional point cloud according to the scaling factor to obtain a scaled three-dimensional point cloud;
[0008] Step S400, determining an offset from the center coordinate point of the scaled three-dimensional point cloud to each offset coordinate point according to the center coordinate point of the scaled three-dimensional point cloud and a plurality of offset coordinate points of the first three-dimensional point cloud;
[0009] Step S500: copy and offset each scaled three-dimensional coordinate point included in the scaled three-dimensional point cloud according to the offset amount corresponding to each offset coordinate point, so as to obtain a plurality of offset three-dimensional point clouds.
[0010] In an exemplary embodiment of the present application, the range value of the first three-dimensional point cloud in the three-dimensional space is determined according to the following steps:
[0011] Step S111: Obtain the horizontal coordinate of each first three-dimensional coordinate point included in the first three-dimensional point cloud, and obtain a first horizontal coordinate list X1=(X 11 ,X 12 ,...,X 1i ,...,X 1n), wherein i=1, 2, ..., n, and n is the number of first three-dimensional coordinate points included in the first three-dimensional point cloud; X 1i is the horizontal coordinate of the i-th first three-dimensional coordinate point included in the first three-dimensional point cloud;
[0012] Step S112: Obtain the ordinate of each first three-dimensional coordinate point included in the first three-dimensional point cloud, and obtain a first ordinate list Y1=(Y 11 ,Y 12 ,...,Y 1i ,...,Y 1n ), where Y 1i is the ordinate of the i-th first three-dimensional coordinate point included in the first three-dimensional point cloud;
[0013] Step S113: Obtain the vertical coordinate of each first three-dimensional coordinate point included in the first three-dimensional point cloud, and obtain a first vertical coordinate list Z1=(Z 11 ,Z 12 ,...,Z 1i ,...,Z 1n ), where Z 1i is the vertical coordinate of the i-th first three-dimensional coordinate point included in the first three-dimensional point cloud;
[0014] Step S114, according to the first horizontal coordinate list X1, determine the length L1 of the first three-dimensional point cloud in the three-dimensional space = MAX(X1) - MIN(X1); wherein MAX() is a preset maximum value determination function; MIN() is a preset minimum value determination function;
[0015] Step S115, determining the width W1=MAX(Y1)-MIN(Y1) of the first three-dimensional point cloud in the three-dimensional space according to the first ordinate list Y1;
[0016] Step S116: Determine the height H1 = MAX(Z1) - MIN(Z1) of the first three-dimensional point cloud in the three-dimensional space according to the first vertical coordinate list Z1.
[0017] In an exemplary embodiment of the present application, the range value of the second three-dimensional point cloud in the three-dimensional space is determined according to the following steps:
[0018] Step S121, obtain the horizontal coordinate of each second three-dimensional coordinate point included in the second three-dimensional point cloud, and obtain a second horizontal coordinate list X2=(X 21 ,X 22 ,...,X 2j ,...,X 2k ), wherein j=1, 2, ..., k, k is the number of second three-dimensional coordinate points included in the second three-dimensional point cloud, X 2jis the abscissa of the j-th second three-dimensional coordinate point included in the second three-dimensional point cloud;
[0019] Step S122: Obtain the ordinate of each second three-dimensional coordinate point included in the second three-dimensional point cloud, and obtain a second ordinate list Y2=(Y 21 ,Y 22 ,...,Y 2j ,...,Y 2k ), where Y 2j is the ordinate of the jth second three-dimensional coordinate point included in the second three-dimensional point cloud;
[0020] Step S123, obtaining the vertical coordinate of each second three-dimensional coordinate point included in the second three-dimensional point cloud, and obtaining a second vertical coordinate list Z2=(Z 21 ,Z 22 ,...,Z 2j ,...,Z 2k ), where Z 2j is the vertical coordinate of the j-th second three-dimensional coordinate point included in the second three-dimensional point cloud;
[0021] Step S124, determining the length L2=MAX(X2)-MIN(X2) of the second three-dimensional point cloud in the three-dimensional space according to the second horizontal coordinate list X2;
[0022] Step S125, determining the width W2=MAX(Y2)-MIN(Y2) of the second three-dimensional point cloud in the three-dimensional space according to the second vertical coordinate list Y2;
[0023] Step S126 : Determine, according to the second vertical coordinate list Z2 , the height H2 = MAX( Z2 ) - MIN( Z2 ) of the second three-dimensional point cloud in the three-dimensional space.
[0024] In an exemplary embodiment of the present application, step S200 includes:
[0025] Step S210, determining the length scaling ratio L3 corresponding to the second three-dimensional point cloud according to L1 and L2 = (L1×s) / L2; wherein s is a preset scaling ratio, 0<s<1;
[0026] Step S220, determining a width scaling ratio W3=(W1×s) / W2 corresponding to the second three-dimensional point cloud according to W1 and W2;
[0027] Step S230, determining the height scaling ratio H3=(H1×s) / H2 corresponding to the second three-dimensional point cloud according to H1 and H2;
[0028] Step S240: Determine MIN(L3, W3, H3) as the scaling factor corresponding to the second three-dimensional point cloud.
[0029] In an exemplary embodiment of the present application, step S300 includes:
[0030] Step S310: Determine the center coordinate point F1 of the second three-dimensional point cloud = (F 11 ,F 12 ,F 13 ), where F 11 =(MAX(X2)+MIN(X2)) / 2; F 11 is the horizontal coordinate corresponding to F1; F 12 =(MAX(Y2)+MIN(Y2)) / 2; F 12 is the ordinate corresponding to F1; F 13 =(MAX(Z2)+MIN(Z2)) / 2; F 13 is the vertical coordinate corresponding to F1;
[0031] Step S320: scaling the j-th second three-dimensional coordinate point included in the second three-dimensional point cloud to obtain a scaled three-dimensional coordinate point G after scaling the j-th second three-dimensional coordinate point. j =(G j1 ,G j2 ,G j3 ), where G j1 G j The corresponding horizontal coordinate is G j2 G j The corresponding vertical coordinate; G j3 G j The corresponding vertical coordinate;
[0032] G j1 The following conditions are met:
[0033] |F 11 -G j1 |=|F 11 -X 2j |×M; M is the scaling factor corresponding to the second three-dimensional point cloud;
[0034] G j2 The following conditions are met:
[0035] |F 12 -G j2 |=|F 12 -Y 2j |×M;
[0036] G j3 The following conditions are met:
[0037] |F 13 -G j3 |=|F 13 -Z 2j |×M.
[0038] In an exemplary embodiment of the present application, step S400 includes:
[0039] Step S410: Determine the center coordinate point F2 of the scaled 3D point cloud. 21 ,F 22 ,F 23 );
[0040] Among them, F 21 =(MAX(G 11 ,G 21 ,...,G j1 ,...,G k1 )+MIN(G 11 ,G 21 ,...,G j1 ,...,G k1 )) / 2; F 21 is the horizontal coordinate corresponding to F2;
[0041] F 22 =(MAX(G 12 ,G 22 ,...,G j2 ,...,G k2 )+MIN(G 12 ,G 22 ,...,G j2 ,...,G k2 )) / 2; F 22 is the ordinate corresponding to F2;
[0042] F 23 =(MAX(G 13 ,G 23 ,...,G j3 ,...,G k3 )+MIN(G 13 ,G 23 ,...,G j3 ,...,G k3 )) / 2; F 23 is the vertical coordinate corresponding to F2;
[0043] Step S420: 11 ,E 12 ,E 13 )、(E 11 ,E 22 ,E 13 )、(E 11 ,E 12 ,E 23 )、(E 11 ,E 22 ,E23 )、(E 21 ,E 12 ,E 13 )、(E 21 ,E 22 ,E 13 )、(E 21 ,E 12 ,E 23 )、(E 21 ,E 22 ,E 23 ) as vertices, establishing a minimum range area corresponding to the first three-dimensional point cloud; the shape of the minimum range area is a cube;
[0044] Among them, E 11 =MAX(X1);E 12 =MAX(Y1);E 13 =MAX(Z1);E 21 =MIN(X1);E 22 =MIN(Y1);E 23 =MIN(Z1);
[0045] Step S430: On each side of the minimum range area, at every preset interval, the corresponding three-dimensional coordinate point is determined as an offset coordinate point to obtain an offset coordinate point list A=(A1, A2, ..., A m ,...,A p ), where m = 1, 2, ..., p, p is the number of offset coordinate points; A m is the three-dimensional coordinate of the mth offset coordinate point; A m =(A m1 ,A m2 ,A m3 );A m1 A m The corresponding horizontal axis is A m2 A m The corresponding vertical coordinate: A m3 A m The corresponding vertical coordinate;
[0046] Step S440: scaling the central coordinate point F2 of the three-dimensional point cloud and the mth offset coordinate point A m , determine F2 to A m The offset B corresponding to the horizontal axis m1 , F2 to A m The vertical axis corresponds to the offset B m2 and F2 to A m The vertical axis corresponding to the offset B m3 Among them, B m1 =A m1 -F21 ; B m2 =A m2 -F 22 ; B m3 =A m3 -F 23 .
[0047] In an exemplary embodiment of the present application, step S500 includes:
[0048] Step S510: According to B m1 , B m2 and B m3 , copy and offset each scaled 3D coordinate point included in the scaled 3D point cloud to obtain a 3D coordinate point list C corresponding to the offset 3D point cloud corresponding to the mth offset coordinate point = (C m1 ,C m2 ,...,C mj ,...,C mk ), where C mj is the three-dimensional coordinate of the j-th point cloud coordinate point in the offset three-dimensional point cloud corresponding to the m-th offset coordinate point; C mj =(C mj1 ,C mj2 ,C mj3 );C mj1 C mj The corresponding horizontal axis; C mj1 =G j1 +B m1 ; C mj2 C mj The corresponding vertical coordinate; C mj2 =G j2 +B m2 ; C mj3 C mj The corresponding vertical coordinate; C mj3 =G j3 +B m3 .
[0049] In an exemplary embodiment of the present application, the attributes of the 3D points in the scaled 3D point cloud meet the following conditions:
[0050] I1=I2+log(M); wherein I2 is the radius of any three-dimensional point in the scaled three-dimensional point cloud before scaling; I1 is the radius of the three-dimensional point corresponding to I2 after scaling; and log() is a preset logarithmic function.
[0051] According to one aspect of the present application, a non-transitory computer-readable storage medium is provided, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the aforementioned three-dimensional point cloud scaling and fusion method.
[0052] According to one aspect of the present application, an electronic device is provided, including a processor and the aforementioned non-transitory computer-readable storage medium.
[0053] The present invention has at least the following beneficial effects:
[0054] The three-dimensional space point cloud scaling fusion method of the present invention determines the scaling factor corresponding to the second three-dimensional point cloud by calculating the range value of the first three-dimensional point cloud and the second three-dimensional point cloud, and then scales the second three-dimensional point cloud according to the scaling factor to obtain the scaled three-dimensional point cloud, and determines the offset from the center coordinate point of the scaled three-dimensional point cloud to each offset coordinate point according to the center coordinate point of the scaled three-dimensional point cloud and several offset coordinate points of the first three-dimensional point cloud, and copies and offsets the scaled three-dimensional point cloud to obtain several offset three-dimensional point clouds. By scaling the second three-dimensional point cloud so that the corresponding ratio of the scaled three-dimensional point cloud and the first three-dimensional point cloud meets the requirements of the actual standard ratio, the scaled three-dimensional point cloud is copied and offset to each offset coordinate point of the first three-dimensional point cloud to achieve the fusion of the first three-dimensional point cloud and the scaled three-dimensional point cloud at each relative position, so that developers can easily process the first three-dimensional point cloud and the scaled three-dimensional point cloud after fusion. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0056] Figure 1 A flowchart of a three-dimensional point cloud scaling and fusion method provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0058] like Figure 1 As shown, the three-dimensional point cloud scaling and fusion method described in this application includes the following steps:
[0059] Step S100, obtaining a range value of the first three-dimensional point cloud in three-dimensional space and a range value of the second three-dimensional point cloud in three-dimensional space according to the coordinates of each first three-dimensional coordinate point included in the first three-dimensional point cloud and the coordinates of each second three-dimensional coordinate point included in the second three-dimensional point cloud;
[0060] The first three-dimensional point cloud and the second three-dimensional point cloud are two point clouds that need to be fused respectively, wherein the three-dimensional coordinate system corresponding to the first three-dimensional point cloud and the three-dimensional coordinate system corresponding to the second three-dimensional point cloud are the same three-dimensional coordinate system, the range value of the first three-dimensional point cloud in the three-dimensional space is the length, width, height and other values of the first three-dimensional point cloud in the three-dimensional space, and the range value of the second three-dimensional point cloud in the three-dimensional space is the length, width, height and other values of the second three-dimensional point cloud in the three-dimensional space.
[0061] The range value of the first three-dimensional point cloud in the three-dimensional space is determined according to steps S111 to S116:
[0062] Step S111: Obtain the horizontal coordinate of each first three-dimensional coordinate point included in the first three-dimensional point cloud, and obtain a first horizontal coordinate list X1=(X 11 ,X 12 ,...,X 1i ,...,X 1n ), wherein i=1, 2, ..., n, and n is the number of first three-dimensional coordinate points included in the first three-dimensional point cloud; X 1i is the horizontal coordinate of the i-th first three-dimensional coordinate point included in the first three-dimensional point cloud;
[0063] Step S112: Obtain the ordinate of each first three-dimensional coordinate point included in the first three-dimensional point cloud, and obtain a first ordinate list Y1=(Y 11 ,Y 12 ,...,Y 1i ,...,Y 1n ), where Y 1i is the ordinate of the i-th first three-dimensional coordinate point included in the first three-dimensional point cloud;
[0064] Step S113: Obtain the vertical coordinate of each first three-dimensional coordinate point included in the first three-dimensional point cloud, and obtain a first vertical coordinate list Z1=(Z 11 ,Z 12 ,...,Z 1i ,...,Z 1n ), where Z 1i is the vertical coordinate of the i-th first three-dimensional coordinate point included in the first three-dimensional point cloud;
[0065] Step S114, according to the first horizontal coordinate list X1, determine the length L1 of the first three-dimensional point cloud in the three-dimensional space = MAX(X1) - MIN(X1); wherein MAX() is a preset maximum value determination function; MIN() is a preset minimum value determination function;
[0066] Step S115, determining the width W1=MAX(Y1)-MIN(Y1) of the first three-dimensional point cloud in the three-dimensional space according to the first ordinate list Y1;
[0067] Step S116: Determine the height H1 = MAX(Z1) - MIN(Z1) of the first three-dimensional point cloud in the three-dimensional space according to the first vertical coordinate list Z1.
[0068] The range value of the second three-dimensional point cloud in the three-dimensional space is determined according to steps S121 to S126:
[0069] Step S121, obtain the horizontal coordinate of each second three-dimensional coordinate point included in the second three-dimensional point cloud, and obtain a second horizontal coordinate list X2=(X 21 ,X 22 ,...,X 2j ,...,X 2k ), wherein j=1, 2, ..., k, k is the number of second three-dimensional coordinate points included in the second three-dimensional point cloud, X 2j is the abscissa of the j-th second three-dimensional coordinate point included in the second three-dimensional point cloud;
[0070] Step S122: Obtain the ordinate of each second three-dimensional coordinate point included in the second three-dimensional point cloud, and obtain a second ordinate list Y2=(Y 21 ,Y 22 ,...,Y 2j ,...,Y 2k ), where Y 2j is the ordinate of the jth second three-dimensional coordinate point included in the second three-dimensional point cloud;
[0071] Step S123, obtaining the vertical coordinate of each second three-dimensional coordinate point included in the second three-dimensional point cloud, and obtaining a second vertical coordinate list Z2=(Z 21 ,Z 22 ,...,Z 2j ,...,Z 2k ), where Z 2j is the vertical coordinate of the j-th second three-dimensional coordinate point included in the second three-dimensional point cloud;
[0072] Step S124, determining the length L2=MAX(X2)-MIN(X2) of the second three-dimensional point cloud in the three-dimensional space according to the second horizontal coordinate list X2;
[0073] Step S125, determining the width W2=MAX(Y2)-MIN(Y2) of the second three-dimensional point cloud in the three-dimensional space according to the second vertical coordinate list Y2;
[0074] Step S126 : Determine, according to the second vertical coordinate list Z2 , the height H2 = MAX( Z2 ) - MIN( Z2 ) of the second three-dimensional point cloud in the three-dimensional space.
[0075] Step S200, determining a scaling factor corresponding to the second three-dimensional point cloud according to a range value of the first three-dimensional point cloud and a range value of the second three-dimensional point cloud;
[0076] In this application, the second three-dimensional point cloud is used as the point cloud that needs to be scaled. For example, the first three-dimensional point cloud is an object and the second three-dimensional point cloud is a product logo corresponding to the object. The second three-dimensional point cloud needs to be fused with the first three-dimensional point cloud so that the product logo (logo) can be displayed on the object. However, since the two three-dimensional point clouds are independent of each other before fusion, the ratio between the two may not meet the actual standards. For example, if the length of the second three-dimensional point cloud is the same as that of the first three-dimensional point cloud, the second three-dimensional point cloud needs to be scaled so that the ratio of the length of the second three-dimensional point cloud to the length of the first three-dimensional point cloud meets the preset ratio standard.
[0077] Further, step S200 includes steps S210 to S240:
[0078] Step S210, determining the length scaling ratio L3 corresponding to the second three-dimensional point cloud according to L1 and L2 = (L1×s) / L2; wherein s is a preset scaling ratio, 0<s<1;
[0079] Step S220, determining a width scaling ratio W3=(W1×s) / W2 corresponding to the second three-dimensional point cloud according to W1 and W2;
[0080] Step S230, determining the height scaling ratio H3=(H1×s) / H2 corresponding to the second three-dimensional point cloud according to H1 and H2;
[0081] Step S240: Determine MIN(L3, W3, H3) as the scaling factor corresponding to the second three-dimensional point cloud.
[0082] Step S300: scaling each second three-dimensional coordinate point included in the second three-dimensional point cloud according to the scaling factor to obtain a scaled three-dimensional point cloud;
[0083] Further, step S300 includes step S310-step S320:
[0084] Step S310: Determine the center coordinate point F1 of the second three-dimensional point cloud = (F 11 ,F 12,F 13 );
[0085] Among them, F 11 =(MAX(X2)+MIN(X2)) / 2; F 11 is the horizontal coordinate corresponding to F1; F 12 =(MAX(Y2)+MIN(Y2)) / 2; F 12 is the ordinate corresponding to F1; F 13 =(MAX(Z2)+MIN(Z2)) / 2; F 13 is the vertical coordinate corresponding to F1;
[0086] Step S320: scaling the j-th second three-dimensional coordinate point included in the second three-dimensional point cloud to obtain a scaled three-dimensional coordinate point G after scaling the j-th second three-dimensional coordinate point. j =(G j1 ,G j2 ,G j3 ), where G j1 G j The corresponding horizontal coordinate is G j2 G j The corresponding vertical coordinate; G j3 G j The corresponding vertical coordinate;
[0087] G j1 The following conditions are met:
[0088] |F 11 -G j1 |=|F 11 -X 2j |×M; M is the scaling factor corresponding to the second three-dimensional point cloud;
[0089] G j2 The following conditions are met:
[0090] |F 12 -G j2 |=|F 12 -Y 2j |×M;
[0091] G j3 The following conditions are met:
[0092] |F 13 -G j3 |=|F 13 -Z 2j |×M.
[0093] Among them, the attributes of the three-dimensional points in the scaled three-dimensional point cloud meet the condition: I1=I2+log(M);
[0094] I2 is the radius of any 3D point in the scaled 3D point cloud before scaling; I1 is the radius of the 3D point corresponding to I2 after scaling; log() is a preset logarithmic function.
[0095] Step S400, determining an offset from the center coordinate point of the scaled three-dimensional point cloud to each offset coordinate point according to the center coordinate point of the scaled three-dimensional point cloud and a plurality of offset coordinate points of the first three-dimensional point cloud;
[0096] The offset coordinate point of the first 3D point cloud is the point where the central coordinate point of the scaled 3D point cloud is moved. After obtaining the scaled 3D point cloud, the first 3D point cloud and the scaled 3D point cloud need to be fused, that is, the scaled 3D point cloud is moved to the surface of the first 3D point cloud. The target point of the movement is the offset coordinate point. In order to enable developers to obtain models of the scaled 3D point cloud at different positions on any surface of the first 3D point cloud, it is necessary to determine several offset coordinate points on the surface of the first 3D point cloud for the scaled 3D point cloud to copy and move.
[0097] Further, step S400 includes step S410-step S440:
[0098] Step S410: Determine the center coordinate point F2 of the scaled 3D point cloud. 21 ,F 22 ,F 23 );
[0099] Among them, F 21 =(MAX(G 11 ,G 21 ,...,G j1 ,...,G k1 )+MIN(G 11 ,G 21 ,...,G j1 ,...,G k1 )) / 2; F 21 is the horizontal coordinate corresponding to F2;
[0100] F 22 =(MAX(G 12 ,G 22 ,...,G j2 ,...,G k2 )+MIN(G 12 ,G 22 ,...,G j2 ,...,G k2 )) / 2; F 22 is the ordinate corresponding to F2;
[0101] F 23 =(MAX(G 13 ,G23 ,...,G j3 ,...,G k3 )+MIN(G 13 ,G 23 ,...,G j3 ,...,G k3 )) / 2; F 23 is the vertical coordinate corresponding to F2;
[0102] Step S420: 11 ,E 12 ,E 13 )、(E 11 ,E 22 ,E 13 )、(E 11 ,E 12 ,E 23 )、(E 11 ,E 22 ,E 23 )、(E 21 ,E 12 ,E 13 )、(E 21 ,E 22 ,E 13 )、(E 21 ,E 12 ,E 23 )、(E 21 ,E 22 ,E 23 ) as vertices, establishing a minimum range area corresponding to the first three-dimensional point cloud; the shape of the minimum range area is a cube;
[0103] Among them, E 11 =MAX(X1);E 12 =MAX(Y1);E 13 =MAX(Z1);E 21 =MIN(X1);E 22 =MIN(Y1);E 23 =MIN(Z1);
[0104] The minimum range area corresponding to the first three-dimensional point cloud is the minimum bounding box of the first three-dimensional point cloud determined by the length, width and height of the first three-dimensional point cloud.
[0105] Step S430: On each side of the minimum range area, at every preset interval, the corresponding three-dimensional coordinate point is determined as an offset coordinate point to obtain an offset coordinate point list A=(A1, A2, ..., A m ,...,A p ), where m = 1, 2, ..., p, p is the number of offset coordinate points; Am is the three-dimensional coordinate of the mth offset coordinate point; A m =(A m1 ,A m2 ,A m3 );A m1 A m The corresponding horizontal axis is A m2 A m The corresponding vertical coordinate: A m3 A m The corresponding vertical coordinate;
[0106] Step S440: scaling the central coordinate point F2 of the three-dimensional point cloud and the mth offset coordinate point A m , determine F2 to A m The offset B corresponding to the horizontal axis m1 , F2 to A m The vertical axis corresponds to the offset B m2 and F2 to A m The vertical axis corresponding to the offset B m3 Among them, B m1 =A m1 -F 21 ; B m2 =A m2 -F 22 ; B m3 =A m3 -F 23 .
[0107] Step S500: copy and offset each scaled three-dimensional coordinate point included in the scaled three-dimensional point cloud according to the offset amount corresponding to each offset coordinate point, so as to obtain a plurality of offset three-dimensional point clouds.
[0108] Offsetting a 3D point cloud is to scale the 3D point cloud and copy and offset it to each offset coordinate point.
[0109] Further, step S500 includes step S510:
[0110] Step S510: According to B m1 , B m2 and B m3 , copy and offset each scaled 3D coordinate point included in the scaled 3D point cloud to obtain a 3D coordinate point list C corresponding to the offset 3D point cloud corresponding to the mth offset coordinate point = (C m1 ,C m2 ,...,C mj ,...,C mk ), where C mj is the three-dimensional coordinate of the j-th point cloud coordinate point in the offset three-dimensional point cloud corresponding to the m-th offset coordinate point; Cmj =(C mj1 ,C mj2 ,C mj3 );C mj1 C mj The corresponding horizontal axis; C mj1 =G j1 +B m1 ; C mj2 C mj The corresponding vertical coordinate; C mj2 =G j2 +B m2 ; C mj3 C mj The corresponding vertical coordinate; C mj3 =G j3 +B m3 .
[0111] The three-dimensional space point cloud scaling fusion method of the present invention determines the scaling factor corresponding to the second three-dimensional point cloud by calculating the range value of the first three-dimensional point cloud and the second three-dimensional point cloud, and then scales the second three-dimensional point cloud according to the scaling factor to obtain the scaled three-dimensional point cloud, and determines the offset from the center coordinate point of the scaled three-dimensional point cloud to each offset coordinate point according to the center coordinate point of the scaled three-dimensional point cloud and several offset coordinate points of the first three-dimensional point cloud, and copies and offsets the scaled three-dimensional point cloud to obtain several offset three-dimensional point clouds. By scaling the second three-dimensional point cloud so that the corresponding ratio of the scaled three-dimensional point cloud and the first three-dimensional point cloud meets the requirements of the actual standard ratio, the scaled three-dimensional point cloud is copied and offset to each offset coordinate point of the first three-dimensional point cloud to achieve the fusion of the first three-dimensional point cloud and the scaled three-dimensional point cloud at each relative position, so that developers can easily process the first three-dimensional point cloud and the scaled three-dimensional point cloud after fusion.
[0112] An embodiment of the present invention further provides a computer program product, which includes program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the method according to various exemplary embodiments of the present invention described above in this specification.
[0113] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0114] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0115] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0116] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0117] The electronic device according to this embodiment of the present invention is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0118] The electronic device is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: the at least one processor mentioned above, the at least one storage device mentioned above, and a bus connecting different system components (including storage devices and processors).
[0119] The storage stores program codes, which can be executed by the processor, so that the processor executes the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification.
[0120] The memory may include readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and may further include read only memory (ROM).
[0121] The storage may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.
[0122] The bus may represent one or more of several types of bus structures including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.
[0123] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), one or more devices that enable a user to interact with the electronic device, and / or any device that enables the electronic device to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter.
[0124] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0125] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0126] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0127] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0128] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0129] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0130] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0131] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0132] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A three-dimensional point cloud scaling and fusion method, characterized in that: The method comprises the following steps: Step S100, obtaining a range value of the first three-dimensional point cloud in three-dimensional space and a range value of the second three-dimensional point cloud in three-dimensional space according to the coordinates of each first three-dimensional coordinate point included in the first three-dimensional point cloud and the coordinates of each second three-dimensional coordinate point included in the second three-dimensional point cloud; the three-dimensional coordinate system corresponding to the first three-dimensional point cloud and the three-dimensional coordinate system corresponding to the second three-dimensional point cloud are the same three-dimensional coordinate system; Step S200: determining a scaling factor corresponding to the second three-dimensional point cloud according to a range value of the first three-dimensional point cloud and a range value of the second three-dimensional point cloud; Step S300: scaling each second three-dimensional coordinate point included in the second three-dimensional point cloud according to the scaling factor to obtain a scaled three-dimensional point cloud; Step S400, determining an offset from the central coordinate point of the scaled 3D point cloud to each of the offset coordinate points according to the central coordinate point of the scaled 3D point cloud and a plurality of offset coordinate points of the first 3D point cloud; Step S500: copy and offset each scaled three-dimensional coordinate point included in the scaled three-dimensional point cloud according to the offset amount corresponding to each offset coordinate point, so as to obtain a plurality of offset three-dimensional point clouds.
2. The method according to claim 1, characterized in that The range value of the first three-dimensional point cloud in the three-dimensional space is determined according to the following steps: Step S111: Obtain the horizontal coordinate of each first three-dimensional coordinate point included in the first three-dimensional point cloud, and obtain a first horizontal coordinate list X1=(X 11 ,X 12 ,...,X 1i ,...,X 1n ), wherein i=1, 2, ..., n, and n is the number of first three-dimensional coordinate points included in the first three-dimensional point cloud; X 1i is the horizontal coordinate of the i-th first three-dimensional coordinate point included in the first three-dimensional point cloud; Step S112: Obtain the ordinate of each first three-dimensional coordinate point included in the first three-dimensional point cloud, and obtain a first ordinate list Y1=(Y 11 ,Y 12 ,...,Y 1i ,...,Y 1n ), where Y 1i is the ordinate of the i-th first three-dimensional coordinate point included in the first three-dimensional point cloud; Step S113: Obtain the vertical coordinate of each first three-dimensional coordinate point included in the first three-dimensional point cloud, and obtain a first vertical coordinate list Z1=(Z 11 ,Z 12 ,...,Z 1i ,...,Z 1n ), where Z 1i is the vertical coordinate of the i-th first three-dimensional coordinate point included in the first three-dimensional point cloud; Step S114: according to the first horizontal coordinate list X1, determine the length L1 of the first three-dimensional point cloud in the three-dimensional space = MAX(X1) - MIN(X1); wherein MAX() is a preset maximum value determination function; and MIN() is a preset minimum value determination function; Step S115, determining the width W1=MAX(Y1)-MIN(Y1) of the first three-dimensional point cloud in the three-dimensional space according to the first vertical coordinate list Y1; Step S116: Determine, according to the first vertical coordinate list Z1, a height H1=MAX(Z1)-MIN(Z1) of the first three-dimensional point cloud in the three-dimensional space.
3. The method according to claim 2, characterized in that The range value of the second three-dimensional point cloud in the three-dimensional space is determined according to the following steps: Step S121: Obtain the horizontal coordinate of each second three-dimensional coordinate point included in the second three-dimensional point cloud, and obtain a second horizontal coordinate list X2=(X 21 ,X 22 ,...,X 2j ,...,X 2k ), wherein j=1, 2, ..., k, k is the number of second three-dimensional coordinate points included in the second three-dimensional point cloud, X 2j is the horizontal coordinate of the jth second three-dimensional coordinate point included in the second three-dimensional point cloud; Step S122: Obtain the ordinate of each second three-dimensional coordinate point included in the second three-dimensional point cloud, and obtain a second ordinate list Y2=(Y 21 ,Y 22 ,...,Y 2j ,...,Y 2k ), where Y 2j is the ordinate of the jth second three-dimensional coordinate point included in the second three-dimensional point cloud; Step S123: Obtain the vertical coordinate of each second three-dimensional coordinate point included in the second three-dimensional point cloud, and obtain a second vertical coordinate list Z2=(Z 21 ,Z 22 ,...,Z 2j ,...,Z 2k ), where Z 2j is the vertical coordinate of the j-th second three-dimensional coordinate point included in the second three-dimensional point cloud; Step S124, determining the length L2=MAX(X2)-MIN(X2) of the second three-dimensional point cloud in the three-dimensional space according to the second horizontal coordinate list X2; Step S125, determining the width W2=MAX(Y2)-MIN(Y2) of the second three-dimensional point cloud in the three-dimensional space according to the second vertical coordinate list Y2; Step S126: Determine, according to the second vertical coordinate list Z2, a height H2=MAX(Z2)-MIN(Z2) of the second three-dimensional point cloud in the three-dimensional space.
4. The method according to claim 3, characterized in that The step S200 includes: Step S210: Determine, according to L1 and L2, a length scaling ratio L3 corresponding to the second three-dimensional point cloud = (L1×s) / L2; wherein s is a preset scaling ratio, 0<s<1; Step S220, determining a width scaling ratio W3=(W1×s) / W2 corresponding to the second three-dimensional point cloud according to W1 and W2; Step S230, determining a height scaling ratio H3=(H1×s) / H2 corresponding to the second three-dimensional point cloud according to H1 and H2; Step S240: Determine MIN(L3, W3, H3) as the scaling factor corresponding to the second three-dimensional point cloud.
5. The method according to claim 4, characterized in that The step S300 includes: Step S310: Determine the center coordinate point F1 of the second three-dimensional point cloud = (F 11 ,F 12 ,F 13 ), where F 11 =(MAX(X2)+MIN(X2)) / 2; F 11 is the horizontal coordinate corresponding to F1; F 12 =(MAX(Y2)+MIN(Y2)) / 2; F 12 is the ordinate corresponding to F1; F 13 =(MAX(Z2)+MIN(Z2)) / 2; F 13 is the vertical coordinate corresponding to F1; Step S320: scaling the j-th second three-dimensional coordinate point included in the second three-dimensional point cloud to obtain a scaled three-dimensional coordinate point G after scaling the j-th second three-dimensional coordinate point. j =(G j1 ,G j2 ,G j3 ), where G j1 G j The corresponding horizontal coordinate is G j2 G j The corresponding vertical coordinate; G j3 G j The corresponding vertical coordinate; G j1 The following conditions are met: |F 11 -G j1 |=|F 11 -X 2j |×M; M is the scaling factor corresponding to the second three-dimensional point cloud; G j2 The following conditions are met: |F 12 -G j2 |=|F 12 -Y 2j |×M; G j3 The following conditions are met: |F 13 -G j3 |=|F 13 -Z 2j |×M。 6. The method according to claim 5, characterized in that The step S400 includes: Step S410: Determine the center coordinate point F2 of the scaled 3D point cloud = (F 21 ,F 22 ,F 23 ); Among them, F 21 =(MAX(G 11 ,G 21 ,...,G j1 ,...,G k1 )+MIN(G 11 ,G 21 ,...,G j1 ,...,G k1 )) / 2; F 21 is the horizontal coordinate corresponding to F2; F 22 =(MAX(G 12 ,G 22 ,...,G j2 ,...,G k2 )+MIN(G 12 ,G 22 ,...,G j2 ,...,G k2 )) / 2; F 22 is the ordinate corresponding to F2; F 23 =(MAX(G 13 ,G 23 ,...,G j3 ,...,G k3 )+MIN(G 13 ,G 23 ,...,G j3 ,...,G k3 )) / 2; F 23 is the vertical coordinate corresponding to F2; Step S420: 11 ,E 12 ,E 13 )、(E 11 ,E 22 ,E 13 )、(E 11 ,E 12 ,E 23 )、(E 11 ,E 22 ,E 23 )、(E 21 ,E 12 ,E 13 )、(E 21 ,E 22 ,E 13 )、(E 21 ,E 12 ,E 23 )、(E 21 ,E 22 ,E 23 ) as vertices, establishing a minimum range area corresponding to the first three-dimensional point cloud; the shape of the minimum range area is a cube; Among them, E 11 =MAX(X1);E 12 =MAX(Y1);E 13 =MAX(Z1);E 21 =MIN(X1);E 22 =MIN(Y1);E 23 =MIN(Z1); Step S430: On each side of the minimum range area, at every preset interval, the corresponding three-dimensional coordinate point is determined as an offset coordinate point to obtain an offset coordinate point list A=(A1, A2, ..., A m ,...,A p ), wherein m=1, 2, ..., p, and p is the number of the offset coordinate points; A m A is the three-dimensional coordinate of the mth offset coordinate point; m =(A m1 ,A m2 ,A m3 );A m1 A m The corresponding horizontal axis is A m2 A m The corresponding vertical coordinate: A m3 A m The corresponding vertical coordinate; Step S440: according to the center coordinate point F2 of the scaled three-dimensional point cloud and the mth offset coordinate point A m , determine F2 to A m The horizontal axis corresponds to the offset B m1 , F2 to A m The vertical axis corresponds to the offset B m2 and F2 to A m The vertical axis corresponding to the offset B m3 Among them, B m1 =A m1 -F 21 ; B m2 =A m2 -F 22 ; B m3 =A m3 -F 23 .
7. The method according to claim 6, characterized in that The step S500 includes: Step S510: According to B m1 , B m2 and B m3 , copy and offset each scaled 3D coordinate point included in the scaled 3D point cloud to obtain a 3D coordinate point list C corresponding to the offset 3D point cloud corresponding to the mth offset coordinate point = (C m1 ,C m2 ,...,C mj ,...,C mk ), where C mj is the three-dimensional coordinate of the j-th point cloud coordinate point in the offset three-dimensional point cloud corresponding to the m-th offset coordinate point; C mj =(C mj1 ,C mj2 ,C mj3 );C mj1 C mj The corresponding horizontal axis; C mj1 =G j1 +B m1 ; C mj2 C mj The corresponding vertical coordinate; C mj2 =G j2 +B m2 ; C mj3 C mj The corresponding vertical coordinate; C mj3 =G j3 +B m3 .
8. The method according to claim 7, characterized in that The attributes of the 3D points in the scaled 3D point cloud meet the following conditions: I1=I2+log(M); Among them, I2 is the radius of any three-dimensional point in the scaled three-dimensional point cloud before scaling; I1 is the radius of the three-dimensional point corresponding to I2 after scaling; log() is a preset logarithmic function.
9. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the storage medium, characterized in that: The at least one instruction or the at least one program is loaded and executed by the processor to implement the three-dimensional point cloud scaling and fusion method as described in any one of claims 1-8.
10. An electronic device, characterized in that: The invention comprises a processor and the non-transitory computer-readable storage medium as claimed in claim 9.