示例#1
0
    def getBackSpeed(self, t):

        a = self.detectionDictionnary.get(t - 1)
        b = self.detectionDictionnary.get(t + 1)

        if a == None or b == None:
            return None

        speedVectorX = a.backX - b.backX
        speedVectorY = a.backY - b.backY

        p = Point(speedVectorX, speedVectorY)
        return p
示例#2
0
    def getFrontSpeed(self, t):

        a = self.detectionDictionnary.get(t - 1)
        b = self.detectionDictionnary.get(t + 1)

        if a == None or b == None:
            return None

        speedVectorX = a.frontX - b.frontX
        speedVectorY = a.frontY - b.frontY

        p = Point(speedVectorX, speedVectorY)
        return p
示例#3
0
    def getSpeedVector(self, t):

        a = self.detectionDictionnary.get(t - 1)
        b = self.detectionDictionnary.get(t + 1)

        if a == None or b == None:
            return None

        speedVectorX = a.massX - b.massX
        speedVectorY = a.massY - b.massY

        p = Point(speedVectorX, speedVectorY)
        return p
示例#4
0
    def getOrientationVector(self, t):

        d = self.detectionDictionnary.get(t)

        if d == None:
            return None

        if d.frontX == None:
            return None

        if d.backX == None:
            return None

        deltaX = d.frontX - d.backX
        deltaY = d.frontY - d.backY
        p = Point(deltaX, deltaY)
        return p
示例#5
0
''' threshold to compute head-genital events '''
MAX_DISTANCE_HEAD_HEAD_GENITAL_THRESHOLD = 15

oneFrame = 1
oneSecond = 30
oneMinute = 30*60
oneHour = 30*60*60
oneDay = 30*60*60*24
oneWeek = 30*60*60*24*7


'''time window at the end of an event to test overlap with another event'''
TIME_WINDOW_BEFORE_EVENT = 15*oneFrame

''' Cage center in 50x50cm area'''
cageCenterCoordinates50x50Area = Point( 256, 208 )

''' Corner Coordinates in 50x50cm area '''
cornerCoordinates50x50Area = [
                        (114,63),
                        (398,63),
                        (398,353),
                        (114,353)
                        ]

def second( second ):
    return second * oneSecond
    
def day( day ):
    return day* oneDay