Skip to content

Commit

Permalink
fixed min of empty array (open space with no obstacles)
Browse files Browse the repository at this point in the history
  • Loading branch information
martind committed Feb 11, 2015
1 parent 8190af3 commit be2fb9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion openni2/viewer.py
Expand Up @@ -26,7 +26,8 @@ def view( filename ):
depth.shape = (240, 320, 1)
centerArea = depth[120-40:120+40, 160-40:160+40]
mask = centerArea > 0
print "Min dist", centerArea[mask].min()/1000.0
if centerArea.max() > 0:
print "Min dist", centerArea[mask].min()/1000.0
img = np.array( [x/20 for x in arr], dtype=np.uint8 )
img.shape = (240, 320, 1)
else:
Expand Down

0 comments on commit be2fb9d

Please sign in to comment.