changed to HSV for better color segmentation, changed most functions to cv2