TW202309834A - Model reconstruction method, electronic device and computer-readable storage medium - Google Patents

Model reconstruction method, electronic device and computer-readable storage medium Download PDF

Info

Publication number
TW202309834A
TW202309834A TW111106861A TW111106861A TW202309834A TW 202309834 A TW202309834 A TW 202309834A TW 111106861 A TW111106861 A TW 111106861A TW 111106861 A TW111106861 A TW 111106861A TW 202309834 A TW202309834 A TW 202309834A
Authority
TW
Taiwan
Prior art keywords
voxel
model
fused
voxels
distance
Prior art date
Application number
TW111106861A
Other languages
Chinese (zh)
Inventor
李辰宸
項驍駿
周立陽
余亦豪
Original Assignee
大陸商深圳市慧鯉科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 大陸商深圳市慧鯉科技有限公司 filed Critical 大陸商深圳市慧鯉科技有限公司
Publication of TW202309834A publication Critical patent/TW202309834A/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/08Projecting images onto non-planar surfaces, e.g. geodetic screens
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • G06T7/75Determining position or orientation of objects or cameras using feature-based methods involving models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • G06T7/85Stereo camera calibration

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Image Generation (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

The disclosure provides a model reconstruction method, electronic device and computer-readable storage medium, wherein the model reconstruction method comprises: fusing a depth image and a reference voxel model of a target object to obtain a first voxel model of the target object; wherein adjacent first voxels in the first voxel model are separated by a first voxel distance, and at least part of the first voxels have first voxel information; resampling the first voxel model to obtain a second voxel model, wherein adjacent second voxels in the second voxel model are separated by a second voxel distance, the second voxel distance is greater than the first voxel distance, and at least part of the second voxel has second voxel information.

Description

模型重建方法及電子設備和電腦可讀儲存介質Model reconstruction method, electronic device, and computer-readable storage medium

本發明關於電腦視覺技術領域,涉及一種模型重建方法及電子設備和電腦可讀儲存介質。The invention relates to the technical field of computer vision, and relates to a model reconstruction method, electronic equipment and a computer-readable storage medium.

在三維重建領域中,體素是實現模型建模的常用方法,體素將三維空間離散化為密緻排列的體素,且在體素上儲存相關體素資訊,以建模物體或場景。例如,在截斷符號距離場(Truncated Signed Distance Function,TSDF)中,體素上儲存其到物體或場景最近表面的截斷符號距離,從而實現對物體或場景的隱式表達。In the field of 3D reconstruction, voxel is a common method to realize model modeling. Voxel discretizes the 3D space into densely arranged voxels, and stores related voxel information on the voxels to model objects or scenes. For example, in Truncated Signed Distance Function (TSDF), the truncated signed distance to the nearest surface of the object or scene is stored on the voxel, so as to realize the implicit expression of the object or scene.

然而,在有限的計算記憶體下,如果物體或場景超出重建模型的表示範圍,則通常捨棄超出範圍的部分,或者嘗試選用更大的體素距離,並從頭開始重新開始重建,上述方式,或是犧牲了重建完整性,或是犧牲了時間效率,而這些代價在實際應用中都是無法承受的。有鑑於此,如何在確保重建完整性的基礎上,提升重建時間效率成為亟待解決的技術問題。However, with limited computational memory, if the object or scene exceeds the representation range of the reconstruction model, it is usually discarded, or try to choose a larger voxel distance and start reconstruction from scratch, the above method, or Is it sacrificing reconstruction integrity, or sacrificing time efficiency, and these costs are unbearable in practical applications. In view of this, how to improve the time efficiency of reconstruction on the basis of ensuring the integrity of reconstruction has become an urgent technical problem to be solved.

本發明實施例提供一種模型重建方法及電子設備和電腦可讀儲存介質。Embodiments of the present invention provide a model reconstruction method, electronic equipment, and a computer-readable storage medium.

本發明實施例第一方面提供了一種模型重建方法,所述方法由電子設備執行,所述方法包括:將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型;其中,第一體素模型中相鄰第一體素間隔第一體素距離,且至少部分第一體素具有第一體素資訊;對第一體素模型進行重採樣,以得到第二體素模型;其中,第二體素模型中相鄰第二體素間隔第二體素距離,第二體素距離大於第一體素距離,且至少部分第二體素具有第二體素資訊。The first aspect of the embodiment of the present invention provides a model reconstruction method, the method is executed by an electronic device, and the method includes: fusing the depth image of the target object with a reference voxel model to obtain the first voxel of the target object model; wherein, in the first voxel model, adjacent first voxels are separated by a first voxel distance, and at least part of the first voxels have first voxel information; the first voxel model is resampled to obtain the first voxel Two-voxel model; wherein, in the second voxel model, adjacent second voxels are separated by a second voxel distance, the second voxel distance is greater than the first voxel distance, and at least some of the second voxels have a second voxel Information.

因此,將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型,且第一體素模型相鄰第一體素間隔第一體素距離,且至少部分第一體素具有第一體素資訊,再對第一體素模型進行重採樣,以得到第二體素模型,且第二體素模型中相鄰第二體素間隔第二體素距離,第二體素距離大於第一體素距離,至少部分第二體素具有第二體素資訊,由於第二體素距離大於第一體素距離,一方面能夠在重採樣之後不會損失模型的表示範圍,且另一方面由於直接在第一體素模型基礎上進行重採樣即可得到第二體素模型,而無需從頭開始重新重建,也能夠提升模型重建的時間效率,故能夠在確保重建完整性的基礎上,提升重建時間效率。此外,由於第二體素距離大於第一體素距離,還能夠減少表示目標對象所需的體素數量,從而能夠有利於減少模型重建所需的計算記憶體,故有利於在有限的計算記憶體下,同時確保重建完整性,並提升時間效率。Therefore, the depth image of the target object is fused with the reference voxel model to obtain the first voxel model of the target object, and the first voxel model is adjacent to the first voxel with a first voxel distance, and at least part of the first voxel model One voxel has the first voxel information, and then the first voxel model is resampled to obtain the second voxel model, and the second voxel distance between adjacent second voxels in the second voxel model is the second voxel distance. The second voxel distance is greater than the first voxel distance, and at least part of the second voxel has second voxel information. Since the second voxel distance is greater than the first voxel distance, on the one hand, the representation of the model can not be lost after resampling range, and on the other hand, because the second voxel model can be obtained directly by resampling on the basis of the first voxel model, there is no need to rebuild from scratch, and the time efficiency of model reconstruction can also be improved, so it is possible to ensure complete reconstruction On the basis of reliability, the reconstruction time efficiency is improved. In addition, because the second voxel distance is greater than the first voxel distance, it can also reduce the number of voxels required to represent the target object, which can help reduce the computational memory required for model reconstruction. body while ensuring reconstruction integrity and improving time efficiency.

本發明實施例第二方面提供了一種模型重建裝置,包括:深度融合部分和重採樣部分,深度融合部分,用於將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型;其中,第一體素模型中相鄰第一體素間隔第一體素距離,且至少部分第一體素具有第一體素資訊;重採樣部分,用於對第一體素模型進行重採樣,以得到第二體素模型;其中,第二體素模型中相鄰第二體素間隔第二體素距離,第二體素距離大於第一體素距離,且至少部分第二體素具有第二體素資訊。The second aspect of the embodiment of the present invention provides a model reconstruction device, including: a depth fusion part and a resampling part, the depth fusion part is used to fuse the depth image of the target object with the reference voxel model to obtain the first object of the target object A voxel model; wherein, in the first voxel model, adjacent first voxels are separated by a first voxel distance, and at least some of the first voxels have first voxel information; the resampling part is used for the first voxel The voxel model is resampled to obtain a second voxel model; wherein, in the second voxel model, adjacent second voxels are separated by a second voxel distance, and the second voxel distance is greater than the first voxel distance, and at least partially The second voxel has second voxel information.

本發明實施例第三方面提供了一種電子設備,包括相互耦接的記憶體和處理器,處理器用於執行記憶體中儲存的程式指令,以實現上述第一方面中的模型重建方法。The third aspect of the embodiment of the present invention provides an electronic device, including a memory and a processor coupled to each other, and the processor is used to execute program instructions stored in the memory to implement the model reconstruction method in the first aspect above.

本發明實施例第四方面提供了一種電腦可讀儲存介質,其上儲存有程式指令,程式指令被處理器執行時實現上述第一方面中的模型重建方法。The fourth aspect of the embodiment of the present invention provides a computer-readable storage medium, on which program instructions are stored, and when the program instructions are executed by a processor, the model reconstruction method in the above-mentioned first aspect is implemented.

本發明實施例第五方面提供了一種電腦程式產品,包括電腦程式或指令,在電腦程式或指令在電腦上運行的情況下,使得電腦執行上述第一方面中的模型重建方法。The fifth aspect of the embodiment of the present invention provides a computer program product, including computer programs or instructions, which enable the computer to execute the model reconstruction method in the first aspect above when the computer programs or instructions are run on the computer.

上述方案,將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型,且第一體素模型相鄰第一體素間隔第一體素距離,且至少部分第一體素具有第一體素資訊,再對第一體素模型進行重採樣,以得到第二體素模型,且第二體素模型中相鄰第二體素間隔第二體素距離,第二體素距離大於第一體素距離,至少部分第二體素具有第二體素資訊,由於第二體素距離大於第一體素距離,一方面能夠在重採樣之後不會損失模型的表示範圍,且另一方面由於直接在第一體素模型基礎上進行重採樣即可得到第二體素模型,而無需從頭開始重新重建,也能夠提升模型重建的時間效率,故能夠在確保重建完整性的基礎上,提升重建時間效率。此外,由於第二體素距離大於第一體素距離,還能夠減少表示目標對象所需的體素數量,從而能夠有利於減少模型重建所需的計算記憶體,故有利於在有限的計算記憶體下,同時確保重建完整性,並提升時間效率。In the above solution, the depth image of the target object is fused with the reference voxel model to obtain the first voxel model of the target object, and the first voxel model is adjacent to the first voxel with a first voxel distance, and at least part of The first voxel has first voxel information, and then the first voxel model is resampled to obtain a second voxel model, and in the second voxel model, adjacent second voxels are separated by a second voxel distance, The second voxel distance is greater than the first voxel distance, and at least some of the second voxels have second voxel information. Since the second voxel distance is greater than the first voxel distance, on the one hand, the model can not be lost after resampling represents the range, and on the other hand, the second voxel model can be obtained by resampling directly on the basis of the first voxel model, without having to rebuild from scratch, and can also improve the time efficiency of model reconstruction, so it is possible to ensure that the reconstruction On the basis of completeness, the reconstruction time efficiency is improved. In addition, because the second voxel distance is greater than the first voxel distance, it can also reduce the number of voxels required to represent the target object, which can help reduce the computational memory required for model reconstruction. body while ensuring reconstruction integrity and improving time efficiency.

下面結合說明書附圖,對本發明實施例的方案進行詳細說明。The solutions of the embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings.

以下描述中,為了說明而不是為了限定,提出了諸如特定系統結構、介面、技術之類的細節,以便透徹理解本發明實施例。In the following description, for the purpose of illustration rather than limitation, details such as specific system structures, interfaces, and techniques are presented for a thorough understanding of the embodiments of the present invention.

本文中術語“系統”和“網路”在本文中常被可互換使用。本文中術語“和/或”,僅僅是一種描述關聯對象的關聯關係,表示可以存在三種關係,例如,A和/或B,可以表示:單獨存在A,同時存在A和B,單獨存在B這三種情況。另外,本文中字元“/”,一般表示前後關聯對象是一種“或”的關係。此外,本文中的“多”表示兩個或者多於兩個。The terms "system" and "network" are often used interchangeably herein. The term "and/or" in this article is just an association relationship describing associated objects, which means that there can be three relationships, for example, A and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone. three conditions. In addition, the character "/" in this article generally indicates that the contextual objects are an "or" relationship. In addition, "many" herein means two or more than two.

請參閱圖1,圖1是本發明實施例模型重建方法一實施例的流程示意圖,可以包括如下步驟。Please refer to FIG. 1 . FIG. 1 is a schematic flowchart of an embodiment of a model reconstruction method according to an embodiment of the present invention, which may include the following steps.

步驟S11:將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型。Step S11: Fusion the depth image of the target object with the reference voxel model to obtain a first voxel model of the target object.

在一些實施例中,目標對象可以包括但不限於:雕像、椅子等單個物體,或者,目標對象也可以包括:沙盤、客廳等包含多個物體的場景,在此不做限定。In some embodiments, the target object may include but not limited to: single objects such as statues and chairs, or the target object may also include: scenes containing multiple objects such as a sand table and living room, which are not limited here.

在一些實施例中,可以利用深度相機目標對象進行拍攝,得到目標對象的深度圖像;或者,也可以利用集成有RGB相機和深度相機的移動終端(如,手機、平板電腦等)對目標對象進行拍攝,得到目標對象的色彩圖像和深度圖像;或者,也可以利用集成為RGB相機的移動終端對目標對象進行拍攝,並基於多視圖立體匹配演算法、神經網路演算法等進行深度恢復,得到目標對象的深度圖像,在此不做限定。In some embodiments, the depth camera can be used to shoot the target object to obtain the depth image of the target object; or, a mobile terminal (such as a mobile phone, a tablet computer, etc.) integrated with an RGB camera and a depth camera can also be used to image the target object Shoot to obtain the color image and depth image of the target object; or, use the mobile terminal integrated as an RGB camera to shoot the target object, and perform depth restoration based on multi-view stereo matching algorithm, neural network algorithm, etc. , to obtain the depth image of the target object, which is not limited here.

在一些實施例中,在首次執行模型重建操作時,可以初始化一個初始模型,作為目標對象的參考體素模型,且參考體素模型中相鄰體素間隔第一體素距離,參考體素模型中各個體素均不具有體素資訊,在此基礎上,再將深度圖像和參考體素模型進行融合,得到第一體素模型。融合的過程,可以參閱下述相關描述。In some embodiments, when the model reconstruction operation is performed for the first time, an initial model can be initialized as a reference voxel model of the target object, and adjacent voxels in the reference voxel model are separated by a first voxel distance, and the reference voxel model Each voxel in has no voxel information. On this basis, the depth image and the reference voxel model are fused to obtain the first voxel model. For the fusion process, please refer to the related description below.

在一些實施例中,在第i(i>1)次執行模型重建操作時,可以將第i-1次執行模型重建操作所獲取到的重建模型作為參考體素模型,並將深度圖像與參考體素模型進行融合,得到第一體素模型。融合的過程,可以參閱下述相關描述。In some embodiments, when the model reconstruction operation is performed for the ith (i>1) time, the reconstruction model obtained by performing the model reconstruction operation for the i-1 time can be used as a reference voxel model, and the depth image and The reference voxel model is fused to obtain the first voxel model. For the fusion process, please refer to the related description below.

本發明實施例中,第一體素模型中相鄰第一體素間隔第一體素距離,且至少部分第一體素具有第一體素資訊。如前所述,參考體素模型中相鄰體素間隔可以與第一體素模型一樣,為了表述描述,第一體素間隔可以記為δ。In an embodiment of the present invention, adjacent first voxels in the first voxel model are separated by a first voxel distance, and at least some of the first voxels have first voxel information. As mentioned above, the interval between adjacent voxels in the reference voxel model may be the same as that in the first voxel model, and the first voxel interval may be denoted as δ for expressing description.

在一些實施例中,為了便於融合計算,第一體素模型和參考體素模型可以均位於世界座標系中,且第一體素資訊包括第一體素的第一截斷符號距離和第一體素權重,類似地,參考體素模型中體素若具有體素資訊,則該體素資訊也可以包含該體素的截斷符號距離和體素權重。需要說明的是,截斷符號距離表示體素至目標對象表面的有向距離。請結合參閱圖2,圖2是截斷符號距離一實施例的示意圖。如圖2所示,網格交點表示體素,體素上方數值表示該體素的截斷符號距離,加粗曲線表示目標對象的表面,在體素的截斷符號距離為正數時,表示該體素位於目標對象內部,在體素的截斷符號距離為負數時,表示該體素位於目標對象外部,在該體素的截斷符號距離為0時,表示該體素位於目標對象的表面,故此通過截斷符號距離能夠構建任意曲面間接的隱式表達。In some embodiments, in order to facilitate fusion calculation, both the first voxel model and the reference voxel model can be located in the world coordinate system, and the first voxel information includes the first truncated signed distance and the first voxel voxel weight. Similarly, if a voxel in the reference voxel model has voxel information, the voxel information can also include the truncated sign distance and voxel weight of the voxel. It should be noted that the truncated signed distance represents the directed distance from the voxel to the surface of the target object. Please refer to FIG. 2 , which is a schematic diagram of an embodiment of the truncated symbol distance. As shown in Figure 2, the grid intersection represents a voxel, the value above the voxel represents the truncated sign distance of the voxel, and the thickened curve represents the surface of the target object. When the truncated sign distance of the voxel is a positive number, it represents the voxel Located inside the target object, when the truncation sign distance of the voxel is a negative number, it means that the voxel is located outside the target object; when the truncation sign distance of the voxel is 0, it means that the voxel is located on the surface of the target object, so by truncation Signed distances enable the construction of implicit representations of arbitrary surface indirections.

在一些實施例中,可以基於深度圖像中的圖元點反投影至世界座標系的投影點,在參考體素模型中選擇體素作為待融合體素,並基於相機內參和拍攝深度圖像時的相機位姿,獲取待融合體素的待融合截斷符號距離,在此基礎上,再基於待融合體素在參考體素模型中的體素權重,將待融合截斷符號距離和待融合體素在參考體素模型中參考截斷符號距離進行融合,得到與待融合體素位置對應的第一體素的第一截斷符號距離,並將待融合體素在參考體素模型中體素權重進行更新,得到與待融合體素位置對應的第一體素的第一體素權重。上述方式,在模型重建過程中,能夠不斷融入深度資訊,有利於不斷提升模型的準確性和完整性。In some embodiments, based on the back-projection of the primitive points in the depth image to the projection points of the world coordinate system, select voxels in the reference voxel model as the voxels to be fused, and based on the camera internal reference and the captured depth image The camera pose at the time, obtain the truncated symbol distance to be fused, on this basis, based on the voxel weight of the voxel to be fused in the reference voxel model, the truncated symbol distance to be fused and the truncated symbol distance to be fused The voxel is fused with reference to the truncated signed distance in the reference voxel model, and the first truncated signed distance of the first voxel corresponding to the position of the voxel to be fused is obtained, and the weight of the voxel to be fused is calculated in the reference voxel model. update to obtain the first voxel weight of the first voxel corresponding to the position of the voxel to be fused. The above method can continuously incorporate in-depth information during the model reconstruction process, which is conducive to continuously improving the accuracy and integrity of the model.

在一些實施例中,為了便於描述,可以將深度圖像中的圖元點(u,v)的深度值記為d,則可以利用相機內參以及拍攝深度圖像時的相機位姿,將圖元點(u,v)反投影至世界座標系,得到投影點P,如公式(1)所示:

Figure 02_image001
……(1) In some embodiments, for the convenience of description, the depth value of the primitive point (u, v) in the depth image can be recorded as d, then the image The element point (u, v) is back-projected to the world coordinate system to obtain the projection point P, as shown in formula (1):
Figure 02_image001
……(1)

上述公式(1)中,

Figure 02_image003
表示拍攝深度圖像時的相機位姿,
Figure 02_image005
表示反投影函數。反投影函數可以表示為公式(2):
Figure 02_image007
……(2) In the above formula (1),
Figure 02_image003
Indicates the camera pose when capturing the depth image,
Figure 02_image005
Represents the backprojection function. The backprojection function can be expressed as formula (2):
Figure 02_image007
……(2)

上述公式(2)中,

Figure 02_image009
均為相機內參中的參數,分別表示相機在u,v方向上的焦距,
Figure 02_image011
也均為相機內參中的參數,分別表示相機在u,v方向上的光心位置。在此基礎上,可以將深度圖像中各個圖元點(或者,屬於目標對象的圖元點)反投影至世界座標系,得到各個圖元點(或者,屬於目標對象的圖元點)在世界座標系中的投影點,則可以將參考體素模型中位於這些投影點預設截斷範圍
Figure 02_image013
內的體素,作為待融合體素。 In the above formula (2),
Figure 02_image009
Both are the parameters in the internal reference of the camera, respectively representing the focal length of the camera in the u and v directions,
Figure 02_image011
They are also parameters in the internal reference of the camera, respectively representing the position of the optical center of the camera in the u and v directions. On this basis, each primitive point (or, the primitive point belonging to the target object) in the depth image can be back-projected to the world coordinate system, and each primitive point (or, the primitive point belonging to the target object) can be obtained in The projected points in the world coordinate system, you can preset the truncated range of these projected points in the reference voxel model
Figure 02_image013
The voxels within are the voxels to be fused.

在一實施場景中,可以基於相機內參和相機位姿,將待融合體素進行重投影得到待融合體素在深度圖像的第一深度以及在相機座標系的第二深度。為了便於描述,可以將待融合體素在世界座標系中位置座標記為V,則第一深度可以表示為

Figure 02_image015
,其中,
Figure 02_image003
表示相機位姿,
Figure 02_image017
表示投影函數,投影函數可以表示為公式(3):
Figure 02_image019
……(3) In an implementation scenario, the voxels to be fused can be reprojected based on the internal camera parameters and the camera pose to obtain the first depth of the voxels to be fused in the depth image and the second depth in the camera coordinate system. For the convenience of description, the position coordinate of the voxel to be fused in the world coordinate system can be marked as V, then the first depth can be expressed as
Figure 02_image015
,in,
Figure 02_image003
represents the camera pose,
Figure 02_image017
Represents the projection function, which can be expressed as formula (3):
Figure 02_image019
... (3)

上述公式(3)中,

Figure 02_image021
表示待融合體素重投影到相機座標系中的位置座標。需要說明的是,通過相機位姿
Figure 02_image003
可以將待融合體素在世界座標系中位置座標V轉換至相機座標系,得到待融合體素在相機座標系中位置座標
Figure 02_image023
,在此基礎上,可以進一步利用上述投影函數將待融合體素在相機座標系中的位置座標轉換至圖像座標系,得到待融合體素在圖像座標系中的位置座標,從而可以根據該位置座標得到待融合體素在深度圖像中的第一深度
Figure 02_image015
。為了簡化表述,對於待融合體素集合內任一體素可以記為v,其重投影至深度圖像的位置座標可以記為u(v),深度圖像在該位置座標處的第一深度可以記為D(u(v))。此外,如前所述,通過相機位姿
Figure 02_image003
可以將待融合體素在世界座標系中位置座標V轉換至相機座標系,得到待融合體素在相機座標系中的位置座標
Figure 02_image023
,則待融合體素在相機座標系的第二深度可以記為
Figure 02_image025
,其中,
Figure 02_image027
表示取深度值,可以取其在相機座標系z軸上的座標值作為第二深度。為了簡化表述,對於待融合體素集合內任一體素可以記為v,其重投影至相機座標系的第二深度可以記為z(v)。在一些實施例中,在獲取第一深度D(u(v))和第二深度z(v)之後,即可基於兩者之間的偏差,得到待融合體素v的待融合截斷符號距離
Figure 02_image029
,如公式(4)所示:
Figure 02_image031
……(4) In the above formula (3),
Figure 02_image021
Indicates the position coordinates of the reprojected voxels to be fused into the camera coordinate system. It should be noted that, through the camera pose
Figure 02_image003
The position coordinate V of the voxel to be fused in the world coordinate system can be converted to the camera coordinate system to obtain the position coordinate of the voxel to be fused in the camera coordinate system
Figure 02_image023
, on this basis, the position coordinates of the voxels to be fused in the camera coordinate system can be further converted to the image coordinate system by using the above projection function, and the position coordinates of the voxels to be fused in the image coordinate system can be obtained, so that according to The position coordinates get the first depth of the voxel to be fused in the depth image
Figure 02_image015
. In order to simplify the expression, any voxel in the voxel set to be fused can be marked as v, and the position coordinate of its reprojection to the depth image can be marked as u(v), and the first depth of the depth image at this position coordinate can be Denote it as D(u(v)). Furthermore, as mentioned earlier, through the camera pose
Figure 02_image003
The position coordinate V of the voxel to be fused in the world coordinate system can be converted to the camera coordinate system to obtain the position coordinate of the voxel to be fused in the camera coordinate system
Figure 02_image023
, then the second depth of the voxel to be fused in the camera coordinate system can be recorded as
Figure 02_image025
,in,
Figure 02_image027
Indicates to take the depth value, and its coordinate value on the z-axis of the camera coordinate system can be taken as the second depth. In order to simplify the expression, any voxel in the voxel set to be fused can be denoted as v, and its second depth reprojected to the camera coordinate system can be denoted as z(v). In some embodiments, after obtaining the first depth D(u(v)) and the second depth z(v), the truncated symbol distance to be fused can be obtained based on the deviation between the two
Figure 02_image029
, as shown in formula (4):
Figure 02_image031
... (4)

上述公式(4)中,

Figure 02_image033
表示前述位置座標u(v)在水平軸x方向上的座標值,
Figure 02_image035
表示前述位置座標u(v)在垂直軸y方向上的座標值,
Figure 02_image037
表示篩選待融合體素時所採用的截斷距離。在計算得到
Figure 02_image039
的基礎上,再將其截斷至[-1,1]區間,即可得到待融合體素v的待融合截斷符號距離
Figure 02_image029
,可以表示為
Figure 02_image041
。 In the above formula (4),
Figure 02_image033
Indicates the coordinate value of the aforementioned position coordinate u(v) in the direction of the horizontal axis x,
Figure 02_image035
Indicates the coordinate value of the aforementioned position coordinate u(v) in the direction of the vertical axis y,
Figure 02_image037
Indicates the cut-off distance used when screening voxels to be fused. in the calculated
Figure 02_image039
On the basis of , then truncate it to the [-1, 1] interval, you can get the truncated symbol distance to be fused for the voxel v to be fused
Figure 02_image029
,It can be expressed as
Figure 02_image041
.

由於待融合截斷符號距離是根據第一深度和第二深度之間的偏差得到的,故能夠準確表示根據深度圖像所提供的深度資訊,待融合體素至目標對象表面的有向距離,有利於提升待融合截斷符號距離的準確性。在一些實施例中,在基於待融合體素在參考體素模型中體素權重融合待融合截斷符號距離和待融合體素在參考體素模型中參考截斷符號距離時,可以獲取待融合體素在參考體素模型中體素權重,以及待融合體素本次融合時的權重,並利用上述兩個權重對待融合體素在參考模型中的參考截斷符號距離、待融合體素的待融合截斷符號距離進行加權平均,得到與待融合體素位置對應的第一體素的第一截斷符號距離。為了便於描述,可以將待融合體素v在參考體素模型中體素權重記為

Figure 02_image043
,在參考體素模型中參考截斷符號距離記為
Figure 02_image045
,則在待融合體素v每次融合時的權重設置為1的情況下,與待融合體素位置對應的第一體素的第一截斷符號距離
Figure 02_image047
可以表示為公式(5):
Figure 02_image049
……(5) Since the truncated symbol distance to be fused is obtained according to the deviation between the first depth and the second depth, it can accurately represent the directional distance from the voxel to be fused to the surface of the target object according to the depth information provided by the depth image, which is beneficial To improve the accuracy of the truncated symbol distance to be fused. In some embodiments, when fusing the truncated signed distance to be fused and the reference truncated signed distance of the voxel to be fused in the reference voxel model based on the voxel weight of the voxel to be fused in the reference voxel model, the voxel to be fused can be obtained The voxel weight in the reference voxel model, and the weight of the voxel to be fused in this fusion, and use the above two weights to treat the reference truncation sign distance of the fused voxel in the reference model, and the to-be-fused truncation The signed distances are weighted and averaged to obtain the first truncated signed distance of the first voxel corresponding to the position of the voxel to be fused. For the convenience of description, the voxel weight of the voxel to be fused in the reference voxel model can be recorded as
Figure 02_image043
, and the reference truncated sign distance in the reference voxel model is denoted as
Figure 02_image045
, then when the weight of the voxel v to be fused is set to 1 for each fusion, the first truncated sign distance of the first voxel corresponding to the voxel position to be fused
Figure 02_image047
It can be expressed as formula (5):
Figure 02_image049
... (5)

需要說明的是,待融合體素,以及與待融合體素位置對應的第一體素在世界座標系中具有相同位置座標,即兩者為空間中的同一點。It should be noted that the voxel to be fused and the first voxel corresponding to the position of the voxel to be fused have the same position coordinates in the world coordinate system, that is, they are the same point in space.

在一些實施例中,在待融合體素在參考體素模型中不具有參考截斷符號距離的情況下,可以將待融合體素的待融合截斷符號距離,作為與待融合體素位置對應的第一體素的第一截斷符號距離。也就是說,在此情況下,公式(5)中

Figure 02_image045
Figure 02_image051
可以視為0。這樣能夠在待融合體素在參考體素模型中不具有參考截斷符號距離的情況下,大大簡化第一截斷符號距離的獲取流程,有利於減少模型重建所需的計算記憶體。 In some embodiments, in the case that the voxel to be fused does not have a reference truncated signed distance in the reference voxel model, the truncated signed distance to be fused of the voxel to be fused can be used as the second corresponding to the position of the voxel to be fused The first truncated sign distance in voxels. That is, in this case, in formula (5)
Figure 02_image045
,
Figure 02_image051
Can be regarded as 0. In this way, when the voxel to be fused does not have a reference truncated signed distance in the reference voxel model, the process of obtaining the first truncated signed distance can be greatly simplified, which is beneficial to reduce the computational memory required for model reconstruction.

在一些實施例中,在體素權重更新之後,與待融合體素位置對應的第一體素的第一體素權重大於待融合體素在參考體素模型中體素權重。例如,如前所述,待融合體素v每次融合時的權重可以設置為1,可以在待融合體素在參考體素模型中體素權重加1,作為與待融合體素位置對應的第一體素的第一體素權重,在此情況下,為了便於描述,可以將與待融合體素v位置對應的第一體素的第一體素權重

Figure 02_image053
表示為公式(6):
Figure 02_image055
……(6) In some embodiments, after the voxel weight is updated, the first voxel weight of the first voxel corresponding to the position of the voxel to be fused is greater than the voxel weight of the voxel to be fused in the reference voxel model. For example, as mentioned above, the weight of the voxel to be fused v can be set to 1 each time it is fused, and the voxel weight of the voxel to be fused can be added to the reference voxel model by 1, as the voxel corresponding to the position of the voxel to be fused The first voxel weight of the first voxel, in this case, for the convenience of description, the first voxel weight of the first voxel corresponding to the position of the voxel to be fused can be
Figure 02_image053
Expressed as formula (6):
Figure 02_image055
... (6)

需要說明的是,更具一般性地,待融合體素v每次融合時的權重也可以設置為其他數值,為了便於描述,可以記為

Figure 02_image057
,則上述公式(5)所表示的第一截斷符號距離
Figure 02_image047
可以相應地表示為:
Figure 02_image059
,在此情況下,上述公式(6)所表示的第一體素權重
Figure 02_image053
可以相應地表示為:
Figure 02_image061
,也就是說,與待融合體素v位置對應的第一體素的第一體素權重為待融合體素v為在參考體素模型中體素權重與待融合體素v每次融合時的權重之和。需要說明的是,待融合體素v每次融合時的權重
Figure 02_image057
可以根據待融合體素v的待融合截斷符號距離
Figure 02_image029
確定,例如,若待融合體素v的待融合截斷符號距離
Figure 02_image029
表示待融合體素至目標對象的表面距離越近,則待融合體素v每次融合時的權重
Figure 02_image057
可以越大,且越趨近於1;或者,待融合體素v每次融合時的權重
Figure 02_image057
也可以根據待融合體素v重投影至深度圖像的局部方差確定,例如,若待融合體素v重投影至深度圖像的局部方差越小,則待融合體素v每次融合時的權重
Figure 02_image057
可以越大,且越趨近於1,在此不做限定。 It should be noted that, more generally, the weight of the voxel v to be fused each time it is fused can also be set to other values. For the convenience of description, it can be recorded as
Figure 02_image057
, then the first truncated sign distance represented by the above formula (5)
Figure 02_image047
can be expressed accordingly as:
Figure 02_image059
, in this case, the first voxel weight expressed by the above formula (6)
Figure 02_image053
can be expressed accordingly as:
Figure 02_image061
, that is to say, the first voxel weight of the first voxel corresponding to the position of the voxel to be fused is Voxel to be fused v is the weight of the voxel in the reference voxel model and the voxel to be fused v Each fusion The sum of the weights of . It should be noted that the weight of voxels to be fused each time they are fused
Figure 02_image057
The symbol distance to be fused can be truncated according to the voxel v to be fused
Figure 02_image029
Determine, for example, the truncated sign distance to be fused if voxel to be fused
Figure 02_image029
Indicates that the closer the surface distance between the voxel to be fused and the target object is, the weight of the voxel to be fused v for each fusion
Figure 02_image057
Can be larger and closer to 1; or, the weight of voxels to be fused each time they are fused
Figure 02_image057
It can also be determined according to the local variance of the reprojection of the voxel v to be fused to the depth image. For example, if the local variance of the reprojection of the voxel v to be fused to the depth image is smaller, the voxel v to be fused each time is fused. Weights
Figure 02_image057
It can be larger and closer to 1, which is not limited here.

所以,將與待融合體素位置對應的第一體素的第一體素權重設置為大於待融合體素在參考體素模型中體素權重,能夠隨著模型重建過程中,逐漸側重於參考待融合體素在參考體素模型中參考截斷符號距離,有利於提升模型重建的準確性。Therefore, setting the first voxel weight of the first voxel corresponding to the position of the voxel to be fused to be greater than the voxel weight of the voxel to be fused in the reference voxel model can gradually focus on the reference voxel during the model reconstruction process. The voxels to be fused refer to the truncated signed distance in the reference voxel model, which is beneficial to improve the accuracy of model reconstruction.

步驟S12:對第一體素模型進行重採樣,以得到第二體素模型。將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型Step S12: resampling the first voxel model to obtain a second voxel model. Fusion the depth image of the target object with the reference voxel model to obtain the first voxel model of the target object

本發明實施例中,第二體素模型中相鄰第二體素間隔第二體素距離,第二體素距離大於第一體素距離,且至少部分第二體素具有第二體素資訊。在一些實施例中,第二體素資訊是在對第一體素模型進行重採樣過程中,根據第一體素資訊計算得到的。In the embodiment of the present invention, adjacent second voxels in the second voxel model are separated by a second voxel distance, the second voxel distance is greater than the first voxel distance, and at least some of the second voxels have second voxel information . In some embodiments, the second voxel information is calculated according to the first voxel information during the process of resampling the first voxel model.

在一些實施例中,第二體素距離可以是第一體素距離的預設倍數,例如,1.5倍、2倍等等,在此不做限定。請結合參閱圖3,圖3是第一體素模型和第二體素模型一實施例的示意圖。需要說明的是,圖3僅示意性地繪製了部分第一體素模型以及部分第二體素模型,如圖3所示,斜線陰影填充圓形表示第一體素,黑色陰影填充圓形表示第二體素,且圖3中第二體素距離為第一體素距離的1.5倍。其他情況可以以此類推,在此不再一一舉例。In some embodiments, the second voxel distance may be a preset multiple of the first voxel distance, for example, 1.5 times, 2 times, etc., which is not limited herein. Please refer to FIG. 3 , which is a schematic diagram of an embodiment of the first voxel model and the second voxel model. It should be noted that Fig. 3 only schematically draws part of the first voxel model and part of the second voxel model. As shown in Fig. 3, the circles filled with oblique lines represent the first voxel, and the circles filled with black shadows represent The second voxel, and the distance of the second voxel in Fig. 3 is 1.5 times of the distance of the first voxel. Other situations can be deduced by analogy, and no more examples will be given here.

在一些實施例中,每次在得到第一體素模型之後,可以先基於具有第一體素資訊的第一體素,檢測第一體素模型是否符合重採樣條件,回應於第一體素模型符合重採樣條件,執行對第一體素模型進行重採樣,得到第二體素模型的步驟,即在重採樣之前先檢測第一體素模型是否符合重採樣條件,能夠自我調整調整體素間距。此外,為了不斷融入深度資訊,以提升模型重建效果,在重採樣之後,可以進一步將第二體素模型作為新的參考體素模型,獲取新的深度圖像,以及重新執行將目標對象的深度圖像和參考進行融合,得到目標對象的第一體素模型的步驟以及後續步驟,從而可以在模型重建過程中,不斷融入深度資訊,提升模型重建的效果。需要說明的是,新的深度圖像可以是以不同相機位姿對目標對象進行拍攝得到的。可以參閱下述相關描述。In some embodiments, after obtaining the first voxel model each time, based on the first voxel with the first voxel information, it is possible to detect whether the first voxel model meets the resampling condition, and respond to the first voxel The model meets the resampling conditions, execute the step of resampling the first voxel model to obtain the second voxel model, that is, check whether the first voxel model meets the resampling conditions before resampling, and can adjust the voxel by itself spacing. In addition, in order to continuously incorporate depth information to improve the model reconstruction effect, after resampling, the second voxel model can be further used as a new reference voxel model to obtain a new depth image, and re-execute the depth of the target object The image and reference are fused to obtain the first voxel model of the target object and the subsequent steps, so that in the process of model reconstruction, depth information can be continuously integrated to improve the effect of model reconstruction. It should be noted that the new depth image may be obtained by shooting the target object with different camera poses. You can refer to the related description below.

在一些實施例中,重採樣條件可以設置為具有第一體素資訊的第一體素多於預設數值。需要說明的是,若第一體素具有第一體素資訊,則在重建過程中,需要為該第一體素分配計算記憶體,故在具有第一體素資訊的第一體素數量較多的情況下,模型重建所需的計算記憶體也較多,在此情況下,可以認為第一體素模型符合重採樣條件,並對第一體素模型進行重採樣,以減少模型重建所需的計算記憶體。In some embodiments, the resampling condition can be set as the number of first voxels with the first voxel information is more than a preset value. It should be noted that if the first voxel has the first voxel information, then in the reconstruction process, it is necessary to allocate computing memory for the first voxel, so when the number of first voxels with the first voxel information is relatively small If there are too many, the computing memory required for model reconstruction is also large. In this case, it can be considered that the first voxel model meets the resampling conditions, and the first voxel model is resampled to reduce the cost of model reconstruction. required computing memory.

在一些實施例中,第一體素模型可以包含若干第一區域,且第一區域包括預設數值個第一體素,如每個第一區域均可以包含

Figure 02_image063
個第一體素,k的數值在此不做限定,如可以設置為15、16、17等等。在此情況下,重採樣條件可以設置為包括:具有參考體素的第一區域多於預設閾值,參考體素為具有第一體素資訊的第一體素。也就是說,可以統計第一體素模型中具有參考體素的第一區域的數量,該數量越多,說明模型重建需要分配的計算記憶體也越多,則為了減少計算記憶體,可以對第一體素模型進行重採樣。 In some embodiments, the first voxel model may contain several first regions, and the first regions include a preset number of first voxels, such as each first region may contain
Figure 02_image063
The first voxel, the value of k is not limited here, for example, it can be set to 15, 16, 17 and so on. In this case, the resampling condition may be set to include: the first region with reference voxels is more than a preset threshold, and the reference voxels are the first voxels with the first voxel information. That is to say, the number of the first regions with reference voxels in the first voxel model can be counted. The larger the number, the more computing memory needs to be allocated for model reconstruction. In order to reduce the computing memory, the The first voxel model is resampled.

在一些實施例中,如前所述,若第一體素具有第一體素資訊,則在重建過程中,需要為該第一體素分配計算記憶體,還可以在得到第一體素模型之後,統計當前所消耗的計算記憶體,則重採樣條件可以設置為包括:當前所消耗的計算記憶體大於預設閾值。在此情況下,若第一體素模型符合重採樣條件,則為了降低後續出現卡頓等情況出現的概率,可以對第一體素模型進行重採樣,以減少計算記憶體。In some embodiments, as mentioned above, if the first voxel has the first voxel information, it is necessary to allocate computing memory for the first voxel during the reconstruction process, and the first voxel model can also be obtained Afterwards, the currently consumed computing memory is counted, and the resampling condition may be set to include: the currently consumed computing memory is greater than a preset threshold. In this case, if the first voxel model satisfies the resampling condition, in order to reduce the probability of occurrence of subsequent freezes, etc., the first voxel model may be resampled to reduce computing memory.

在一些實施例中,回應於第一體素模型不符合重採樣條件,可以將第一體素模型作為新的參考體素模型,並獲取新的深度圖像,以及重新執行將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型的步驟以及後續步驟,從而可以在模型重建過程中,不斷融入深度資訊,提升模型重建的效果。需要說明的是,新的深度圖像可以是以不同相機位姿對目標對象進行拍攝得到的。可以參閱下述相關描述。In some embodiments, in response to the fact that the first voxel model does not meet the resampling conditions, the first voxel model can be used as a new reference voxel model, and a new depth image is acquired, and the depth image of the target object is re-executed. The image and the reference voxel model are fused to obtain the first voxel model of the target object and subsequent steps, so that in the process of model reconstruction, depth information can be continuously integrated to improve the effect of model reconstruction. It should be noted that the new depth image may be obtained by shooting the target object with different camera poses. You can refer to the related description below.

在一些實施例中,每次在得到第一體素模型之後,也可以不檢測第一體素模型是否符合重採樣條件,而直接對第一體素模型進行重採樣。需要說明的是,在此情況下,為了盡可能地減少由於第一體素模型不符合重採樣條件仍然進行重採樣而帶來的精度損失,預設倍數可以設置地適當小一些。例如,在檢測第一體素模型是否符合重採樣條件的情況下,預設倍數可以設置為1.5、2等等,則在不檢測第一體素模型是否符合重採樣條件的情況下,預設倍數可以設置為1.1、1.2等等,在此不做限定。In some embodiments, each time after the first voxel model is obtained, the first voxel model may be directly resampled without checking whether the first voxel model meets the resampling condition. It should be noted that, in this case, in order to reduce as much as possible the loss of accuracy caused by resampling because the first voxel model does not meet the resampling conditions, the preset multiple can be set appropriately smaller. For example, in the case of detecting whether the first voxel model meets the resampling condition, the preset multiple can be set to 1.5, 2, etc., then in the case of not detecting whether the first voxel model meets the resampling condition, the preset The multiple can be set to 1.1, 1.2, etc., which is not limited here.

在一些實施例中,重採樣可以採用但不限於諸如三線性插值等插值演算法實現,可以參閱下述公開實施例。In some embodiments, resampling can be implemented by using but not limited to interpolation algorithms such as trilinear interpolation, and reference can be made to the following disclosed embodiments.

需要說明的是,本發明實施例以及下述公開實施例,即可以應用於即時掃描過程中的模型重建,也可以應用於掃描完畢之後的模型重建,在此不做限定。It should be noted that the embodiments of the present invention and the following disclosed embodiments can be applied to model reconstruction during real-time scanning, and can also be applied to model reconstruction after scanning, and are not limited here.

在一些實施例中,以即時掃描過程中進行模型重建為例,可以利用集成有RGB相機和深度相機的移動終端對目標對象進行拍攝,得到第一幀圖像資訊,且第一幀圖像資訊包括色彩圖像和深度圖像,並獲取拍攝第一幀圖像資訊時的相機位姿,以及將第一幀圖像資訊作為關鍵圖像資訊,在此基礎上,可以初始化一個初始模型,並採用本發明實施例中的模型重建方法,利用第一幀深度圖像和初始模型重建得到一個重建模型,作為下一次模型重建的參考體素模型;與此同時,在拍攝得到第二幀圖像資訊之後,可以結合位姿跟蹤演算法(如,最鄰近反覆運算演算法等)、第二幀圖像資訊和第一幀圖像資訊的相機位姿,得到第二幀圖像資訊的相機位姿,並在第二幀圖像資訊的相機位姿與第一幀圖像資訊的相機位姿之間的差異滿足預設條件(如,差異大於閾值)的情況下,將第二幀圖像資訊作為關鍵圖像資訊,在此基礎上,可以利用第二幀深度圖像和最新得到的參考體素模型重建得到一個重建模型,作為下一次模型重建的參考體素模型,反之若不滿足預設條件,則繼續對第三幀圖像資訊的相機位姿進行跟蹤,並檢測第三幀圖像資訊是否可以作為關鍵圖像資訊,若可以則利用第三幀深度圖像和最新得到的參考體素模型重建得到一個重建模型,作為下一次模型重建的參考體素模型,若不可以則繼續對第四幀圖像資訊進行位姿跟蹤,以此類推,直至掃描完畢,從而可以在掃描過程中,不斷融入深度資訊,提升模型重建效果。需要說明的,每次利用參考體素模型和深度圖像進行模型重建的過程,可以參閱前述相關描述。In some embodiments, taking model reconstruction during real-time scanning as an example, a mobile terminal integrated with an RGB camera and a depth camera can be used to photograph the target object to obtain the first frame of image information, and the first frame of image information Including color images and depth images, and obtaining the camera pose when shooting the first frame of image information, and using the first frame of image information as key image information, on this basis, an initial model can be initialized, and Using the model reconstruction method in the embodiment of the present invention, a reconstruction model is obtained by reconstructing the first frame of depth image and the initial model as a reference voxel model for the next model reconstruction; at the same time, the second frame of image is obtained after shooting After information, the camera position of the second frame of image information can be obtained by combining the pose tracking algorithm (such as the nearest neighbor iterative algorithm, etc.), the second frame of image information and the camera pose of the first frame of image information. pose, and when the difference between the camera pose of the second frame of image information and the camera pose of the first frame of image information satisfies a preset condition (for example, the difference is greater than a threshold), the second frame of image Information is the key image information. On this basis, a reconstruction model can be reconstructed by using the second frame depth image and the latest reference voxel model, which will be used as the reference voxel model for the next model reconstruction. If the condition is set, continue to track the camera pose of the third frame of image information, and check whether the third frame of image information can be used as the key image information, and if so, use the third frame of depth image and the latest reference Voxel model reconstruction obtains a reconstructed model as the reference voxel model for the next model reconstruction. If not possible, continue to perform pose tracking on the fourth frame of image information, and so on until the scanning is completed, so that the scanning process can In-depth information is continuously integrated to improve the model reconstruction effect. It should be noted that for each process of model reconstruction using the reference voxel model and the depth image, reference may be made to the foregoing related descriptions.

在一些實施例中,以掃描完畢之後進行模型重建為例,如前所述,在掃描過程中,可以不斷進行位姿跟蹤,得到關鍵圖像資訊,則在掃描完畢之後,可以得到以掃描時間有早到晚排序的若干關鍵圖像資訊及其相機位姿。在此基礎上,可以依序選擇一個關鍵圖像資訊,並利用該關鍵圖像資訊中深度圖像與最新得到的參考體素模型重建得到一個重建模型,並作為下一次模型重建的參考體素模型,以此類推,直至關鍵圖像資訊均被選擇為止。需要說明的是,在首次模型重建時,可以初始化一個初始模型,作為參考體素模型。此外,每次利用參考體素模型和深度圖像進行模型重建的過程,可以參閱前述相關描述。In some embodiments, take model reconstruction after scanning as an example. As mentioned above, during the scanning process, pose tracking can be performed continuously to obtain key image information. After scanning, the scanning time can be obtained. There are several key image information and their camera poses sorted from early to late. On this basis, a key image information can be selected sequentially, and a reconstruction model can be obtained by using the depth image in the key image information and the latest reference voxel model, which can be used as the reference voxel for the next model reconstruction model, and so on, until key image information is selected. It should be noted that, when the model is reconstructed for the first time, an initial model can be initialized as a reference voxel model. In addition, for each process of model reconstruction using the reference voxel model and the depth image, reference may be made to the aforementioned related descriptions.

上述方案,將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型,且第一體素模型相鄰第一體素間隔第一體素距離,且至少部分第一體素具有第一體素資訊,再對第一體素模型進行重採樣,以得到第二體素模型,且第二體素模型中相鄰第二體素間隔第二體素距離,第二體素距離大於第一體素距離,至少部分第二體素具有第二體素資訊,由於第二體素距離大於第一體素距離,一方面能夠在重採樣之後不會損失模型的表示範圍,且另一方面由於直接在第一體素模型基礎上進行重採樣即可得到第二體素模型,而無需從頭開始重新重建,也能夠提升模型重建的時間效率,故能夠在確保重建完整性的基礎上,提升重建時間效率。此外,由於第二體素距離大於第一體素距離,還能夠減少表示目標對象所需的體素數量,從而能夠有利於減少模型重建所需的計算記憶體,故有利於在有限的計算記憶體下,同時確保重建完整性,並提升時間效率。In the above solution, the depth image of the target object is fused with the reference voxel model to obtain the first voxel model of the target object, and the first voxel model is adjacent to the first voxel with a first voxel distance, and at least part of The first voxel has first voxel information, and then the first voxel model is resampled to obtain a second voxel model, and in the second voxel model, adjacent second voxels are separated by a second voxel distance, The second voxel distance is greater than the first voxel distance, and at least some of the second voxels have second voxel information. Since the second voxel distance is greater than the first voxel distance, on the one hand, the model can not be lost after resampling represents the range, and on the other hand, the second voxel model can be obtained by resampling directly on the basis of the first voxel model, without having to rebuild from scratch, and can also improve the time efficiency of model reconstruction, so it is possible to ensure that the reconstruction On the basis of completeness, the reconstruction time efficiency is improved. In addition, because the second voxel distance is greater than the first voxel distance, it can also reduce the number of voxels required to represent the target object, which can help reduce the computational memory required for model reconstruction. body while ensuring reconstruction integrity and improving time efficiency.

請參閱圖4,圖4是圖1中步驟S12一實施例的流程示意圖。本發明實施例中,第一體素模型和第二體素模型均位於世界座標系,可以包括如下步驟。Please refer to FIG. 4 , which is a schematic flowchart of an embodiment of step S12 in FIG. 1 . In the embodiment of the present invention, both the first voxel model and the second voxel model are located in the world coordinate system, which may include the following steps.

步驟S41:篩選第一體素作為第二體素的候選體素。Step S41: Screen the first voxel as a candidate voxel for the second voxel.

在一些實施例中,如前所述,第一體素模型可以包含若干第一區域,第二體素模型可以包含若干第二區域,且第一區域包含預設數值個第一體素,第二區域包含預設數值個第二體素,預設數值可以設置為

Figure 02_image063
,k的數值可以設置為15、16、17等等,在此不做限定。在此基礎上,可以在若干第一區域中篩選候選區域,且候選區域中至少一個第一體素具有第一體素資訊,從而選擇與候選區域至少部分重合的第二區域,作為與候選區域對應的目標區域,再選擇目標區域內預設數值個第二體素,以分別為各個選擇的第二體素篩選第一體素,得到候選體素,也就是說,可以將各個選擇的第二體素,作為即將確定第二體素資訊的第二體素。上述方式,能夠在將第一體素模型和第二體素模型劃分區域的基礎上,根據區域劃分針對性地選擇第二區域,以將其內預設閾值個第二體素作為後續即將確定第二體素資訊的第二體素,能夠排除其他無關的第二體素對重採樣的影響,有利於加速模型重建。 In some embodiments, as mentioned above, the first voxel model may contain several first regions, the second voxel model may contain several second regions, and the first region contains a preset number of first voxels, and the second voxel model may contain several second regions. The second area contains a preset number of second voxels, and the preset value can be set to
Figure 02_image063
, the value of k can be set to 15, 16, 17, etc., which is not limited here. On this basis, the candidate area can be screened in several first areas, and at least one first voxel in the candidate area has the first voxel information, so as to select the second area that at least partially overlaps with the candidate area as the candidate area. The corresponding target area, and then select a preset number of second voxels in the target area to screen the first voxels for each selected second voxel to obtain candidate voxels, that is to say, each selected second voxel can be The second voxel is used as the second voxel to determine the second voxel information. In the above method, on the basis of dividing the first voxel model and the second voxel model into regions, the second region can be targetedly selected according to the region division, so that the preset threshold second voxels in it can be used as subsequent determinations. The second voxel of the second voxel information can eliminate the influence of other irrelevant second voxels on resampling, which is beneficial to speed up model reconstruction.

在一些實施例中,請結合參閱圖3,以k=2為例,左側2*2*2的第一區域內第一體素(即左側2*2*2個由斜線陰影所填充的圓形)具有第一體素資訊,則可以將該第一區域作為候選區域,該第一區域與圖3所示2*2*2的第二區域(即圖3中2*2*2個由黑色陰影填充的圓形)部分重合,則可以將該第二區域作為目標區域,並將該目標區域內2*2*2個第二體素作為即將確定第二體素資訊的第二體素。其他情況可以以此類推,在此不再一一舉例。In some embodiments, please refer to FIG. 3 , taking k=2 as an example, the first voxel in the first area of 2*2*2 on the left side (that is, the 2*2*2 circles filled with slash shadows on the left side shape) has the first voxel information, then the first region can be used as a candidate region, which is the same as the second region of 2*2*2 shown in Figure 3 (that is, the 2*2*2 in Figure 3 composed of The circle filled with black shadow) partially overlaps, then the second area can be used as the target area, and the 2*2*2 second voxels in the target area can be used as the second voxels to determine the second voxel information . Other situations can be deduced by analogy, and no more examples will be given here.

在一些實施例中,為了便於描述,可以將第一體素模型中候選區域記為

Figure 02_image065
,各個候選區域對應的目標區域可以記為
Figure 02_image067
,在此基礎上,對於上述目標區域集合
Figure 02_image069
每一個目標區域
Figure 02_image071
內各個第二體素
Figure 02_image073
均可以執行下述插值計算過程。 In some embodiments, for the convenience of description, the candidate region in the first voxel model can be recorded as
Figure 02_image065
, the target area corresponding to each candidate area can be recorded as
Figure 02_image067
, on this basis, for the above target area set
Figure 02_image069
each target area
Figure 02_image071
Each second voxel in
Figure 02_image073
Both can perform the following interpolation calculation process.

在一些實施例中,在獲取即將確定第二體素資訊的第二體素

Figure 02_image075
之後,可以根據第二體素
Figure 02_image075
在世界座標系中的位置座標
Figure 02_image077
,在第一體素模型中搜索與該第二體素
Figure 02_image075
最接近的八個第一體素,作為其候選體素。請結合參閱圖3,以圖3中實線箭頭所指第二體素為例,可以先在z座標軸方向低於該第二體素的第一體素中搜索一個與該第二體素最接近的第一體素,如可以搜索到虛線箭頭所指第一體素,在此基礎上,可以將該第一體素右側相鄰的第一體素、後方相鄰的第一體素以及上方相鄰的第一體素均作為該第二體素的候選體素,以及這些候選體素作為頂點的正方體上其他第一體素也作為該第二體素的候選體素,即可以獲取到該第二體素的八個最接近的候選體素。其他情況可以以此類推,在此不再一一舉例。 In some embodiments, after obtaining the second voxel that is about to determine the second voxel information
Figure 02_image075
Then, according to the second voxel
Figure 02_image075
Position coordinates in the world coordinate system
Figure 02_image077
, in the first voxel model to search for the second voxel
Figure 02_image075
The eight closest first voxels are taken as its candidate voxels. Please refer to FIG. 3. Taking the second voxel indicated by the solid arrow in FIG. 3 as an example, you can first search for a voxel that is closest to the second voxel in the z-axis direction of the first voxel that is lower than the second voxel. The closest first voxel, if the first voxel indicated by the dotted arrow can be searched, on this basis, the first voxel adjacent to the right side of the first voxel, the first voxel adjacent to the rear and The first voxels adjacent above are all candidates for the second voxel, and the other first voxels on the cube whose vertices are the vertices of these candidate voxels are also candidates for the second voxel, that is, you can get The eight closest candidate voxels to this second voxel. Other situations can be deduced by analogy, and no more examples will be given here.

步驟S42:基於第二體素和候選體素在世界座標系中的偏離距離,得到候選體素的參考權重。Step S42: Obtain the reference weight of the candidate voxel based on the deviation distance between the second voxel and the candidate voxel in the world coordinate system.

在一些實施例中,偏離距離與參考權重負相關,也就是說,偏離距離越大,參考權重越小,而偏離距離越小,參考權重越大,故能夠盡可能多地參考與第二體素較近的候選體素的第一體素資訊,而盡可能少地參考與第二體素較遠的候選體素的第一體素資訊,有利於提升第二體素資訊的準確性。In some embodiments, the deviation distance is negatively correlated with the reference weight, that is, the greater the deviation distance, the smaller the reference weight, and the smaller the deviation distance, the greater the reference weight, so as much as possible can be referenced with the second volume The first voxel information of the candidate voxels that are closer to the second voxel, and the first voxel information of the candidate voxels that are farther away from the second voxel are referred to as little as possible, which is beneficial to improve the accuracy of the second voxel information.

在一些實施例中,世界座標系由第一座標軸、第二座標軸和第三座標軸構成,則可以基於第二體素和候選體素在第一座標軸上的第一偏離距離,得到候選體素的第一權重,並基於第二體素和候選體素在第二座標軸上的第二偏離距離,得到候選體素的第二權重,以及基於第二體素和候選體素在第三座標軸上的第三偏離距離,得到候選體素的第三權重,在此基礎上,可以再基於第一權重、第二權重和第三權重,得到候選體素的參考權重。上述方式,能夠在世界座標系的各個方向上分別衡量權重,有利於提升參考權重的準確性。In some embodiments, the world coordinate system is composed of the first coordinate axis, the second coordinate axis and the third coordinate axis, then the candidate voxel can be obtained based on the first deviation distance between the second voxel and the candidate voxel on the first coordinate axis The first weight, and based on the second deviation distance between the second voxel and the candidate voxel on the second coordinate axis, the second weight of the candidate voxel is obtained, and based on the distance between the second voxel and the candidate voxel on the third coordinate axis The third deviation distance obtains the third weight of the candidate voxel, and on this basis, the reference weight of the candidate voxel can be obtained based on the first weight, the second weight and the third weight. The above method can measure the weights in each direction of the world coordinate system, which is beneficial to improve the accuracy of the reference weights.

在一些實施例中,第一權重與第一偏離距離負相關,第二權重與第二偏離距離負相關,第三權重與第三偏離距離負相關。In some embodiments, the first weight is negatively correlated with the first offset distance, the second weight is negatively correlated with the second offset distance, and the third weight is negatively correlated with the third offset distance.

在一些實施例中,在得到第一權重、第二權重和第三權重之後,可以將第一權重、第二權重和第三權重相乘,得到候選體素的參考權重。In some embodiments, after the first weight, the second weight and the third weight are obtained, the first weight, the second weight and the third weight may be multiplied to obtain the reference weight of the candidate voxel.

在一些實施例中,為了便於描述,可以將第一座標軸記為x軸,第二座標軸記為y軸,第三座標軸記為z軸,則對於第二體素

Figure 02_image075
而言,其候選體素v的第一權重
Figure 02_image079
、第二權重
Figure 02_image081
、第三權重
Figure 02_image083
可以分別表示為公式(7)、公式(8)、公式(9):
Figure 02_image085
……(7)
Figure 02_image087
……(8)
Figure 02_image089
……(9) In some embodiments, for ease of description, the first coordinate axis can be marked as x-axis, the second coordinate axis can be marked as y-axis, and the third coordinate axis can be marked as z-axis, then for the second voxel
Figure 02_image075
In terms of, the first weight of its candidate voxel v
Figure 02_image079
, the second weight
Figure 02_image081
, the third weight
Figure 02_image083
It can be expressed as formula (7), formula (8), formula (9):
Figure 02_image085
... (7)
Figure 02_image087
……(8)
Figure 02_image089
……(9)

上述公式(7)、(8)和(9)中,

Figure 02_image091
Figure 02_image093
Figure 02_image095
分別表示第二體素
Figure 02_image075
分別在x軸、y軸、z軸上的座標值,
Figure 02_image097
Figure 02_image099
Figure 02_image101
分別表示候選體素分別在在x軸、y軸、z軸上的座標值。此外,
Figure 02_image103
表示第一體素距離。 In the above formulas (7), (8) and (9),
Figure 02_image091
,
Figure 02_image093
,
Figure 02_image095
respectively represent the second voxel
Figure 02_image075
The coordinate values on the x-axis, y-axis, and z-axis respectively,
Figure 02_image097
,
Figure 02_image099
,
Figure 02_image101
represent the coordinate values of the candidate voxels on the x-axis, y-axis, and z-axis respectively. also,
Figure 02_image103
Indicates the first voxel distance.

步驟S43:基於候選體素的第一體素資訊和參考權重,得到第二體素的第二體素資訊。Step S43: Obtain second voxel information of the second voxel based on the first voxel information of the candidate voxel and the reference weight.

在一些實施例中,可以利用各個候選體素的參考權重分別對對應候選體素的第一體素資訊進行加權處理,得到第二體素的第二體素資訊,這樣通過簡單加權計算即可得到第二體素資訊,有利於減少模型重建所需的計算記憶體。In some embodiments, the reference weights of each candidate voxel can be used to weight the first voxel information of the corresponding candidate voxel to obtain the second voxel information of the second voxel, which can be obtained through simple weighting calculation. Obtaining the second voxel information is beneficial to reduce the computational memory required for model reconstruction.

在一些實施例中,第二體素資訊包括第二截斷符號距離,第一體素資訊包括第一截斷符號距離,則第二體素

Figure 02_image075
的第二截斷符號距離
Figure 02_image105
可以表示為公式(10):
Figure 02_image107
……(10) In some embodiments, the second voxel information includes a second truncated signed distance, the first voxel information includes a first truncated signed distance, then the second voxel
Figure 02_image075
The second truncated signed distance of
Figure 02_image105
can be expressed as formula (10):
Figure 02_image107
... (10)

上述公式(10)中,

Figure 02_image109
表示第二體素
Figure 02_image075
的候選體素集合,
Figure 02_image029
表示候選體素的第一截斷符號距離。 In the above formula (10),
Figure 02_image109
represents the second voxel
Figure 02_image075
The set of candidate voxels,
Figure 02_image029
Indicates the first truncated sign distance of candidate voxels.

在一些實施例中,第二體素資訊還包括第二體素權重,第一體素資訊還包括第一體素權重,則第二體素

Figure 02_image075
的第二體素權重
Figure 02_image111
可以表示為公式(11):
Figure 02_image113
……(11) In some embodiments, the second voxel information further includes a second voxel weight, the first voxel information further includes a first voxel weight, then the second voxel
Figure 02_image075
The second voxel weight of
Figure 02_image111
can be expressed as formula (11):
Figure 02_image113
... (11)

上述公式(11)中,

Figure 02_image109
表示第二體素
Figure 02_image075
的候選體素集合,
Figure 02_image115
表示候選體素的第一體素權重。需要說明的是,在採用第二體素的八個最接近的候選體素的情況下,可以採用上述公式(7)至公式(11),來計算該第二體素的第二體素資訊。其他情況可以以此類推,在此不再一一舉例。 In the above formula (11),
Figure 02_image109
represents the second voxel
Figure 02_image075
The set of candidate voxels,
Figure 02_image115
Indicates the first voxel weight of the candidate voxel. It should be noted that, in the case of using the eight closest candidate voxels of the second voxel, the above formula (7) to formula (11) can be used to calculate the second voxel information of the second voxel . Other situations can be deduced by analogy, and no more examples will be given here.

上述方案,第一體素模型和第二體素模型均位於世界座標系,通過篩選第一體素作為第二體素的候選體素,並基於第二體素和候選體素在世界座標系中的偏離距離,得到候選體素的參考權重,在此基礎上,再基於候選體素的第一體素資訊和參考權重,得到第二體素的第二體素資訊,從而能夠根據各個候選體素分別與第二體素的偏離距離而不同程度地參考各個候選體素的第一體素資訊,進而一方面能夠提升第二體素資訊的準確性,有利於提升第二體素模型的準確性,另一方面由於僅需簡單運算即可得到第二體素資訊,有利於減少模型重建的計算記憶體。In the above scheme, both the first voxel model and the second voxel model are located in the world coordinate system, by screening the first voxel as the candidate voxel of the second voxel, and based on the second voxel and the candidate voxel in the world coordinate system The reference weight of the candidate voxel is obtained based on the deviation distance in , and on this basis, based on the first voxel information and reference weight of the candidate voxel, the second voxel information of the second voxel is obtained, so that each candidate voxel can be obtained according to The deviation distances between the voxels and the second voxels refer to the first voxel information of each candidate voxel to varying degrees, and on the one hand, it can improve the accuracy of the second voxel information, which is conducive to improving the accuracy of the second voxel model. Accuracy, on the other hand, because the second voxel information can be obtained only by simple calculations, it is beneficial to reduce the computational memory for model reconstruction.

請參閱圖5,圖5是本發明實施例模型重建方法另一實施例的流程示意圖。可以包括如下步驟。Please refer to FIG. 5 . FIG. 5 is a schematic flowchart of another embodiment of a model reconstruction method according to an embodiment of the present invention. The following steps may be included.

步驟S51:將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型。Step S51: Fusion the depth image of the target object with the reference voxel model to obtain a first voxel model of the target object.

本發明實施例中,第一體素模型中相鄰第一體素間隔第一體素距離,且至少部分第一體素具有第一體素資訊。可以參閱前述公開實施例中相關描述。In an embodiment of the present invention, adjacent first voxels in the first voxel model are separated by a first voxel distance, and at least some of the first voxels have first voxel information. Reference may be made to relevant descriptions in the aforementioned disclosed embodiments.

步驟S52:基於具有第一體素資訊的第一體素,檢測第一體素模型是否符合重採樣條件,若是則執行步驟S53,否則執行步驟S56。Step S52: Based on the first voxel with the first voxel information, detect whether the first voxel model meets the resampling condition, if yes, perform step S53, otherwise, perform step S56.

在一些實施例中,第一體素模型包含若干第一區域,第一區域包含預設數值個第一體素,重採樣條件包括:具有參考體素的第一區域多於第一閾值,且參考體素為具有第一體素資訊的第一體素,可以參閱前述公開實施例中相關描述。In some embodiments, the first voxel model includes a plurality of first regions, the first regions include a preset number of first voxels, and the resampling condition includes: the first region with reference voxels is more than a first threshold, and The reference voxel is the first voxel with the first voxel information, and reference can be made to related descriptions in the aforementioned disclosed embodiments.

在一些實施例中,重採樣條件可以設置為包括:具有第一體素資訊的第一體素多於第二閾值,由於具有第一體素資訊的第一體素會佔據計算記憶體,故通過衡量具有第一體素資訊的第一體素來設置重採樣條件,有利於在有限的計算記憶體的情況下實現模型重建。可以參閱前述公開實施例中相關描述。In some embodiments, the resampling condition can be set to include: the first voxels with the first voxel information are more than the second threshold, since the first voxels with the first voxel information will occupy the computing memory, so Setting the resampling condition by measuring the first voxel with the first voxel information is beneficial to realize model reconstruction under the condition of limited computing memory. Reference may be made to relevant descriptions in the aforementioned disclosed embodiments.

步驟S53:對第一體素模型進行重採樣,以得到第二體素模型。Step S53: Resampling the first voxel model to obtain a second voxel model.

本發明實施例中,第二體素模型中相鄰第二體素間隔第二體素距離,第二體素距離大於第一體素距離,且至少部分第二體素具有第二體素資訊。可以參閱前述公開實施例中相關描述In the embodiment of the present invention, adjacent second voxels in the second voxel model are separated by a second voxel distance, the second voxel distance is greater than the first voxel distance, and at least some of the second voxels have second voxel information . You can refer to the relevant descriptions in the aforementioned disclosed embodiments

步驟S54:將第二體素模型作為新的參考體素模型,並獲取新的深度圖像。Step S54: using the second voxel model as a new reference voxel model, and acquiring a new depth image.

在對第一體素模型進行重採樣,並獲取到第二體素模型之後,可以將第二體素模型作為新的參考部分,並獲取新的深度圖像,以進行下一次模型重建。After resampling the first voxel model and obtaining the second voxel model, the second voxel model can be used as a new reference part, and a new depth image can be obtained for the next model reconstruction.

步驟S55:重新執行步驟S51以及後續步驟。Step S55: Re-execute step S51 and subsequent steps.

在將第二體素模型作為新的參考體素模型,並獲取新的深度圖像之後,即可重新執行上述步驟S51以及後續步驟,以再次融入新的深度資訊。After the second voxel model is used as a new reference voxel model and a new depth image is obtained, the above step S51 and subsequent steps can be re-executed to incorporate new depth information again.

步驟S56:將第一體素模型作為新的參考體素模型,並獲取新的深度圖像。Step S56: using the first voxel model as a new reference voxel model, and acquiring a new depth image.

如果第一體素模型不符合重採樣條件,則可以將第一體素模型作為新的參考體素模型,並獲取新的深度圖像,以進行下一次模型重建。If the first voxel model does not meet the resampling conditions, the first voxel model can be used as a new reference voxel model, and a new depth image can be obtained for the next model reconstruction.

步驟S57:重新執行步驟S51以及後續步驟。Step S57: Re-execute step S51 and subsequent steps.

在將第一體素模型作為新的參考體素模型,並獲取新的深度圖像之後,即可重新執行上述步驟S51以及後續步驟,以再次融入新的深度資訊,這樣能夠不斷融入深度資訊,提升模型重建的準確性和完整性。After using the first voxel model as a new reference voxel model and obtaining a new depth image, the above step S51 and subsequent steps can be re-executed to integrate new depth information again, so that depth information can be continuously integrated, Improve the accuracy and completeness of model reconstructions.

需要說明的是,本發明實施例可以應用於即時掃描過程中的模型重建,也可以應用於掃描完畢之後的模型重建,在此不做限定,可以參閱前述公開實施例中相關描述。It should be noted that the embodiments of the present invention can be applied to model reconstruction during real-time scanning, and can also be applied to model reconstruction after scanning, which is not limited here, and reference can be made to relevant descriptions in the aforementioned disclosed embodiments.

請結合參閱圖6a-圖6c,圖6a是本發明實施例模型重建方法中的第一體素模型效果示意圖,圖6b是本發明實施例模型重建方法中的第二體素模型效果示意圖,圖6c是本發明實施例模型重建方法中的最終模型效果示意圖,如圖6a-圖6c所示,在基於截斷符號距離得到各階段的重建模型之後,可以採用諸如移動立方體(Marching Cubes,MC)提取出網格模型,可見在第一體素模型、重採樣之後的第二體素模型以及重建完畢之後的最終模型三個階段中,網格模型的幾何外形基本一致,但是相較於第一體素模型而言,第二體素模型和最終模型的網格密度有所降低,故有利於在有限的計算記憶體下,同時確保重建完整性,並提升時間效率,從而使得模型重建能夠適於手機、平板電腦等移動終端應用。此外,在獲取到最終模型之後,可以對該最終模型進行紋理貼圖等處理,以得到目標對象的渲染模型,該渲染模型可以應用於擴增實境(Augmented Reality,AR)、虛擬實境(Virtual Reality,VR)等場景中,在此不做限定。Please refer to Fig. 6a-Fig. 6c in combination. Fig. 6a is a schematic diagram of the effect of the first voxel model in the model reconstruction method of the embodiment of the present invention, and Fig. 6b is a schematic diagram of the effect of the second voxel model in the model reconstruction method of the embodiment of the present invention, Fig. 6c is a schematic diagram of the final model effect in the model reconstruction method of the embodiment of the present invention, as shown in Figure 6a-Figure 6c, after the reconstruction model of each stage is obtained based on the truncated symbol distance, such as moving cube (Marching Cubes, MC) can be used to extract From the grid model, it can be seen that in the three stages of the first voxel model, the second voxel model after resampling, and the final model after reconstruction, the geometric shape of the grid model is basically the same, but compared with the first voxel model For the voxel model, the grid density of the second voxel model and the final model is reduced, so it is beneficial to ensure the integrity of the reconstruction and improve the time efficiency under the limited computing memory, so that the model reconstruction can be suitable for Mobile terminal applications such as mobile phones and tablets. In addition, after the final model is obtained, texture mapping and other processing can be performed on the final model to obtain a rendering model of the target object, which can be applied to augmented reality (Augmented Reality, AR), virtual reality (Virtual Reality) Reality, VR) and other scenarios, there is no limitation here.

