I want to apply this filter to a gray image in Rust:
The filter is in the form of a rectangle inside the image: