distance map filtered for abrupt changes