videosegmentation / video_segment

Main repository for The Video Segmentation Project
Other
168 stars 80 forks source link

region 0 and 1 have the same random color #24

Open lulu1315 opened 5 years ago

lulu1315 commented 5 years ago

hello. I've noticed that region 0 and 1 always had the same color. (Linux Ubuntu 18.04) after investigation i fixed it by modifying the way random colors are generated in segment_util/segmentation_render.cpp in function HierarchyColorGenerator line 68 srand(region_id); changed to srand(region_id+1);

i guess it's related to the way srand interprets 0 and 1 as arguments https://stackoverflow.com/questions/8049556/what-s-the-difference-between-srand1-and-srand0

luc