public static void clusterToBinary ( List < List < Point2D_I32 > > clusters , GrayU8 binary ) { ImageMiscOps . fill ( binary , 0 ) ; for ( List < Point2D_I32 > l : clusters ) { for ( Point2D_I32 p : l ) { binary . set ( p . x , p . y , 1 ) ; } } }
Sets each pixel in the list of clusters to one in the binary image .