上述方案,將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型,基於具有第一體素資訊的第一體素,檢測第一體素模型是否符合重採樣條件,若是則對第一體素模型進行重採樣,以得到第二體素模型,將第二體素模型作為新的參考體素模型,並獲取新的深度圖像以及重新執行上述融合過程,否則將第一體素模型作為新的參考體素模型,並獲取新的深度圖像以及重新執行上述融合過程,故能夠在重建過程中自我調整地調整體素間距,有利於在有限的計算記憶體下,同時確保重建完整性,並提升時間效率。In the above solution, the depth image of the target object is fused with the reference voxel model to obtain the first voxel model of the target object, and based on the first voxel with the first voxel information, it is detected whether the first voxel model conforms to the Sampling conditions, if so, resample the first voxel model to obtain the second voxel model, use the second voxel model as a new reference voxel model, and obtain a new depth image and re-execute the above fusion process , otherwise, the first voxel model is used as a new reference voxel model, and a new depth image is obtained and the above fusion process is performed again, so the voxel spacing can be self-adjusted during the reconstruction process, which is beneficial in the limited calculation memory while ensuring reconstruction integrity and improving time efficiency.

請參閱圖7,圖7是本發明實施例模型重建裝置70一實施例的方塊示意圖。模型重建裝置70包括:深度融合部分71和重採樣部分72,深度融合部分71,被配置為將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型;其中,第一體素模型中相鄰第一體素間隔第一體素距離,且至少部分第一體素具有第一體素資訊;重採樣部分72,被配置為對第一體素模型進行重採樣,以得到第二體素模型;其中,第二體素模型中相鄰第二體素間隔第二體素距離,第二體素距離大於第一體素距離,且至少部分第二體素具有第二體素資訊。Please refer to FIG. 7 . FIG. 7 is a schematic block diagram of an embodiment of a model reconstruction device 70 according to an embodiment of the present invention. The model reconstruction device 70 includes: a depth fusion part 71 and a resampling part 72, the depth fusion part 71 is configured to fuse the depth image of the target object with the reference voxel model to obtain the first voxel model of the target object; , adjacent first voxels in the first voxel model are separated by a first voxel distance, and at least some of the first voxels have first voxel information; the resampling part 72 is configured to re-sample the first voxel model Sampling to obtain a second voxel model; wherein, adjacent second voxels in the second voxel model are separated by a second voxel distance, the second voxel distance is greater than the first voxel distance, and at least part of the second voxel Has second voxel information.

