have gradient angles binned up into 8 (overlapping) compass points. need to implement connected component algorithm