Minimum and maximum filtering over windows