上述方案,將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型,且第一體素模型相鄰第一體素間隔第一體素距離,且至少部分第一體素具有第一體素資訊,再對第一體素模型進行重採樣,以得到第二體素模型,且第二體素模型中相鄰第二體素間隔第二體素距離,第二體素距離大於第一體素距離,至少部分第二體素具有第二體素資訊,由於第二體素距離大於第一體素距離,一方面能夠在重採樣之後不會損失模型的表示範圍,且另一方面由於直接在第一體素模型基礎上進行重採樣即可得到第二體素模型,而無需從頭開始重新重建,也能夠提升模型重建的時間效率,故能夠在確保重建完整性的基礎上,提升重建時間效率。此外,由於第二體素距離大於第一體素距離,還能夠減少表示目標對象所需的體素數量,從而能夠有利於減少模型重建所需的計算記憶體,故有利於在有限的計算記憶體下,同時確保重建完整性,並提升時間效率。In the above solution, the depth image of the target object is fused with the reference voxel model to obtain the first voxel model of the target object, and the first voxel model is adjacent to the first voxel with a first voxel distance, and at least part of The first voxel has first voxel information, and then the first voxel model is resampled to obtain a second voxel model, and in the second voxel model, adjacent second voxels are separated by a second voxel distance, The second voxel distance is greater than the first voxel distance, and at least some of the second voxels have second voxel information. Since the second voxel distance is greater than the first voxel distance, on the one hand, the model can not be lost after resampling represents the range, and on the other hand, the second voxel model can be obtained by resampling directly on the basis of the first voxel model, without having to rebuild from scratch, and can also improve the time efficiency of model reconstruction, so it is possible to ensure that the reconstruction On the basis of completeness, the reconstruction time efficiency is improved. In addition, because the second voxel distance is greater than the first voxel distance, it can also reduce the number of voxels required to represent the target object, which can help reduce the computational memory required for model reconstruction. body while ensuring reconstruction integrity and improving time efficiency.

