A three-dimensional reconstruction method and device based on graphics processor
By grouping threads on the graphics processor and establishing correspondence with the camera, allocating two-dimensional points to thread groups for processing, and filtering out available points through pose verification, the low efficiency of two-dimensional point processing in existing three-dimensional reconstruction technology is solved. The problem has improved the three-dimensional reconstruction effect and user experience.
Patent Information
- Application Number
- CN202110787421.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-12
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2041-07-12
AI Technical Summary
The existing three-dimensional reconstruction technology has shortcomings in image processing efficiency and user experience, especially in a multi-threaded environment, which is difficult to effectively allocate and process two-dimensional points, affecting the effect of three-dimensional reconstruction.
By determining the specified number of cameras and threads on the graphics processor, grouping threads and establishing a correspondence with the camera, assigning two-dimensional points to thread groups for processing, and filtering out available points through pose verification for three-dimensional reconstruction.
It improves the processing efficiency and effect of the three-dimensional reconstruction process, ensures effective processing of two-dimensional points, improves user experience, and improves image processing efficiency through multi-threading.
Smart Images

Figure CN113610959B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of simulation display technology, and in particular to a three-dimensional reconstruction method and device based on a graphics processor. Background Art
[0002] The English term for 3D reconstruction is 3D Reconstruction. 3D reconstruction refers to the establishment of a mathematical model suitable for computer representation and processing of 3D objects. It is the basis for processing, operating and analyzing its properties in a computer environment. It is also a key technology for establishing virtual reality in the computer to express the objective world. The effect of 3D reconstruction will directly affect the user experience. Summary of the invention
[0003] The embodiments of the present application provide a graphics processor-based 3D reconstruction method and device to at least partially solve the above technical problems.
[0004] The present application embodiment adopts the following technical solutions:
[0005] In a first aspect, an embodiment of the present application provides a three-dimensional reconstruction method based on a graphics processor, the method comprising:
[0006] Determine the number of designated cameras and the number of available threads of the graphics processor, wherein the designated cameras are used to capture images of the designated environment, different designated cameras have different postures when capturing images of the designated environment, and the images captured by the designated cameras include a number of two-dimensional points;
[0007] According to the number of specified cameras, each available thread is grouped to obtain a number of thread groups, so that the thread groups correspond to the specified cameras one by one;
[0008] For each thread group, assigning two-dimensional points in an image acquired by a designated camera corresponding to the thread group to each thread in the thread group, so that each thread processes the assigned two-dimensional points;
[0009] Execute 3D reconstruction based on the processing results of each thread group.
[0010] In an optional embodiment of the present specification, in each obtained thread group, the number of threads in any two thread groups is the same.
[0011] In an optional embodiment of the present specification, allocating two-dimensional points in an image captured by a designated camera corresponding to the thread group to each thread in the thread group includes:
[0012] Acquire the number of preset three-dimensional points in the specified environment, where different three-dimensional points have different coordinates in the specified environment, and the image is obtained by collecting the three-dimensional points, so that each two-dimensional point corresponds to one three-dimensional point;
[0013] Each three-dimensional point is allocated to each thread in the thread group, so that each thread processes a two-dimensional point corresponding to the three-dimensional point allocated to it.
[0014] In an optional embodiment of the present specification, any two threads in the thread group are assigned the same number of three-dimensional points.
[0015] In an optional embodiment of the present specification, the processing result is obtained by following the steps:
[0016] Get the position and posture of the specified camera corresponding to the thread group;
[0017] According to the position and posture of the designated camera, the assigned two-dimensional points are processed to obtain the coordinates of the two-dimensional points in the position and posture as reference coordinates;
[0018] For each reference coordinate, it is determined whether there is a two-dimensional point among the two-dimensional points whose coordinates differ from the reference coordinates by no more than a preset threshold value, so as to obtain a processing result.
[0019] In an optional embodiment of the present specification, the processing result includes a plurality of sub-processing results, and the sub-processing results correspond to the two-dimensional points one by one; performing three-dimensional reconstruction according to the processing results of each thread group includes:
[0020] For each sub-processing result, if the sub-processing result indicates that the difference between the reference coordinates of the two-dimensional point corresponding to the sub-processing result and the coordinates of at least one two-dimensional point is not greater than a preset threshold, the two-dimensional point corresponding to the sub-processing result is determined as an available point;
[0021] Based on the available points, three-dimensional reconstruction is performed.
[0022] In an optional embodiment of the present specification, for each thread group, after allocating two-dimensional points in an image acquired by a specified camera corresponding to the thread group to each thread in the thread group, the method further includes:
[0023] If it is detected that a thread group has completed the two-dimensional processing assigned to it, the thread group is determined as an available thread group, and the two-dimensional point is reassigned to the available thread group.
[0024] In a second aspect, an embodiment of the present application further provides a three-dimensional reconstruction device based on a graphics processor, for implementing any one of the methods in the aforementioned first aspect.
[0025] In a third aspect, an embodiment of the present application further provides an electronic device, including:
[0026] Processor; and
[0027] A memory arranged to store computer executable instructions which, when executed, cause the processor to perform any of the methods of the first aspect.
[0028] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores one or more programs, and when the one or more programs are executed by an electronic device including multiple applications, the electronic device executes any one of the methods in the first aspect.
[0029] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: the three-dimensional reconstruction process in this specification processes the two-dimensional points used in the reconstruction process, which can effectively ensure the effect of three-dimensional reconstruction. Moreover, the process in this specification uses a graphics processor when processing two-dimensional points, and the image processor includes multiple threads, which can effectively improve processing efficiency. In addition, the process in this specification also groups the available threads of the graphics processor, and establishes a corresponding relationship between the obtained thread group and the specified camera, which is conducive to the allocation of two-dimensional points collected by the specified camera. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0031] Figure 1 A schematic diagram of a three-dimensional reconstruction process based on a graphics processor provided in an embodiment of this specification;
[0032] Figure 2 A schematic diagram of a holographic display scene provided in an embodiment of this specification;
[0033] Figure 3 A schematic diagram of the structure of a three-dimensional reconstruction device based on a graphics processor provided in an embodiment of this specification;
[0034] Figure 4 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0035] The present invention is further described in detail below by specific embodiments in conjunction with the accompanying drawings. Wherein similar elements in different embodiments adopt associated similar element numbers. In the following embodiments, many detailed descriptions are for making the present application better understood. However, those skilled in the art can easily recognize that some features can be omitted in different situations, or can be replaced by other elements, materials, methods. In some cases, some operations related to the present application are not shown or described in the specification, and this is to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.
[0036] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.
[0037] The serial numbers of the components in this document, such as "second", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning. The "connection" and "coupling" mentioned in this application, unless otherwise specified, include direct and indirect connections (couplings).
[0038] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0039] The 3D reconstruction method based on a graphics processor in this specification may include the following steps:
[0040] S100: Determine the number of designated cameras and the number of available threads of a graphics processor, wherein the designated cameras are used to capture images of a designated environment, and different designated cameras have different postures when capturing images of the designated environment, and the images captured by the designated cameras include a number of two-dimensional points.
[0041] The 3D reconstruction process in this specification does not impose any specific restrictions on the number of designated cameras involved. Optionally, the number of designated cameras may be two or more.
[0042] The designated camera in this specification may be a physical camera with a physical structure, or a virtual camera corresponding to the user's viewpoint. The available thread in this specification refers to a thread that is not currently executing data processing, that is, an idle thread.
[0043] Among them, the graphics processor is GPU. The graphics processor processes all points in the data at the same time to speed up the calculation. Compared with the central processing unit (CPU), the advantage of GPU is that it can generate a large number of threads, which can reduce the total calculation time when a large number of parallel calculations are performed.
[0044] The designated environment in this specification can be determined according to actual needs. For example, the designated environment can be a room or an area in a room.
[0045] When the 3D reconstruction process based on the graphics processor in this specification is applied to the field of holographic display technology, the specified environment may be the environment where the holographic sandbox (sandbox display device) is located, for example: Figure 2 In this example, the execution subject of the process in this specification may be a control module of the holographic display system to which the holographic sandbox belongs.
[0046] S102: Grouping available threads according to the number of designated cameras to obtain a plurality of thread groups, such that the thread groups correspond to the designated cameras one by one.
[0047] Specifically, the number of designated cameras may be determined to be a designated number, and the available threads may be divided into a designated number of thread groups.
[0048] It can be seen that through the graphics processor-based 3D reconstruction process in this specification, a corresponding relationship can be established between the thread group and the specified camera, so as to achieve a reasonable allocation of graphics processing resources among the specified cameras.
[0049] In an optional embodiment of the present specification, in each obtained thread group, the number of threads in any two thread groups is the same.
[0050] Exemplarily, for example, there are 20 thread groups, each thread group has 64 threads, and there are 64×20=1280 threads in total.
[0051] S104: For each thread group, assign two-dimensional points in an image acquired by a designated camera corresponding to the thread group to each thread in the thread group, so that each thread processes the assigned two-dimensional points.
[0052] In this specification, the processing performed by the thread group on the two-dimensional points is intended to make each two-dimensional point meet the data requirements for three-dimensional reconstruction and / or to filter out two-dimensional points that can be used for three-dimensional reconstruction from each two-dimensional point.
[0053] In an optional embodiment of the present specification, if it is detected that a thread group has completed the two-dimensional processing assigned to it, the thread group is determined as an available thread group, and the two-dimensional point is reassigned to the available thread group.
[0054] In actual scenarios, the image acquisition performed by a designated camera on a designated environment may be continuous over time, that is, in actual application scenarios, there may be a phenomenon that the designated camera acquires images continuously. In order to be able to process the two-dimensional points in each acquired image in a timely manner. In an optional embodiment of the present specification, if a thread group that has completed the two-dimensional processing assigned to it is detected, the thread group is determined as an available thread group, and the two-dimensional points are reassigned to the available thread group.
[0055] S106: Execute 3D reconstruction according to the processing results of each thread group.
[0056] After obtaining the processing results corresponding to the two-dimensional points that can be used for three-dimensional reconstruction through the aforementioned steps, the processing results can be used.
[0057] In an optional embodiment of the present specification, the processing result includes a plurality of sub-processing results, and the sub-processing results correspond to the two-dimensional points one by one. For each sub-processing result, if the sub-processing result indicates that the difference between the reference coordinates of the two-dimensional point corresponding to the sub-processing result and the coordinates of at least one two-dimensional point is not greater than a preset threshold, the two-dimensional point corresponding to the sub-processing result is determined as an available point; and three-dimensional reconstruction is performed based on each available point obtained.
[0058] As can be seen from the foregoing, in this specification, a thread group includes several threads. In order to achieve effective processing of two-dimensional points by each thread in the thread group, in an optional embodiment of this specification, several three-dimensional points are predetermined for designation. Since the specified environment is a certain space, the three-dimensional points in the specified environment can be represented by three-dimensional coordinates. Optionally, any one of the three-dimensional points is used as the target point, and the other three-dimensional points adjacent to the target point are each at the same distance from the target point. In the aforementioned holographic display scene, the origin of the three-dimensional coordinate system used to determine the three-dimensional coordinates is at the center of the holographic sandbox.
[0059] Then, the number of preset three-dimensional points in the specified environment is obtained, different three-dimensional points have different coordinates in the specified environment, and the image is obtained by collecting each three-dimensional point, so that each two-dimensional point corresponds to a three-dimensional point. Each three-dimensional point is assigned to each thread in the thread group, so that each thread processes the two-dimensional point corresponding to the three-dimensional point assigned to it.
[0060] In an optional embodiment of the present specification, the allocation method used when allocating the two-dimensional points to the threads may be average allocation.
[0061] Optionally, the number of preset three-dimensional points in the specified environment is negatively correlated with the number of the specified cameras, and / or positively correlated with the number of threads of the graphics processor, and / or negatively correlated with the frame rate of the specified cameras.
[0062] Exemplarily, for example, each thread group has 64 threads, there are 256 3D points in the scene, and each thread is responsible for processing two-dimensional points corresponding to four three-dimensional points.
[0063] In an optional embodiment of the present specification, the thread processes the two-dimensional point as follows:
[0064] The pose of the designated camera corresponding to the thread group is obtained; according to the pose of the designated camera, the allocated two-dimensional points are processed to obtain the coordinates of the two-dimensional points in the pose as reference coordinates.
[0065] For each reference coordinate, determine whether there is a two-dimensional point among the two-dimensional points whose coordinates differ from the reference coordinates by no more than a preset threshold. If the judgment result is yes, the two-dimensional point is determined as an available point; if the judgment result is no, the two-dimensional point is determined as an unavailable point. The judgment result for a two-dimensional point is the sub-processing result corresponding to the two-dimensional point. Each sub-processing result constitutes a set, which is the processing result.
[0066] Then, three-dimensional reconstruction is performed based on the available points.
[0067] It can be seen that the graphics processor-based 3D reconstruction process in this specification can realize 3D reconstruction on the one hand, and on the other hand, can also verify each 2D point during the reconstruction process to avoid points with large errors affecting the reconstruction effect, thereby improving the user experience.
[0068] In an optional embodiment of the present specification, an upper limit value of the number of threads may be set so that the number of threads in each thread group does not exceed the upper limit value of the number of threads. The upper limit value of the number of threads may be determined according to the frame rate of the specified camera, and the upper limit value of the number of threads is positively correlated with the frame rate of the specified camera.
[0069] Based on the same idea, the present specification also provides a corresponding embodiment Figure 1 A 3D reconstruction device based on a graphics processor for the partial process shown. Figure 3 As shown, the three-dimensional reconstruction device based on a graphics processor may include one or more of the following modules:
[0070] The quantity determination module 300 is configured to: determine the number of designated cameras and the number of available threads of the graphics processor, wherein the designated cameras are used to capture images of a designated environment, and different designated cameras have different postures when capturing images of the designated environment, and the images captured by the designated cameras include a number of two-dimensional points.
[0071] The thread group determination module 302 is configured to group the available threads according to the number of designated cameras to obtain a plurality of thread groups, so that the thread groups correspond to the designated cameras one by one.
[0072] The first allocation module 304 is configured to: for each thread group, allocate the two-dimensional points in the image captured by the designated camera corresponding to the thread group to each thread in the thread group, so that each thread processes the allocated two-dimensional points.
[0073] The 3D reconstruction module 306 is configured to perform 3D reconstruction according to the processing results of each thread group.
[0074] In an optional embodiment of the present specification, in each obtained thread group, the number of threads in any two thread groups is the same.
[0075] In an optional embodiment of the present specification, the first allocation module 304 is specifically configured to: obtain the number of preset three-dimensional points in the specified environment, different three-dimensional points have different coordinates in the specified environment, and the image is obtained by collecting each three-dimensional point, so that each two-dimensional point corresponds to one three-dimensional point;
[0076] Each three-dimensional point is allocated to each thread in the thread group, so that each thread processes a two-dimensional point corresponding to the three-dimensional point allocated to it.
[0077] In an optional embodiment of the present specification, any two threads in the thread group are assigned the same number of three-dimensional points.
[0078] In an optional embodiment of the present specification, the device includes a processing module, which is configured to: obtain the posture of the specified camera corresponding to the thread group; process the assigned two-dimensional points according to the posture of the specified camera to obtain the coordinates of the two-dimensional points in the posture as reference coordinates; for each reference coordinate, determine whether there is a two-dimensional point among each two-dimensional point whose coordinate difference with the reference coordinate is not greater than a preset threshold to obtain a processing result.
[0079] In an optional embodiment of the present specification, the processing result includes multiple sub-processing results, and the sub-processing results correspond to the two-dimensional points one by one.
[0080] In an optional embodiment of the present specification, the three-dimensional reconstruction module 306 is specifically configured as follows: for each sub-processing result, if the sub-processing result indicates that the difference between the reference coordinates of the two-dimensional point corresponding to the sub-processing result and the coordinates of at least one two-dimensional point is not greater than a preset threshold, then the two-dimensional point corresponding to the sub-processing result is determined as a usable point; and three-dimensional reconstruction is performed based on the obtained usable points.
[0081] In an optional embodiment of the present specification, the device also includes a second allocation module, and the second allocation module is configured to: if it is detected that a thread group has completed the two-dimensional processing assigned to it, determine the thread group as an available thread group, and re-allocate the two-dimensional point to the available thread group.
[0082] It can be understood that the above-mentioned graphics processor-based 3D reconstruction device can implement the various steps of the holographic display process performed by the graphics processor-based 3D reconstruction device provided in the aforementioned embodiments, and the relevant explanations on the graphics processor-based 3D reconstruction method are applicable to the graphics processor-based 3D reconstruction device, which will not be repeated here.
[0083] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 4 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0084] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0085] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0086] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a three-dimensional reconstruction device based on a graphics processor at the logical level. The processor executes the program stored in the memory and is specifically used to perform any of the above-mentioned holographic display processes.
[0087] The above application Figure 1 The method disclosed in the illustrated embodiment for executing a three-dimensional reconstruction device based on a graphics processor can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or instructions in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0088] The electronic device may also perform Figure 1 At least some of the method steps performed by the three-dimensional reconstruction device based on the graphics processor are implemented, and a three-dimensional reconstruction device based on the graphics processor is implemented. The embodiments of the present application are not repeated here.
[0089] The present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by an electronic device including multiple application programs, enable the electronic device to execute Figure 1 The illustrated embodiment shows a method executed by a graphics processor-based 3D reconstruction device, and is specifically used to execute any of the aforementioned graphics processor-based 3D reconstruction methods.
[0090] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0091] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0092] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0093] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0094] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0095] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0096] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0097] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0098] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0099] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A three-dimensional reconstruction method based on a graphics processor, wherein: The method comprises: Determine the number of designated cameras and the number of available threads of the graphics processor, wherein the designated cameras are used to collect images of the designated environment, different designated cameras have different postures when collecting images of the designated environment, and the images collected by the designated cameras include a number of two-dimensional points; According to the number of specified cameras, each available thread is grouped to obtain a number of thread groups, so that the thread groups correspond to the specified cameras one by one; For each thread group, assigning two-dimensional points in an image acquired by a designated camera corresponding to the thread group to each thread in the thread group, so that each thread processes the assigned two-dimensional points; Perform 3D reconstruction based on the processing results of each thread group; The method of allocating two-dimensional points in an image acquired by a designated camera corresponding to the thread group to each thread in the thread group includes: Acquire the number of preset three-dimensional points in the specified environment, where different three-dimensional points have different coordinates in the specified environment, and the image is obtained by collecting the three-dimensional points, so that each two-dimensional point corresponds to one three-dimensional point; Allocating each 3D point to each thread in the thread group, so that each thread processes a 2D point corresponding to the 3D point allocated to it; Wherein, the number of three-dimensional points allocated to any two threads in the thread group is the same; The processing result is obtained by following steps: Get the position and posture of the specified camera corresponding to the thread group; According to the position and posture of the designated camera, the assigned two-dimensional points are processed to obtain the coordinates of the two-dimensional points in the position and posture as reference coordinates; For each reference coordinate, it is determined whether there is a two-dimensional point among the two-dimensional points whose coordinates differ from the reference coordinates by no more than a preset threshold value, so as to obtain a processing result.
2. The method of claim 1, wherein: In each obtained thread group, the number of threads in any two thread groups is the same.
3. The method of claim 1, wherein: The processing result includes a plurality of sub-processing results, and the sub-processing results correspond to the two-dimensional points one by one; performing three-dimensional reconstruction according to the processing results of each thread group, including: For each sub-processing result, if the sub-processing result indicates that the difference between the reference coordinates of the two-dimensional point corresponding to the sub-processing result and the coordinates of at least one two-dimensional point is not greater than a preset threshold, the two-dimensional point corresponding to the sub-processing result is determined as an available point; Based on the available points, three-dimensional reconstruction is performed.
4. The method of claim 1, wherein: For each thread group, after allocating the two-dimensional points in the image acquired by the designated camera corresponding to the thread group to each thread in the thread group, the method further includes: If it is detected that a thread group has completed the two-dimensional processing assigned to it, the thread group is determined as an available thread group, and the two-dimensional point is reassigned to the available thread group.
5. A three-dimensional reconstruction device based on a graphics processor, wherein the device is used to implement any of the methods described in claims 1 to 4.
6. A non-volatile computer-readable storage medium, characterized in that: The non-volatile computer-readable storage medium stores computer-executable instructions, which, when executed by one or more processors, enable the one or more processors to execute any one of the methods of claims 1 to 4.
7. An electronic device comprising: processor; as well as A memory arranged to store computer executable instructions, which when executed cause the processor to perform the method of any one of claims 1 to 4.
Citation Information
Patent Citations
Three-dimensional environment reconstruction
CN102622776A
Mark point recognition method, apparatus and device, and storage medium
WO2021077982A1