import cv2
import numpy as np
while True:
cam = cv2.VideoCapture(0)
while(cam.isOpened()):
ret, im = cam.read()
im=im.reshape(1,-1,3)
im_list=im.tolist()
im_tuples=map(tuple,im_list[0])
im_set=set(im_tuples)
print len(im_set)
This is my code. It runs really slow (like once a second). How can I increase its speed? It already seems really small. Do I lower the image dimensions or something? Or is this as fast as it gets?