在一些公開實施例中,第一體素模型和第二體素模型均位於世界座標系,重採樣部分72包括候選體素篩選子部分,被配置為篩選第一體素作為第二體素的候選體素;重採樣部分72包括參考權重計算子部分,被配置為基於第二體素和候選體素在世界座標系中的偏離距離,得到候選體素的參考權重;重採樣部分72包括體素資訊計算子部分,被配置為基於候選體素的第一體素資訊和參考權重,得到第二體素的第二體素資訊。In some disclosed embodiments, both the first voxel model and the second voxel model are located in the world coordinate system, and the resampling part 72 includes a candidate voxel screening subsection configured to screen the first voxel as the second voxel Candidate voxel; the resampling part 72 includes a reference weight calculation subsection, configured to obtain the reference weight of the candidate voxel based on the deviation distance between the second voxel and the candidate voxel in the world coordinate system; the resampling part 72 includes a voxel The voxel information calculation subpart is configured to obtain second voxel information of the second voxel based on the first voxel information of the candidate voxel and the reference weight.

因此,一方面能夠提升第二體素資訊的準確性,有利於提升第二體素模型的準確性,另一方面由於僅需簡單運算即可得到第二體素資訊,有利於減少模型重建的計算記憶體。Therefore, on the one hand, the accuracy of the second voxel information can be improved, which is conducive to improving the accuracy of the second voxel model; Computational memory.

