Two dimensional median filtering.
Replaces elements of A with the median of their neighbours defined by true elements of logical matrix domain. The default domain is a 3 by 3 matrix with all elements equal to 1. If domain is 1 by 2 row vector, the domain matrix will be logical(ones(domain(2), domain(1))).
Optional variable padding defines the padding used in augmenting the borders of A. See impad for details.
See also: ordfilt2