Density watershed scheme for 5th-order median filtering