在一些公開實施例中,世界座標系由第一座標軸、第二座標軸和第三座標軸構成,參考權重計算子部分包括第一權重計算單元,被配置為基於第二體素和候選體素在第一座標軸上的第一偏離距離,得到候選體素的第一權重,參考權重計算子部分包括第二權重計算單元,被配置為基於第二體素和候選體素在第二座標軸上的第二偏離距離,得到候選體素的第二權重,參考權重計算子部分包括第三權重計算單元,被配置為基於第二體素和候選體素在第三座標軸上的第三偏離距離,得到候選體素的第三權重,參考權重計算子部分包括參考權重計算單元,被配置為基於第一權重、第二權重和第三權重,得到候選體素的參考權重。In some disclosed embodiments, the world coordinate system is composed of a first coordinate axis, a second coordinate axis and a third coordinate axis, and the reference weight calculation subpart includes a first weight calculation unit configured to The first deviation distance on the coordinate axis obtains the first weight of the candidate voxel, and the reference weight calculation subpart includes a second weight calculation unit configured to be based on the second voxel and the second weight of the candidate voxel on the second coordinate axis The deviation distance is used to obtain the second weight of the candidate voxel, and the reference weight calculation subpart includes a third weight calculation unit configured to obtain the candidate voxel based on the third deviation distance between the second voxel and the candidate voxel on the third coordinate axis The third weight of the voxel, the reference weight calculation subpart includes a reference weight calculation unit configured to obtain the reference weight of the candidate voxel based on the first weight, the second weight and the third weight.

因此,能夠在世界座標系的各個方向上分別衡量權重,有利於提升參考權重的準確性。Therefore, being able to measure the weights in each direction of the world coordinate system is beneficial to improve the accuracy of the reference weights.

在一些公開實施例中,偏離距離與參考權重負相關;和/或,第二體素資訊是由各個候選體素的參考權重對候選體素的第一體素資訊加權處理得到的。In some disclosed embodiments, the deviation distance is negatively correlated with the reference weight; and/or, the second voxel information is obtained by weighting the reference weight of each candidate voxel to the first voxel information of the candidate voxel.

