Example #1
0
 def test_tile_real(self):
     project = PTOProject.from_file_name('in.pto')
     print 'Creating tiler'
     t = Tiler(project, 'out', st_scalar_heuristic=2)
     self.assertEqual(len(list(t.gen_supertiles())), 4)
     print 'Unit test running tiler (real)'
     t.run()
Example #2
0
    def test_tile_dry(self):
        '''
		Inputs are 1632 x 1224
		a 3 x 3 grid allows testing edge boundary conditions as well as internal
		The reference fully stitched image is 3377 x 2581
		'''
        project = PTOProject.from_file_name('in.pto')
        print 'Creating tiler'
        t = Tiler(project, 'out', st_scalar_heuristic=2)
        #iw = 1632
        #ih = 1224
        #t.set_size_heuristic(iw, ih)
        '''
		Should make 4 tiles with 3 X 3
		'''
        #t.super_tw = 2 * iw
        #t.super_th = 2 * ih
        '''
		Each supertile should cover two images as setup
		There will be some overlap in the center and unique area on all four edges
		'''
        self.assertEqual(len(list(t.gen_supertiles())), 4)
        print 'Unit test running tiler (real)'
        t.dry = True
        t.run()
Example #3
0
        stp = mem2pix(mksize(args.stm))
        print 'Memory %s => %s pix' % (args.stm, size2str(stp))
    elif auto_size:
        stm = config.super_tile_memory()
        if stm:
            stp = mem2pix(mksize(stm))
            # having issues creating very large
            if stp > 2**32 / 4:
                # 66 GB max useful as currently written
                print 'WARNING: reducing to maximum tile size'
                stp = 2**32 / 4

    t = Tiler(project,
              out_dir,
              stw=mksize(args.stw),
              sth=mksize(args.sth),
              stp=stp,
              clip_width=args.clip_width,
              clip_height=args.clip_height,
              log_dir=log_dir)
    t.threads = args.threads
    t.verbose = args.verbose
    t.st_dir = args.st_dir
    t.force = args.force
    t.merge = args.merge
    t.out_extension = args.out_ext
    t.ignore_errors = args.ignore_errors
    t.ignore_crop = args.ignore_crop
    t.st_limit = float(args.st_limit)

    # TODO: make this more proper?
    if args.nona_args: