def backgrounder(image_path): if os.system('which clear') == 0: os.system('clear') fbB = fb(shrink=1) assert os.path.exists(image_path) background = cv2.imread(image_path) fbB.imshow('back',background) fbB.close() os.system("figlet HST") print("virtual_size:",fb0.vw,fb0.vh) print("camra :",args.cam_w, args.cam_h, "shrink:1/%d"%args.shrink, "thread:", args.thread, "DMA Mode:", args.dma)
args = argparse.ArgumentParser() args.add_argument('-c', '--cv', action='store_true') args.add_argument('-s', '--shrink', type=int, default=3, choices=[1, 2, 3]) args.add_argument('-bg', '--background', type=str, default='debian2.jpg') args.add_argument('-cm', '--cammode', type=str, default='qvga', choices=['qvga', 'vga', 'svga']) args = args.parse_args() assert os.path.exists('/dev/fb0') and os.path.exists('/dev/video0') ph_height = 288 # placeholder height ph_width = 352 # placeholder width ph_chann = 3 fb0 = fb(shrink=args.shrink) if True: fbB = fb(shrink=1) assert os.path.exists(args.background) background = cv2.imread(args.background) os.system('clear') if os.system('which clear') == 0: os.system('clear') fbB.imshow('back', background) os.system("banner HST") if os.system('which setterm') == 0: os.system('setterm -blank 0;echo setterm -blank 0') fbB = fb(shrink=1) fbB.close() print("virtual_size:", fb0.vw, fb0.vh) devmem_image = devmem(0xe018c000, ph_height * ph_width * ph_chann) devmem_start = devmem(0xe0c00004, 4)
ph_height = 288 # placeholder height ph_width = 352 # placeholder width ph_chann = 3 def backgrounder(image_path): if os.system('which clear') == 0: os.system('clear') fbB = fb(shrink=1) assert os.path.exists(image_path) background = cv2.imread(image_path) fbB.imshow('back',background) fbB.close() os.system("figlet HST") print("virtual_size:",fb0.vw,fb0.vh) print("camra :",args.cam_w, args.cam_h, "shrink:1/%d"%args.shrink, "thread:", args.thread, "DMA Mode:", args.dma) fb0 = fb(shrink=args.shrink) backgrounder(args.background) if os.system('which setterm') == 0: os.system('setterm -blank 0;echo setterm -blank 0') image_area_addr = 0xe018c000 if args.dma and os.path.exists(args.phys_addr): with open(args.phys_addr) as f: cmd = "image_area_addr = %s"%(f.read().strip()) exec(cmd) else: args.dma=False print("image_area_addr:%x"%image_area_addr) devmem_image = devmem(image_area_addr, ph_height*ph_width*ph_chann) devmem_start = devmem(0xe0c00004,4) devmem_stat = devmem(0xe0c00008,0x4) devmem_pred = devmem(0xe0000000,0xc15c)