contour filtering and combining