some optimizations to ocl::erode/dilate