Basic computer vision algorithms optimized for CPU, CUDA and OpenCL