因此,偏離距離設置為與參考權重負相關,即偏離距離越大,參考權重越小,而偏離距離越小,參考權重越大,故能夠盡可能多地參考與第二體素較近的候選體素的第一體素資訊,而盡可能少地參考與第二體素較遠的候選體素的第一體素資訊,有利於提升第二體素資訊的準確性;而由於第二體素資訊是由各個候選體素的參考權重對候選體素的第一體素資訊加權處理得到的,故通過簡單加權計算即可得到第二體素資訊,有利於減少模型重建所需的計算記憶體。Therefore, the deviation distance is set to be negatively correlated with the reference weight, that is, the larger the deviation distance is, the smaller the reference weight is, and the smaller the deviation distance is, the greater the reference weight is, so it is possible to refer to as many candidates as possible that are closer to the second voxel. The first voxel information of the voxel, and refer to the first voxel information of the candidate voxel farther away from the second voxel as little as possible, which is beneficial to improve the accuracy of the second voxel information; and because the second voxel The voxel information is obtained by weighting the first voxel information of the candidate voxels with the reference weight of each candidate voxel, so the second voxel information can be obtained through simple weighting calculation, which is beneficial to reduce the computational memory required for model reconstruction body.

在一些公開實施例中,第一體素模型包含若干第一區域,第二體素模型包括若干第二區域,且第一區域包含預設數值個第一體素,第二區域包含預設數值個第二體素,重採樣部分72包括候選區域篩選子部分,被配置為在若干第一區域中篩選候選區域;其中,候選區域中至少一個第一體素具有第一體素資訊;重採樣部分72包括目標區域選擇子部分,被配置為選擇與候選區域至少部分重合的第二區域,作為與候選區域對應的目標區域;重採樣部分72包括第二體素選擇子部分,被配置為選擇目標區域內預設數值個第二體素,體素篩選子部分被配置為分別為各個選擇的第二體素篩選第一體素,得到候選體素。In some disclosed embodiments, the first voxel model includes a plurality of first regions, the second voxel model includes a plurality of second regions, and the first region contains a preset number of first voxels, and the second region contains a preset value a second voxel, the resampling part 72 includes a candidate area screening subsection configured to screen candidate areas in several first areas; wherein, at least one first voxel in the candidate area has first voxel information; resampling Part 72 includes a target area selection subsection configured to select a second area that at least partially overlaps with the candidate area as a target area corresponding to the candidate area; the resampling section 72 includes a second voxel selection subsection configured to select There are a preset number of second voxels in the target area, and the voxel screening subpart is configured to screen the first voxels for each selected second voxels to obtain candidate voxels.

因此,能夠在將第一體素模型和第二體素模型劃分區域的基礎上,根據區域劃分針對性地選擇第二區域,以將其內預設閾值個第二體素作為後續即將確定第二體素資訊的第二體素,能夠排除其他無關的第二體素對重採樣的影響,有利於加速模型重建。Therefore, on the basis of dividing the first voxel model and the second voxel model into regions, the second region can be targetedly selected according to the region division, so that the second voxels within the preset threshold can be used as the second voxels to be determined later. The second voxel of the two-voxel information can eliminate the influence of other irrelevant second voxels on resampling, which is beneficial to speed up model reconstruction.

在一些公開實施例中,模型重建裝置70還包括模型檢測部分,被配置為基於具有第一體素資訊的第一體素,檢測第一體素模型是否符合重採樣條件;模型重建裝置70還包括第一分支部分和第一獲取部分,第一分支部分被配置為結合重採樣部分72回應於第一體素模型符合重採樣條件,執行對第一體素模型進行重採樣,以得到第二體素模型的步驟。In some disclosed embodiments, the model reconstruction device 70 further includes a model detection part configured to detect whether the first voxel model meets the resampling condition based on the first voxel having the first voxel information; the model reconstruction device 70 also Including a first branch part and a first acquisition part, the first branch part is configured to perform resampling on the first voxel model in combination with the resampling part 72 in response to the first voxel model meeting the resampling condition, so as to obtain the second Steps for voxel models.

因此,通過具有第一體素資訊的第一體素,檢測第一體素模型是否符合重採樣條件,並回應於第一體素模型符合重採樣條件,執行對第一體素模型進行重採樣以得到第二體素模型的步驟,即在重採樣之前先檢測第一體素模型是否符合重採樣條件,能夠自我調整調整體素間距。Therefore, through the first voxel having the first voxel information, it is detected whether the first voxel model meets the resampling condition, and in response to the first voxel model meeting the resampling condition, resampling the first voxel model is performed The step of obtaining the second voxel model is to detect whether the first voxel model meets the resampling condition before resampling, and the voxel spacing can be adjusted by itself.

在一些公開實施例中,第一體素模型包含若干第一區域,第一區域包含預設數值個第一體素,重採樣條件包括:具有參考體素的第一區域多於第一閾值,且參考體素為具有第一體素資訊的第一體素;或者,重採樣條件包括:具有第一體素資訊的第一體素多於第二閾值。In some disclosed embodiments, the first voxel model includes a plurality of first regions, the first regions include a preset number of first voxels, and the resampling condition includes: the number of first regions with reference voxels is greater than a first threshold, And the reference voxel is the first voxel with the first voxel information; or, the resampling condition includes: the first voxel with the first voxel information is more than the second threshold.

因此,第一體素模型包括若干第一區域,第一區域包含預設數值個第一體素,重採樣條件設置為具有參考體素的第一區域多於第一閾值,且參考體素為具有第一體素資訊的第一體素,或者,重採樣條件設置為包括具有第一體素資訊的第一體素多於第二閾值,由於具有第一體素資訊的第一體素會佔據計算記憶體,故通過衡量具有第一體素資訊的第一體素來設置重採樣條件,有利於在有限的計算記憶體的情況下實現模型重建。Therefore, the first voxel model includes several first regions, the first regions contain a preset number of first voxels, the resampling condition is set to have more first regions with reference voxels than the first threshold, and the reference voxels are the first voxel with the first voxel information, or the resampling condition is set to include more than the second threshold of the first voxel with the first voxel information, since the first voxel with the first voxel information will Occupies computing memory, so the resampling condition is set by measuring the first voxel with information of the first voxel, which is beneficial to realize model reconstruction under the condition of limited computing memory.

在一些公開實施例中,第一分支部分還被配置為結合第一獲取部分將第二體素模型作為新的參考體素模型,並獲取新的深度圖像,以及結合深度融合部分71重新執行將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型的步驟;和/或,模型重建裝置70還包括第二分支部分和第二獲取部分,第二分支部分被配置為結合第二獲取部分回應於第一體素模型不符合重採樣條件,將第一體素模型作為新的參考體素模型,並獲取新的深度圖像,並結合深度融合部分71重新執行將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型的步驟。In some disclosed embodiments, the first branch part is further configured to use the second voxel model as a new reference voxel model in combination with the first acquisition part, and acquire a new depth image, and re-execute in combination with the depth fusion part 71 The step of fusing the depth image of the target object with the reference voxel model to obtain the first voxel model of the target object; and/or, the model reconstruction device 70 also includes a second branch part and a second acquisition part, the second branch The part is configured to combine the second acquisition part in response to the first voxel model not meeting the resampling condition, use the first voxel model as a new reference voxel model, and acquire a new depth image, and combine the depth fusion part 71 Re-executing the step of fusing the depth image of the target object with the reference voxel model to obtain the first voxel model of the target object.

因此,將第二體素模型作為新的參考體素模型,並獲取新的深度圖像,以及重新執行將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型的步驟以及後續步驟,能夠不斷融入深度資訊,提升模型重建的準確性和完整性,而回應於第一體素模型不符合重採樣條件,將第一體素模型作為新的參考體素模型,並獲取新的深度圖像,以及重新執行將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型的步驟以及後續,故能夠不斷融入深度資訊,提升模型重建的準確性和完整性。Therefore, the second voxel model is used as a new reference voxel model, and a new depth image is obtained, and the depth image of the target object is fused with the reference voxel model to obtain the first voxel of the target object The steps of the model and subsequent steps can continuously incorporate in-depth information to improve the accuracy and completeness of model reconstruction. In response to the fact that the first voxel model does not meet the resampling conditions, the first voxel model is used as a new reference voxel model , and obtain a new depth image, and re-execute the steps of fusing the depth image of the target object with the reference voxel model to obtain the first voxel model of the target object and the follow-up, so it can continuously integrate depth information and improve the model Accuracy and completeness of reconstruction.

在一些公開實施例中,第一體素模型和參考體素模型均位於世界座標系,參考體素模型中相鄰體素間隔第一體素距離,且第一體素資訊包括第一體素的第一截斷符號距離和第一體素權重,深度融合部分71包括待融合體素篩選子部分,被配置為基於深度圖像中的圖元點反投影至世界座標系的投影點,在參考體素模型中選擇體素作為待融合體素;深度融合部分71包括待融合截斷符號距離獲取子部分,被配置為基於相機內參和拍攝深度圖像時的相機位姿,獲取待融合體素的待融合截斷符號距離;深度融合部分71包括第一截斷符號距離獲取子部分,被配置為基於待融合體素在參考體素模型中體素權重,將待融合截斷符號距離和待融合體素在參考體素模型中參考截斷符號距離進行融合,得到與待融合體素位置對應的第一體素的第一截斷符號距離;深度融合部分71包括第一體素權重獲取子部分,被配置為將待融合體素在參考體素模型中體素權重進行更新,得到與待融合體素位置對應的第一體素的第一體素權重。In some disclosed embodiments, both the first voxel model and the reference voxel model are located in the world coordinate system, adjacent voxels in the reference voxel model are separated by a first voxel distance, and the first voxel information includes the first voxel The first truncated symbol distance and the first voxel weight, the depth fusion part 71 includes a voxel screening subsection to be fused, which is configured to back-project the primitive point in the depth image to the projection point of the world coordinate system, in the reference Select voxel in the voxel model as the voxel to be fused; the depth fusion part 71 includes a truncated sign distance acquisition subsection to be fused, which is configured to obtain the voxel to be fused based on the internal reference of the camera and the camera pose when shooting the depth image. The truncated symbol distance to be fused; the depth fusion part 71 includes a first truncated symbol distance acquisition subsection, which is configured to combine the truncated symbol distance to be fused and the voxel to be fused in the reference voxel model based on the weight of the voxel to be fused. In the reference voxel model, the reference truncated symbol distance is fused to obtain the first truncated symbol distance of the first voxel corresponding to the position of the voxel to be fused; the depth fusion part 71 includes a first voxel weight acquisition subsection, which is configured to The voxel weight of the voxel to be fused is updated in the reference voxel model to obtain the first voxel weight of the first voxel corresponding to the position of the voxel to be fused.

因此,第一體素模型和參考體素模型均位於世界座標系,參考體素模型中相鄰體素間隔第一體素距離,且第一體素資訊包括第一體素的第一截斷符號距離和第一體素權重,基於深度圖像中的圖元點反投影至世界座標系的投影點,在參考體素模型中選擇體素作為待融合體素,再基於相機內參和拍攝深度圖像時的相機位姿,獲取待融合體素的待融合截斷符號距離,以及基於待融合體素在參考體素模型中的體素權重,將待融合截斷符號距離和待融合體素在參考體素模型中參考截斷符號距離進行融合,得到與待融合體素位置對應的第一體素的第一截斷符號距離,並將待融合體素在參考體素模型中體素權重進行更新,得到與待融合體素位置對應的第一體素的第一體素權重,故在模型重建過程中,能夠不斷融入深度資訊,有利於不斷提升模型的準確性和完整性。Therefore, both the first voxel model and the reference voxel model are located in the world coordinate system, adjacent voxels in the reference voxel model are separated by the first voxel distance, and the first voxel information includes the first truncated sign of the first voxel The distance and the weight of the first voxel are based on the back-projection of the primitive points in the depth image to the projection points of the world coordinate system, and the voxels are selected in the reference voxel model as the voxels to be fused, and then based on the camera internal reference and the shooting depth map The camera pose at the time of imaging, obtain the truncated sign distance of the voxel to be fused, and based on the voxel weight of the voxel to be fused in the reference voxel model, the truncated sign distance to be fused and the voxel to be fused in the reference volume In the voxel model, the reference truncated symbol distance is fused to obtain the first truncated symbol distance of the first voxel corresponding to the position of the voxel to be fused, and the voxel weight of the voxel to be fused is updated in the reference voxel model to obtain the same as The first voxel weight of the first voxel corresponding to the voxel position to be fused, so in the process of model reconstruction, depth information can be continuously integrated, which is conducive to continuously improving the accuracy and integrity of the model.

在一些公開實施例中,待融合截斷符號距離獲取子部分包括重投影單元,被配置為基於相機內參和相機位姿,將待融合體素進行重投影,得到待融合體素在深度圖像的第一深度以及在相機座標系的第二深度;待融合截斷符號距離獲取子部分包括截斷符號距離計算單元,被配置為基於第一深度與第二深度之間的偏差,得到待融合截斷符號距離。In some disclosed embodiments, the acquisition subsection of the truncated symbol distance to be fused includes a reprojection unit configured to reproject the voxels to be fused based on the camera internal reference and the camera pose, to obtain the voxels to be fused in the depth image The first depth and the second depth in the camera coordinate system; the truncated symbol distance to be fused acquisition subpart includes a truncated symbol distance calculation unit configured to obtain the truncated symbol distance to be fused based on the deviation between the first depth and the second depth .

因此,故能夠準確表示根據深度圖像所提供的深度資訊,待融合體素至目標對象表面的有向距離,有利於提升待融合截斷符號距離的準確性。Therefore, it can accurately represent the directional distance from the voxel to be fused to the surface of the target object according to the depth information provided by the depth image, which is beneficial to improve the accuracy of the truncated symbol distance to be fused.

在一些公開實施例中,與待融合體素位置對應的第一體素的第一體素權重大於待融合體素在參考體素模型中體素權重;和/或,在待融合體素在參考體素模型中不具有參考截斷符號距離的情況下,將待融合體素的待融合截斷符號距離,作為與待融合體素位置對應的第一體素的第一截斷符號距離。In some disclosed embodiments, the first voxel weight of the first voxel corresponding to the position of the voxel to be fused is greater than the voxel weight of the voxel to be fused in the reference voxel model; and/or, when the voxel to be fused is in If there is no reference truncated signed distance in the reference voxel model, the to-be-fused truncated signed distance of the to-be-fused voxel is used as the first truncated signed distance of the first voxel corresponding to the position of the to-be-fused voxel.

因此,將與待融合體素位置對應的第一體素的第一體素權重設置為大於待融合體素在參考體素模型中體素權重,能夠隨著模型重建過程中,逐漸側重於參考待融合體素在參考體素模型中參考截斷符號距離,有利於提升模型重建的準確性;而在待融合體素在參考體素模型中不具有參考截斷符號距離的情況下,將待融合體素的待融合截斷符號距離,作為與待融合體素位置對應的第一體素的第一截斷符號距離,能夠在待融合體素在參考體素模型中不具有參考截斷符號距離的情況下,大大簡化第一截斷符號距離的獲取流程,有利於減少模型重建所需的計算記憶體。Therefore, setting the first voxel weight of the first voxel corresponding to the position of the voxel to be fused to be greater than the voxel weight of the voxel to be fused in the reference voxel model can gradually focus on the reference voxel during the model reconstruction process. The voxels to be fused refer to the truncated signed distance in the reference voxel model, which is beneficial to improve the accuracy of model reconstruction; and when the voxels to be fused do not have the reference truncated signed distance in the reference voxel model, the fused voxel The truncated signed distance of the voxel to be fused, as the first truncated signed distance of the first voxel corresponding to the position of the voxel to be fused, can be in the case that the voxel to be fused does not have a reference truncated signed distance in the reference voxel model, The acquisition process of the first truncated sign distance is greatly simplified, which is beneficial to reduce the computational memory required for model reconstruction.

請參閱圖8,圖8是本發明實施例電子設備80一實施例的方塊示意圖。電子設備80包括相互耦接的記憶體81和處理器82,處理器82被配置為執行記憶體81中儲存的程式指令,以實現上述任一模型重建方法實施例的步驟。在一些實施例中,電子設備80可以包括但不限於:微型電腦、伺服器,此外,電子設備80還可以包括筆記型電腦、平板電腦等移動設備,在此不做限定。需要說明的是,由於上述任一模型重建方法實施例所提供的技術方案,均能夠在有限計算記憶體情況下,同時確保重建完整性,並提升時間效率,故電子設備80可以包括手機、平板電腦等移動終端。Please refer to FIG. 8 . FIG. 8 is a schematic block diagram of an embodiment of an electronic device 80 according to an embodiment of the present invention. The electronic device 80 includes a memory 81 and a processor 82 coupled to each other, and the processor 82 is configured to execute the program instructions stored in the memory 81 to implement the steps of any one of the model reconstruction method embodiments above. In some embodiments, the electronic device 80 may include, but is not limited to: a microcomputer, a server. In addition, the electronic device 80 may also include mobile devices such as notebook computers and tablet computers, which are not limited here. It should be noted that since the technical solution provided by any of the above-mentioned embodiments of the model reconstruction method can ensure the integrity of the reconstruction and improve the time efficiency under the condition of limited computing memory, the electronic device 80 can include mobile phones, tablet Computers and other mobile terminals.

