Simple computer vision related functions