Another non-linear operation on the pixels in the box around the input pixel is to test whether they match a reference shape. This is a very powerful and useful approach to cleaning up noisy binary images known as mathematical morphology and objects in the image are treated according to their compatibility with a structuring element. We can perform operations on binary images such as erosion or dilation which make objects smaller or bigger respectively, or opening and closing which separate or merge objects respectively.