fixed Erode and Dilate in case of kernel = Mat()