Skip to content

Commit 3a39f22

Browse files
committed
minor fixes
1 parent d7c5c18 commit 3a39f22

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

modules/dense_correspondence_manipulation/change_detection/change_detection.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@ def run(self, output_dir=None, rendered_images_dir=None):
351351
if rendered_images_dir is None:
352352
rendered_images_dir = os.path.join(self.foreground_reconstruction.data_dir, 'rendered_images')
353353

354+
fusion_mesh_foreground_file = os.path.join(os.path.join(self.foreground_reconstruction.data_dir, 'fusion_mesh_foreground.ply'))
355+
354356
if not os.path.isdir(output_dir):
355357
os.makedirs(output_dir)
356358

@@ -359,6 +361,9 @@ def run(self, output_dir=None, rendered_images_dir=None):
359361

360362
start_time = time.time()
361363

364+
print "saving cropped mesh"
365+
self.foreground_reconstruction.save_poly_data(fusion_mesh_foreground_file)
366+
362367
# read in each image in the log
363368
camera_pose_data = self.foreground_reconstruction.kinematics_pose_data
364369
img_file_extension = 'png'

modules/dense_correspondence_manipulation/fusion/fusion_reconstruction.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,16 @@ def setup(self):
118118
self.load_poly_data()
119119
self.image_dir = os.path.join(self.data_dir, 'images')
120120

121+
def save_poly_data(self, filename):
122+
"""
123+
Save the poly data to a file
124+
:param filename:
125+
:type filename:
126+
:return:
127+
:rtype:
128+
"""
129+
ioUtils.writePolyData(self.poly_data, filename)
130+
121131
@property
122132
def poly_data_type(self):
123133
return self._poly_data_type
@@ -283,19 +293,6 @@ def load_poly_data(self):
283293
self.poly_data = self.poly_data_raw
284294
self.crop_poly_data()
285295

286-
# def crop_poly_data(self):
287-
# dim_x = self.config['crop_box']['dimensions']['x']
288-
# dim_y = self.config['crop_box']['dimensions']['y']
289-
# dim_z = self.config['crop_box']['dimensions']['z']
290-
# dimensions = [dim_x, dim_y, dim_z]
291-
#
292-
# transform = director_utils.transformFromPose(self.config['crop_box']['transform'])
293-
#
294-
# # store the old poly data
295-
# self.poly_data_uncropped = self.poly_data
296-
#
297-
# self.poly_data = segmentation.cropToBox(self.poly_data, transform, dimensions)
298-
299296
@property
300297
def fusion_pose_data(self):
301298
raise ValueError("TSDFReconstruction doesn't have fusion_pose_data")

0 commit comments

Comments
 (0)