Пример #1
0
        print ST.LM_list.status()

    scanned = searchScript.landMarkSearch("SIFT", ST.LM_list.active)
    for LM in scanned:
        ST.LM_list.scan.append(LM)

    if len(ST.LM_list.preload) > 0:
        scanned = searchScript.landMarkSearch("SIFT", ST.LM_list.preload)
        for LM in scanned:
            ST.LM_list.preload.remove(LM)
            ST.LM_list.addToActive(LM)
            ST.LM_list.scan.append(LM)

    totalFound = 0
    for LM in ST.LM_list.active:
        if LM.seen > 3:
            LM.matchThreshold = 0.7
            totalFound += 1

    if totalFound == len(media.imagesList):
        return True
    else:
        return False


#if script is called directly from terminal, useful for debugging methods
if __name__ == "__main__":
    #firstTimeRunning = True
    ST.init()
    run()
        top_left = max_loc
        bottom_right = (top_left[0] + w, top_left[1] + h)

    #ST.cam.frame =  cv2.rectangle(ST.cam.frame,top_left, bottom_right, 255, 2)

    x = int((top_left[1] + bottom_right[1]) / 2.0)
    y = int((top_left[0] + bottom_right[0]) / 2.0)
    keyPts = [[x, y]]

    return keyPts


#if script is called directly from terminal, useful for debugging methods
if __name__ == "__main__":
    print "This was called from terminal."
    ST.init()  #initializes global variables and classes
    ST.cam.vidSource = cv2.VideoCapture('./media/ForwardMovementID.mp4')
    cv2.namedWindow('frame')
    cv2.namedWindow('Masks')

    initMask = np.zeros(
        (600, 600),
        dtype=np.uint8)  #creating empty matrix, size of video frame
    initMask[300:500, 300:500] = 1

    template = cv2.imread('./media/Tag16h6.png')

    while (1):
        ret, ST.cam.frame = ST.cam.vidSource.read()  #read
        ST.cam.frame = cv2.imread('./media/aprilTagTest.png')