コード例 #1
0
ファイル: ukeCamera.py プロジェクト: bfishbaum/virtualUke
	def updateFingers(self,frame):
		cols = [x[0] for x in self.corners]
		rows = [x[1] for x in self.corners]
		maxCol = max(cols)
		minCol = min(cols)
		maxRow = max(rows)
		minRow = min(rows)
		fretBoard = self.masterImage[minRow:maxRow, minCol:maxCol]
		fretBoard = imgMod.blackMask(fretBoard) 
コード例 #2
0
ファイル: ukeCamera.py プロジェクト: bfishbaum/virtualUke
	def checkFretPoints(self):
		fretBoard = imgMod.blackMask(self.masterImage)
		chordString = ""
		for ukeString in self.fretPoints:
			stringDown = False
			for i in range(len(ukeString)):
				point = ukeString[i]
				if(fretBoard[point[1],point[0]] == 1):
					chordString += str(i)
					stringDown = True
					break
			if(not stringDown):
				chordString += "0"
		return chordString