示例#1
0
def main():
    fb3 = "/dev/fb0"
    os.putenv("SDL_FBDEV", fb3)
    # set up audio driver to avoid alisa lib erros
    os.environ['SDL_AUDIODRIVER'] = "dsp"

    # os.environ['SDL_VIDEODRIVER'] = fb3
    # os.environ["SDL_FBDEV"] = fb3
    define.platform_init()

    # pygame.init()
    # root = setup_tkinter()
    # fps_clock = pygame.time.Clock()

    # WIDTH =  define.VERTICAL_LINES
    # HEIGHT = define.HORIZONTAL_PIXELS
    # # screen = pygame.display.set_mode((1240, 1010))
    # size = (pygame.display.Info().current_w, pygame.display.Info().current_h)
    #
    # print("Framebuffer size set {} x {}".format(size[0],size[1]))
    #
    # screen = pygame.display.set_mode((1265, 1015), pygame.FULLSCREEN)
    # while True:
    #     screen.fill(BLACK)

    # game_loop(screen, fps_clock)
    test_loop()
示例#2
0
def main_():
    """
    """

    env_setup()

    define.platform_init()

    try:
        pygame.init()
    except Exception as error:
        print(error)

    # title fonts
    fonts = pygame.font.SysFont("Comic Sans MS", 40)
    title = fonts.render(PROJECT_TITLE, False, (0, 0, 255))
    print("[INFO] title set up done...")

    # making mouse invisible
    pygame.mouse.set_visible(False)

    screen = pygame.display.set_mode(
        SCREEN_SIZE, pygame.FULLSCREEN | pygame.HWSURFACE | pygame.DOUBLEBUF)

    screen.fill(WHITE)

    while True:

        if TASK_INDEX is 0:
            # cam_test.main()
            pass
        if TASK_INDEX is 1:
            face_recog.face_recog_pygm(screen, FPS)
示例#3
0
def main():
    """
    """
    env_setup()

    define.platform_init()

    try:
        pygame.init()
    except Exception as error:
        print(error)

    # title fonts
    fonts = pygame.font.SysFont("Comic Sans MS", 40)
    title = fonts.render(
        'Closed Loop Object Tracking based on Image Recognition', False,
        (0, 0, 255))
    print("[INFO] title set up done...")

    fps_clock = pygame.time.Clock()

    # making mouse invisible
    pygame.mouse.set_visible(False)

    screen = pygame.display.set_mode(
        SCREEN_SIZE, pygame.FULLSCREEN | pygame.HWSURFACE | pygame.DOUBLEBUF)

    screen.fill(WHITE)

    cam_loop(screen, fps_clock, title)
示例#4
0
def main():
    """
    """
    env_setup()

    log = _logging.logger_init(log_filepath="obj_track_img_recog.log",
                               project_name="main")
    log.info("main script starts")

    log.info("calling  define.platform_init()")
    define.platform_init()

    log.info("calling  display_gui.Menu()")
    disply = display_gui.Menu()

    log.info("calling  disply.display_init()")
    screen = disply.display_init()

    log.info("calling  disply.display_color()")
    disply.display_color()

    log.info("calling  display.display_menu_init()")
    disply_obj = display.display_menu_init(screen)

    while True:
        if not globals.CAM_START:  # camera is off, picture will be displayed
            screen.fill(WHITE)  # clean up the display
            cam_off.cam_off_loop(screen, disply_obj)

        if globals.EXIT:
            break

        while globals.CAM_START:

            if globals.TASK_INDEX is 1:
                screen.fill(WHITE)
                face_recog.face_recog_pygm(screen, disply_obj, FPS)

            if globals.TASK_INDEX is 2:
                screen.fill(WHITE)
                motion_detect.motion_detection_pygm(screen, disply_obj, FPS)

            if globals.TASK_INDEX is 3:
                screen.fill(WHITE)
                object_recognition.object_recog_pygm(screen, disply_obj)

            if not globals.CAM_START or globals.EXIT:
                log.info("Camera is OFF")
                break

        if globals.EXIT:
            break

    pygame.quit()
    log.info("exiting from the main...")