Initial checkin for local min/max filter

Can we use `size_t` there to avoid warnings? Also space is missing before braces.