Skip to content

Commit

Permalink
Merge pull request #2455 from wkentaro/label_image_decomposer_division
Browse files Browse the repository at this point in the history
Fix label_id division by 256 -> 255
  • Loading branch information
k-okada authored Oct 21, 2019
2 parents b1780f9 + 699b734 commit 94ea19e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jsk_perception/node_scripts/label_image_decomposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def label2rgb(lbl, img=None, label_names=None, alpha=0.3, bg_label=0):

lbl_viz = np.zeros((lbl.shape[0], lbl.shape[1], 3), dtype=np.uint8)
fg_mask = lbl != bg_label
lbl_viz[fg_mask] = cmap[lbl[fg_mask] % 256]
lbl_viz[fg_mask] = cmap[lbl[fg_mask] % 255]
lbl_viz[~fg_mask] = bg_color

if img is not None:
Expand Down

0 comments on commit 94ea19e

Please sign in to comment.