Solved by ptab in post #2 
              
              
                Dilating a kernel adds spacing between kernel elements, for example: a 2-dilated 3x3-kernel can be viewed as a  5x5 kernel. 
You will need to adjust for this by using larger padding.