Three-dimensional reconstruction method, system, electronic device and storage medium
By deploying multiple scanning modules with different distances in the scanning system, the module with the longest distance is used first to obtain point cloud data, and the target scanning module is determined based on the characteristic parameters, and the three-dimensional points are combined with weights to solve the problem of accurate three-dimensional reconstruction data. It solves the problems of low accuracy and efficiency and achieves higher 3D reconstruction accuracy and efficiency.
Patent Information
- Application Number
- CN202410901847.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-07-05
AI Technical Summary
When scanning objects across scales in large-scale scenes, existing technology cannot guarantee the accuracy and scanning efficiency of 3D reconstruction data. It is prone to excessive traces and broken grid connections, resulting in low accuracy of 3D reconstruction data and difficulty with fixed equipment. Scanning large targets is time inefficient.
Use multiple scanning modules with different distances to obtain the first point cloud data by acquiring the scanning module with the farthest working distance, determine its characteristic parameters, and determine the target scanning module based on the characteristic parameters to obtain the second point cloud of the target area. data, combining multiple 3D points with weights to generate 3D reconstruction data.
On the basis of ensuring the integrity of point cloud data, the accuracy of feature analysis of different structures and shapes is improved, thereby improving the accuracy and scanning efficiency of three-dimensional reconstruction data.
Smart Images