處理器82被配置為控制其自身以及記憶體81以實現上述任一模型重建方法實施例的步驟。處理器82還可以稱為中央處理單元(Central Processing Unit,CPU)。處理器82可能是一種積體電路晶片,具有信號的處理能力。處理器82還可以是通用處理器、數位訊號處理器(Digital Signal Processor,DSP)、專用積體電路(Application Specific Integrated Circuit,ASIC)、現場可程式設計閘陣列(Field-Programmable Gate Array,FPGA)或者其他可程式設計邏輯器件、分立門或者電晶體邏輯器件、分立硬體元件。通用處理器可以是微處理器或者該處理器也可以是任何常規的處理器等。另外,處理器82可以由積體電路晶片共同實現。The processor 82 is configured to control itself and the memory 81 to implement the steps in any of the above embodiments of the model reconstruction method. The processor 82 may also be called a central processing unit (Central Processing Unit, CPU). The processor 82 may be an integrated circuit chip with signal processing capability. The processor 82 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) Or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. In addition, the processor 82 may be collectively realized by an integrated circuit chip.

上述方案,一方面能夠在重採樣之後不會損失模型的表示範圍,且另一方面由於直接在第一體素模型基礎上進行重採樣即可得到第二體素模型,而無需從頭開始重新重建,也能夠提升模型重建的時間效率,故能夠在確保重建完整性的基礎上,提升重建時間效率。此外,由於第二體素距離大於第一體素距離,還能夠減少表示目標對象所需的體素數量,從而能夠有利於減少模型重建所需的計算記憶體,故有利於在有限的計算記憶體下,同時確保重建完整性,並提升時間效率。The above solution, on the one hand, can not lose the representation range of the model after resampling, and on the other hand, the second voxel model can be obtained by directly resampling on the basis of the first voxel model, without having to rebuild from scratch , can also improve the time efficiency of model reconstruction, so it can improve the time efficiency of reconstruction on the basis of ensuring the integrity of reconstruction. In addition, because the second voxel distance is greater than the first voxel distance, it can also reduce the number of voxels required to represent the target object, which can help reduce the computational memory required for model reconstruction. body while ensuring reconstruction integrity and improving time efficiency.

請參閱圖9,圖9為本發明實施例電腦可讀儲存介質90一實施例的方塊示意圖。電腦可讀儲存介質90儲存有能夠被處理器運行的程式指令91,程式指令91用於實現上述任一模型重建方法實施例的步驟。Please refer to FIG. 9 . FIG. 9 is a schematic block diagram of an embodiment of a computer-readable storage medium 90 according to an embodiment of the present invention. The computer-readable storage medium 90 stores program instructions 91 that can be executed by the processor, and the program instructions 91 are used to implement the steps of any one of the above-mentioned model reconstruction method embodiments.

本發明實施例還提供一種電腦程式產品,該電腦程式產品包括電腦程式或指令,在所述電腦程式或指令在電腦上運行的情況下,使得所述電腦執行上述方法實施例中任一模型重建方法實施例的步驟。The embodiment of the present invention also provides a computer program product, the computer program product includes a computer program or instruction, and when the computer program or instruction is run on the computer, the computer executes any model reconstruction in the above method embodiment Steps of a method embodiment.

上述方案,一方面能夠在重採樣之後不會損失模型的表示範圍,且另一方面由於直接在第一體素模型基礎上進行重採樣即可得到第二體素模型,而無需從頭開始重新重建,也能夠提升模型重建的時間效率,故能夠在確保重建完整性的基礎上,提升重建時間效率。此外,由於第二體素距離大於第一體素距離,還能夠減少表示目標對象所需的體素數量,從而能夠有利於減少模型重建所需的計算記憶體,故有利於在有限的計算記憶體下,同時確保重建完整性,並提升時間效率。The above solution, on the one hand, can not lose the representation range of the model after resampling, and on the other hand, the second voxel model can be obtained by directly resampling on the basis of the first voxel model, without having to rebuild from scratch , can also improve the time efficiency of model reconstruction, so it can improve the time efficiency of reconstruction on the basis of ensuring the integrity of reconstruction. In addition, because the second voxel distance is greater than the first voxel distance, it can also reduce the number of voxels required to represent the target object, which can help reduce the computational memory required for model reconstruction. body while ensuring reconstruction integrity and improving time efficiency.

本發明涉及擴增實境領域,通過獲取現實環境中的目標對象的圖像資訊,進而借助各類視覺相關演算法實現對目標對象的相關特徵、狀態及屬性進行檢測或識別處理,從而得到與應用匹配的虛擬與現實相結合的AR效果。示例性的,目標對象可涉及與人體相關的臉部、肢體、手勢、動作等,或者與物體相關的標識物、標誌物,或者與場館或場所相關的沙盤、展示區域或展示物品等。視覺相關演算法可涉及視覺定位、同步定位與建圖(Simultaneous Localization And Mapping,SLAM)、三維重建、圖像註冊、背景分割、對象的關鍵點提取及跟蹤、對象的位姿或深度檢測等。應用不僅可以涉及跟真實場景或物品相關的導覽、導航、講解、重建、虛擬效果疊加展示等交互場景,還可以涉及與人相關的特效處理,比如妝容美化、肢體美化、特效展示、虛擬模型展示等交互場景。The present invention relates to the field of augmented reality, by acquiring the image information of the target object in the real environment, and then using various visual correlation algorithms to detect or identify the relevant characteristics, states and attributes of the target object, so as to obtain the Apply matching virtual and reality combined AR effects. Exemplarily, the target object may involve faces, limbs, gestures, actions, etc. related to the human body, or markers and markers related to objects, or sand tables, display areas or display items related to venues or places. Vision-related algorithms may involve visual positioning, simultaneous localization and mapping (SLAM), 3D reconstruction, image registration, background segmentation, object key point extraction and tracking, object pose or depth detection, etc. Applications can not only involve interactive scenes such as tours, navigation, explanations, reconstructions, virtual effect overlays and display related to real scenes or objects, but can also involve special effects processing related to people, such as makeup beautification, body beautification, special effect display, virtual model Display and other interactive scenes.

可通過卷積神經網路,實現對目標對象的相關特徵、狀態及屬性進行檢測或識別處理。上述卷積神經網路是基於深度學習方塊進行模型訓練而得到的網路模型。The relevant characteristics, states and attributes of the target object can be detected or identified through the convolutional neural network. The above-mentioned convolutional neural network is a network model obtained through model training based on deep learning blocks.

在本發明所提供的幾個實施例中,應該理解到,所揭露的方法和裝置,可以通過其它的方式實現。例如,以上所描述的裝置實施方式僅僅是示意性的,例如,模組或單元的劃分,僅僅為一種邏輯功能劃分,實際實現時可以有另外的劃分方式,例如單元或元件可以結合或者可以集成到另一個系統,或一些特徵可以忽略,或不執行。另一點,所顯示或討論的相互之間的耦合或直接耦合或通信連接可以是通過一些介面,裝置或單元的間接耦合或通信連接,可以是電性、機械或其它的形式。In the several embodiments provided by the present invention, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementations described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, units or components can be combined or integrated. to another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

作為分離部件說明的單元可以是或者也可以不是物理上分開的,作為單元顯示的部件可以是或者也可以不是物理單元,即可以位於一個地方,或者也可以分佈到網路單元上。可以根據實際的需要選擇其中的部分或者全部單元來實現本實施方式方案的目的。A unit described as a separate component may or may not be physically separated, and a component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or may also be distributed to network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本發明實施例各個實施例中的各功能單元可以集成在一個處理單元中,也可以是各個單元單獨物理存在,也可以兩個或兩個以上單元集成在一個單元中。上述集成的單元既可以採用硬體的形式實現,也可以採用軟體功能單元的形式實現。In addition, each functional unit in each embodiment of the embodiments of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented not only in the form of hardware, but also in the form of software functional units.

集成的單元如果以軟體功能單元的形式實現並作為獨立的產品銷售或使用時,可以儲存在一個電腦可讀取儲存介質中。基於這樣的理解,本發明實施例的技術方案本質上或者說對現有技術做出貢獻的部分或者該技術方案的全部或部分可以以軟體產品的形式體現出來,該電腦軟體產品儲存在一個儲存介質中,包括若干指令用以使得一台電腦設備(可以是個人電腦,伺服器,或者網路設備等)或處理器(processor)執行本發明各個實施方式方法的全部或部分步驟。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of software products, and the computer software products are stored in a storage medium Among them, several instructions are included to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) execute all or part of the steps of the methods in various embodiments of the present invention.

而前述的儲存介質可以是可以保持和儲存由指令執行設備使用的指令的有形設備,可為易失性儲存介質或非易失性儲存介質。電腦可讀儲存介質例如可以是但不限於:電存放裝置、磁存放裝置、光存放裝置、電磁存放裝置、半導體存放裝置或者上述的任意合適的組合。電腦可讀儲存介質的更具體的例子(非窮舉的列表)包括:可擕式電腦盤、硬碟、隨機存取記憶體(Random Access Memory,RAM)、唯讀記憶體(Read Only Memory,ROM)、可擦式可程式設計唯讀記憶體(Erasable Programmable Read Only Memory,EPROM或快閃記憶體)、靜態隨機存取記憶體(Static Random-Access Memory,SRAM)、可擕式壓縮磁碟唯讀記憶體(Compact Disk Read Only Memory,CD-ROM)、數位多功能盤(Digital versatile Disc,DVD)、記憶棒、軟碟、機械編碼設備、例如其上儲存有指令的打孔卡或凹槽內凸起結構、以及上述的任意合適的組合。這裡所使用的電腦可讀儲存介質不被解釋為暫態信號本身,諸如無線電波或者其他自由傳播的電磁波、通過波導或其他傳輸媒介傳播的電磁波(例如,通過光纖電纜的光脈衝)、或者通過電線傳輸的電信號。The aforementioned storage medium may be a tangible device capable of holding and storing instructions used by the instruction execution device, and may be a volatile storage medium or a non-volatile storage medium. The computer-readable storage medium may be, for example but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, Random Access Memory (RAM), Read Only Memory (RAM), ROM), Erasable Programmable Read Only Memory (Erasable Programmable Read Only Memory, EPROM or flash memory), Static Random-Access Memory (Static Random-Access Memory, SRAM), portable compressed disk Compact Disk Read Only Memory (CD-ROM), Digital versatile Disc (DVD), memory sticks, floppy disks, mechanically encoded devices such as punched cards or embossed cards with instructions stored on them The protrusion structure in the groove, and any suitable combination of the above. A computer-readable storage medium as used herein is not to be construed as a transient signal per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other Electrical signals transmitted by wires.

工業實用性 本發明實施例將目標對象的深度圖像和參考體素模型進行融合,得到目標對象的第一體素模型,且第一體素模型相鄰第一體素間隔第一體素距離,且至少部分第一體素具有第一體素資訊,再對第一體素模型進行重採樣,以得到第二體素模型,且第二體素模型中相鄰第二體素間隔第二體素距離,第二體素距離大於第一體素距離,至少部分第二體素具有第二體素資訊,由於第二體素距離大於第一體素距離,一方面能夠在重採樣之後不會損失模型的表示範圍,且另一方面由於直接在第一體素模型基礎上進行重採樣即可得到第二體素模型,而無需從頭開始重新重建,也能夠提升模型重建的時間效率,故能夠在確保重建完整性的基礎上,提升重建時間效率。此外,由於第二體素距離大於第一體素距離,還能夠減少表示目標對象所需的體素數量,從而能夠有利於減少模型重建所需的計算記憶體,故有利於在有限的計算記憶體下,同時確保重建完整性,並提升時間效率。 Industrial Applicability In the embodiment of the present invention, the depth image of the target object is fused with the reference voxel model to obtain the first voxel model of the target object, and the first voxel model is adjacent to the first voxel with a first voxel distance, and at least Part of the first voxels have the first voxel information, and then resample the first voxel model to obtain the second voxel model, and the second voxel distance between adjacent second voxels in the second voxel model , the second voxel distance is greater than the first voxel distance, and at least some of the second voxels have second voxel information. Since the second voxel distance is greater than the first voxel distance, on the one hand, the model can not be lost after resampling On the other hand, the second voxel model can be obtained by resampling directly on the basis of the first voxel model without rebuilding from scratch, and the time efficiency of model reconstruction can also be improved, so it can be ensured On the basis of rebuilding integrity, the efficiency of rebuilding time is improved. In addition, because the second voxel distance is greater than the first voxel distance, it can also reduce the number of voxels required to represent the target object, which can help reduce the computational memory required for model reconstruction. body while ensuring reconstruction integrity and improving time efficiency.

70:模型重建裝置 71:深度融合部分 72:重採樣部分 80:電子設備 81:記憶體 82:處理器 90:電腦可讀儲存介質 91:程式指令 S11~S12,S41~S43,S51~S57:步驟 70:Model reconstruction device 71: Deep fusion part 72: Resampling part 80: Electronic equipment 81: memory 82: Processor 90: computer readable storage medium 91: Program instruction S11~S12, S41~S43, S51~S57: steps

圖1是本發明實施例模型重建方法一實施例的流程示意圖; 圖2是截斷符號距離一實施例的示意圖; 圖3是第一體素模型和第二體素模型一實施例的示意圖; 圖4是圖1中步驟S12一實施例的流程示意圖; 圖5是本發明實施例模型重建方法另一實施例的流程示意圖; 圖6a是本發明實施例模型重建方法中的第一體素模型效果示意圖; 圖6b是本發明實施例模型重建方法中的第二體素模型效果示意圖; 圖6c是本發明實施例模型重建方法中的最終模型效果示意圖; 圖7是本發明實施例模型重建裝置一實施例的方塊示意圖; 圖8是本發明實施例電子設備一實施例的方塊示意圖; 圖9是本發明實施例電腦可讀儲存介質一實施例的方塊示意圖。 Fig. 1 is a schematic flow chart of an embodiment of a model reconstruction method according to an embodiment of the present invention; Fig. 2 is a schematic diagram of an embodiment of truncated symbol distance; Fig. 3 is a schematic diagram of an embodiment of a first voxel model and a second voxel model; Fig. 4 is a schematic flow chart of an embodiment of step S12 in Fig. 1; Fig. 5 is a schematic flowchart of another embodiment of the model reconstruction method of the embodiment of the present invention; Fig. 6a is a schematic diagram of the effect of the first voxel model in the model reconstruction method of the embodiment of the present invention; Fig. 6b is a schematic diagram of the effect of the second voxel model in the model reconstruction method of the embodiment of the present invention; Fig. 6c is a schematic diagram of the final model effect in the model reconstruction method of the embodiment of the present invention; 7 is a schematic block diagram of an embodiment of a model reconstruction device according to an embodiment of the present invention; FIG. 8 is a schematic block diagram of an embodiment of an electronic device according to an embodiment of the present invention; FIG. 9 is a schematic block diagram of an embodiment of a computer-readable storage medium according to an embodiment of the present invention.

S11~S12:步驟 S11~S12: Steps

Claims (15)

