tatiana0599 commited on
Commit
8b282db
·
1 Parent(s): b1f53e4

Test with bunny

Browse files
Files changed (2) hide show
  1. colored_sphere.obj +2 -2
  2. pc_to_mesh.py +4 -4
colored_sphere.obj CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:af0623db05615dfdab7a8b430a9a9d280cb04494851279f776570e4648e81d2c
3
- size 124159899
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c4219279fe8712e11ba282f2b451da1134422b9075ff859ab1d1ee6595979c3d
3
+ size 5056223
pc_to_mesh.py CHANGED
@@ -43,16 +43,16 @@ bbox = pcd.get_axis_aligned_bounding_box()
43
 
44
  mesh = mesh.crop(bbox)
45
 
46
- # colors = np.asarray(mesh.vertex_colors) # Nx3 array, values in [0,1]
47
- # factor = 2 # >1 to lighten, <1 to darken
48
- # colors = np.clip(colors * factor, 0, 1) # keep in [0,1]
49
 
50
  # # Stretch each channel to [0,1]
51
  # min_val = colors.min(axis=0)
52
  # max_val = np.quantile(colors, q=0.95, axis=0)
53
  # print(min_val, max_val)
54
  # colors = (colors - min_val) / (max_val - min_val + 1e-8)
55
- # mesh.vertex_colors = o3d.utility.Vector3dVector(colors)
56
 
57
 
58
  # --- Save mesh as .obj with per-vertex colors ---
 
43
 
44
  mesh = mesh.crop(bbox)
45
 
46
+ colors = np.asarray(mesh.vertex_colors) # Nx3 array, values in [0,1]
47
+ factor = 1.5 # >1 to lighten, <1 to darken
48
+ colors = np.clip(colors * factor, 0, 1) # keep in [0,1]
49
 
50
  # # Stretch each channel to [0,1]
51
  # min_val = colors.min(axis=0)
52
  # max_val = np.quantile(colors, q=0.95, axis=0)
53
  # print(min_val, max_val)
54
  # colors = (colors - min_val) / (max_val - min_val + 1e-8)
55
+ mesh.vertex_colors = o3d.utility.Vector3dVector(colors)
56
 
57
 
58
  # --- Save mesh as .obj with per-vertex colors ---