Dynamic based contour clustering