Skip to content

Commit 1f515f9

Browse files
committed
Solved visualisation bug
1 parent c82fb3a commit 1f515f9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

libs/_3d/projection.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,11 @@ def getObjectDimensions(_c1, _c2, centroid, draw=False):
216216
height = (estHeights[-1] - estHeights[0]) * 1000
217217

218218
# Draw final dimensions
219+
img1 = copy.deepcopy(c1['rgb'])
220+
img2 = copy.deepcopy(c2['rgb'])
221+
219222
if draw:
220-
img1 = copy.deepcopy(c1['rgb'])
221-
img2 = copy.deepcopy(c2['rgb'])
222-
223+
223224
for i, rad in enumerate(estRadius):
224225

225226
p3d = []

main.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def getObjectDimensions(self):
7878
centroid = centroid[:,:-1].reshape(-1)
7979

8080
height, width, visualization = getObjectDimensions(self.c1, self.c2, centroid, self.args.draw)
81-
cv2.imwrite('{}/id{}_l{}_b{}.png'.format(self.output_path, self.args.object, self.args.lighting, self.args.background), visualization )
81+
if self.args.draw:
82+
cv2.imwrite('{}/id{}_l{}_b{}.png'.format(self.output_path, self.args.object, self.args.lighting, self.args.background), visualization )
8283

8384
f.write('id{}_l{}_b{}.png\t{:.2f}\t{:.2f}\n'.format(self.args.object, self.args.lighting, self.args.background, height, width))
8485
print('Object {}, lighting {}, and background {} measured!'.format(self.args.object, self.args.lighting, self.args.background))

0 commit comments

Comments
 (0)