from recognizer import recognize, triple, quadriple
import cv2

red = (52, 28, 216)
green = (71, 143, 31)
blue = (143, 62, 1)
yellow = (70, 223, 232)
colors = [red, green, blue, yellow]

# Test 1
image = cv2.imread('color_balls/pictures/test1.jpg')

result, image_result = recognize(image, triple, [yellow, blue])
print("Oreder right?: ", result)

cv2.namedWindow('Image', cv2.WINDOW_NORMAL)
cv2.imshow('Image', image_result)

while cv2.waitKey(1) != ord('q'):
    continue

cv2.destroyAllWindows()

# Test 2

image = cv2.imread('color_balls/pictures/test2.jpg')

result, image_result = recognize(image, triple, [blue, yellow, green])
print("Oreder right?: ", result)

cv2.namedWindow('Image', cv2.WINDOW_NORMAL)
cv2.imshow('Image', image_result)

while cv2.waitKey(1) != ord('q'):
    continue

cv2.destroyAllWindows()

# Test 3

image = cv2.imread('color_balls/pictures/test3.jpg')

result, image_result = recognize(image, triple, [blue, yellow, green])
print("Oreder right?: ", result)

cv2.namedWindow('Image', cv2.WINDOW_NORMAL)
cv2.imshow('Image', image_result)

while cv2.waitKey(1) != ord('q'):
    continue

cv2.destroyAllWindows()

# Test 4

image = cv2.imread('color_balls/pictures/test4.jpg')

result, image_result = recognize(image, quadriple, [red, blue, yellow, green])
print("Oreder right?: ", result)

cv2.namedWindow('Image', cv2.WINDOW_NORMAL)
cv2.imshow('Image', image_result)

while cv2.waitKey(1) != ord('q'):
    continue

cv2.destroyAllWindows()

# Test 3

image = cv2.imread('color_balls/pictures/test5.jpg')

result, image_result = recognize(image, quadriple, [blue, yellow, red, green])
print("Oreder right?: ", result)

cv2.namedWindow('Image', cv2.WINDOW_NORMAL)
cv2.imshow('Image', image_result)

while cv2.waitKey(1) != ord('q'):
    continue

cv2.destroyAllWindows()