Three-dimensional scanning method and system, electronic device, and storage medium
By enabling the collaborative work of discrete and integrated graphics cards, parallel processing of the 3D scanning process is achieved, solving the problem of long 3D scanning time and improving scanning efficiency and data volume.
Patent Information
- Application Number
- PCT/CN2025/107979
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-11
- Filing Date
- 2025-07-10
- Publication Date
- 2026-01-15
AI Technical Summary
Existing 3D scanning technology is time-consuming and limited by GPU resources, resulting in frame rate limitations and data volume restrictions due to video memory size limitations. Increasing video memory requires replacing the dedicated graphics card, which is a time-consuming operation.
By calling the discrete graphics card to execute the reconstruction algorithm and the integrated graphics card to execute the fusion algorithm, the reconstruction and fusion processes of different frame scan images are parallelized, and multi-threaded scheduling is used to improve efficiency.
It reduces the time required for 3D scanning, improves scanning efficiency, avoids the problem of limited video memory size due to the specific graphics card model, and achieves higher scanning data volume and frame rate.
Smart Images

Figure CN2025107979_15012026_PF_FP_ABST
Abstract
Description
3D scanning methods, systems, electronic devices and storage media
[0001] This disclosure claims priority to Chinese Patent Application No. 202410928927.5, filed on July 11, 2024, entitled “Three-dimensional scanning method, system, electronic device and storage medium”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application belongs to the field of 3D scanning technology, and in particular relates to a 3D scanning method, system, electronic device and storage medium. Background Technology
[0003] 3D scanning technology is an important research direction in the fields of computer vision and graphics processing, and it has broad application prospects in autonomous driving, robot autonomous navigation, cultural relic protection, architectural design, and clinical medicine.
[0004] However, 3D scanning technology places high demands on the graphics processing unit (GPU) resources of electronic devices. In related technologies, 3D scanning is time-consuming due to limitations in GPU resources. Summary of the Invention
[0005] This application provides a three-dimensional scanning method, system, electronic device, and storage medium to solve the problem of long scanning time.
[0006] In a first aspect, embodiments of this application provide a three-dimensional scanning method applied to an electronic device, the electronic device including a discrete graphics card and an integrated graphics card, the three-dimensional scanning method including: calling the discrete graphics card to obtain scanning data corresponding to the target object, converting the scanning data into point cloud data, generating a rotation displacement matrix based on the scanning data, calling the integrated graphics card to generate a point cloud fusion result based on the point cloud data and the rotation displacement matrix, and generating a three-dimensional model of the target object based on the point cloud fusion result.
[0007] In some embodiments, the three-dimensional scanning method provided in this application further includes: determining multiple algorithm flows corresponding to the three-dimensional scanning process and the algorithm type corresponding to each algorithm flow; determining the video memory requirement type corresponding to each algorithm flow; determining the matching graphics card type according to the algorithm type and the video memory requirement type; and calling the graphics card corresponding to the graphics card type to execute the corresponding algorithm flow.
[0008] In some embodiments, in the three-dimensional scanning method provided in this application, determining the matching graphics card type based on the algorithm type and the memory requirement type includes: when the algorithm type is a computationally intensive algorithm and the memory requirement type is fixed, determining the graphics card type as a discrete graphics card; when the algorithm type is a memory-intensive algorithm and the memory requirement type is incremental, determining the graphics card type as an integrated graphics card.
[0009] In some embodiments, the three-dimensional scanning method provided in this application further includes: creating a first thread for calling a discrete graphics card, using the first thread to call the discrete graphics card to convert the scanned image of the current frame into first point cloud data based on the scanned data and sending the first point cloud data to the integrated graphics card, calling the discrete 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.
[0010] In some embodiments, the three-dimensional scanning method provided in this application further includes: creating a second thread for calling the integrated graphics card, and 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.
[0011] In some embodiments, in the three-dimensional scanning method provided in this application, the second thread calls the integrated graphics card to perform fusion processing on the first point cloud data and the second point cloud data respectively, including: generating the first point cloud fusion result by calling the integrated graphics card using the second thread based on the first point cloud data and the rotation displacement matrix, and generating the second point cloud fusion result by calling the integrated graphics card using the second thread based on the second point cloud data and the rotation displacement matrix.
[0012] Secondly, embodiments of this application also provide a three-dimensional scanning system applied to an electronic device. The electronic device includes a discrete graphics card and an integrated graphics card. The three-dimensional scanning system includes a reconstruction module, a tracking module, and a fusion module. The reconstruction module is configured to acquire scanning data corresponding to a target object and convert the scanning data into point cloud data. The reconstruction module is called by the discrete graphics card. The tracking module is configured to generate a rotation and displacement matrix based on the scanning data. The fusion module is configured to generate a point cloud fusion result of the target object based on the point cloud data and the rotation and 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.
[0013] In some embodiments, the three-dimensional scanning system provided in this application further includes a thread creation module. The thread creation module is configured to create a first thread and a second thread. The first thread is configured to call the discrete 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. The discrete graphics card is then called to continue converting the scanned image of the next frame into second point cloud data based on the scanned data, until all frames of scanned images are converted into point cloud data. The second thread is configured to call the integrated graphics card to perform fusion processing on the first point cloud data and the second point cloud data respectively.
[0014] Thirdly, embodiments of this application also provide an electronic device, including: a discrete 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 discrete graphics card and / or the integrated graphics card and / or the processor, the discrete graphics card and / or the integrated graphics card and / or the processor executes any of the above-mentioned three-dimensional scanning methods.
[0015] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a discrete graphics card and / or an integrated graphics card and / or a processor, implements the three-dimensional scanning method described above.
[0016] The 3D scanning method provided in this application is applied to an electronic device, which includes a discrete graphics card and an integrated graphics card. The 3D scanning method includes: calling the discrete graphics card to acquire scanning data corresponding to the target object, converting the scanning data into point cloud data, generating a rotation and displacement matrix based on the scanning data, and calling the integrated graphics card to generate a point cloud fusion result based on the point cloud data and the rotation and displacement matrix. The above method, by calling the discrete graphics card to execute the reconstruction algorithm and the integrated graphics card to execute the fusion algorithm, enables the reconstruction and fusion processes of different frames of scanned images to be performed in parallel, improving the efficiency of 3D scanning and reducing the time consumption of 3D scanning. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 is a schematic diagram of the application scenario of the three-dimensional scanning method provided in the embodiments of this application.
[0019] Figure 2 is a diagram of the application equipment for the three-dimensional scanning method provided in the embodiments of this application.
[0020] Figure 3 is a structural diagram of the three-dimensional scanning system provided in an embodiment of this application.
[0021] Figure 4 is a schematic flowchart of the three-dimensional scanning method provided in the embodiments of this application.
[0022] Figure 5 is a flowchart of the invocation method of the first thread provided in an embodiment of this application.
[0023] Figure 6 is a flowchart of the second thread invocation method provided in an embodiment of this application. Detailed Implementation
[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0025] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this application's specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It should be understood that, unless otherwise stated, "at least one" means one or more. "More than one" means two or more. For example, at least one of a, b, or c can represent seven cases: a, b, c, a and b, a and c, b and c, and a, b, and c.
[0027] 3D scanning technology is an important research direction in computer vision and image processing, with broad application prospects in autonomous driving, robot navigation, cultural relic preservation, architectural design, and clinical medicine. Currently, most 3D scanning algorithms rely on the GPU resources of dedicated graphics cards in electronic devices. However, in practical use, many other functions (such as web browsing and document editing) also consume GPU resources, causing 3D scanning tasks to queue and limiting the frame rate. Furthermore, the model of the dedicated graphics card in an electronic device determines the amount of video memory, which limits the amount of data that can be scanned in 3D. Increasing video memory requires replacing the dedicated graphics card, which is time-consuming. In summary, due to limitations in GPU resources, current 3D scanning processes are relatively time-consuming.
[0028] In view of the above problems, in order to solve the problem of long time consumption in 3D scanning, this application provides a 3D scanning method, a 3D scanning system, an electronic device and a storage medium. By calling the discrete graphics card to execute the reconstruction algorithm in 3D scanning and calling the integrated graphics card to execute the fusion algorithm, the reconstruction process and fusion process of different frame scan images can be carried out in parallel, thereby reducing the time consumption of 3D scanning.
[0029] Figure 1 is a schematic diagram of an application scenario of the three-dimensional scanning method provided in this application embodiment. As shown in Figure 1, the application scenario includes at least a scanning device 10, a target object, and an electronic device 20. 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 a laser or a speckle device whose projection light is a speckle. This application embodiment uses a laser device to scan a 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. This application embodiment uses a human head as an example. The electronic device 20 can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants, tablets, portable multimedia players, vehicle terminals (e.g., vehicle navigation terminals), wearable electronic devices, and devices with data processing functions such as digital TVs, desktop computers, and smart home devices. In some embodiments, the number of scanning devices 10 can be one or more, without limitation. This application embodiment uses a single scanning device as an example.
[0030] In some embodiments, the scanning device 10 is communicatively connected to the electronic device 20. 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. 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. Then, the image features are sent 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. The communication connection method includes wired communication connection and wireless communication connection. The wired communication connection can include one or more wired communication solutions such as Universal Serial Bus (USB) and Controller Area Network (CAN). Wireless communication connectivity can include one or more of the following wireless communication solutions: Wireless Fidelity (Wi-Fi), Bluetooth (BT), mobile communication networks, Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), etc.
[0031] It should be understood that the above description is merely an illustrative example of the application scenarios of the three-dimensional scanning method in this application. In other embodiments, the application scenarios 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 a target object and the function of processing the scanned image to obtain a three-dimensional model of the target object.
[0032] Figure 2 is an application device diagram of the three-dimensional scanning method provided in the embodiments of this application. As shown in Figure 2, the electronic device 20 includes a discrete graphics card 21, an integrated graphics card 22, a memory 23, at least one processor 24, and at least one communication bus 25. The discrete graphics card 21 and / or the integrated graphics card 22 and / or the processor 24 are configured to implement the three-dimensional scanning method when executing a computer program stored in the memory 23. The at least one communication bus 25 is configured to enable communication between the memory 23 and the discrete graphics card 21 and / or the integrated graphics card 22 and / or the processor 24.
[0033] The structure of the electronic device shown in Figure 2 does not constitute a limitation on the embodiments of this application. The electronic device 20 may also include more or fewer other hardware or software than shown in the figure, or different component arrangements.
[0034] In some embodiments of this application, the electronic device 20 may also be connected to a client device, which includes, but is not limited to, any electronic product that can interact with the user via a keyboard, mouse, remote control, touchpad or voice control device, such as a personal computer, tablet computer, smartphone, digital camera, etc.
[0035] It should be noted that electronic device 20 is only an example. Other existing or future electronic products that are suitable for this application should also be included within the scope of protection of this application and are incorporated herein by reference.
[0036] In some embodiments, the electronic device 20 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.
[0037] Figure 3 is a structural diagram of the three-dimensional scanning system provided in an embodiment of this application. As shown in Figure 3, the three-dimensional scanning system 30 may include multiple functional modules composed of computer program segments. The computer programs of each program segment in the three-dimensional scanning system 30 may be stored in the memory 23 of the electronic device 20 and executed by the discrete graphics card 21 and / or the integrated graphics card 22 and / or the processor 24 to perform the three-dimensional scanning function.
[0038] In some embodiments, the 3D scanning system 30 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: a reconstruction module 31, a tracking module 32, and a fusion module 33.
[0039] The term "module" in this application refers to a series of computer program segments that can be executed by a discrete graphics card 21 and / or an integrated graphics card 22 and / or a processor 24 and can perform a fixed function, and are stored in a memory 23. Exemplarily, the reconstruction module 31, the tracking module 32, and the fusion module 33 can be located in the memory 23 of the electronic device 20. Then, the discrete graphics card 21 is invoked to execute the computer program segments within the reconstruction module 31, the processor 24 is invoked to execute the computer program segments within the tracking module 32, and the integrated graphics card 22 is invoked to execute the computer program segments within the fusion module 33. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0040] The reconstruction module 31 is configured to acquire the scan data corresponding to the target object and convert the scan data into point cloud data.
[0041] The tracking module 32 is configured to generate a rotational displacement matrix based on the scan data.
[0042] The fusion module 33 is configured to generate a point cloud fusion result of the target object based on the point cloud data and the rotation displacement matrix, and to generate a three-dimensional model of the target object based on the point cloud fusion result.
[0043] In some embodiments, the 3D scanning system 30 further includes a thread creation module 34, which is configured to create a first thread and a second thread. The first thread is configured to control the discrete graphics card to call the reconstruction module 31, and the second thread is configured to control the integrated graphics card to call the fusion module 33.
[0044] In some embodiments, the first thread is configured to invoke the discrete graphics card to convert the scanned image of the current frame into first point cloud data based on the scan data, and to send the first point cloud data to the integrated graphics card. It also invokes the discrete graphics card to continue converting the scanned image of the next frame into second point cloud data based on the scan data, until all frames of scanned images are converted into point cloud data. The second thread is configured to invoke the integrated graphics card to perform fusion processing on the first point cloud data and the second point cloud data respectively.
[0045] It is understood that the three-dimensional scanning system 30 and the three-dimensional scanning method of the above embodiments belong to the same inventive concept. The specific implementation of each module of the three-dimensional scanning system 30 corresponds to each step of the three-dimensional scanning method in the above embodiments, and will not be repeated here.
[0046] The module division described above is a logical functional division, and other division methods may be used in actual implementation. Furthermore, the functional modules in the various embodiments of this application can be integrated into the same processing unit, or each module can exist physically separately, or two or more modules can be integrated into the same unit. The integrated modules described above can be implemented in hardware or in a combination of hardware and software functional modules.
[0047] The 3D scanning system provided in this application embodiment enables the reconstruction and fusion processes of different frame scan images to run in parallel by calling the computer program segment in the reconstruction module of the discrete graphics card and calling the computer program segment in the fusion module of the integrated graphics card, thereby reducing the time consumption of 3D scanning.
[0048] The technical solutions of this application will be described in detail below through specific embodiments. 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 again in some embodiments.
[0049] Figure 4 is a schematic flowchart of the three-dimensional scanning method provided in an embodiment of this application. As shown in Figure 4, the three-dimensional scanning method is applied to an electronic device and includes the following steps:
[0050] S11, the independent graphics card is called to obtain the scanning data corresponding to the target object, and the scanning data is converted into point cloud data.
[0051] In at least one embodiment of this application, the target object can be an object of various shapes, such as a human head, a car, or a mechanical part. In one embodiment, the scanning data can be images obtained by scanning the target object from multiple preset 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 scanning data can also be image features obtained by the scanning device based on the analysis of multiple frames of scanned images. Image features can include edge features, corner features, color features, depth features, luminance features, and geometric features. The direction that can capture complete facial information of the target object is called the front view, and the direction that only captures part of the facial information of the target object is called the side view. Complete facial information can include the eyes, nose, mouth, and ears.
[0052] In at least one embodiment of this application, the scanning data is described using a scanned image as an example. After scanning the image of the target object, the scanning device sends the scanned image to an electronic device. The electronic device then calls a dedicated graphics card to acquire the scanned image of the target object and converts the scanned image into point cloud data. Point cloud data refers to a three-dimensional data structure composed of a large number of points. Each point typically includes attributes such as its position information, color information, and intensity information in a three-dimensional coordinate system. In some embodiments, the step of calling the dedicated graphics card to acquire the scanned data corresponding to the target object and converting the scanned data into point cloud data may include: calling the dedicated graphics card to determine the depth information of each pixel in the scanned image based on the scanned data; determining the three-dimensional coordinates of each pixel in three-dimensional space based on the depth information and preset scanning parameters; and using the three-dimensional coordinates of all pixels as the point cloud data of the scanned image. The scanning parameters refer to relevant parameter information of the scanning device, such as focal length and principal point coordinates.
[0053] S12, Generate a rotational displacement matrix based on the scan data.
[0054] In at least one embodiment of this application, a rotational displacement matrix is used to describe the changes in position and orientation of the scanning device relative to the target object throughout the scanning process. The rotational displacement matrix includes the relative rotation and displacement between every two frames of scanned images. In some embodiments, generating the rotational displacement matrix based on the scan data may include: acquiring multiple marker points in each frame of scanned images based on the scan data, comparing the marker points in two adjacent frames of scanned images, determining the position information of the same marker points in the two adjacent frames of scanned images, determining the motion trajectory of the same marker points based on the position information, and generating the rotational displacement matrix based on the motion trajectory. The marker points in each frame of scanned images can be extracted using a scale-invariant feature change algorithm. Based on the matched marker points, the least squares method or other optimization algorithms are used to calculate the rotation parameters and translation parameters from one viewpoint to another. The rotation parameters form a rotation matrix, and the translation parameters form a translation vector. The rotational displacement matrix is then formed by combining the rotation matrix and the translation vector. The rotation matrix represents the angular changes of the scanning device between different viewpoints. The rotation matrix can be a 3x3 matrix used to describe the rotation of the target object in space, and it includes information about the rotation of the marker points around the X, Y, and Z axes. Translation vectors are used to describe changes in the position of the scanning device. A translation vector can be a 3x1 vector that describes the translation of the target object in space. The translation vector includes the distance the marker point moves in the X, Y, and Z axis directions.
[0055] In some embodiments, the data processing of generating a rotational displacement matrix based on the scan data does not require GPU resources. Thus, the process of generating a rotational displacement matrix based on the scan data can be executed by the processor within the electronic device, which can avoid wasting GPU resources and improve resource utilization.
[0056] S13, 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.
[0057] In at least one embodiment of this application, the integrated graphics card is invoked to apply a rotation and translation matrix to the point cloud data. The point cloud data is then transformed to the target coordinate system via matrix multiplication, achieving correct alignment and fusion of the point cloud data to obtain a point cloud fusion result. In some embodiments, when the scanned image consists of multiple frames, each frame contains corresponding point cloud data. The point cloud data of each frame is transformed to the target coordinate system using a rotation and translation matrix to obtain the point cloud fusion result corresponding to each frame. Subsequently, a three-dimensional model of the target object is generated based on the multiple point cloud fusion results.
[0058] In the three-dimensional scanning method provided in this application embodiment, by calling the discrete 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 fusion process of different frame scan images can be carried out in parallel, reducing the time consumption of three-dimensional scanning.
[0059] In some embodiments, the integrated graphics card can utilize half of the electronic device's RAM. For example, if the electronic device has 64GB of RAM, the integrated graphics card can use 32GB of video memory, and the electronic device can be equipped with a card slot to increase RAM. Based on these characteristics, using both a dedicated graphics card and an integrated graphics card to perform 3D scanning avoids the limited scanning frame rate caused by using the dedicated graphics card to execute the entire 3D scanning algorithm process. Furthermore, using the integrated graphics card to execute the relevant 3D scanning algorithm process can increase the amount of scanned data, improve the efficiency of 3D scanning, and reduce the time consumed in 3D scanning.
[0060] In some embodiments, when using both a discrete graphics card and an integrated graphics card to perform a 3D scanning process, the method further includes: determining multiple algorithm flows corresponding to the 3D scanning process and the algorithm type corresponding to each algorithm flow; determining the memory requirement type corresponding to each algorithm flow; determining the matching graphics card type based on the algorithm type and memory requirement type; and calling the graphics card corresponding to the graphics card type to execute the corresponding algorithm flow. The algorithm flow may include a reconstruction flow (as described in step S11), a tracking flow (as described in step S12), and a fusion flow (as described in step S13). The algorithm type may include computationally intensive algorithms and memory-intensive algorithms. The memory requirement type includes fixed memory requirements and incremental memory requirements. In some embodiments, determining the matching graphics card type based on the algorithm type and memory requirement type, and executing the corresponding algorithm flow based on the graphics card type, may further include: when the algorithm type is a computationally intensive algorithm and the memory requirement type is fixed, determining the graphics card type as a discrete graphics card and calling the discrete graphics card to execute the reconstruction flow; when the algorithm type is a memory-intensive algorithm and the memory requirement type is incremental, determining the graphics card type as an integrated graphics card and calling the integrated graphics card to execute the fusion flow. The embodiments of this application determine the required video memory based on the algorithm type and video memory requirement type of each algorithm process, utilize discrete graphics cards to execute computationally intensive algorithms, and utilize integrated graphics cards to execute memory-intensive algorithms, thereby improving the accuracy of the utilization of discrete and integrated graphics cards, thereby improving the efficiency of 3D scanning and reducing the time consumption of 3D scanning.
[0061] In at least one embodiment of this application, multi-threaded scheduling of discrete and integrated graphics cards can be used to achieve parallel processing of the reconstruction and fusion processes, improving the efficiency of 3D scanning and reducing the time consumption of 3D scanning. Figure 5 is a flowchart of the first thread invocation method provided in an embodiment of this application. The first thread invocation method is applied to an electronic device. As shown in Figure 5, it includes the following steps:
[0062] S21, Create a first thread for calling the discrete graphics card.
[0063] S22, the first thread calls the discrete graphics card to convert the scanned image of the current frame into first point cloud data based on the scanned data and sends the first point cloud data to the integrated graphics card. The discrete graphics card is then called to continue converting 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.
[0064] In at least one embodiment of this application, when the scanned image consists of multiple frames, the first thread calls the discrete graphics card to convert the scanned image of the current frame into first point cloud data based on the scanned data. The first point cloud data is then sent to the integrated graphics card, which uses the first point cloud data and a rotation / displacement matrix to transform it into the target coordinate system, achieving correct alignment and fusion of the first point cloud data to obtain a first point cloud fusion result. Simultaneously, after reconstructing the scanned image of the current frame, the first thread calls the discrete graphics card to continue reconstructing the scanned image of the next frame based on the scanned data, obtaining second point cloud data. This second point cloud data is then sent to the integrated graphics card, which uses the second point cloud data and a rotation / displacement matrix to transform it into the target coordinate system, achieving correct alignment and fusion of the second point cloud data to obtain a second point cloud fusion result. This allows the fusion process of the current frame's scanned image and the reconstruction process of the next frame's scanned image to proceed in parallel, frame by frame. This process continues until the first thread calls the discrete graphics card to convert all frames of scanned images into point cloud data.
[0065] This application embodiment utilizes a first thread to call a dedicated graphics card to perform a reconstruction process on each frame of scanned images. At the same time, it can call an integrated graphics card to perform a fusion process on the scanned images. This avoids the problem in the prior art that a dedicated graphics card cannot concurrently perform reconstruction and fusion processes on multiple frames of scanned images, thereby improving the efficiency of 3D scanning and reducing the time consumption of 3D scanning.
[0066] Figure 6 is a flowchart of the second thread invocation method provided in an embodiment of this application. The second thread invocation method is applied to an electronic device. As shown in Figure 6, it includes the following steps:
[0067] S31, Create a second thread for calling the integrated graphics card.
[0068] S32, the second thread calls the integrated graphics card to perform fusion processing on the first point cloud data and the second point cloud data respectively.
[0069] In at least one embodiment of this application, when the second thread receives the first point cloud data sent by the first thread, it calls the integrated graphics card to fuse the first point cloud data with the rotation and displacement matrix to obtain a first point cloud fusion result. Then, when the second thread receives the second point cloud data sent by the first thread, it calls the integrated graphics card to fuse the second point cloud data with the rotation and displacement matrix to obtain a second point cloud fusion result. This process continues until the second thread receives the Nth point cloud data sent by the first thread, at which point it calls the integrated graphics card to fuse the Nth point cloud data with the rotation and displacement matrix to obtain the Nth point cloud fusion result, where N is a natural number greater than 1.
[0070] In this embodiment, a second thread is used to call the integrated graphics card to perform a fusion process on the point cloud data corresponding to each frame of the scanned image. At the same time, a dedicated graphics card can be called to perform a reconstruction process on the scanned image, thereby achieving parallel processing of the reconstruction process and the fusion process, improving the efficiency of 3D scanning and reducing the time consumption of 3D scanning.
[0071] Continuing with the description of the electronic device in Figure 2, the memory 23 stores a computer program that, when executed by the discrete graphics card 21 and / or integrated graphics card 22 and / or processor 24, implements all or part of the steps in the 3D scanning method. The memory 23 includes read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.
[0072] In some embodiments, the computer-readable storage medium may primarily include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function, etc., and the stored data area may store data created based on the use of the electronic device 20, etc.
[0073] In some embodiments, at least one processor 24 is the control unit of the electronic device 20, connecting various components of the electronic device 20 via various interfaces and lines. It executes programs or modules stored in the memory 23 and calls data stored in the memory 23 to perform various functions and process data. For example, when at least one processor 24 executes a computer program stored in the memory, it implements all or part of the steps of the three-dimensional scanning method in this application embodiment, or implements all or part of the functions of the three-dimensional scanning device. At least one processor 24 may be composed of integrated circuits, such as a single-packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips.
[0074] The integrated unit implemented as a software functional module described above can be stored in a computer-readable storage medium. This software functional module, stored in a storage medium, includes several instructions to cause an electronic device (which may be a personal computer, electronic device, or network device, etc.) or processor to execute portions of the methods of the various embodiments of this application.
[0075] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.
[0076] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0077] Furthermore, the functional modules in the various embodiments of this 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 integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0078] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that it can be implemented in other specific forms without departing from the spirit or essential characteristics of this application. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within this application. No reference numerals in the claims should be construed as limiting the scope of the claims. Furthermore, it is clear that the word "comprising" does not exclude other elements or, and the singular does not exclude the plural. Multiple elements or devices recited in the specification may also be implemented by a single element or device through software or hardware. The terms "first," "second," etc., are used to indicate names and do not indicate any particular order.
[0079] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of this application without departing from the spirit and scope of the technical solutions of this application. Industrial applicability
[0080] The 3D scanning method disclosed herein is applied to electronic devices, including discrete graphics cards and integrated graphics cards. The method includes: using the discrete graphics card to acquire scan data corresponding to the target object, converting the scan data into point cloud data, generating a rotation-displacement matrix based on the scan data, and using the integrated graphics card to generate a point cloud fusion result based on the point cloud data and the rotation-displacement matrix. This method, by using the discrete graphics card to execute the reconstruction algorithm and the integrated graphics card to execute the fusion algorithm, enables the reconstruction and fusion processes of different frames of scanned images to be performed in parallel, improving the efficiency of 3D scanning, reducing the time consumption of 3D scanning, and possessing strong industrial applicability.
Claims
1. A three-dimensional scanning method applied to electronic devices, wherein, The electronic device includes a discrete graphics card and an integrated graphics card, and the 3D scanning method includes: The discrete graphics card is invoked to obtain the scan data corresponding to the target object, and the scan data is converted into point cloud data; Generate a rotational displacement matrix based on the scan data; Based on the point cloud data and the rotation displacement matrix, the integrated graphics card is invoked to generate a point cloud fusion result, and a three-dimensional model of the target object is generated based on the point cloud fusion result.
2. The three-dimensional scanning method as described in claim 1, wherein, The method further includes: Determine the multiple algorithm flows corresponding to the 3D scanning process and the algorithm type corresponding to each algorithm flow; Determine the memory requirement type corresponding to each algorithm process; The matching graphics card type is determined based on the algorithm type and the video memory requirement type; The corresponding algorithm process is executed by calling the graphics card corresponding to the graphics card type.
3. The three-dimensional scanning method as described in claim 2, wherein, The step of determining the matching graphics card type based on the algorithm type and the video memory requirement type includes: When the algorithm type is a computationally intensive algorithm and the memory requirement type is a fixed memory requirement, the graphics card type is determined to be a discrete graphics card. When the algorithm type is a memory-intensive algorithm and the memory requirement type is incremental memory requirement, the graphics card type is determined to be an integrated graphics card.
4. The three-dimensional scanning method as described in claim 1, wherein, The method further includes: Create a first thread for calling the discrete graphics card; and The first thread calls the discrete graphics card to convert the scanned image of the current frame into first point cloud data based on the scanned data and sends the first point cloud data to the integrated graphics card. The discrete graphics card then continues to convert the scanned image of the next frame into second point cloud data based on the scanned data, until all frames of scanned images are converted into point cloud data.
5. The three-dimensional scanning method as described in claim 4, wherein, The method further includes: Create a second thread to invoke 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 as described in claim 5, wherein, The step of 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, the second thread calls the integrated graphics card to generate the first point cloud fusion result. Based on the second point cloud data and the rotation displacement matrix, the second thread calls the integrated graphics card to generate the second point cloud fusion result.
7. A three-dimensional scanning system, applied to electronic devices, wherein, The electronic device includes a discrete graphics card and an integrated graphics card; the 3D scanning system includes: a reconstruction module, a tracking module, and a fusion module, wherein: The reconstruction module is configured to acquire scan data corresponding to the target object and convert the scan data into point cloud data. The reconstruction module is invoked by the discrete graphics card. The tracking module is configured to generate a rotational displacement matrix based on the scan data; The fusion module is configured to generate a point cloud fusion result of the target object based on the point cloud data and the rotation displacement matrix, and to generate a three-dimensional model of the target object based on the point cloud fusion result; the fusion module is invoked by the integrated graphics card.
8. The three-dimensional scanning system as described in claim 7, wherein, The 3D scanning system also includes a thread creation module, which is configured to create a first thread and a second thread. The first thread is configured to call the discrete 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 discrete 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 configured 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, wherein, include: The system includes a discrete graphics card, an integrated graphics card, a processor, and a memory, wherein the memory stores a computer program that, when executed by the discrete graphics card and / or the integrated graphics card and / or the processor, performs the three-dimensional scanning method according to any one of claims 1-6.
10. A computer-readable storage medium, wherein, The storage medium stores a computer program that, when executed by a discrete graphics card and / or an integrated graphics card and / or a processor, implements the three-dimensional scanning method as described in any one of claims 1-6.
Citation Information
Patent Citations
Indoor scene 3D reconstruction method based on Kinect
CN106803267A
City-level mass point cloud coordinate conversion method based on heterogeneous parallel computing
CN113190515A
Display card scheduling method, electronic equipment and computer readable storage medium
CN116028211A
Multi-core processor parallel point cloud fusion method, device and equipment and storage medium
CN117437112A
Three-dimensional scanning method and system, electronic equipment and storage medium
CN118887329A