Beispiel #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()
Beispiel #2
0
	def test_tile_real(self):
		project = PTOProject.parse_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()
Beispiel #3
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.parse_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()
Beispiel #4
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()
Beispiel #5
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:
Beispiel #6
0
        stp = mksize(args.stp)
    elif args.stm:
        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:
        t.nona_args = args.nona_args.replace('"', '').split(' ')
    if args.enblend_args:
        t.enblend_args = args.enblend_args.replace('"', '').split(' ')
Beispiel #7
0
    stp = None
    if args.stp:
        stp = mksize(args.stp)
    elif args.stm:
        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))

    t = Tiler(
        project,
        "out",
        stw=mksize(args.stw),
        sth=mksize(args.sth),
        stp=stp,
        clip_width=args.clip_width,
        clip_height=args.clip_height,
    )
    t.force = args.force
    t.merge = args.merge
    t.out_extension = args.out_extension
    t.ignore_errors = args.ignore_errors

    if args.super_t_xstep:
        t.super_t_xstep = args.super_t_xstep
    if args.super_t_ystep:
        t.super_t_ystep = args.super_t_ystep
    if args.clip_width:
        t.clip_width = args.clip_width