一種模型重建方法,包括: 將目標對象的深度圖像和參考體素模型進行融合,得到所述目標對象的第一體素模型;其中,所述第一體素模型中相鄰第一體素間隔第一體素距離,且至少部分所述第一體素具有第一體素資訊; 對所述第一體素模型進行重採樣,得到第二體素模型;其中,所述第二體素模型中相鄰第二體素間隔第二體素距離,所述第二體素距離大於所述第一體素距離,且至少部分所述第二體素具有第二體素資訊。 A method for model reconstruction, comprising: Fusing the depth image of the target object with the reference voxel model to obtain a first voxel model of the target object; wherein, in the first voxel model, adjacent first voxels are separated by a first voxel distance, and at least some of the first voxels have first voxel information; Resampling the first voxel model to obtain a second voxel model; wherein, in the second voxel model, adjacent second voxels are separated by a second voxel distance, and the second voxel distance is greater than The first voxel distance, and at least some of the second voxels have second voxel information. 根據請求項1所述的方法,其中,所述第一體素模型和所述第二體素模型均位於世界座標系,所述對所述第一體素模型進行重採樣,得到第二體素模型,包括: 篩選所述第一體素作為所述第二體素的候選體素; 基於所述第二體素和所述候選體素在所述世界座標系中的偏離距離,得到所述候選體素的參考權重; 基於所述候選體素的第一體素資訊和參考權重,得到所述第二體素的第二體素資訊。 According to the method described in claim 1, wherein, both the first voxel model and the second voxel model are located in the world coordinate system, and the second voxel model is obtained by resampling the first voxel model prime models, including: screening the first voxel as a candidate voxel for the second voxel; Obtaining a reference weight of the candidate voxel based on the deviation distance between the second voxel and the candidate voxel in the world coordinate system; Based on the first voxel information and the reference weight of the candidate voxels, second voxel information of the second voxels is obtained. 根據請求項2所述的方法,其中,所述世界座標系由第一座標軸、第二座標軸和第三座標軸構成,所述基於所述第二體素和所述候選體素在所述世界座標系中的偏離距離,得到所述候選體素的參考權重,包括: 基於所述第二體素和所述候選體素在所述第一座標軸上的第一偏離距離,得到所述候選體素的第一權重,並基於所述第二體素和所述候選體素在所述第二座標軸上的第二偏離距離,得到所述候選體素的第二權重,以及基於所述第二體素和所述候選體素在所述第三座標軸上的第三偏離距離,得到所述候選體素的第三權重; 基於所述第一權重、所述第二權重和所述第三權重,得到所述候選體素的所述參考權重。 The method according to claim 2, wherein the world coordinate system is composed of a first coordinate axis, a second coordinate axis and a third coordinate axis, and the world coordinate system based on the second voxel and the candidate voxel The deviation distance in the system is obtained to obtain the reference weight of the candidate voxel, including: Based on the first offset distance between the second voxel and the candidate voxel on the first coordinate axis, obtain the first weight of the candidate voxel, and based on the second voxel and the candidate voxel The second deviation distance of the voxel on the second coordinate axis to obtain the second weight of the candidate voxel, and the third deviation on the third coordinate axis based on the second voxel and the candidate voxel distance to obtain the third weight of the candidate voxel; The reference weight of the candidate voxel is obtained based on the first weight, the second weight, and the third weight. 根據請求項2所述的方法,其中,所述偏離距離與所述參考權重負相關。The method according to claim 2, wherein the deviation distance is negatively correlated with the reference weight. 根據請求項2或4所述的方法,其中,所述第二體素資訊基於各個所述候選體素的參考權重對所述候選體素的第一體素資訊加權處理得到。The method according to claim 2 or 4, wherein the second voxel information is obtained by weighting the first voxel information of the candidate voxels based on the reference weights of each of the candidate voxels. 根據請求項2所述的方法,其中,所述第一體素模型包含若干第一區域,所述第二體素模型包括若干第二區域,且所述第一區域包含預設數值個所述第一體素,所述第二區域包含所述預設數值個所述第二體素,在所述篩選所述第一保證體素作為所述第二體素的候選體素之前,所述方法還包括: 在所述若干第一區域中篩選候選區域;其中,所述候選區域中至少一個所述第一體素具有所述第一體素資訊; 選擇與所述候選區域至少部分重合的第二區域,作為與所述候選區域對應的目標區域; 選擇所述目標區域內所述預設數值個所述第二體素; 所述篩選所述第一體素作為所述第二體素的候選體素,包括: 分別為各個選擇的第二體素篩選所述第一體素,作為所述候選體素。 According to the method described in claim 2, wherein, the first voxel model includes several first regions, the second voxel model includes several second regions, and the first region contains a preset number of the The first voxel, the second region contains the preset number of the second voxels, and before the screening of the first guaranteed voxels as the candidate voxels of the second voxels, the Methods also include: Screening candidate regions in the plurality of first regions; wherein at least one of the first voxels in the candidate regions has the first voxel information; selecting a second area that at least partially overlaps with the candidate area as a target area corresponding to the candidate area; selecting the preset number of second voxels within the target area; The screening of the first voxel as the candidate voxel of the second voxel includes: Screening the first voxels for each of the selected second voxels as the candidate voxels respectively. 根據請求項1至4任一所述的方法,其中,所述方法還包括: 基於具有所述第一體素資訊的第一體素,檢測所述第一體素模型是否符合重採樣條件; 回應於所述第一體素模型符合所述重採樣條件,執行所述對所述第一體素模型進行重採樣,得到第二體素模型的步驟。 The method according to any one of claims 1 to 4, wherein the method further comprises: Detecting whether the first voxel model meets a resampling condition based on the first voxel having the first voxel information; In response to the first voxel model meeting the resampling condition, the step of resampling the first voxel model to obtain a second voxel model is performed. 根據請求項7所述的方法,其中,所述第一體素模型包含若干第一區域,所述第一區域包含預設數值個所述第一體素,所述重採樣條件包括:具有參考體素的第一區域的數量大於第一閾值,且所述參考體素為具有所述第一體素資訊的第一體素; 或者,所述重採樣條件包括:具有所述第一體素資訊的第一體素的數量多於第二閾值。 According to the method described in claim 7, wherein, the first voxel model includes several first regions, and the first regions include a preset number of the first voxels, and the resampling condition includes: having a reference a number of first regions of voxels is greater than a first threshold, and the reference voxel is a first voxel having the first voxel information; Alternatively, the resampling condition includes: the number of first voxels with the first voxel information is greater than a second threshold. 根據請求項7所述的方法,其中,所述方法還包括以下至少之一: 將所述第二體素模型作為新的參考體素模型,並獲取新的深度圖像,以及重新執行所述將目標對象的深度圖像和參考體素模型進行融合,得到所述目標對象的第一體素模型的步驟以及後續步驟; 回應於所述第一體素模型不符合所述重採樣條件,將所述第一體素模型作為新的參考體素模型,並獲取新的深度圖像,以及重新執行所述將目標對象的深度圖像和參考體素模型進行融合,得到所述目標對象的第一體素模型的步驟以及後續步驟。 The method according to claim 7, wherein the method further includes at least one of the following: Using the second voxel model as a new reference voxel model, and acquiring a new depth image, and re-executing the fusion of the depth image of the target object and the reference voxel model to obtain the target object's Steps for the first voxel model and subsequent steps; Responding to the fact that the first voxel model does not meet the resampling condition, using the first voxel model as a new reference voxel model, and acquiring a new depth image, and re-executing the resampling of the target object. The step of fusing the depth image and the reference voxel model to obtain the first voxel model of the target object and subsequent steps. 根據請求項1至4任一項所述的方法,其中,所述第一體素模型和所述參考體素模型均位於世界座標系,所述參考體素模型中相鄰體素間隔所述第一體素距離,且所述第一體素資訊包括第一體素的第一截斷符號距離和第一體素權重,所述將目標對象的深度圖像和參考體素模型進行融合,得到所述目標對象的第一體素模型,包括: 基於所述深度圖像中的圖元點反投影至所述世界座標系的投影點,在所述參考體素模型中選擇所述體素作為待融合體素; 基於相機內參和拍攝所述深度圖像時的相機位姿,獲取所述待融合體素的待融合截斷符號距離; 基於所述待融合體素在所述參考體素模型中體素權重,將所述待融合截斷符號距離和所述待融合體素在所述參考體素模型中參考截斷符號距離進行融合,得到與所述待融合體素位置對應的第一體素的第一截斷符號距離;以及, 將所述待融合體素在所述參考體素模型中體素權重進行更新,得到與所述待融合體素位置對應的第一體素的第一體素權重。 According to the method described in any one of claim items 1 to 4, wherein, the first voxel model and the reference voxel model are both located in the world coordinate system, and the interval between adjacent voxels in the reference voxel model is The first voxel distance, and the first voxel information includes the first truncated symbol distance and the first voxel weight of the first voxel, and the depth image of the target object is fused with the reference voxel model to obtain The first voxel model of the target object, comprising: Selecting the voxel in the reference voxel model as the voxel to be fused based on the back-projection of the primitive point in the depth image to the projection point of the world coordinate system; Obtaining the truncated sign distance to be fused of the voxel to be fused based on the camera internal reference and the camera pose when the depth image is taken; Based on the voxel weight of the voxel to be fused in the reference voxel model, the truncated signed distance to be fused and the reference truncated signed distance of the voxel to be fused in the reference voxel model are fused to obtain a first truncated signed distance of a first voxel corresponding to the voxel position to be fused; and, Updating the voxel weight of the voxel to be fused in the reference voxel model to obtain the first voxel weight of the first voxel corresponding to the position of the voxel to be fused. 根據請求項10所述的方法,其中,所述基於相機內參和拍攝所述深度圖像時的相機位姿,獲取所述待融合體素的待融合截斷符號距離,包括: 基於所述相機內參和所述相機位姿,將所述待融合體素重投影,得到所述待融合體素在所述深度圖像的第一深度以及在所述相機座標系的第二深度; 基於所述第一深度與所述第二深度之間的偏差,得到所述待融合截斷符號距離。 According to the method described in claim 10, wherein the acquisition of the truncated sign distance to be fused of the voxels to be fused based on the camera internal reference and the camera pose when the depth image is taken includes: Based on the camera internal reference and the camera pose, reproject the voxel to be fused to obtain a first depth of the voxel to be fused in the depth image and a second depth in the camera coordinate system ; Based on the deviation between the first depth and the second depth, the truncated symbol distance to be fused is obtained. 根據請求項10所述的方法,其中,與所述待融合體素位置對應的第一體素的第一體素權重大於所述待融合體素在所述參考體素模型中體素權重。The method according to claim 10, wherein the first voxel weight of the first voxel corresponding to the position of the voxel to be fused is greater than the voxel weight of the voxel to be fused in the reference voxel model. 根據請求項10所述的方法,其中,在所述待融合體素在所述參考體素模型中不具有所述參考截斷符號距離的情況下,將所述待融合體素的待融合截斷符號距離,作為與所述待融合體素位置對應的第一體素的第一截斷符號距離。According to the method described in claim 10, wherein, in the case that the voxel to be fused does not have the reference truncated sign distance in the reference voxel model, the truncated sign to be fused of the voxel to be fused is distance, as the first truncated signed distance of the first voxel corresponding to the position of the voxel to be fused. 一種電子設備,包括相互耦接的記憶體和處理器,所述處理器用於執行所述記憶體中儲存的程式指令,以實現請求項1至13任一項所述的模型重建方法。An electronic device, comprising a memory and a processor coupled to each other, the processor is used to execute program instructions stored in the memory to implement the model reconstruction method described in any one of claims 1 to 13. 一種電腦可讀儲存介質,其上儲存有程式指令,所述程式指令被處理器執行時實現請求項1至13任一項所述的模型重建方法。A computer-readable storage medium, on which program instructions are stored, and when the program instructions are executed by a processor, the model reconstruction method described in any one of claims 1 to 13 is realized.
TW111106861A 2021-08-25 2022-02-24 Model reconstruction method, electronic device and computer-readable storage medium TW202309834A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110983894.0 2021-08-25
CN202110983894.0A CN113706373A (en) 2021-08-25 2021-08-25 Model reconstruction method and related device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
TW202309834A true TW202309834A (en) 2023-03-01

Family

ID=78654835

Family Applications (1)

Application Number Title Priority Date Filing Date
TW111106861A TW202309834A (en) 2021-08-25 2022-02-24 Model reconstruction method, electronic device and computer-readable storage medium

Country Status (3)

Country Link
CN (1) CN113706373A (en)
TW (1) TW202309834A (en)
WO (1) WO2023024441A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113706373A (en) * 2021-08-25 2021-11-26 深圳市慧鲤科技有限公司 Model reconstruction method and related device, electronic equipment and storage medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116628800A (en) * 2023-05-09 2023-08-22 海南华筑国际工程设计咨询管理有限公司 Building design system based on BIM
CN117350926B (en) * 2023-12-04 2024-02-13 北京航空航天大学合肥创新研究院 Multi-mode data enhancement method based on target weight
CN118097156A (en) * 2024-04-26 2024-05-28 百洋智能科技集团股份有限公司 Basin bottom dysfunction detection method, device, computer equipment and storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1890267A3 (en) * 1998-07-16 2008-07-09 The Research Foundation of the State University of New York Apparatus and method for real-time volume processing and universal 3D rendering
WO2015006790A1 (en) * 2013-07-18 2015-01-22 A.Tron3D Gmbh Method of capturing three-dimensional (3d) information on a structure
CN106548507A (en) * 2015-09-16 2017-03-29 富士通株式会社 The method and apparatus of three-dimensional reconstruction object
CN116721203A (en) * 2017-09-27 2023-09-08 虹软科技股份有限公司 Method, device and storage medium for measuring three-dimensional model
CN108537876B (en) * 2018-03-05 2020-10-16 清华-伯克利深圳学院筹备办公室 Three-dimensional reconstruction method, device, equipment and storage medium
CN108898630B (en) * 2018-06-27 2020-12-15 清华-伯克利深圳学院筹备办公室 Three-dimensional reconstruction method, device, equipment and storage medium
CN110390719B (en) * 2019-05-07 2023-02-24 香港光云科技有限公司 Reconstruction equipment based on flight time point cloud
CN112767538B (en) * 2021-01-11 2024-06-07 浙江商汤科技开发有限公司 Three-dimensional reconstruction and related interaction and measurement methods, related devices and equipment
CN112750201B (en) * 2021-01-15 2024-03-29 浙江商汤科技开发有限公司 Three-dimensional reconstruction method, related device and equipment
CN113706373A (en) * 2021-08-25 2021-11-26 深圳市慧鲤科技有限公司 Model reconstruction method and related device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113706373A (en) * 2021-08-25 2021-11-26 深圳市慧鲤科技有限公司 Model reconstruction method and related device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN113706373A (en) 2021-11-26
WO2023024441A1 (en) 2023-03-02

Similar Documents

Publication Publication Date Title
US10977818B2 (en) Machine learning based model localization system
US11222474B2 (en) Methods and systems for applying machine learning to volumetric capture of a body in a real-world scene
CN109887003B (en) Method and equipment for carrying out three-dimensional tracking initialization
CN110889890B (en) Image processing method and device, processor, electronic equipment and storage medium
TW202309834A (en) Model reconstruction method, electronic device and computer-readable storage medium
CN110998659B (en) Image processing system, image processing method, and program
Bostanci et al. Augmented reality applications for cultural heritage using Kinect
WO2023071964A1 (en) Data processing method and apparatus, and electronic device and computer-readable storage medium
US10846923B2 (en) Fusion of depth images into global volumes
EP3326156B1 (en) Consistent tessellation via topology-aware surface tracking
JP2002042169A (en) Three-dimensional image providing system, its method, morphing image providing system, and its method
CN109906600B (en) Simulated depth of field
WO2023071790A1 (en) Pose detection method and apparatus for target object, device, and storage medium
TWI722638B (en) Method and electronic device for a point cloud fusion, and computer storage medium thereof
WO2021097843A1 (en) Three-dimensional reconstruction method and device, system and storage medium
CN115439607A (en) Three-dimensional reconstruction method and device, electronic equipment and storage medium
WO2022110877A1 (en) Depth detection method and apparatus, electronic device, storage medium and program
CN115965735B (en) Texture map generation method and device
Tian et al. Registration and occlusion handling based on the FAST ICP-ORB method for augmented reality systems
CN115775300B (en) Human body model reconstruction method, human body model reconstruction training method and device
WO2023035509A1 (en) Grid generation method and apparatus, electronic device, computer-readable storage medium, computer program and computer program product
CN112465890A (en) Depth detection method and device, electronic equipment and computer readable storage medium
Phothong et al. Generation and quality improvement of 3D models from silhouettes of 2D images
Roumaissa et al. Real Time Handling Occlusion in Augmented Reality Based on Photogrammetry
Pastor et al. An agent-based paradigm for the reconstruction of conical perspectives