The morphology function requires some blank space at the edges of the image, which is called a border. You can set the size of the border when you create the image buffer, and you can adjust the size of the border using IMAQ ImageBorderSize.
Bruce
Bruce Ammons
Ammons Engineering