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

        p = self.p[0]
        x, y, h, w = p
        rot_box = (x, y), (h, w), 0
        box = cv2.cv.BoxPoints(rot_box)
        box = np.int0(box)
        cv2.drawContours(frame, [box], 0, color, 2)
        cv2.putText(frame, str(num), (int(x), int(y)), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 0), 2)
コード例 #2
0
ファイル: particlefilter.py プロジェクト: misaelzapata/TFM
    def paintp(self, frame):

        pt = self.p

        print pt[0]

        for p in pt:
            x, y, h, w = p
            rot_box = (x, y), (h, w), 0
            box = cv2.cv.BoxPoints(rot_box)
            box = np.int0(box)
            cv2.drawContours(frame, [box], 0, (255, 255, 255), 2)
コード例 #3
0
ファイル: particlefilter.py プロジェクト: d-val/TFM
    def paintbestp(self, frame, num, color):

        x, y, h, w, vx, vy = self.p_star  #@original
        #x, y, h, w, _ = p
        pstar_box = (x, y), (h, w), 0

        paint_pstar=1
        if paint_pstar:
            # OpenCV 2.4.8
            box = cv2.cv.BoxPoints(pstar_box)
            """
            # OpenCV 3.0.0
            box = cv2.boxPoints(rot_box)
            """
            box = np.int0(box)
            cv2.drawContours(frame, [box], 0, color, 2)
            cv2.putText(frame, str(num), (int(x), int(y)),
                        cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 0), 2)

        debug_flag=0
        if debug_flag:
            print "Tr* = [%d,%d,%d,%d]" % (x,y,vx,vy)
            print "Tr mean:"
            print self.p_mean
            print "particles:"
            for ki in xrange(0,self.num_p-1):
                print self.p[ki]

            # OpenCV 2.4.8
            box = cv2.cv.BoxPoints(self.rb)
            """
            # OpenCV 3.0.0
            box = cv2.boxPoints(self.rb)
            """
            box = np.int0(box)
            if self.update:
                cv2.drawContours(frame, [box], 0, (0, 0, 255), 2)
コード例 #4
0
ファイル: particlefilter.py プロジェクト: gelansheshed/TFM
    def paintbestp(self, frame, num, color):

        x, y, h, w, vx, vy = self.p_star  #@original
        #x, y, h, w, _ = p
        pstar_box = (x, y), (h, w), 0

        paint_pstar = 1
        if paint_pstar:
            # OpenCV 2.4.8
            box = cv2.cv.BoxPoints(pstar_box)
            """
            # OpenCV 3.0.0
            box = cv2.boxPoints(rot_box)
            """
            box = np.int0(box)
            cv2.drawContours(frame, [box], 0, color, 2)
            cv2.putText(frame, str(num), (int(x), int(y)),
                        cv2.FONT_HERSHEY_SIMPLEX, 0.5, (0, 0, 0), 2)

        debug_flag = 0
        if debug_flag:
            print "Tr* = [%d,%d,%d,%d]" % (x, y, vx, vy)
            print "Tr mean:"
            print self.p_mean
            print "particles:"
            for ki in xrange(0, self.num_p - 1):
                print self.p[ki]

            # OpenCV 2.4.8
            box = cv2.cv.BoxPoints(self.rb)
            """
            # OpenCV 3.0.0
            box = cv2.boxPoints(self.rb)
            """
            box = np.int0(box)
            if self.update:
                cv2.drawContours(frame, [box], 0, (0, 0, 255), 2)
コード例 #5
0
ファイル: particlefilter.py プロジェクト: d-val/TFM
    def paintp(self, frame, color):

        pt = self.p

        for p in pt:
            x, y, h, w, _, _ = p
            #x, y, h, w, _ = p
            rot_box = (x, y), (h, w), 0
            # OpenCV 2.4.8
            box = cv2.cv.BoxPoints(rot_box)
            """
            # OpenCV 3.0.0
            box = cv2.boxPoints(rot_box)
            """
            box = np.int0(box)
            cv2.drawContours(frame, [box], 0, color, 1)
コード例 #6
0
ファイル: particlefilter.py プロジェクト: gelansheshed/TFM
    def paintp(self, frame, color):

        pt = self.p

        for p in pt:
            x, y, h, w, _, _ = p
            #x, y, h, w, _ = p
            rot_box = (x, y), (h, w), 0
            # OpenCV 2.4.8
            box = cv2.cv.BoxPoints(rot_box)
            """
            # OpenCV 3.0.0
            box = cv2.boxPoints(rot_box)
            """
            box = np.int0(box)
            cv2.drawContours(frame, [box], 0, color, 1)