Three-dimensional scanning method and system, electronic equipment and storage medium
By processing the reconstruction and integration process of independent graphics cards and integrated graphics cards in parallel in three-dimensional scanning technology, the problem of time-consuming three-dimensional scanning is solved, efficiency is improved and the use of graphics card resources is reduced, and a faster three-dimensional scanning process is achieved.
Patent Information
- Application Number
- CN202410928927.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-11
- Publication Date
- 2024-11-01
AI Technical Summary
The existing three-dimensional scanning technology has a long time-consuming requirement for GPU resources, and the video memory size of independent graphics cards limits the amount of data. To increase the video memory, it requires changing the device, which is time-consuming to operate.
By calling the independent graphics card to perform reconstruction algorithm in three-dimensional scanning, and calling the integrated graphics card to perform fusion algorithm, the reconstruction process and fusion process of scanned images can be parallelized by scanning images, reducing the time-consuming of 3-dimensional scanning.
It improves the efficiency of three-dimensional scanning, reduces time-consuming, avoids the problem of frame rate restriction due to GPU resource limitation, and improves the utilization rate of graphics cards through multi-threading.
Smart Images

Figure CN118887329A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of three-dimensional scanning technology, and in particular, relates to a three-dimensional scanning method, system, electronic device and storage medium. Background Art
[0002] Three-dimensional scanning technology is an important research direction in the field of computer vision technology and graphics and image processing. It has broad application prospects in autonomous driving, robot autonomous navigation, cultural relics protection, architectural design, clinical medicine, etc.
[0003] However, the 3D scanning technology has high requirements on the GPU resources of electronic devices. In the related art, due to the limitation of GPU resources, the 3D scanning takes a long time. Summary of the invention
[0004] The embodiments of the present application provide a three-dimensional scanning method, system, electronic device and storage medium to solve the problem that three-dimensional scanning takes a long time.
[0005] In a first aspect, an embodiment of the present application provides a three-dimensional scanning method, which is applied to an electronic device, wherein the electronic device includes an independent graphics card and an integrated graphics card, and the three-dimensional scanning method includes: calling the independent graphics card to obtain scanning data corresponding to a target object, and converting the scanning data into point cloud data; generating a rotation displacement matrix based on the scanning data; based on the point cloud data and the rotation displacement matrix, calling the integrated graphics card to generate a point cloud fusion result, and generating a three-dimensional model of the target object based on the point cloud fusion result.
[0006] Furthermore, in the above-mentioned three-dimensional scanning method provided in the embodiment of the present application, the method also includes: determining multiple algorithm processes corresponding to the three-dimensional scanning process and the algorithm type corresponding to each algorithm process; determining the graphics card requirement type corresponding to each algorithm process; determining the matching graphics card type according to the algorithm type and the graphics card type; and calling the graphics card corresponding to the graphics card type to execute the corresponding algorithm process.
[0007] Furthermore, in the above-mentioned three-dimensional scanning method provided in the embodiment of the present application, the determining of the matching graphics card type according to the algorithm type and the graphics memory requirement type includes: when the algorithm type is a computationally intensive algorithm and the graphics memory requirement type is a fixed graphics memory requirement, determining that the graphics card type is an independent graphics card; when the algorithm type is a memory access intensive algorithm and the graphics memory requirement type is an incremental graphics memory requirement, determining that the graphics card type is an integrated graphics card.
[0008] Furthermore, in the above-mentioned three-dimensional scanning method provided in the embodiment of the present application, the method also includes: creating a first thread for calling the independent graphics card; and using the first thread to call the independent graphics card to convert the scanned image of the current frame into first point cloud data based on the scanned data and send the first point cloud data to the integrated graphics card, calling the independent graphics card to continue to convert the scanned image of the next frame into second point cloud data based on the scanned data, until the scanned images of all frames are converted into point cloud data.
[0009] Furthermore, in the above-mentioned three-dimensional scanning method provided in the embodiment of the present application, the method also includes: creating a second thread for calling the integrated graphics card; using the second thread to call the integrated graphics card to fuse the first point cloud data and the second point cloud data respectively.
[0010] Furthermore, in the above-mentioned three-dimensional scanning method provided in the embodiment of the present application, the use of the second thread to call the integrated graphics card to fuse the first point cloud data and the second point cloud data respectively includes: based on the first point cloud data and the rotation displacement matrix, using the second thread to call the integrated graphics card to generate a first point cloud fusion result; based on the second point cloud data and the rotation displacement matrix, using the second thread to call the integrated graphics card to generate a second point cloud fusion result.
[0011] In a second aspect, an embodiment of the present application also provides a three-dimensional scanning system, which is applied to an electronic device, wherein the electronic device includes an independent graphics card and an integrated graphics card; the three-dimensional scanning system includes: a reconstruction module, a tracking module and a fusion module, wherein: the reconstruction module is used to obtain scanning data corresponding to the target object, and convert the scanning data into point cloud data, and the reconstruction module is called by the independent graphics card; the tracking module is used to generate a rotation displacement matrix based on the scanning data; the fusion module is used to generate a point cloud fusion result of the target object based on the point cloud data and the rotation displacement matrix, and generate a three-dimensional model of the target object based on the point cloud fusion result; the fusion module is called by the integrated graphics card.
[0012] Furthermore, in the above-mentioned three-dimensional scanning system provided in the embodiment of the present application, the three-dimensional scanning system also includes a thread creation module, and the thread creation module is used to create a first thread and a second thread, wherein the first thread is used to call the independent graphics card to convert the scanned image of the current frame into first point cloud data based on the scanned data and send the first point cloud data to the integrated graphics card, and call the independent graphics card to continue to convert the scanned image of the next frame into second point cloud data based on the scanned data until the scanned images of all frames are converted into point cloud data; the second thread is used to call the integrated graphics card to perform fusion processing on the first point cloud data and the second point cloud data respectively.
[0013] In a third aspect, an embodiment of the present application further provides an electronic device, comprising: an independent graphics card, an integrated graphics card, a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is executed by the independent graphics card and / or the integrated graphics card and / or the processor, the independent graphics card and / or the integrated graphics card and / or the processor executes any one of the above-described three-dimensional scanning methods.
[0014] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein a computer program is stored in the storage medium. When the computer program is executed by an independent graphics card and / or an integrated graphics card and / or a processor, the three-dimensional scanning method described in any one of the above items is implemented.
[0015] The three-dimensional scanning method provided by the embodiment of the present application, the electronic device includes an independent graphics card and an integrated graphics card, and the three-dimensional scanning method includes: calling the independent graphics card to obtain the scanning data corresponding to the target object, and converting the scanning data into point cloud data; generating a rotation displacement matrix according to the scanning data; based on the point cloud data and the rotation displacement matrix, calling the integrated graphics card to generate a point cloud fusion result. The above method calls the independent graphics card to execute the reconstruction algorithm, and calls the integrated graphics card to execute the fusion algorithm, so that the reconstruction process and the fusion process of different frame scan images can be parallel, thereby improving the efficiency of three-dimensional scanning and reducing the time consumption of three-dimensional scanning. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0017] Figure 1 It is a schematic diagram of an application scenario of the three-dimensional scanning method provided in an embodiment of the present application.
[0018] Figure 2 This is a diagram of application equipment of the three-dimensional scanning method provided in an embodiment of the present application.
[0019] Figure 3 It is a structural equipment diagram of a three-dimensional scanning system provided in an embodiment of the present application.
[0020] Figure 4 It is a schematic flow chart of the three-dimensional scanning method provided in an embodiment of the present application.
[0021] Figure 5 This is a flowchart of the calling method of the first thread provided in an embodiment of the present application.
[0022] Figure 6 This is a flow chart of the calling method of the second thread provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0024] In the following, 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 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 the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.
[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 in the technical field in this application. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. It should be understood that, unless otherwise specified in this application, "at least one" refers to one or more. "Multiple" refers to two or more than two. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c seven situations.
[0026] Three-dimensional scanning technology is an important research direction in the field of computer vision technology and graphics and image processing. It has broad application prospects in autonomous driving, robot autonomous navigation, cultural relics protection, architectural design, clinical medicine, etc. At present, most three-dimensional scanning algorithms rely on the GPU resources of independent graphics cards in electronic devices. However, in actual use, in addition to the three-dimensional scanning algorithm, there are many functions (such as web browsing, document editing, etc.) that will also occupy the GPU resources of electronic devices, resulting in the need to queue up for three-dimensional scanning tasks and the limited frame rate of three-dimensional scanning; in addition, the model of the independent graphics card in the electronic device determines the size of the video memory, and the size of the video memory limits the amount of data for three-dimensional scanning. If you want to increase the video memory, you need to replace the independent graphics card of the electronic device, which is time-consuming. In summary, due to the limitation of GPU resources, the current three-dimensional scanning takes a long time.
[0027] In view of the above problems, in order to solve the problem of long time consumption of three-dimensional scanning, the embodiments of the present application provide a three-dimensional scanning method, a three-dimensional scanning system, an electronic device and a storage medium. By calling an independent graphics card to execute the reconstruction algorithm in three-dimensional scanning, and calling an integrated graphics card to execute the fusion algorithm, the reconstruction process and the fusion process of different frame scanned images can be carried out in parallel, thereby reducing the time consumption of three-dimensional scanning.
[0028] Figure 1 Schematic diagram of the application scenario of the three-dimensional scanning method provided in the embodiment of the present application. Figure 1 As shown, the application scenario at least includes a scanning device 10, a target object, and an electronic device 20, wherein the scanning device 10 can provide different projection lights, for example, the scanning device 10 can include at least one of a laser device whose projection light is laser or a speckle device whose projection light is speckle. The embodiment of the present application takes the scanning device 10 as a laser device to scan the target object as an example. The target object can be an object of various shapes, for example, the target object can be a car, a human head, a mechanical part, etc., and the embodiment of the present application takes the target object as an example of a human head. The electronic device 20 can include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants, tablet computers, portable multimedia players, vehicle terminals (such as vehicle navigation terminals), wearable electronic devices, and devices with data processing functions such as digital TVs, desktop computers, smart home devices, etc. In some embodiments, the number of scanning devices 10 can be one or more, which is not limited here. The embodiment of the present application takes the number of scanning devices as one as an example.
[0029] In some embodiments, the scanning device 10 is connected to the electronic device 20 for communication, and the scanning device 10 scans the surface of the target object to obtain at least one frame of scanned image of the target object, and then sends the at least one frame of scanned image to the electronic device 20, and the electronic device 20 performs three-dimensional scanning processing based on the at least one frame of scanned image to obtain a three-dimensional model of the target object. In other embodiments, the scanning device 10 scans the surface of the target object to obtain at least one frame of scanned image of the target object, and analyzes each frame of scanned image to obtain image features, and then sends the image features to the electronic device 20, and the electronic device 20 performs three-dimensional scanning processing based on the image features to obtain a three-dimensional model of the target object. Among them, the communication connection mode includes wired communication connection and wireless communication connection, and the wired communication connection can include one or more wired communication solutions such as Universal Serial Bus (USB) and Controller Area Network (CAN). The wireless communication connection may include one or more wireless communication solutions such as Wireless Fidelity (Wi-Fi), Bluetooth (BT), mobile communication network, Frequency Modulation (FM), Near Field Communication (NFC), and Infrared (IR).
[0030] It should be understood that the above description is only an illustrative example of the application scenario of the three-dimensional scanning method in the embodiment of the present application. In some other embodiments, the application scenario may have more or fewer components, or some components may be replaced. For example, in other embodiments, the scanning device may integrate the function of scanning the target object and the function of processing the scanned image to obtain a three-dimensional model of the target object.
[0031] Figure 2 : is an application device diagram of the three-dimensional scanning method provided in the embodiment of the present application. Figure 2 As shown, the electronic device 20 includes an independent graphics card 21, an integrated graphics card 22, a memory 23, at least one processor 24 and at least one communication bus 25. The independent graphics card 21 and / or the integrated graphics card 22 and / or the processor 24 are used to implement a three-dimensional scanning method when executing a computer program stored in the memory 23. The at least one communication bus 25 is configured to implement connection and communication between the memory 23 and the independent graphics card 21 and / or the integrated graphics card 22 and / or the processor 24.
[0032] Figure 2The structure of the electronic device shown does not constitute a limitation on the embodiments of the present application. The electronic device 20 may also include more or less other hardware or software than shown in the figure, or a different arrangement of components.
[0033] In some embodiments of the present application, the electronic device 20 can also be connected to a client device, which includes but is not limited to any electronic product that can interact with a user through a keyboard, mouse, remote control, touchpad or voice control device, such as a personal computer, a tablet computer, a smart phone, a digital camera, etc.
[0034] It should be noted that the electronic device 20 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.
[0035] In some embodiments, the electronic device 20 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0036] Figure 3 : is a structural equipment diagram of a three-dimensional scanning system provided in an embodiment of the present application. Figure 3 As shown, the three-dimensional scanning system 30 may include multiple functional modules composed of computer program segments. The computer programs of the various program segments in the three-dimensional scanning system 30 may be stored in the memory 23 of the electronic device 20 and executed by the independent graphics card 21 and / or the integrated graphics card 22 and / or the processor 24 to perform the three-dimensional scanning function.
[0037] In some embodiments, the three-dimensional scanning system 30 may be divided into a plurality of functional modules according to the functions it performs, and the functional modules may include: a reconstruction module 31 , a tracking module 32 and a fusion module 33 .
[0038] The module referred to in this application refers to a series of computer program segments that can be executed by the independent graphics card 21 and / or the integrated graphics card 22 and / or the processor 24 and can complete fixed functions, which are stored in the memory 23. Exemplarily, the reconstruction module 31, the tracking module 32 and the fusion module 33 can be set in the memory 23 of the electronic device 20, and then the independent graphics card 21 is called to execute the computer program segment in the reconstruction module 31, the processor 24 is called to execute the computer program segment in the tracking module 32, and the integrated graphics card 22 is called to execute the computer program segment in the fusion module 33. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0039] The reconstruction module 31 is used to obtain scanning data corresponding to the target object and convert the scanning data into point cloud data.
[0040] The tracking module 32 is used to generate a rotation displacement matrix according to the scanning data.
[0041] The fusion module 33 is used to generate a point cloud fusion result of the target object according to the point cloud data and the rotation displacement matrix, and to generate a three-dimensional model of the target object according to the point cloud fusion result.
[0042] In some embodiments, the three-dimensional scanning system 30 also includes a thread creation module 34, which is used to create a first thread and a second thread, wherein the first thread is used to control the independent graphics card to call the reconstruction module 31; the second thread is used to control the integrated graphics card to call the fusion module 33.
[0043] In some embodiments, the first thread is used to call the independent graphics card to convert the scanned image of the current frame into first point cloud data based on the scanned data and send the first point cloud data to the integrated graphics card, and call the independent graphics card to continue to convert the scanned image of the next frame into second point cloud data based on the scanned data until all the scanned images of the frames are converted into point cloud data. The second thread is used to call the integrated graphics card to perform fusion processing on the first point cloud data and the second point cloud data respectively.
[0044] It can be understood that the three-dimensional scanning system 30 and the three-dimensional scanning method of the above-mentioned embodiment belong to the same inventive concept, and the specific implementation method of each module of the three-dimensional scanning system 30 corresponds to the various steps of the three-dimensional scanning method in the above-mentioned embodiment, which will not be repeated in this application.
[0045] The module division described above is a logical function division, and there may be other division methods in actual implementation. In addition, the functional modules in each embodiment of the present application may be integrated in the same processing unit, or each module may exist physically separately, or two or more modules may be integrated in the same unit. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0046] The above-mentioned three-dimensional scanning system provided in the embodiment of the present application calls the independent graphics card to execute the computer program segment in the reconstruction module, and calls the integrated graphics card to execute the computer program segment in the fusion module, so that the reconstruction process and the fusion process of different frame scan images can be carried out in parallel, thereby reducing the time consumption of three-dimensional scanning.
[0047] The present application will describe the technical solution of the present application in detail through specific embodiments below. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0048] Figure 4is a schematic flow chart of the three-dimensional scanning method provided in the embodiment of the present application. Figure 4 As shown, the three-dimensional scanning method is applied to an electronic device, comprising the following steps:
[0049] S11, calling the independent graphics card to obtain scanning data corresponding to the target object, and converting the scanning data into point cloud data.
[0050] In at least one embodiment of the present application, the target object may be an object of various shapes, for example, the target object may be a human head, a car, a mechanical part, etc. In one embodiment, the scan data may be an image obtained by scanning the target object from a plurality of preset different shooting angles using a scanning device, for example, the scanning device scans the front and side of the target object respectively to obtain multiple frames of scanned images; in other embodiments, the scan data may also be image features obtained by analyzing the multiple frames of scanned images by the scanning device, and the image features may include edge features, corner features, color features, depth features, photometric features, and geometric features, etc. Among them, the direction that can collect the complete facial information of the target object is called the front, and the direction that only collects part of the facial information of the target object is called the side, and the complete facial information may include human eyes, nose, mouth, and ears.
[0051] In at least one embodiment of the present application, the scanning data is taken as a scanning image for example. After scanning the scanning image of the target object, the scanning device sends the scanning image to the electronic device, and the electronic device calls the independent graphics card to obtain the scanning image of the target object, and converts the scanning image into point cloud data. Wherein, point cloud data refers to a three-dimensional data structure composed of a large number of points, and each point generally includes its position information, color information, and intensity information in a three-dimensional coordinate system. In some embodiments, the calling of the independent graphics card to obtain the scanning data corresponding to the target object and converting the scanning data into point cloud data may include: calling the independent graphics card to determine the depth information of each pixel in the scanning image based on the scanning data; determining the three-dimensional coordinates of each pixel in the three-dimensional space based on the depth information and the preset scanning parameters; and using the three-dimensional coordinates of all pixels as the point cloud data of the scanning image. Wherein, the scanning parameters refer to the relevant parameter information of the scanning device, such as focal length, principal point coordinates, and other information.
[0052] S12, generating a rotation displacement matrix according to the scan data.
[0053] In at least one embodiment of the present application, the rotation displacement matrix is used to describe the change information of the position and direction of the scanning device relative to the target object during the entire scanning process, and the rotation displacement matrix includes the relative rotation and displacement between each two frames of scanned images. In some embodiments, the generation of the rotation displacement matrix according to the scanning data may include: acquiring multiple marker points in each frame of the scanned image based on the scanning data; comparing the marker points of two adjacent frames of the scanned image to determine the position information of the same marker points in the two adjacent frames of the scanned image; determining the motion trajectory of the same marker points according to the position information, and generating the rotation displacement matrix according to the motion trajectory. Among them, the marker points of each frame of the scanned image can be extracted using a scale-invariant feature change algorithm. According to the matched marker points, the least squares method or other optimization algorithm is used to calculate the rotation parameters and translation parameters from one perspective to another, the rotation matrix is formed by the rotation parameters, the translation vector is formed by the translation parameters, and the rotation displacement matrix is formed according to the rotation matrix and the translation vector. Among them, the rotation matrix is used to represent the angle change of the scanning device between different perspectives, and the rotation matrix can be a 3x3 matrix used to describe the rotation of the target object in space, and the rotation matrix includes information about the rotation of the marker points around the X, Y and Z axes. The translation vector is used to describe the change in the position of the scanning device. The translation vector can be a 3x1 vector that describes the translation of the target object in space. The translation vector includes the movement distance of the marker point in the X, Y and Z axis directions.
[0054] In some embodiments, the data processing process of generating a rotation displacement matrix based on the scan data does not need to occupy GPU resources. In this way, the processor in the electronic device can be used to execute the process of generating a rotation displacement matrix based on the scan data, which can avoid wasting GPU resources and improve resource utilization.
[0055] S13, based on the point cloud data and the rotation displacement matrix, calling the integrated graphics card to generate a point cloud fusion result, and generating a three-dimensional model of the target object according to the point cloud fusion result.
[0056] In at least one embodiment of the present application, the integrated graphics card is called to apply the rotation displacement matrix to the point cloud data, and the point cloud data is transformed into the target coordinate system through matrix multiplication to achieve correct alignment and fusion of the point cloud data, and obtain a point cloud fusion result. In some embodiments, when the scanned image is multiple frames, there is corresponding point cloud data for each frame of the scanned image, and the point cloud data of each frame of the scanned image is transformed into the target coordinate system through the rotation displacement matrix to obtain a point cloud fusion result corresponding to each frame of the scanned image; then a three-dimensional model of the target object is generated based on the multiple point cloud fusion results.
[0057] In the three-dimensional scanning method provided in the embodiment of the present application, by calling the independent graphics card to execute the reconstruction algorithm in the three-dimensional scanning, and calling the integrated graphics card to execute the fusion algorithm, the reconstruction process and the fusion process of different frame scan images can be carried out in parallel, thereby reducing the time consumption of three-dimensional scanning.
[0058] In some embodiments, the video memory that can be used by the integrated graphics card is half of the memory of the electronic device. For example, if the electronic device has 64GB of memory, the integrated graphics card can use 32GB of video memory; and the electronic device can be provided with a card slot for increasing the memory. Based on the above characteristics, the independent graphics card and the integrated graphics card are used together to realize three-dimensional scanning, avoiding the problem of limited scanning frame rate caused by using the independent graphics card to execute the entire algorithm flow of three-dimensional scanning, and using the integrated graphics card to execute the relevant algorithm flow of three-dimensional scanning can increase the amount of scanning data, improve the efficiency of three-dimensional scanning, and reduce the time consumption of three-dimensional scanning.
[0059] In some embodiments, when a three-dimensional scanning process is implemented by using an independent graphics card and an integrated graphics card together, the method further includes: determining multiple algorithm processes corresponding to the three-dimensional scanning process and the algorithm type corresponding to each algorithm process; determining the type of video memory requirement corresponding to each algorithm process; determining the matching graphics card type according to the algorithm type and the type of video memory requirement, and calling the graphics card corresponding to the graphics card type to execute the corresponding algorithm process. Among them, the algorithm process may include a reconstruction process (such as the process described in step S11), a tracking process (such as the process described in step S12), and a fusion process (such as the process described in step S13). The algorithm type may include a computationally intensive algorithm and a memory-intensive algorithm. The video memory requirement type includes a fixed video memory requirement and an incremental video memory requirement. In some embodiments, determining the matching graphics card type according to the algorithm type and the video memory requirement type, and executing the corresponding algorithm process according to the graphics card corresponding to the graphics card type may also include: when the algorithm type is a computationally intensive algorithm and the video memory requirement type is a fixed video memory requirement, determining the graphics card type is an independent graphics card, and calling the independent graphics card to execute the reconstruction process; when the algorithm type is a memory-intensive algorithm and the video memory requirement type is an incremental video memory requirement, determining the graphics card type is an integrated graphics card, and calling the integrated graphics card to execute the fusion process. The embodiment of the present application determines the required video memory according to the algorithm type and video memory requirement type of each algorithm process, uses an independent graphics card to execute computationally intensive algorithms, and uses an integrated graphics card to execute memory access intensive algorithms, thereby improving the accuracy of the use of independent graphics cards and integrated graphics cards, thereby improving the efficiency of three-dimensional scanning and reducing the time consumption of three-dimensional scanning.
[0060] In at least one embodiment of the present application, multi-threaded scheduling of independent graphics cards and integrated graphics cards can be used to achieve parallel processing of reconstruction processes and fusion processes, thereby improving the efficiency of three-dimensional scanning and reducing the time consumption of three-dimensional scanning. Figure 51 is a flowchart of a method for calling a first thread provided in an embodiment of the present application, and the method for calling a first thread is applied to an electronic device. Figure 5 As shown, the following steps are included:
[0061] S21, creating a first thread for calling the independent graphics card.
[0062] S22, using the first thread to call the independent graphics card to convert the scanned image of the current frame into first point cloud data based on the scanned data and send the first point cloud data to the integrated graphics card, and call the independent graphics card to continue to convert the scanned image of the next frame into second point cloud data based on the scanned data, until the scanned images of all frames are converted into point cloud data.
[0063] In at least one embodiment of the present application, when the scanned image is multiple frames, the first thread is used to call the independent graphics card to convert the scanned image of the current frame into the first point cloud data based on the scanned data, and the first point cloud data is sent to the integrated graphics card, and the integrated graphics card transforms the first point cloud data into the target coordinate system according to the first point cloud data and the rotation displacement matrix, so as to achieve the correct alignment and fusion of the first point cloud data and obtain the first point cloud fusion result. At the same time, after the first thread reconstructs the scanned image of the current frame, it calls the independent graphics card to continue to reconstruct the scanned image of the next frame based on the scanned data to obtain the second point cloud data, and sends the second point cloud data to the integrated graphics card, and the integrated graphics card transforms the second point cloud data into the target coordinate system according to the second point cloud data and the rotation displacement matrix, so as to achieve the correct alignment and fusion of the second point cloud data and obtain the second point cloud fusion result, so as to achieve the fusion process of the scanned image of the current frame and the reconstruction process of the scanned image of the next frame in parallel; and so on, until the first thread calls the independent graphics card to convert the scanned images of all frames into point cloud data.
[0064] The embodiment of the present application utilizes the first thread to call the independent graphics card to execute the reconstruction process for each frame of the scanned image, and can also call the integrated graphics card to execute the fusion process for the scanned image, thereby avoiding the problem in the prior art that the independent graphics card cannot concurrently execute the reconstruction process and the fusion process for multiple frames of scanned images, thereby improving the efficiency of three-dimensional scanning and reducing the time consumption of three-dimensional scanning.
[0065] Figure 6 1 is a flow chart of a method for calling a second thread provided in an embodiment of the present application, and the method for calling a second thread is applied to an electronic device. Figure 6 As shown, the following steps are included:
[0066] S31, creating a second thread for calling the integrated graphics card.
[0067] S32: Use the second thread to call the integrated graphics card to perform fusion processing on the first point cloud data and the second point cloud data respectively.
[0068] In at least one embodiment of the present application, when the second thread receives the first point cloud data sent by the first thread, the second thread calls the integrated graphics card to fuse the first point cloud data with the rotation displacement matrix to obtain a first point cloud fusion result; thereafter, when the second thread receives the second point cloud data sent by the first thread, the second thread calls the integrated graphics card to fuse the second point cloud data with the rotation displacement matrix to obtain a second point cloud fusion result; and so on, until the second thread receives the Nth point cloud data sent by the first thread, the second thread calls the integrated graphics card to fuse the Nth point cloud data with the rotation displacement matrix to obtain the Nth point cloud fusion result, where N is a natural number greater than 1.
[0069] The embodiment of the present application utilizes the second thread to call the integrated graphics card to execute a fusion process on the point cloud data corresponding to each frame of the scanned image, and at the same time, can call the independent graphics card to execute the reconstruction process on the scanned image, thereby realizing parallel processing of the reconstruction process and the fusion process, improving the efficiency of three-dimensional scanning, and reducing the time consumption of three-dimensional scanning.
[0070] then Figure 2 The description of the electronic device is that a computer program is stored in the memory 23, and when the computer program is executed by the independent graphics card 21 and / or the integrated graphics card 22 and / or the processor 24, all or part of the steps in the three-dimensional scanning method are implemented. The memory 23 includes a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc memory, magnetic disk memory, magnetic tape memory, or any other computer-readable medium that can be used to carry or store data.
[0071] 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 electronic device 10, etc.
[0072] In some embodiments, at least one processor 24 is the control core (Control Unit) of the electronic device 10, and uses various interfaces and lines to connect various components of the entire electronic device 10, and executes various functions and processes data of the electronic device 10 by running or executing programs or modules stored in the memory 23, and calling data stored in the memory 23. For example, when at least one processor 24 executes the computer program stored in the memory, it implements all or part of the steps of the three-dimensional scanning method in the embodiment of the present application; or implements all or part of the functions of the three-dimensional scanning device. At least one processor 24 can be composed of an integrated circuit, for example, it can be composed of a single packaged integrated circuit, or it can be composed of multiple 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.
[0073] 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, including a number of instructions for enabling an electronic device (which can be a personal computer, electronic device, or network device, etc.) or a processor to execute parts of the methods of various embodiments of the present application.
[0074] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation.
[0075] 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, and 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.
[0076] 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.
[0077] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is limited by the attached claims rather than the above description, so it is intended to include all changes that fall within the meaning and scope of the equivalent elements of the claims in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "including" does not exclude other units or, 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 particular order.
[0078] 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 scanning method, applied to electronic equipment, characterized in that: The electronic device includes an independent graphics card and an integrated graphics card, and the three-dimensional scanning method includes: Calling the independent graphics card to obtain scanning data corresponding to the target object, and converting the scanning data into point cloud data; generating a rotational displacement matrix according to the scan data; Based on the point cloud data and the rotation displacement matrix, the integrated graphics card is called to generate a point cloud fusion result, and a three-dimensional model of the target object is generated according to the point cloud fusion result.
2. The three-dimensional scanning method according to claim 1, characterized in that: The method further comprises: Determine multiple algorithm processes corresponding to the three-dimensional scanning process and the algorithm type corresponding to each algorithm process; Determine the video memory requirement type corresponding to each algorithm process; Determining a matching graphics card type according to the algorithm type and the graphics memory requirement type; Call the graphics card corresponding to the graphics card type to execute the corresponding algorithm process.
3. The three-dimensional scanning method according to claim 2, characterized in that: The determining a matching graphics card type according to the algorithm type and the graphics memory requirement type includes: When the algorithm type is a computationally intensive algorithm and the video memory requirement type is a fixed video memory requirement, determining that the graphics card type is an independent graphics card; When the algorithm type is a memory access intensive algorithm and the video memory requirement type is a video memory requirement increment, it is determined that the graphics card type is an integrated graphics card.
4. The three-dimensional scanning method according to claim 1, characterized in that: The method further comprises: Creating a first thread for calling the independent graphics card; and The first thread is used to call the independent graphics card to convert the scanned image of the current frame into first point cloud data based on the scanned data and send the first point cloud data to the integrated graphics card, and the independent graphics card is called to continue to convert the scanned image of the next frame into second point cloud data based on the scanned data until the scanned images of all frames are converted into point cloud data.
5. The three-dimensional scanning method according to claim 4, characterized in that: The method further comprises: Creating a second thread for calling the integrated graphics card; The second thread is used to call the integrated graphics card to perform fusion processing on the first point cloud data and the second point cloud data respectively.
6. The three-dimensional scanning method according to claim 5, characterized in that: The using the second thread to call the integrated graphics card to perform fusion processing on the first point cloud data and the second point cloud data respectively includes: Based on the first point cloud data and the rotation displacement matrix, using the second thread to call the integrated graphics card to generate a first point cloud fusion result; Based on the second point cloud data and the rotation displacement matrix, the second thread is used to call the integrated graphics card to generate a second point cloud fusion result.
7. A three-dimensional scanning system, applied to electronic equipment, characterized in that: The electronic device includes an independent graphics card and an integrated graphics card; the three-dimensional scanning system includes: a reconstruction module, a tracking module and a fusion module, wherein: The reconstruction module is used to obtain the scan data corresponding to the target object and convert the scan data into point cloud data, and the reconstruction module is called by the independent graphics card; The tracking module is used to generate a rotation displacement matrix according to the scanning data; The fusion module is used to generate a point cloud fusion result of the target object according to the point cloud data and the rotation displacement matrix, and to generate a three-dimensional model of the target object according to the point cloud fusion result; the fusion module is called by the integrated graphics card.
8. The three-dimensional scanning system according to claim 7, characterized in that: The three-dimensional scanning system further includes a thread creation module, wherein the thread creation module is used to create a first thread and a second thread, wherein: The first thread is used to call the independent graphics card to convert the scanned image of the current frame into first point cloud data based on the scanned data and send the first point cloud data to the integrated graphics card, and call the independent graphics card to continue to convert the scanned image of the next frame into second point cloud data based on the scanned data until all the scanned images of the frames are converted into point cloud data; The second thread is used to call the integrated graphics card to perform fusion processing on the first point cloud data and the second point cloud data respectively.
9. An electronic device, characterized in that: include: An independent graphics card, an integrated graphics card, a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the independent graphics card and / or the integrated graphics card and / or the processor, the independent graphics card and / or the integrated graphics card and / or the processor executes the three-dimensional scanning method described in any one of claims 1-6.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by an independent graphics card and / or an integrated graphics card and / or a processor, the three-dimensional scanning method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Three-dimensional scanning method and system, electronic device, and storage medium
WO2026012445A1