Figure CN118429550B
Abstract
Description
Technical Field
[0001] The present application relates to the field of three-dimensional scanning technology, and in particular to a three-dimensional reconstruction method, system, electronic device and storage medium. Background Art
[0002] At present, when implementing cross-scale scanning of objects in large-scale scenes, multiple scanning devices are usually relied on to scan the scanned objects to ensure the integrity of the point cloud data. For example, a handheld structured light scanning module is usually used to ensure the integrity of the global data, and at the same time, high-precision fixed equipment is relied on to obtain high-precision detail data. Then, in the point cloud reconstruction process, different point cloud data from multiple devices are used for splicing processing, and the point cloud weights are relied on to merge the point clouds in the same area. However, this method is prone to obvious excessive traces and mesh connection breakage risks after point cloud data reconstruction, resulting in low accuracy of 3D reconstruction data. In addition, it relies on the back-end processing of mesh data, and fixed equipment is difficult to scan large targets, which is time-inefficient. Summary of the invention
[0003] In view of the above, it is necessary to propose a three-dimensional reconstruction method, system, electronic device and storage medium to solve the technical problems of low accuracy and scanning efficiency of three-dimensional reconstruction data.
[0004] The present application provides a three-dimensional reconstruction method, which is applied to an electronic device, wherein the electronic device is communicatively connected to a plurality of scanning modules, the plurality of scanning modules are used to scan an object to be scanned, and each scanning module has a different working distance range. The method comprises: obtaining first point cloud data obtained by scanning the object to be scanned by a scanning module having the longest working distance; wherein the first point cloud data comprises a plurality of first three-dimensional points; determining characteristic parameters of the first point cloud data; determining a target area on the object to be scanned according to the characteristic parameters; determining a target scanning module from the plurality of scanning modules according to the characteristic parameters in the target area; obtaining second point cloud data obtained by the target scanning module scanning the target area; wherein the second point cloud data comprises a plurality of second three-dimensional points; determining the weights of each first three-dimensional point and each second three-dimensional point; and fusing the plurality of first three-dimensional points and the plurality of second three-dimensional points corresponding to at least one of the target areas according to the weights to obtain three-dimensional reconstruction data of the object to be scanned.
[0005] In some embodiments, the feature parameters include: the category of the object to be scanned; and curvature data of the first point cloud data.
[0006] In some embodiments, determining a target scanning module from the multiple scanning modules based on the characteristic parameters in the target area includes: traversing the category of each scanning module; when the category of the traversed scanning module is the same as the category of the object to be scanned, determining the scanning module corresponding to the category as the target scanning module.
[0007] In some embodiments, determining the target scanning module from the multiple scanning modules based on the characteristic parameters in the target area includes: determining the physical resolution required for scanning the target area based on the curvature data; traversing the point cloud physical resolution corresponding to each scanning module to determine the difference between the point cloud physical resolution and the physical resolution required for the target area; and determining, from the scanning modules whose point cloud physical resolution is greater than the physical resolution required for the target area, the scanning module corresponding to the smallest difference as the target scanning module.
[0008] In some embodiments, the fusion resolution in the electronic device is set according to the point cloud physical resolution of the target scanning module, and the fusion resolution is used to characterize the resolution of the three-dimensional reconstruction data of the target area.
[0009] In some embodiments, the number of light rays emitted by the target scanning module when scanning the object to be scanned is determined based on the distance between the target scanning module and the object to be scanned.
[0010] In some embodiments, the weight of each first three-dimensional point is determined according to the position of the light to which each first three-dimensional point belongs in the corresponding scanning module; the weight of each second three-dimensional point is determined according to the position of the light to which each second three-dimensional point belongs in the target scanning module; and / or the weight of each first three-dimensional point is determined according to the distance between the scanning module corresponding to each first three-dimensional point and the object to be scanned; the weight of each second three-dimensional point is determined according to the distance between the target scanning module and the object to be scanned; and / or the weight of each first three-dimensional point is determined according to the incident angle of the light to which each first three-dimensional point belongs when irradiating the object to be scanned; the weight of each second three-dimensional point is determined according to the incident angle of the light to which each second three-dimensional point belongs when irradiating the object to be scanned.
[0011] An embodiment of the present application also provides a three-dimensional reconstruction system, which includes: multiple scanning modules and an electronic device; the multiple scanning modules are used to scan an object to be scanned, and each scanning module has a different distance from the object to be scanned during scanning; the electronic device is used to obtain first point cloud data collected by the scanning module corresponding to the largest distance; determine characteristic parameters of the first point cloud data; determine a target scanning module from the multiple scanning modules based on the characteristic parameters; obtain second point cloud data obtained by the target scanning module scanning the object to be scanned; and fuse the first point cloud data and the second point cloud data to obtain three-dimensional reconstruction data of the object to be scanned.
[0012] An embodiment of the present application also provides an electronic device, comprising: a memory storing at least one instruction; and a processor executing the instruction stored in the memory to implement the three-dimensional reconstruction method.
[0013] An embodiment of the present application also provides a computer-readable storage medium, in which at least one instruction is stored. The at least one instruction is executed by a processor in an electronic device to implement the three-dimensional reconstruction method.
[0014] It can be seen from the above technical solutions that the embodiment of the present application deploys multiple scanning modules with different distances in the scanning system, and preferentially uses the scanning module with the longest distance to obtain the first point cloud data during the real-time scanning process, and then determines the characteristic parameters of the object to be scanned according to the first point cloud data, and determines the physical resolution required for the object to be scanned according to the characteristic parameters, and finally adjusts the adaptive scanning module to perform three-dimensional reconstruction of the object to be scanned. In this way, the accuracy of analyzing the features of different structures and shapes can be improved on the basis of ensuring the integrity of the point cloud data, thereby improving the accuracy of the three-dimensional reconstruction data. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a schematic diagram of a three-dimensional reconstruction system provided in one embodiment of the present application.
[0016] Figure 2 This is a flow chart of a three-dimensional reconstruction method provided in one embodiment of the present application.
[0017] Figure 3 This is a flow chart of a method for determining a target scanning module provided in one embodiment of the present application.
[0018] Figure 4 This is a flowchart of a method for determining a target scanning module provided by another embodiment of the present application.
[0019] Figure 5 This is a flowchart of a method for determining weights of a first three-dimensional point and a second three-dimensional point provided by an embodiment of the present application.
[0020] Figure 6 This is a flowchart of a method for determining weights of a first three-dimensional point and a second three-dimensional point provided by another embodiment of the present application.
[0021] Figure 7 This is a flowchart of a method for determining weights of a first three-dimensional point and a second three-dimensional point provided by another embodiment of the present application.
[0022] Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to more clearly understand the purpose, features and advantages of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the absence of conflict, the embodiments of the present application and the features in the embodiments can be combined with each other. In the following description, many specific details are set forth to facilitate a full understanding of the present application, and the embodiments described are only a part of the embodiments of the present application, rather than all of the embodiments.
[0024] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art to which the present application belongs. The terms used herein in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0026] The embodiment of the present application provides a three-dimensional reconstruction method, which can be applied to one or more electronic devices. The electronic device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA), a digital processor (Digital Signal Processor, DSP), an embedded device, etc.
[0027] An electronic device can be any electronic product that can interact with customers, such as personal computers, tablet computers, smart phones, personal digital assistants (PDAs), game consoles, Internet Protocol Television (IPTV), smart wearable devices, etc.
[0028] The electronic device may also include a network device and / or a client device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing.
[0029] The networks where electronic devices are located include but are not limited to the Internet, wide area network, metropolitan area network, local area network, virtual private network (VPN), etc.
[0030] like Figure 1 As shown, a 3D reconstruction system provided by the present application includes an electronic device 100 and a plurality of scanning modules, wherein the electronic device 100 is connected in communication with a database 200. The electronic device is also connected in communication with the plurality of scanning modules, for example Figure 1 The first scanning module 300, the second scanning module 400 and the third scanning module 500 are shown. Among them, multiple scanning modules are used to scan the object to be scanned 600 to perform three-dimensional reconstruction of the object to be scanned 600. Among them, the distance between each scanning module and the object to be scanned 600 is different during scanning. The database 200 can be a data storage device built into the electronic device 100, or it can be an external data storage device that is communicatively connected to the electronic device 100, and this application does not limit this. The database 200 is used to store point cloud data obtained by scanning the object to be scanned 600 by multiple scanning modules.
[0031] In one embodiment of the present application, the electronic device 100 obtains from the database 200 the first point cloud data obtained by scanning the object to be scanned by the scanning module corresponding to the largest distance, wherein the first point cloud data includes a plurality of first three-dimensional points. The scanning module corresponding to the largest distance may be as follows: Figure 1 The electronic device 100 is also used to determine the characteristic parameters of the first point cloud data, and determine the target scanning module from the plurality of scanning modules according to the characteristic parameters, wherein the target scanning module can be as follows: Figure 1 The electronic device 100 is also used to obtain a target scanning module (eg, Figure 1The second scanning module 400 or the third scanning module 500 shown in the figure scans the object to be scanned 600 to obtain the second point cloud data, wherein the second point cloud data includes a plurality of second three-dimensional points. The electronic device 100 is also used to determine the weight of each first three-dimensional point and each second three-dimensional point, and fuse the plurality of first three-dimensional points and the plurality of second three-dimensional points according to the weight to obtain the three-dimensional reconstruction data of the object to be scanned 600, wherein the three-dimensional reconstruction data is used to characterize the structure and shape of the object to be scanned 600.
[0032] like Figure 2 , is a flow chart of a 3D reconstruction method provided in an embodiment of the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. A 3D reconstruction method provided in an embodiment of the present application includes the following steps.
[0033] S20, obtaining first point cloud data obtained by scanning the object to be scanned by a scanning module with the longest working distance; wherein the first point cloud data includes a plurality of first three-dimensional points.
[0034] In one embodiment of the present application, the object to be scanned may be any object whose geometric shape needs to be measured, such as a car, a medical device, or a product part, etc. The present application does not limit the properties and shape of the object to be scanned. Before measuring the object to be scanned, a small number of object marker points may be attached to the object to be scanned, and the object marker points may be reflective marker points or reflective textures.
[0035] In one embodiment of the present application, a camera and a light source transmitter are provided in the scanning module. The light source transmitter is used to project structured light onto the surface of the object to be scanned; the camera is used to capture the structured light reflected by the surface of the object to be scanned, and determine the point cloud data corresponding to the object to be scanned based on the reflected light. In order to ensure the integrity of the point cloud data, the object to be scanned can be scanned based on multiple scanning modules, wherein each scanning module has a different working distance range and requires a different distance from the object to be scanned when used. In this way, point cloud data of different depths and angles of the object to be scanned can be obtained. The present application does not limit the specific scanning posture of the scanning module and the position of each scanning module;
[0036] The light source may be an optical device, a DLP projector, an LED, etc., and the projected structured light may be a single light ray, multiple parallel light rays, multiple groups of crossed parallel lines, speckle, a grating, etc.
[0037] In one embodiment of the present application, the first point cloud data may be a collection of point cloud data obtained when the scanning module with the longest working distance scans the object to be scanned. The first point cloud data includes a plurality of first three-dimensional points, each of which corresponds to a three-dimensional coordinate. For example, the scanning module with the longest working distance from the object to be scanned may be as follows: Figure 1 The scanning module 300 is shown.
[0038] In one embodiment of the present application, the three-dimensional coordinates of the first three-dimensional point are used to represent the position of the first three-dimensional point in a preset coordinate system. The coordinate origin of the preset coordinate system may be the position of the scanning module in the target space where the object to be scanned is located, or may be a pre-set point in the target space, which is not limited in the present application.
[0039] S21, determining characteristic parameters of the first point cloud data.
[0040] In one embodiment of the present application, the characteristic parameters of the first point cloud data are used to describe the local attributes of each first three-dimensional point. The characteristic parameters include: the category of the object to be scanned; and the curvature data of the first point cloud data. The category of the object to be scanned is used to characterize the structure and shape of the object to be scanned. Exemplarily, when the category of the object to be scanned is a sphere, it indicates that the surface structure of the object to be scanned is a spherical structure; when the category of the object to be scanned is a cube, it indicates that the surface structure of the object to be scanned is a cube structure. The present application does not limit the specific category of the object to be scanned. The curvature data of the first point cloud data is used to characterize the roughness of the surface of the object to be scanned or the complexity of the surface shape. When the curvature data is larger, it indicates that the surface roughness or the complexity of the surface shape of the object to be scanned is higher; when the curvature data is smaller, it indicates that the surface roughness or the complexity of the surface shape of the object to be scanned is lower.
[0041] In some embodiments, the characteristic parameters of the first point cloud data also include: a normal vector, which is used to characterize the normal direction of the surface where each first three-dimensional point is located; surface roughness, which is used to characterize the smoothness or roughness of the point cloud surface and can be used to analyze the texture of the object surface; color value, intensity value, incident direction of light, etc. of the first point cloud data.
[0042] S22, determining a target area on the object to be scanned according to the characteristic parameters, and determining a target scanning module from the multiple scanning modules according to the characteristic parameters in the target area.
[0043] In one embodiment of the present application, in order to perform three-dimensional reconstruction of the scanned object based on point cloud data obtained by scanning the scanned object by multiple scanning modules, thereby improving the accuracy of three-dimensional reconstruction, a target scanning module can be determined from multiple scanning modules based on characteristic parameters of the first point cloud data.
[0044] In one embodiment of the present application, during scanning, in order to improve the accuracy of three-dimensional reconstruction of a region with a complex structure and shape on the object to be scanned, a target region may be first determined on the object to be scanned based on a characteristic parameter. Exemplarily, the characteristic parameter may be curvature data of the first point cloud data. When the curvature data of the point cloud data corresponding to any region on the object to be scanned is large, it indicates that the structure and shape of the region on the object to be scanned are relatively complex, and the region may be determined to be a target region.
[0045] In one embodiment of the present application, each scanning module is suitable for scanning objects of different distances, structures and shapes. For example, the light emitted by some scanning modules can be used to scan objects of spherical structure; the light emitted by other scanning modules can be used to scan objects of cubic structure. The present application does not limit the types of objects to be scanned that the scanning modules are applicable to. Specifically, when the characteristic parameters include the category of the object to be scanned, the method for determining the target scanning module can be referred to in Figure 3 The corresponding detailed description.
[0046] In one embodiment of the present application, the curvature data of the first point cloud data is used to characterize the local geometric shape of the surface of the first point cloud data, and can be used to describe the degree of bending or curvature change of the first three-dimensional point. When the curvature data is larger, it indicates that the surface roughness or the complexity of the surface shape of the object to be scanned is higher, and the object to be scanned can be scanned according to a scanning module with a higher physical resolution to improve the accuracy of three-dimensional reconstruction of the object to be scanned; when the curvature data is smaller, it indicates that the surface roughness or the complexity of the surface shape of the object to be scanned is lower, and the object to be scanned can be scanned according to a scanning module with a lower physical resolution, thereby improving the efficiency of three-dimensional reconstruction of the object to be scanned while ensuring the accuracy of three-dimensional reconstruction. Specifically, when the characteristic parameters include the curvature data of the first point cloud data, the method for determining the target scanning module can be found in. Figure 4 The corresponding detailed description.
[0047] In one embodiment of the present application, in order to ensure the accuracy of three-dimensional reconstruction of the scanned object and improve the efficiency of three-dimensional reconstruction, the method further includes: setting the fusion resolution in the electronic device according to the point cloud physical resolution of the target scanning module, and the fusion resolution is used to characterize the resolution of the three-dimensional reconstruction data of the target area. Among them, the point cloud physical resolution of the scanning module may be the optical resolution of the scanning module, which is used to measure the precision of the photosensitive device in the scanning module. Specifically, the point cloud physical resolution may be the actual number of light points that can be captured per square inch of area by the optical components of the scanning module, usually expressed in dpi (dots per inch), and the point cloud physical resolution can reflect the ability of the scanning module to capture the details of the point cloud data. The higher the point cloud physical resolution, the richer the details of the point cloud data captured by the scanning module.
[0048] In one embodiment of the present application, in order to improve the accuracy of three-dimensional reconstruction of the object to be scanned, the target space where the object to be scanned is located can be divided into multiple voxels to provide data support for the voxelization of point cloud data. The point cloud data can be subsequently divided based on multiple voxels to obtain the point cloud data corresponding to each voxel, and the point cloud data corresponding to each voxel can be fused to improve the accuracy of three-dimensional reconstruction. Among them, the number of voxels in the target space. Exemplarily, the size of the voxel can be 1mm*1mm*1mm, or it can be 0.3mm*0.3mm*0.3mm, which is not limited in the present application.
[0049] In one embodiment of the present application, during the three-dimensional reconstruction of the object to be scanned, if the voxel size is too high, the granularity of segmenting the target space will be insufficient, resulting in information loss; if the voxel size is too low, the number of voxels in the target space will be too large, which will lead to the problem that the three-dimensional reconstruction takes a long time and the computing resource occupancy rate of the electronic device is high. In order to avoid the above problems, the fusion resolution in the electronic device can be set according to the physical resolution of the point cloud of the target scanning module, and the fusion resolution is used to characterize the resolution of the three-dimensional reconstruction data corresponding to the object to be scanned.
[0050] In one embodiment of the present application, taking a laser source as an example; when the camera in the scanning module performs light alignment, since the light projected by the scanning module is dense and has a consistent geometric shape, alignment errors may occur, resulting in a high error in the point cloud data. In order to improve the accuracy of the acquired point cloud data, the number of light rays emitted by the scanning module can be reduced. Specifically, the scanning module emits multiple light rays to the object to be scanned during the three-dimensional reconstruction process, wherein the multiple light rays include a central light ray and the remaining light rays that are distributed in parallel and dispersed around the central light ray. Since the remaining projected light planes are severely curved, the point cloud data generated by the remaining light rays will show a large deformation, and therefore the accuracy of the point cloud data generated by the remaining light rays will gradually decrease.
[0051] In one embodiment of the present application, during the three-dimensional reconstruction of the object to be scanned, the method further includes: determining the number of light rays emitted by the target scanning module when scanning the object to be scanned based on the distance between the target scanning module and the object to be scanned. Specifically, when the object to be scanned is scanned using the target scanning module, at least one pair of light rays in the scanning module can be canceled, wherein the number of at least one light ray can be determined based on the distance between the scanning module and the object to be scanned, the longer the distance is, the fewer the number of light rays to be canceled, and the closer the distance is, the more the number of light rays to be canceled. Exemplarily, when the scanning module farthest from the object to be scanned (for example, Figure 1 The scanning module 300 shown in FIG. Figure 1 The distance between the target scanning module (for example, Figure 1 When emitting 7 rays to scan the object to be scanned, at least one pair of rays located on the outer side of the 7 rays can be cancelled. This can reduce the number of rays, thereby reducing the complexity of the point cloud data, and thus improving the efficiency of point cloud data processing; it can also reduce the number of outer rays, thereby reducing the point cloud data corresponding to the edge of the object to be scanned, and thus reducing the deformation of the point cloud data, and thus improving the accuracy of processing the point cloud data.
[0052] S23, obtaining second point cloud data obtained by the target scanning module scanning the target area; wherein the second point cloud data includes a plurality of second three-dimensional points.
[0053] In one embodiment of the present application, the second point cloud data may be a collection of point cloud data obtained when the target scanning module scans the object to be scanned. The second point cloud data includes a plurality of second three-dimensional points, each of which corresponds to a three-dimensional coordinate. Exemplarily, the target scanning module may be as follows: Figure 1 The scanning module 400 or the scanning module 500 is shown.
[0054] In one embodiment of the present application, the three-dimensional coordinates of the second three-dimensional point are used to represent the position of the second three-dimensional point in a preset coordinate system. The coordinate origin of the preset coordinate system may be the position of the scanning module in the target space where the object to be scanned is located, or may be a pre-set point in the target space, which is not limited in the present application.
[0055] S24, determining the weight of each first three-dimensional point and each second three-dimensional point.
[0056] In one embodiment of the present application, in order to improve the accuracy of three-dimensional reconstruction of the object to be scanned, the weights of each first three-dimensional point and each second three-dimensional point can be determined in combination with the distances between multiple scanning modules and the object to be scanned, the positions of the light rays that irradiate the first three-dimensional points and the second three-dimensional points in the corresponding scanning modules, and the incident angles of the light rays when irradiating the modules to be scanned.
[0057] In one embodiment of the present application, the incident angle of the light corresponding to the first three-dimensional point when irradiating the module to be scanned can be determined according to the three-dimensional coordinates of the first three-dimensional point in the preset coordinate system and the three-dimensional coordinates of the scanning module in the preset coordinate system; and the incident angle of the light corresponding to the second three-dimensional point when irradiating the module to be scanned can be determined according to the three-dimensional coordinates of the second three-dimensional point in the preset coordinate system and the three-dimensional coordinates of the scanning module in the preset coordinate system. Specifically, the coordinate line between the first three-dimensional point and the scanning module can be determined, and the normal vector of the first point cloud data can be determined, and the angle between the coordinate line and the normal vector of the first point cloud data can be calculated to obtain the incident angle of the light corresponding to the first three-dimensional point when irradiating the module to be scanned; the coordinate line between the second three-dimensional point and the scanning module can be determined, and the normal vector of the second point cloud data can be determined, and the angle between the coordinate line and the normal vector of the second point cloud data can be calculated to obtain the incident angle of the light corresponding to the second three-dimensional point when irradiating the module to be scanned.
[0058] In one embodiment of the present application, the method for determining the weights of the first three-dimensional point and the second three-dimensional point is shown in Figure 5 The corresponding detailed description and / or Figure 6 The corresponding detailed description and / or Figure 7 The corresponding detailed description.
[0059] S25, fusing the plurality of first three-dimensional points and the plurality of second three-dimensional points corresponding to at least one of the target areas according to the weights to obtain three-dimensional reconstruction data of the object to be scanned.
[0060] In one embodiment of the present application, in order to fit the approximate plane of the surface of the object to be scanned in each voxel according to the point cloud data in each voxel, the first three-dimensional point in each voxel and the second three-dimensional point corresponding to at least one target area can be fitted based on the least squares method to obtain the target point and the target normal vector corresponding to each voxel, and then the approximate plane of the surface of the object to be scanned in each voxel can be determined based on the target point and the target normal vector. Wherein, when fitting the first three-dimensional point in each voxel and the second three-dimensional point corresponding to at least one target area based on the least squares method, the confidence of the first three-dimensional point and the second three-dimensional point can be adjusted during the fitting process according to the weights of the first three-dimensional point and the second three-dimensional point. In this way, the accuracy of the three-dimensional reconstruction data of the object to be scanned can be improved.
[0061] In one embodiment of the present application, after obtaining the target point and target normal vector corresponding to each voxel, the approximate plane of the object to be scanned in the voxel can be determined based on the target point and the corresponding target normal vector, and then the approximate plane of each voxel can be fused to obtain the three-dimensional reconstruction data of the object to be scanned.
[0062] Exemplarily, when there are curves C1 and C2 on the surface of the object to be scanned, and curves C1 and C2 intersect at a three-dimensional point P, if the tangent vector of curve C1 at the three-dimensional point P is T1, and the tangent vector of curve C2 at the three-dimensional point P is T2, then both tangent vector T1 and tangent vector T2 are on the tangent plane of the surface at the three-dimensional point P. The normal vector of the three-dimensional point P can be determined based on vectors T1 and T2, and the direction of the tangent plane can be determined by the three-dimensional coordinates of the three-dimensional point P and the normal vector, and the surface of the object to be scanned at the three-dimensional point P can be characterized based on the tangent plane. In order to obtain the approximate plane corresponding to the plane of the object to be scanned, the local approximate plane of each voxel can be determined according to the above method, and the plane of the object to be scanned can be constructed based on the local approximate plane of each voxel.
[0063] In one embodiment of the present application, when the three-dimensional coordinates of the three-dimensional point P in the preset coordinate system are (x0, y0, z0), and the target normal vector n is (A, B, C), the plane equation of the three-dimensional point P can be determined according to the following relationship:
[0064] ; Among them, (A, B, C) represents the normal vector of the plane where the three-dimensional point P is located, and (x0, y0, z0) represents the three-dimensional coordinates of the three-dimensional point P.
[0065] It can be seen from the above technical solutions that the embodiment of the present application deploys multiple scanning modules with different distances in the scanning system, and preferentially uses the scanning module with the longest distance to obtain the first point cloud data during the real-time scanning process, and then determines the characteristic parameters of the object to be scanned according to the first point cloud data, and determines the physical resolution required for the object to be scanned according to the characteristic parameters, and finally adjusts the adaptive scanning module to perform three-dimensional reconstruction of the object to be scanned. In this way, the accuracy of analyzing the features of different structures and shapes can be improved on the basis of ensuring the integrity of the point cloud data, thereby improving the accuracy of the three-dimensional reconstruction data.
[0066] like Figure 3 , is a flow chart of a method for determining a target scanning module provided by an embodiment of the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. The method for determining a target scanning module provided by an embodiment of the present application includes the following steps.
[0067] S30, traversing the categories of each scanning module.
[0068] In one embodiment of the present application, each scanning module is suitable for scanning objects to be scanned of different structures and shapes. For example, the light emitted by some scanning modules can be used to scan objects to be scanned with a spherical structure; the light emitted by other scanning modules can be used to scan objects to be scanned with a cubic structure. In order to determine the scanning module suitable for scanning the object to be scanned, the category of each scanning module in the multiple scanning modules can be traversed. The present application does not limit the order of traversing the multiple scanning modules.
[0069] S31, when the category of the traversed scanning module is the same as the category of the object to be scanned, determining the scanning module corresponding to the category as the target scanning module.
[0070] In one embodiment of the present application, when the category of the traversed scanning module is the same as the category of the object to be scanned, it indicates that the traversed scanning module is suitable for scanning the object to be scanned for three-dimensional reconstruction. Exemplarily, when the traversed scanning module is a sphere, and the structure of the object to be scanned is also a sphere, it can be confirmed that the traversed scanning module is a target scanning module. Then, the second point cloud data obtained by the target scanning module scanning the object to be scanned can be obtained. It can provide data support for the subsequent fusion of multiple point clouds to obtain three-dimensional reconstruction data.
[0071] like Figure 4 , is a flow chart of a method for determining a target scanning module provided by another embodiment of the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. The method for determining a target scanning module provided by an embodiment of the present application includes the following steps.
[0072] S40: Determine a physical resolution required for scanning the target area according to the curvature data.
[0073] In one embodiment of the present application, the curvature data of the first three-dimensional point can be determined according to the three-dimensional coordinates corresponding to the first three-dimensional point, and the physical resolution required for scanning the object to be scanned can be determined according to the curvature data. When the curvature data is larger, the physical resolution is larger, and when the curvature data is smaller, the physical resolution is smaller. Specifically, when the curvature data is larger, it indicates that the structure of the surface of the object to be scanned is more complex. It can be determined that the size of the voxel required for scanning the object to be scanned is smaller, and the physical resolution is larger. In this way, the fineness of the voxel processing of the point cloud data can be improved, thereby improving the accuracy of three-dimensional reconstruction; when the curvature data is smaller, it indicates that the surface of the object to be scanned is smoother. It can be determined that the size of the voxel required for scanning the object to be scanned is larger, and the physical resolution is smaller, thereby improving the efficiency of point cloud data processing.
[0074] S41, traversing the point cloud physical resolution corresponding to each scanning module, and determining the difference between the point cloud physical resolution and the physical resolution required by the target area.
[0075] In one embodiment of the present application, the point cloud physical resolution of the scanning module may be the optical resolution of the scanning module, which is used to measure the precision of the photosensitive device in the scanning module. Specifically, the point cloud physical resolution may be the actual number of light points that can be captured per square inch of the optical components of the scanning module, usually expressed in dpi (dots per inch). The point cloud physical resolution can reflect the ability of the scanning module to capture the details of the point cloud data. The higher the point cloud physical resolution, the richer the details of the point cloud data captured by the scanning module. In order to determine the scanning module suitable for scanning the object to be scanned, the point cloud physical resolution corresponding to each scanning module in the multiple scanning modules may be traversed. The present application does not limit the order of traversing the multiple scanning modules.
[0076] In one embodiment of the present application, in order to determine a point cloud physical resolution close to the physical resolution required by the target area, the difference between the point cloud physical resolution and the physical resolution required by the target area is also determined. Subsequently, the point cloud physical resolution close to the required physical resolution and the corresponding target scanning module can be determined based on the difference.
[0077] S42, from the scanning modules whose point cloud physical resolution is greater than the physical resolution required by the target area, determine the scanning module corresponding to the smallest difference as the target scanning module.
[0078] In one embodiment of the present application, when the point cloud physical resolution of the traversed scanning module is greater than the physical resolution required for the target area, and the difference between the point cloud physical resolution and the physical resolution required for the target area is the smallest, it indicates that the scanning module is suitable for scanning the object to be scanned, and the accuracy of the second point cloud data scanned by the scanning module meets the corresponding physical resolution, so the scanning module can be determined as the target scanning module.
[0079] like Figure 5 , is a flow chart of a method for determining the weights of a first three-dimensional point and a second three-dimensional point provided by an embodiment of the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. The method for determining the weights of a first three-dimensional point and a second three-dimensional point provided by an embodiment of the present application includes the following steps.
[0080] S50, determining the weight of each first three-dimensional point according to the position of the light to which each first three-dimensional point belongs in the corresponding scanning module.
[0081] In one embodiment of the present application, a scanning module emits a plurality of light rays to illuminate an object to be scanned, and receives light rays reflected by the object to be scanned to obtain point cloud data of the object to be scanned. The farther the position of the light rays irradiating the object to be scanned in the corresponding scanning module is from the center of the scanning module, the closer the part of the object to be scanned illuminated by the light rays is to the outside, and thus the weight of the first three-dimensional point obtained by scanning the object to be scanned by the light rays is lower. The closer the position of the light rays irradiating the object to be scanned in the corresponding scanning module is from the center of the scanning module, the closer the part of the object to be scanned illuminated by the light rays is to the center of the object to be scanned, and thus the weight of the first three-dimensional point obtained by scanning the object to be scanned by the light rays is higher.
[0082] S51, determining the weight of each second three-dimensional point according to the position of the light to which each second three-dimensional point belongs in the target scanning module.
[0083] In one embodiment of the present application, when the position of the light irradiating the object to be scanned in the target scanning module is farther from the center of the target scanning module, the part of the object to be scanned irradiated by the light is closer to the outside, so the weight of the second three-dimensional point obtained by scanning the object to be scanned by the light is lower. When the position of the light irradiating the object to be scanned in the target scanning module is closer to the center of the target scanning module, the part of the object to be scanned by the light is closer to the center of the object to be scanned, so the weight of the second three-dimensional point obtained by scanning the object to be scanned by the light is higher.
[0084] like Figure 6 , is a flow chart of a method for determining the weights of a first three-dimensional point and a second three-dimensional point provided by another embodiment of the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. The method for determining the weights of a first three-dimensional point and a second three-dimensional point provided by an embodiment of the present application includes the following steps.
[0085] S60: Determine the weight of each first three-dimensional point according to the distance between the scanning module corresponding to each first three-dimensional point and the object to be scanned.
[0086] In one embodiment of the present application, the greater the distance between the scanning module and the object to be scanned, the coarser the features of the surface of the object to be scanned represented by the point cloud data obtained by the scanning module, and the lower the weight of the point cloud data obtained by scanning the object to be scanned by the scanning module; the closer the distance between the scanning module and the object to be scanned, the higher the accuracy of the features of the surface of the object to be scanned represented by the point cloud data obtained by the scanning module, and the higher the weight of the point cloud data obtained by scanning the object to be scanned by the scanning module.
[0087] S61, determining the weight of each second three-dimensional point according to the distance between the target scanning module and the object to be scanned.
[0088] In one embodiment of the present application, the greater the distance between the target scanning module and the object to be scanned, the rougher the features of the surface of the object to be scanned represented by the second point cloud data obtained by the target scanning module, and the lower the weight of the second three-dimensional point; the closer the distance between the scanning module and the object to be scanned, the higher the accuracy of the features of the surface of the object to be scanned represented by the point cloud data obtained by the scanning module, and the higher the weight of the second three-dimensional point.
[0089] like Figure 7 , is a flowchart of a method for determining the weights of a first three-dimensional point and a second three-dimensional point provided by another embodiment of the present application. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted. The method for determining the weights of a first three-dimensional point and a second three-dimensional point provided by an embodiment of the present application includes the following steps.
[0090] S70, determining a weight of each first three-dimensional point according to an incident angle of the light to which each first three-dimensional point belongs irradiating the object to be scanned.
[0091] In one embodiment of the present application, when determining the incident angle corresponding to the light to which the first three-dimensional point belongs, the coordinate line between the first three-dimensional point and the scanning module can be determined, and the normal vector of the first point cloud data can be determined, and the angle between the coordinate line and the normal vector of the first point cloud data can be calculated to obtain the incident angle of the light corresponding to the first three-dimensional point when irradiating the module to be scanned. When the incident angle is larger, it indicates that the light is closer to the direction perpendicular to the surface of the object to be scanned, so the weight of the first point cloud data is higher; when the incident angle is smaller, it indicates that the light is closer to the direction tangent to the surface of the object to be scanned, so the weight of the first point cloud data is lower.
[0092] S71, determining a weight of each second three-dimensional point according to an incident angle of the light to which each second three-dimensional point belongs irradiating the object to be scanned.
[0093] In one embodiment of the present application, the coordinate line between the second three-dimensional point and the scanning module can be determined, and the normal vector of the second point cloud data can be determined, and the angle between the coordinate line and the normal vector of the second point cloud data can be calculated to obtain the incident angle of the light corresponding to the second three-dimensional point when irradiating the module to be scanned. When the incident angle is larger, it indicates that the light is closer to the direction perpendicular to the surface of the object to be scanned, so the weight of the second point cloud data is higher; when the incident angle is smaller, it indicates that the light is closer to the direction tangent to the surface of the object to be scanned, so the weight of the second point cloud data is lower.
[0094] See also Figure 8, is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 100 includes a memory 12 and a processor 13. The memory 12 is used to store computer-readable instructions, and the processor 13 is used to execute the computer-readable instructions stored in the memory to implement a three-dimensional reconstruction method described in any of the above embodiments.
[0095] In an embodiment of the present application, the electronic device 100 further includes a bus, and a computer program stored in the memory 12 and executable on the processor 13, such as a three-dimensional reconstruction program.
[0096] Figure 8 Only the electronic device 100 having the memory 12 and the processor 13 is shown, and those skilled in the art can understand that Figure 4 The structure shown does not constitute a limitation on the electronic device 100 , and the electronic device 100 may include fewer or more components than shown in the figure, or combine some components, or arrange the components differently.
[0097] Combination Figure 2 The memory 12 in the electronic device 100 stores a plurality of computer-readable instructions to implement a three-dimensional reconstruction method, and the processor 13 can execute the plurality of instructions to implement: obtaining first point cloud data obtained by scanning the object to be scanned by the scanning module with the longest working distance; wherein the first point cloud data includes a plurality of first three-dimensional points; determining characteristic parameters of the first point cloud data; determining a target area on the object to be scanned according to the characteristic parameters; determining a target scanning module from the plurality of scanning modules according to the characteristic parameters in the target area; obtaining second point cloud data obtained by the target scanning module scanning the target area; wherein the second point cloud data includes a plurality of second three-dimensional points; determining the weights of each first three-dimensional point and each second three-dimensional point; and fusing the plurality of first three-dimensional points and the plurality of second three-dimensional points corresponding to at least one of the target areas according to the weights to obtain three-dimensional reconstruction data of the object to be scanned.
[0098] Specifically, the specific implementation method of the processor 13 for the above instructions can refer to Figure 2 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0099] Those skilled in the art will appreciate that the schematic diagram is merely an example of the electronic device 100 and does not constitute a limitation on the electronic device 100. The electronic device 100 may be a bus-type structure or a star-type structure. The electronic device 100 may also include more or less other hardware or software than shown in the diagram, or a different arrangement of components. For example, the electronic device 100 may also include input and output devices, network access devices, etc.
[0100] It should be noted that the electronic device 100 is only an example, and other existing or future electronic products that are suitable for the present application should also be included in the protection scope of the present application and included here by reference.
[0101] Among them, the memory 12 includes at least one type of readable storage medium, and the readable storage medium can be non-volatile or volatile. The readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the electronic device 100, such as a mobile hard disk of the electronic device 100. In other embodiments, the memory 12 can also be an external storage device of the electronic device 100, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the electronic device 100. The memory 12 can not only be used to store application software and various types of data installed in the electronic device 100, such as a code of a three-dimensional reconstruction program, etc., but also can be used to temporarily store data that has been output or is to be output.
[0102] In some embodiments, the processor 13 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and a combination of various control chips. The processor 13 is the control core (Control Unit) of the electronic device 100, and uses various interfaces and lines to connect various components of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing programs or modules stored in the memory 12 (for example, executing a three-dimensional reconstruction program, etc.), and calling data stored in the memory 12.
[0103] The processor 13 executes the operating system of the electronic device 100 and various installed applications. The processor 13 executes the applications to implement the steps in each of the above-mentioned three-dimensional reconstruction method embodiments, for example Figure 2 Steps shown.
[0104] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules / units may be a series of computer-readable instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the electronic device 100.
[0105] The above-mentioned integrated unit implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, and includes a number of instructions for enabling a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to execute a part of a three-dimensional reconstruction method described in each embodiment of the present application.
[0106] If the module / unit integrated in the electronic device 100 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also instruct the relevant hardware devices to complete through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented.
[0107] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory and other memory, etc.
[0108] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.
[0109] The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. Figure 4Only one arrow is used in the figure, but it does not mean that there is only one bus or one type of bus. The bus is configured to realize the connection and communication between the memory 12 and at least one processor 13, etc.
[0110] An embodiment of the present application also provides a computer-readable storage medium (not shown), in which computer-readable storage medium is stored computer-readable instructions, and the computer-readable instructions are executed by a processor in an electronic device to implement a three-dimensional reconstruction method described in any of the above embodiments.
[0111] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0112] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0113] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0114] In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the specification can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any specific order.
[0115] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. A three-dimensional reconstruction method, applied to electronic equipment, characterized in that: The electronic device is communicatively connected to a plurality of scanning modules, the plurality of scanning modules are used to scan an object to be scanned, each scanning module has a different working distance range, and the method includes: Acquire first point cloud data obtained by scanning the object to be scanned by a scanning module with the longest working distance; wherein the first point cloud data includes a plurality of first three-dimensional points; Determine characteristic parameters of the first point cloud data; wherein the characteristic parameters include: the category of the object to be scanned, wherein the category is used to characterize the structure and shape of the object to be scanned; and curvature data of the first point cloud data; Determine a target area on the object to be scanned according to the characteristic parameters; Determine a target scanning module from the plurality of scanning modules according to the characteristic parameters in the target area; Acquire second point cloud data obtained by scanning the target area by the target scanning module; wherein the second point cloud data includes a plurality of second three-dimensional points; determining a weight for each first three-dimensional point and each second three-dimensional point; The plurality of first three-dimensional points and the plurality of second three-dimensional points corresponding to at least one of the target areas are fused according to the weights to obtain three-dimensional reconstruction data of the object to be scanned.
2. The three-dimensional reconstruction method according to claim 1, characterized in that: The determining a target scanning module from the plurality of scanning modules according to the characteristic parameters in the target area comprises: Traversing the categories of each scanning module; When the category of the traversed scanning module is the same as the category of the object to be scanned, the scanning module corresponding to the category is determined as the target scanning module.
3. The three-dimensional reconstruction method according to claim 1, characterized in that: The determining of a target scanning module from the plurality of scanning modules according to the characteristic parameters in the target area comprises: Determining the physical resolution required when scanning the target area according to the curvature data; Traversing the point cloud physical resolution corresponding to each scanning module, and determining the difference between the point cloud physical resolution and the physical resolution required by the target area; From the scanning modules whose point cloud physical resolution is greater than the physical resolution required by the target area, determine the scanning module corresponding to the smallest difference as the target scanning module.
4. The three-dimensional reconstruction method according to claim 3, characterized in that: The method further comprises: The fusion resolution in the electronic device is set according to the point cloud physical resolution of the target scanning module, and the fusion resolution is used to characterize the resolution of the three-dimensional reconstruction data of the target area.
5. The three-dimensional reconstruction method according to claim 1, characterized in that: The method further comprises: Based on the distance between the target scanning module and the object to be scanned, the number of light rays emitted by the target scanning module when scanning the object to be scanned is determined.
6. The three-dimensional reconstruction method according to claim 1, wherein: Determining the weight of each first three-dimensional point and each second three-dimensional point comprises: Determine the weight of each first 3D point according to the position of the light to which each first 3D point belongs in the corresponding scanning module; determine the weight of each second 3D point according to the position of the light to which each second 3D point belongs in the target scanning module; and / or Determine the weight of each first three-dimensional point according to the distance between the scanning module corresponding to each first three-dimensional point and the object to be scanned; determine the weight of each second three-dimensional point according to the distance between the target scanning module and the object to be scanned; and / or The weight of each first three-dimensional point is determined according to the incident angle of the light to which each first three-dimensional point belongs when irradiating the object to be scanned; the weight of each second three-dimensional point is determined according to the incident angle of the light to which each second three-dimensional point belongs when irradiating the object to be scanned.
7. A three-dimensional reconstruction system, characterized in that: The system comprises: a plurality of scanning modules and electronic equipment; The multiple scanning modules are used to scan the object to be scanned, and the distance between each scanning module and the object to be scanned is different; The electronic device is used to obtain first point cloud data collected by a scanning module corresponding to the maximum distance; determine characteristic parameters of the first point cloud data; determine a target scanning module from the multiple scanning modules according to the characteristic parameters; obtain second point cloud data obtained by the target scanning module scanning the object to be scanned; and fuse the first point cloud data and the second point cloud data to obtain three-dimensional reconstruction data of the object to be scanned.
8. An electronic device, characterized in that: The electronic device comprises a processor and a memory, and the processor is used to implement the three-dimensional reconstruction method according to any one of claims 1 to 6 when executing a computer program stored in the memory.
9. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the three-dimensional reconstruction method according to any one of claims 1 to 6 is implemented.
