コード例 #1
0
ファイル: particlefilter.py プロジェクト: misaelzapata/TFM
    def plikelihood(self):

        (x, y), (h, w), a = self.det
        det = np.floor(np.array([[x, y, h, w]]))
        yrep = np.ones((self.num_p, 4)) * det

        R2 = np.sum(np.power(self.p - yrep, 2), 1)
        width = 2 * (np.amax(np.sqrt(R2)) - np.amin(np.sqrt(R2)))
        prob = np.exp(-R2 / width)

        prob = prob / np.sum(prob)
        self.prob = prob

        self.sortprob()
コード例 #2
0
ファイル: particlefilter.py プロジェクト: d-val/TFM
    def plikelihood(self):

        if self.update:
            (x, y), (h, w), a = self.rb

            det = np.floor(np.array([[x, y, h, w, x - self.p_star[0], y - self.p_star[1]]]))
            yrep = np.ones((self.num_p, 6)) * det

            R2 = np.sum(np.power(self.p[:, 0:6] - yrep, 2), 1)
            width = 2 * (np.amax(np.sqrt(R2)) - np.amin(np.sqrt(R2)))
            prob = np.exp(- R2 / width)

            a = np.sum(prob)
            if a != 0.0:
                prob = prob / np.sum(prob)
            self.prob = prob

            self.sortprob()
        self.calculatepstar()
コード例 #3
0
ファイル: particlefilter.py プロジェクト: gelansheshed/TFM
    def plikelihood(self):

        if self.update:
            (x, y), (h, w), a = self.rb

            det = np.floor(
                np.array([[x, y, h, w, x - self.p_star[0],
                           y - self.p_star[1]]]))
            yrep = np.ones((self.num_p, 6)) * det

            R2 = np.sum(np.power(self.p[:, 0:6] - yrep, 2), 1)
            width = 2 * (np.amax(np.sqrt(R2)) - np.amin(np.sqrt(R2)))
            prob = np.exp(-R2 / width)

            a = np.sum(prob)
            if a != 0.0:
                prob = prob / np.sum(prob)
            self.prob = prob

            self.sortprob()
        self.calculatepstar()
コード例 #4
0
ファイル: particlefilter.py プロジェクト: d-val/TFM
    def plikelihood_new(self):

        if self.update:
            (x, y), (h, w), a = self.rb


            detectionExtended = np.floor(np.array([[x, y, h, w, x - self.p_star[0], y - self.p_star[1]]]))
            yrep = np.ones((self.num_p, 6)) * detectionExtended
            prob = gaussMixModelPDF(oneParticle,detectionExtended,p_star)


            R2 = np.sum(np.power(self.p[:, 0:6] - yrep, 2), 1)
            width = 2 * (np.amax(np.sqrt(R2)) - np.amin(np.sqrt(R2)))
            prob = np.exp(- R2 / width)

            a = np.sum(prob)

            if a != 0.0:
                prob = prob / np.sum(prob)
            self.prob = prob

            self.sortprob()
            self.calculatepstar()
コード例 #5
0
ファイル: particlefilter.py プロジェクト: gelansheshed/TFM
    def plikelihood_new(self):

        if self.update:
            (x, y), (h, w), a = self.rb

            detectionExtended = np.floor(
                np.array([[x, y, h, w, x - self.p_star[0],
                           y - self.p_star[1]]]))
            yrep = np.ones((self.num_p, 6)) * detectionExtended
            prob = gaussMixModelPDF(oneParticle, detectionExtended, p_star)

            R2 = np.sum(np.power(self.p[:, 0:6] - yrep, 2), 1)
            width = 2 * (np.amax(np.sqrt(R2)) - np.amin(np.sqrt(R2)))
            prob = np.exp(-R2 / width)

            a = np.sum(prob)

            if a != 0.0:
                prob = prob / np.sum(prob)
            self.prob = prob

            self.sortprob()
            self.calculatepstar()
コード例 #6
0
ファイル: association.py プロジェクト: d-val/TFM
def normpdf(x, m, v):
    
    return (1 / (np.sqrt(2 * np.pi) * v)) * np.exp(-(1./2) * np.power((x - m) / v, 2))
コード例 #7
0
def normpdf(x, m, v):

    return (1 / (np.sqrt(2 * np.pi) * v)) * np.exp(-(1. / 2) * np.power(
        (x - m) / v, 2))