algo/IBDT.py
def addPoint(self, entry:object) -> None:
        """Calculates velocity and classifies event type of the given sample, if already trained.

        Not a method for aggregating data samples. Method is for using the classifier.

        :param entry: IBDT_Data to classify event on.
        :return:
        """
        entry.base.classification = MOVEMENT['UNDEF']

        #Low confidence, ignore it
        if entry.base.confidence < self.minSampleConfidence:
            return None



        #Add new point to window and update previous valid point
        self.window.append( entry )
        self.prev = self.cur
        self.cur = self.window[len(self.window)-1]

        #Remove old entries from window
        while True:
            #TODO math.abs() needed??
            if (self.cur.base.ts - self.window[0].base.ts) > (2*self.maxSaccadeDurationMs):
                self.window.popleft()
            else:
                break


        #First point being classified is a special case (since we classify interframe periods)
        if not self.prev:
            self.cur.base.classification = MOVEMENT['UNDEF']
            entry.base.classification = self.cur.base.classification
            return None



        #We have an intersample period, let's classify it
        self.cur.base.v = self.estimateVelocity(self.cur, self.prev)

        #Update the priors
        self.updatePursuitPrior()
        self.cur.fixation.prior = 1 - self.cur.pursuit.prior
        self.cur.saccade.prior = self.cur.fixation.prior


        #Update the likelihoods
        self.updatePursuitLikelihood()
        self.updateFixationAndSaccadeLikelihood()


        #Update the posteriors
        self.cur.pursuit.update()
        self.cur.fixation.update()
        self.cur.saccade.update()



        #Decision
        if self.classification == CLASSIFICATION['TERNARY']:
            self.ternaryClassification()
        elif self.classification == CLASSIFICATION['BINARY']:
            self.binaryClassification()


        entry.classification = self.cur.base.classification
Calculates velocity and classifies event type of the given sample, if already trained.

        Not a method for aggregating data samples. Method is for using the classifier.

        :param entry: IBDT_Data to classify event on.
        :return:
        
Calculates velocity and classifies event type of the given sample, if already trained.
Not a method for aggregating data samples. Method is for using the classifier.
Calculates velocity and classifies event type of the given sample if already trained . Not a method for aggregating data samples . Method is for using the classifier .
def addPoint(self, entry:object) -> None:
        entry.base.classification = MOVEMENT['UNDEF']
        if entry.base.confidence < self.minSampleConfidence:
            return None
        self.window.append( entry )
        self.prev = self.cur
        self.cur = self.window[len(self.window)-1]
        while True:
            if (self.cur.base.ts - self.window[0].base.ts) > (2*self.maxSaccadeDurationMs):
                self.window.popleft()
            else:
                break
        if not self.prev:
            self.cur.base.classification = MOVEMENT['UNDEF']
            entry.base.classification = self.cur.base.classification
            return None
        self.cur.base.v = self.estimateVelocity(self.cur, self.prev)
        self.updatePursuitPrior()
        self.cur.fixation.prior = 1 - self.cur.pursuit.prior
        self.cur.saccade.prior = self.cur.fixation.prior
        self.updatePursuitLikelihood()
        self.updateFixationAndSaccadeLikelihood()
        self.cur.pursuit.update()
        self.cur.fixation.update()
        self.cur.saccade.update()
        if self.classification == CLASSIFICATION['TERNARY']:
            self.ternaryClassification()
        elif self.classification == CLASSIFICATION['BINARY']:
            self.binaryClassification()
        entry.classification = self.cur.base.classification
def addPoint ( self , entry : object ) -> None : entry . base . classification = MOVEMENT [ 'UNDEF' ] if entry . base . confidence < self . minSampleConfidence : return None self . window . append ( entry ) self . prev = self . cur self . cur = self . window [ len ( self . window ) - 1 ] while True : if ( self . cur . base . ts - self . window [ 0 ] . base . ts ) > ( 2 * self . maxSaccadeDurationMs ) : self . window . popleft ( ) else : break if not self . prev : self . cur . base . classification = MOVEMENT [ 'UNDEF' ] entry . base . classification = self . cur . base . classification return None self . cur . base . v = self . estimateVelocity ( self . cur , self . prev ) self . updatePursuitPrior ( ) self . cur . fixation . prior = 1 - self . cur . pursuit . prior self . cur . saccade . prior = self . cur . fixation . prior self . updatePursuitLikelihood ( ) self . updateFixationAndSaccadeLikelihood ( ) self . cur . pursuit . update ( ) self . cur . fixation . update ( ) self . cur . saccade . update ( ) if self . classification == CLASSIFICATION [ 'TERNARY' ] : self . ternaryClassification ( ) elif self . classification == CLASSIFICATION [ 'BINARY' ] : self . binaryClassification ( ) entry . classification = self . cur . base . classification
Calculates velocity and classifies event type of the given sample, if already trained.
Calculates velocity and classifies event type of the given sample if already trained .
"""Calculates velocity and classifies event type of the given sample, if already trained.

        Not a method for aggregating data samples. Method is for using the classifier.

        :param entry: IBDT_Data to classify event on.
        :return:
        """ #Low confidence, ignore it #Add new point to window and update previous valid point #Remove old entries from window #TODO math.abs() needed?? #First point being classified is a special case (since we classify interframe periods) #We have an intersample period, let's classify it #Update the priors #Update the likelihoods #Update the posteriors #Decision
None
self
entry
object
IBDT_Data to classify event on.
IBDT_Data to classify event on .