def addNewInformation(self, l, camMod = False): coord_center = CoordTransformer() #coord_center.setInfo(640, 480, 400, 300) coord_center.setInfo(640, 480, 900, 550) i = int(l[1]) typ = l[0] x = -1. y = -1. if (len(l) > 2): x = int(l[2]) y = int(l[3]) if camMod: (x, y) = coord_center.newCoord(x, y) #print (x, y) d = 0. maxd = -1. # down & rien if len(self.gestureList) == 0 and typ != "up": self.newCoordonate(i, typ, x, y) elif len(self.gestureList) > 0 and typ == "up": self.newCoordonate(i, typ, x, y) elif len(self.gestureList) > 0 and typ == "down": lastG = None for g in self.gestureList: (sx, sy, sx0, sy0, t) = g.getCoordonate() #g.printGesture() d = self.distance(x, y, sx, sy) #print "D = ", d, "<", x, y, "> <", sx, sy, ">" if (d <= maxd or maxd == -1) and d <= self.maxBruit: maxd = d lastG = g i = g.getId() if not lastG is None: lastG.printGesture() if (maxd != -1): self.newCoordonate(i, typ, x, y)
from CoordTransformer.CoordTransformer import * t = CoordTransformer() t.setInfo(640, 43, 900, 550) x = 0 y = 43 (x, y) = t.newCoord(x, y) print x, y