Median and related local filters for tensor-valued images