This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2,time,thread,threading | |
import numpy as np,pygame | |
from collections import Counter | |
clk = pygame.time.Clock() | |
def fingerCount(cap,openSecs): | |
ret,img = cap.read() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Imports | |
import pygame,time,random,cv2 | |
from detectionFunction import fingerCount | |
from multiprocessing.pool import ThreadPool | |
from collections import Counter | |
#Threading and Opencv | |
pool = ThreadPool(processes=1) | |
cap = cv2.VideoCapture(0) | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2,time,thread,threading | |
import numpy as np,pygame | |
from collections import Counter | |
clk = pygame.time.Clock() | |
def fingerCount(cap,openSecs): | |
dfcts = [] | |
# cap = cv2.VideoCapture(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame,time,random,cv2,thread,threading | |
from detectionFunction import fingerCount | |
pygame.init() | |
display_width = 1366 | |
display_height = 700 | |
black = (0,0,0) | |
white = (255,255,255) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2,time,thread,threading | |
import numpy as np,pygame | |
from collections import Counter | |
clk = pygame.time.Clock() | |
def fingerCount(openSecs): | |
dfcts = [] | |
cap = cv2.VideoCapture(0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from detectionFunction import fingerCount | |
import thread,threading,time,cv2 | |
from multiprocessing.pool import ThreadPool | |
pool = ThreadPool(processes=1) | |
cap = cv2.VideoCapture(0) | |
# cap = 1 | |
async_result = pool.apply_async(fingerCount, (cap,1, )) # tuple of args for foo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pygame,time,random | |
pygame.init() | |
display_width = 800 | |
display_height = 600 | |
white = (255,255,255) | |
black = (0,0,0) | |
red = (255,0,0) | |
green = (0,255,0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
def main(): | |
u,l,c = raw_input().split() | |
U = list(map(int,raw_input().split())) | |
L = list(map(int,raw_input().split())) | |
temp1 = [0]*1005 | |
temp2 = [0]*1005 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flag = 1 | |
def calcLPS(pat): | |
leng = 0 | |
i = 1 | |
lps = [0]*len(pat) | |
while i<len(pat): | |
print pat[i],i+1,pat[leng],leng+1 | |
if pat[i]==pat[leng]: | |
leng+=1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
tree = [-1]*100000 | |
val = [1]*100000 | |
lazy = [0]*100000 | |
def buildTree(node,st,ed): | |
# global tree | |
if st>ed: | |
return |