Siromanec commited on
Commit
c65c7a4
1 Parent(s): 2efaa03

pointcloud_depth_coeff=1.05

Browse files
Files changed (2) hide show
  1. handcrafted_solution.py +2 -2
  2. script.py +1 -0
handcrafted_solution.py CHANGED
@@ -454,7 +454,7 @@ def prune_not_connected(all_3d_vertices, connections_3d):
454
  return np.array(new_verts), connected_out
455
 
456
 
457
- def predict(entry, visualize=False, scale_estimation_coefficient=2.5, clustering_eps=100, dist_coeff=0, **kwargs) -> Tuple[
458
  np.ndarray, List[int]]:
459
  if 'gestalt' not in entry or 'depthcm' not in entry or 'K' not in entry or 'R' not in entry or 't' not in entry:
460
  print('Missing required fields in the entry')
@@ -525,7 +525,7 @@ def predict(entry, visualize=False, scale_estimation_coefficient=2.5, clustering
525
  homo_belonging_points = cv2.convertPointsToHomogeneous(np.array([i.xyz for i in belonging_points]))
526
  depth = cv2.convertPointsFromHomogeneous(cv2.transform(homo_belonging_points, world_to_cam))
527
  depth = depth[:, 0, 2]
528
- depth = depth[important[0]]
529
  projected2d = projected2d[important]
530
  if len(depth) < 1:
531
  print(f'No 3D points in image {i}')
 
454
  return np.array(new_verts), connected_out
455
 
456
 
457
+ def predict(entry, visualize=False, scale_estimation_coefficient=2.5, clustering_eps=100, dist_coeff=0, pointcloud_depth_coeff = 1, **kwargs) -> Tuple[
458
  np.ndarray, List[int]]:
459
  if 'gestalt' not in entry or 'depthcm' not in entry or 'K' not in entry or 'R' not in entry or 't' not in entry:
460
  print('Missing required fields in the entry')
 
525
  homo_belonging_points = cv2.convertPointsToHomogeneous(np.array([i.xyz for i in belonging_points]))
526
  depth = cv2.convertPointsFromHomogeneous(cv2.transform(homo_belonging_points, world_to_cam))
527
  depth = depth[:, 0, 2]
528
+ depth = depth[important[0]] * pointcloud_depth_coeff
529
  projected2d = projected2d[important]
530
  if len(depth) < 1:
531
  print(f'No 3D points in image {i}')
script.py CHANGED
@@ -139,6 +139,7 @@ if __name__ == "__main__":
139
  scale_estimation_coefficient=2.54,
140
  clustering_eps=100,
141
  dist_coeff=0.1,
 
142
  ))
143
 
144
  for i, result in enumerate(tqdm(results)):
 
139
  scale_estimation_coefficient=2.54,
140
  clustering_eps=100,
141
  dist_coeff=0.1,
142
+ pointcloud_depth_coeff=1.05,
143
  ))
144
 
145
  for i, result in enumerate(tqdm(results)):