Grouping Contours Via a Related Image