Ejemplo n.º 1
0
    def __init__(self, src):
        self.cap = video.create_capture(src, presets['book'])
        self.frame = None
        self.paused = False
        self.tracker = PlaneTracker()

        cv2.namedWindow('plane')
        self.rect_sel = common.RectSelector('plane', self.on_rect)
Ejemplo n.º 2
0
    def __init__(self, src):
        self.cap = cv.VideoCapture(src)
        self.frame = None
        self.paused = False
        self.tracker = PlaneTracker()

        cv.namedWindow('plane')
        self.rect_sel = common.RectSelector('plane', self.on_rect)
Ejemplo n.º 3
0
 def __init__(self, src):
     self.cap = video.create_capture(src)
     self.frame = None
     self.paused = False
     self.tracker = PlaneTracker()
     self.tracker.add_target(targetImage, (0, 0, 210, 210))
     cv2.namedWindow('plane')
     self.rect_sel = common.RectSelector('plane', self.on_rect)
Ejemplo n.º 4
0
    def Open(self):
        self.frame = None
        self.paused = False
        self.tracker = PlaneTracker()

        cv.namedWindow(titleWindow)
        self.rect_sel = common.RectSelector(titleWindow, self.on_rect)
        PyStreamRun(self.OpenCVCode, titleWindow)
Ejemplo n.º 5
0
    def __init__(self, src):
        self.cap = video.create_capture(src)
        self.frame = None
        self.paused = False
        self.tracker = PlaneTracker()

        cv2.namedWindow('plane')
        cv2.createTrackbar('focal', 'plane', 25, 50, common.nothing)
        self.rect_sel = common.RectSelector('plane', self.on_rect)
    def Open(self):
        self.imgRGB = None
        self.paused = False
        self.tracker = PlaneTracker()

        cv.namedWindow(titleWindow)
        cv.createTrackbar('focal', titleWindow, 25, 50, common.nothing)
        self.rect_sel = common.RectSelector(titleWindow, self.on_rect)
        PyStreamRun(self.OpenCVCode, titleWindow)
Ejemplo n.º 7
0
    def __init__(self, src):
        #self.cap = video.create_capture(src)
        self.cap = cv2.VideoCapture('http://10.0.0.10:8080/stream/video.mjpeg')
        self.frame = None
        self.paused = False
        self.tracker = PlaneTracker()

        cv2.namedWindow('plane')
        self.rect_sel = common.RectSelector('plane', self.on_rect)
    def __init__(self, src):
        image = cv.imread(src, 1)
        small = cv.resize(image, (0,0), fx=0.125, fy=0.125) # resizing the image, as high resolution image taken
        self.frame = small
        self.paused = False
        self.tracker = PlaneTracker()

        cv.namedWindow('Selected Region')
        # cv.setMouseCallback('Selected Region', self.draw_circle_corner)
        self.rect_sel = common.RectSelector('Selected Region', self.on_rect)
Ejemplo n.º 9
0
    def __init__(self, src):
        self.cap = video.create_capture(src, presets['book'])
        self.frame = None
        self.paused = False
        self.tracker = PlaneTracker()

        cv.namedWindow('plane', cv.WINDOW_NORMAL)
        cv.createTrackbar('focal', 'plane', 25, 50, common.nothing)
        cv.resizeWindow('plane', 1920, 1080)
        self.rect_sel = common.RectSelector('plane', self.on_rect)
Ejemplo n.º 10
0
 def __init__(self, data_input):
     self.paused = False
     #self.cap = cv2.VideoCapture(data_input)
     self.cap = cv2.VideoCapture('133.avi')
     self.frame = None
     self.detector = cv2.ORB(1000)
     self.matcher = cv2.FlannBasedMatcher(flann_params, {})
     self.taregets = []
     cv2.namedWindow('src')
     self.rect_selector = common.RectSelector('src', self.on_rect_selector)
Ejemplo n.º 11
0
    def __init__(self):
        self.cam = cv.VideoCapture(0)
        self.frame = None
        self.paused = False
        self.multi_tracker = CustomMultiTracker()
        self.tracker = cv.TrackerKCF_create()
        self.isTracking = False

        cv.namedWindow("demo")
        self.rect_sel = common.RectSelector('demo', self.on_rect)
Ejemplo n.º 12
0
    def __init__(self, src, f_img, f_img2, off_info):
        self.cap = video.create_capture(src)
        self.f_img = f_img
        self.f_img2 = f_img2
        self.off_info = off_info
        self.frame = None
        self.paused = True
        self.tracker = PlaneTracker()

        cv2.namedWindow('plane')
        self.rect_sel = common.RectSelector('plane', self.on_rect)
Ejemplo n.º 13
0
    def __init__(self, src):
        self.cap = video.create_capture(src)
        self.ref_frame = None

        self.detector = cv2.ORB(nfeatures=1000)
        self.matcher = cv2.FlannBasedMatcher(
            flann_params, {})  # bug : need to pass empty dict (#1329)

        cv2.namedWindow('plane')
        self.rect_sel = common.RectSelector('plane', self.on_rect)

        self.frame = None
Ejemplo n.º 14
0
    def __init__(self, cap, landmarks=None, template=None):
        self.cap = cap
        self.frame = None
        self.paused = False
        self.tracker = DeformationTracker()
        self.landmarks = landmarks

        cv2.namedWindow('plane')

        self.rect_sel = common.RectSelector('plane', self.on_rect)
        if self.landmarks is not None and template is not None:
            h, w, nchannel = template.shape
            self.tracker.set_target(template, (0, 0, w, h),
                                    landmarks=landmarks)
Ejemplo n.º 15
0
 def __init__(self, src):
     cv.namedWindow(WIN_NAME)
     cv.moveWindow(WIN_NAME, 0, 0)
     self.cap = video.create_capture(src, presets['book'])
     self.frame = None
     self.auto_output_frame = None
     self.paused = False
     self.tracker = PlaneTracker()
     self.rect_sel = common.RectSelector('plane', self.on_rect)
     self.user_selected_rect = None
     self.focal_length = 0.0
     self.horizontal_angel = 0.0
     self.known_distance = 200
     self.KNOWN_WIDTH = 40
     self.KNOWN_HEIGHT = 40
     self.msg = None
     self.serial = 0
     self.auto_save = False
     self.auto_serial = 0
    def __init__(self):
        self.args = self.parseArgs()
        if self.args.cannedimages:
            self.fnpat = '../../pictures/RealFullField/%d.jpg'
            self.waitPeriod = 20
        else:
            self.fnpat = None
            self.waitPeriod = 1

        self.fsrc = FSrc(self.fnpat)
        if not self.fsrc:
            exit(1)
        self.frame = None
        self.frameBW = None
        self.paused = False
        load = not self.args.ignoretarget
        self.tracker = planeTracker.PlaneTracker(loadtargets=load)
        self.winNm = 'FeatureTracker'
        cv2.namedWindow(self.winNm)
        self.selRect = common.RectSelector(self.winNm, self.rectCB)