• Stars
    star
    117
  • Rank 301,828 (Top 6 %)
  • Language
    MATLAB
  • License
    MIT License
  • Created over 1 year ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[CVPR2023 Highlight] Marching-Primitives: Shape Abstraction from Signed Distance Function

Marching-Primitives: Shape Abstraction from Signed Distance Function

Project|Paper|Supplementary|Arxiv|3D-Demos|Data

example

This repo provides the source code for the CVPR2023 paper:

Marching-Primitives: Shape Abstraction from Signed Distance Function
Weixiao Liu1,2, Yuwei Wu2, Sipu Ruan2, Gregory S. Chirikjian2
1 National University of Singapore, 2 Johns Hopkins University

Citation

If you find this repo useful, please give us a star and cite:

@Inproceedings{Liu2023CVPR,
     title = {Marching-Primitives: Shape Abstraction from Signed Distance Function},
     author = {Liu, Weixiao and Wu, Yuwei and Ruan, Sipu and Chirikjian, Gregory},
     booktitle = {Proceedings IEEE Conf. on Computer Vision and Pattern Recognition (CVPR)},
     year = {2023}
}

Thanks for your interest!

Update

  • March 27th, 2023 - V0.1 basic version is online, including MATLAB implementation of the algorithm, data(SDF) preprocess script, and visualization tools. Python implementation is planned in the coming updates.
  • March 28th, 2023 - implementation details has been updated.
  • April 2nd, 2023 - update bounding-box based parameter reinitialization for better performance (line 101-111 in MPS.m).

Abstraction

Representing complex objects with basic geometric primitives has long been a topic in computer vision. Primitive-based representations have the merits of compactness and computational efficiency in higher-level tasks such as physics simulation, collision checking, and robotic manipulation. Unlike previous works which extract polygonal meshes from a signed distance function (SDF), in this paper, we present a novel method, named Marching-Primitives, to obtain a primitive-based abstraction directly from an SDF. Our method grows geometric primitives (such as superquadrics) iteratively by analyzing the connectivity of voxels while marching at different levels of signed distance. For each valid connected volume of interest, we march on the scope of voxels from which a primitive is able to be extracted in a probabilistic sense and simultaneously solve for the parameters of the primitive to capture the underlying local geometry. We evaluate the performance of our method on both synthetic and real-world datasets. The results show that the proposed method outperforms the state-of-the-art in terms of accuracy, and is directly generalizable among different categories and scales.

Implementation

Marching-Primitives algorithm

The source code of the algorithm is in /MATLAB/src/MPS.m

x = MPS(sdf, grid)

The algorithm depends on the Image Processing Toolbox of MATLAB. The algorithm requires a Signed Distance Function discretized on a voxel grid as input. More specifically, for a grid of size $(x,y,z):M\times N\times W$, grid.size = [M, N, W] is the size of the voxel grid; grid.range = [x_min, x_max, y_min, y_max, z_min, z_max] stores the range of the voxel grid, and sdf is a 1-D array flattened from the 3-D array storing the signed distance of points in the voxel grid.

The output of the function is a 2D array of size $K*11$, where each row stores the parameter of a superquadric $[\epsilon_1, \epsilon_2, a_x, a_y, a_z, euler_z, euler_y, euler_x, t_x, t_y, t_z]$.

Preparing SDF from meshes

If you do not have SDF files but want to test the algorithm, we have a simple script mesh2sdf_preparation to generate SDF from meshes. The script is based on this package. The mesh file will be first transformed to be watertight so that a valid SDF can be extracted. To run the script, first install dependency

pip install mesh2sdf

Then simply run

python3 mesh2sdf_convert.py $location of the mesh file$ --normalize --grid_resolution 100

where the mesh and sdf will be normalized within $[-1, 1]$ if you add –-normalized; and --grid_resolution specifies the resolution of the sdf (default $100$). The script accepts mesh forms: .stl, .off, .ply, .collada, .json, .dict, .glb, .dict64, .msgpack, .obj. The SDF (.csv) and preprocessed watertight mesh (_watertight.stl) will be saved at the same folder of the input mesh. A few meshes from ShapeNet/ModelNet are prepared in the data at /MATALB/data.

Demo script

After obtaining the SDF file, run the demo script at /MATLAB/demo_script.m. The script conducts the shape abstraction and visualize the results. The recovered superquadric representation is saved as *.mat at the same location of the input SDF. For visualization, mesh file of the superquadric representation is also saved as *_sq.stl.

More Repositories

1

LSG-CPD

[ICCV 2021] CPD with Local Surface Geometry (LSG-CPD)
MATLAB
31
star
2

hrm

[T-RO] Highway RoadMap (HRM) paradigm for robot motion planning based on parameterizations of the free space
C++
31
star
3

ravens_visual_foresight

[IROS 2022] Transporters with Visual Foresight (TVF)
Python
10
star
4

cfc-collision

[RA-L/IROS2022] Collision detection for general convex smooth bodies using closed-form contact space (CFC)
C++
9
star
5

banana_distribution

MATLAB
7
star
6

primp-python

[T-RO] Python implementation of PRobabilistically-Informed Motion Primitives (PRIMP)
Python
6
star
7

primp-matlab

[T-RO] MATLAB implementation of PRobabilistically-Informed Motion Primitives (PRIMP), a learning-from-demonstration method on Lie group.
MATLAB
5
star
8

cfc-collision-matlab

Collision detection between convex and smooth bodies using closed-form contact space parameterization, MATLAB implementation.
MATLAB
5
star
9

deformable_ravens_vf

Goal-Conditioned Transporter Networks (GCTN) for the multi-modal action proposal module of Transporters with Visual Foresight (TVF)
Python
4
star
10

tvf

Project webpage for TVF
CSS
2
star
11

cfc_collision_ros

ROS package for motion planning application using the collision detection framework based on closed-form contact space.
C++
2
star
12

EMS-superquadric_fitting

MATLAB
2
star
13

panda_moveit_ctrl

Control Panda robot with MoveIt
Python
1
star
14

VolumePreservingModel

Model Reduction in Soft Robotics Using Locally Volume-Preserving Primitives
MATLAB
1
star
15

realcontainerimagination

Project page for RA-L submission of open container imagination
CSS
1
star
16

chair_imagination

Python
1
star
17

shape_abstraction_via_superquadric

MATLAB
1
star
18

Igethangofit

This webpage is for the robotic hanging paper that submitted to RAL.
1
star