xmin = int(arguments['<xmin>']) ymin = int(arguments['<ymin>']) xmax = int(arguments['<xmax>']) ymax = int(arguments['<ymax>']) x = xmax-xmin y = ymax-ymin cap = cv.CaptureFromFile(video) score = {} c_frame = -1 maxIntensity = 255.0 phi = 1 theta = 1 contours = cv2.imread(logo) hist_logo = tools.calcul_hist(contours, x*4, y*4, None) contours2 = cv2.imread(logo2) hist_logo2 = tools.calcul_hist(contours2, x*4, y*4, None) while(c_frame<(cv.GetCaptureProperty(cap, cv.CV_CAP_PROP_FRAME_COUNT)-1)): frame = cv.QueryFrame(cap) c_frame += 1 if frame: frame = frame[ymin:ymax, xmin:xmax] frame_a = np.asarray(frame) frame_a = cv2.resize(frame_a, (0,0), fx=4, fy=4) if cv.WaitKey(1) & 0xFF == ord('q'): break newImage0 = (maxIntensity/phi)*(frame_a/(maxIntensity/theta))**2 newImage0 = array(newImage0,dtype=uint8)