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_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 #3
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 #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.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 #5
0
        t.clip_height = args.clip_height
    # if they specified clip but not supertile step recalculate the step so they don't have to do it
    if args.clip_width or args.clip_height and not (args.super_t_xstep
                                                    or args.super_t_ystep):
        t.recalc_step()

    if args.full:
        t.make_full()
    t.enblend_lock = args.enblend_lock

    if args.single_dir and not os.path.exists(args.single_dir):
        os.mkdir(args.single_dir)

    print 'Running tiler'
    try:
        t.run()
    except KeyboardInterrupt:
        if t.stale_worker:
            print 'WARNING: forcing exit on stuck worker'
            time.sleep(0.5)
            os._exit(1)
    print 'Tiler done!'

    print 'Creating single image'
    single_fn = args.single_fn
    if single_fn is None:
        single_fn = 'out.jpg'
    if args.single_dir:
        single_fn = os.path.join(args.single_dir, single_fn)
    # sometimes I restitch with different supertile size
    # this results in excessive merge, although really I should just delete the old files
Beispiel #6
0
    if args.clip_height:
        t.clip_height = args.clip_height
    # if they specified clip but not supertile step recalculate the step so they don't have to do it
    if args.clip_width or args.clip_height and not (args.super_t_xstep or args.super_t_ystep):
        t.recalc_step()

    if args.full:
        t.make_full()
    t.enblend_lock = args.enblend_lock

    if args.single_dir and not os.path.exists(args.single_dir):
        os.mkdir(args.single_dir)
        
    print 'Running tiler'
    try:
        t.run()
    except KeyboardInterrupt:
        if t.stale_worker:
            print 'WARNING: forcing exit on stuck worker'
            time.sleep(0.5)
            os._exit(1)
    print 'Tiler done!'

    print 'Creating single image'
    single_fn = args.single_fn
    if single_fn is None:
        single_fn = 'out.jpg'
    if args.single_dir:
        single_fn = os.path.join(args.single_dir, single_fn)
    # sometimes I restitch with different supertile size
    # this results in excessive merge, although really I should just delete the old files