Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Master

* Fix tensor based TSDF integration example.
* Use GLIBCXX_USE_CXX11_ABI=ON by default
* Python 3.9 support. Tensorflow bump 2.4.1 -> 2.5.0. PyTorch bump 1.7.1 -> 1.8.1 (LTS)
* Fix undefined names: docstr and VisibleDeprecationWarning (PR #3844)
Expand Down
12 changes: 6 additions & 6 deletions docs/tutorial/t_reconstruction_system/integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ In the activation step, we first locate blocks that contain points unprojected f

.. literalinclude:: ../../../examples/python/t_reconstruction_system/integrate.py
:language: python
:lineno-start: 82
:lines: 27,83-85
:lineno-start: 52
:lines: 52-54

Integration
````````````
Expand All @@ -23,8 +23,8 @@ We may use optimized functions, along with raw depth images with calibration par

.. literalinclude:: ../../../examples/python/t_reconstruction_system/integrate.py
:language: python
:lineno-start: 86
:lines: 27,87-93
:lineno-start: 58
:lines: 58-60

Currently, to use our optimized function, we assume the below combinations of data types, in the order of ``depth image``, ``color image``, ``tsdf in voxel grid``, ``weight in voxel grid``, ``color in voxel grid`` in CPU

Expand All @@ -48,8 +48,8 @@ You may use the provided APIs to extract surface points.

.. literalinclude:: ../../../examples/python/t_reconstruction_system/integrate.py
:language: python
:lineno-start: 135
:lines: 27,136-140
:lineno-start: 106
:lines: 106-110

Note ``extract_triangle_mesh`` applies marching cubes and generate mesh. ``extract_point_cloud`` uses the similar algorithm, but skips the triangle face generation step.

Expand Down
7 changes: 4 additions & 3 deletions examples/python/t_reconstruction_system/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# ----------------------------------------------------------------------------

import os

import argparse
import configargparse


Expand Down Expand Up @@ -107,9 +109,8 @@ def __init__(self):

integration_parser = self.add_argument_group('integration')
integration_parser.add(
'--integration_mode',type=str,
choices=['color', 'depth'],
help='Volumetric integration mode.')
'--integrate_color', action=argparse.BooleanOptionalAction,
default=True, help='Volumetric integration mode.')
integration_parser.add(
'--voxel_size', type=float,
help='Voxel size in meter for volumetric integration.')
Expand Down
3 changes: 1 addition & 2 deletions examples/python/t_reconstruction_system/default_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ depth_folder: depth
color_folder: color
path_intrinsic: ''
path_color_intrinsic: ''
fragment_size: 100
depth_min: 0.1
depth_max: 3.0
depth_scale: 1000.0
Expand All @@ -21,7 +20,7 @@ icp_voxelsize: 0.05
icp_distance_thr: 0.07
global_registration_method: ransac
registration_loop_weight: 0.1
integration_mode: color
integrate_color: true
voxel_size: 0.0058
trunc_voxel_multiplier: 8.0
block_count: 40000
Expand Down
16 changes: 6 additions & 10 deletions examples/python/t_reconstruction_system/integrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,22 @@
# P.S. This example is used in documentation, so, please ensure the changes are
# synchronized.

import os
import numpy as np
import time

import open3d as o3d
import open3d.core as o3c
import time
import matplotlib.pyplot as plt
from tqdm import tqdm
from config import ConfigParser

from common import load_rgbd_file_names, load_depth_file_names, load_intrinsic, load_extrinsics, get_default_dataset
from config import ConfigParser


def integrate(depth_file_names, color_file_names, depth_intrinsic,
color_intrinsic, extrinsics, integrate_color, config):

color_intrinsic, extrinsics, config):
n_files = len(depth_file_names)
device = o3d.core.Device(config.device)

if integrate_color:
if config.integrate_color:
vbg = o3d.t.geometry.VoxelBlockGrid(
attr_names=('tsdf', 'weight', 'color'),
attr_dtypes=(o3c.float32, o3c.float32, o3c.float32),
Expand Down Expand Up @@ -56,7 +53,7 @@ def integrate(depth_file_names, color_file_names, depth_intrinsic,
depth, depth_intrinsic, extrinsic, config.depth_scale,
config.depth_max)

if integrate_color:
if config.integrate_color:
color = o3d.t.io.read_image(color_file_names[i]).to(device)
vbg.integrate(frustum_block_coords, depth, color, depth_intrinsic,
color_intrinsic, extrinsic, config.depth_scale,
Expand All @@ -83,7 +80,6 @@ def integrate(depth_file_names, color_file_names, depth_intrinsic,
'Default dataset may be selected from the following options: '
'[lounge, jack_jack]',
default='lounge')
parser.add('--integrate_color', action='store_true')
parser.add('--path_trajectory',
help='path to the trajectory .log or .json file.')
parser.add('--path_npz',
Expand Down
1 change: 0 additions & 1 deletion examples/python/t_reconstruction_system/run_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@
intrinsic,
intrinsic,
extrinsics,
integrate_color=True,
config=config)

pcd = vbg.extract_point_cloud()
Expand Down