synthetic
Module for synthetic data generation.
Mesh
Bases: Object
Object with associated mesh.
This class maintains two meshes, the original mesh and the scaled mesh.
Updating the scale will always be relative to the original mesh. I.e., two times setting the relative scale by 0.1 will not yield a final scale of 0.01 as it will always be relative to the original mesh.
Source code in sdfest/estimation/synthetic.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
__init__(mesh=None, path=None, scale=1, rel_scale=False, center=False, position=None, orientation=None)
Initialize mesh.
Must provide either mesh or path. If path is given, mesh will be loaded from specified file. If mesh is given, it will be used as the original mesh.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mesh |
Optional[TriangleMesh]
|
The original (i.e., unscaled mesh). |
None
|
path |
Optional[str]
|
The path of the mesh to load. |
None
|
scale |
float
|
See Mesh.update_scale. |
1
|
rel_scale |
bool
|
See Mesh.update_scale. |
False
|
center |
bool
|
whether to center the mesh upon loading. |
False
|
position |
Optional[array]
|
See Object.init. |
None
|
orientation |
Optional[array]
|
See Object.init. |
None
|
Source code in sdfest/estimation/synthetic.py
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
get_transformed_o3d_geometry()
Get o3d mesh at current pose.
Source code in sdfest/estimation/synthetic.py
132 133 134 135 136 137 138 139 |
|
load_mesh_from_file(path, scale=1, rel_scale=False)
Load mesh from file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
Path of the obj file. |
required |
scale |
float
|
See Mesh.update_scale. |
1
|
rel_scale |
bool
|
See Mesh.update_scale. |
False
|
Source code in sdfest/estimation/synthetic.py
77 78 79 80 81 82 83 84 85 86 87 88 |
|
update_scale(scale=1, rel_scale=False)
Update relative or absolute scale of mesh.
Absolute scale represents half the largest extent in x, y, or z direction. Relative scale represents the scale factor from original mesh.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scale |
float
|
The desired absolute or relative scale of the object. |
1
|
rel_scale |
bool
|
If true, scale will be relative to original mesh. Otherwise, scale will be the resulting absolute scale. |
False
|
Source code in sdfest/estimation/synthetic.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
|
Object
Bases: ABC
Generic positioned object representation.
Each object has a 6-DOF pose, stored as a 3D translation vector and a normalized quaternion representing its orientation.
Source code in sdfest/estimation/synthetic.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
__init__(position=None, orientation=None)
Initialize object position and orientation.
Source code in sdfest/estimation/synthetic.py
21 22 23 24 25 26 27 28 |
|
draw_depth_geometry(obj, camera)
Render an object given a camera.
Source code in sdfest/estimation/synthetic.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
|