def __init__(self, size, noComp): self.noComp = noComp self.default_width = 640 self.default_height = 480 self.rescale_ratio = 5 self.pca = eigenHands(size) self.gabor = gaborFilters(False, size) self.bgTotal = cv.CreateMat(70, 70, cv.CV_8UC3)
def __init__(self, makeData, size): self.pca = eigenHands(size) #create the data matrix if they are not there if(makeData == True): self.pca.makeMatrix("garb") self.pca.makeMatrix("hands") self.pca.makeMatrix("rock") self.pca.makeMatrix("paper") self.pca.makeMatrix("scissors")
def __init__(self, size, makeData, noComp): self.pca = eigenHands(size) self.gabor = gaborFilters(False, size) self.classify = classifyHands(False, size) self.prep = preprocessing(size, noComp) if (makeData == True): self.pca.makeMatrix("garb") self.pca.makeMatrix("hands") self.pca.makeMatrix("rock") self.pca.makeMatrix("paper") self.pca.makeMatrix("scissors")
def __init__(self, size, makeData, noComp): self.pca = eigenHands(size) self.gabor = gaborFilters(False, size) self.classify = classifyHands(False, size) self.prep = preprocessing(size, noComp) if(makeData == True): self.pca.makeMatrix("garb") self.pca.makeMatrix("hands") self.pca.makeMatrix("rock") self.pca.makeMatrix("paper") self.pca.makeMatrix("scissors")
def __init__(self, makeData, size): self.pca = eigenHands(size) self.lambd = None self.gamma = None self.psi = None self.theta = None self.sigma = None self.dim = None if(makeData == True): self.pca.makeMatrix("garb") self.pca.makeMatrix("hands") self.pca.makeMatrix("rock") self.pca.makeMatrix("paper") self.pca.makeMatrix("scissors")
def __init__(self, makeData, size): self.pca = eigenHands(size) self.lambd = None self.gamma = None self.psi = None self.theta = None self.sigma = None self.dim = None if (makeData == True): self.pca.makeMatrix("garb") self.pca.makeMatrix("hands") self.pca.makeMatrix("rock") self.pca.makeMatrix("paper") self.pca.makeMatrix("scissors")
print "\t6 => do some classifications (SVN)" print "\t7 => do some classifications (Knn)" print "\t8 => create the FINAL models for classifiers" print "\t9 => detect hands & predict\n" choice = raw_input('your choice... ') sizeImg = raw_input('the size of the training images ...') build = raw_input('build the training matrixes (y/n) ...') buildOpt = {'y':True, 'n':False} print "\n" #____________________________________________________________________________________________________ #____________________________________________________________________________________________________ #____________________________________________________________________________________________________ if(build == "y"): datas = ['rock','paper','scissors','hands','garb'] for aset in datas: hands = eigenHands(int(sizeImg)) hands.makeMatrix(aset) #____________________________________________________________________________________________________ if(int(choice) == 1): dataset = raw_input('choose the dataset c= > rock & paper & scissors; h => hands vs garbage ...') noComp = raw_input('number of components for PCA ...') datas = {'c':['rock','paper','scissors'], 'h':['hands','garb']} hands = eigenHands(int(sizeImg)) _,X,_ = hands.justGetDataMat(datas[dataset][0],"",False) hands.doPCA(X, int(noComp), "PCA/") for i in range(0,len(datas[dataset])): projData = hands.justGetDataMat(datas[dataset][i],"",True) hands.projPCA(projData, False, "PCA/", datas[dataset][i]) #____________________________________________________________________________________________________