Fast median filtering for phase or orientation data