Changed to use OpenCV