VISION: Updated cardDetection.py to be a function