示例#1
0
 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)
示例#2
0
	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)
示例#3
0
	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")
示例#4
0
 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")
示例#5
0
	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")
示例#6
0
	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")
示例#7
0
 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")
示例#8
0
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])
#____________________________________________________________________________________________________