当前位置: 首页>>代码示例>>Python>>正文


Python PTOProject.parse_from_file_name方法代码示例

本文整理汇总了Python中pr0ntools.stitch.pto.project.PTOProject.parse_from_file_name方法的典型用法代码示例。如果您正苦于以下问题:Python PTOProject.parse_from_file_name方法的具体用法?Python PTOProject.parse_from_file_name怎么用?Python PTOProject.parse_from_file_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pr0ntools.stitch.pto.project.PTOProject的用法示例。


在下文中一共展示了PTOProject.parse_from_file_name方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_tile_real

# 需要导入模块: from pr0ntools.stitch.pto.project import PTOProject [as 别名]
# 或者: from pr0ntools.stitch.pto.project.PTOProject import parse_from_file_name [as 别名]
	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()
开发者ID:xorrhks0216,项目名称:pr0ntools,代码行数:9,代码来源:test.py

示例2: test_multi

# 需要导入模块: from pr0ntools.stitch.pto.project import PTOProject [as 别名]
# 或者: from pr0ntools.stitch.pto.project.PTOProject import parse_from_file_name [as 别名]
	def test_multi(self):
		print 'Multi test'
		project = PTOProject.parse_from_file_name('in.pto')
		remapper = Remapper(project)
		remapper.image_type = Remapper.TIFF_SINGLE
		remapper.run()	
		self.clean()
开发者ID:xorrhks0216,项目名称:pr0ntools,代码行数:9,代码来源:test.py

示例3: test_tile_dry

# 需要导入模块: from pr0ntools.stitch.pto.project import PTOProject [as 别名]
# 或者: from pr0ntools.stitch.pto.project.PTOProject import parse_from_file_name [as 别名]
	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()
开发者ID:xorrhks0216,项目名称:pr0ntools,代码行数:27,代码来源:test.py

示例4: test_center_anchor

# 需要导入模块: from pr0ntools.stitch.pto.project import PTOProject [as 别名]
# 或者: from pr0ntools.stitch.pto.project.PTOProject import parse_from_file_name [as 别名]
	def test_center_anchor(self):
		project = PTOProject.parse_from_file_name('in.pto')
		center_anchor(project)
		'''
		Image 4 at (1, 1) is the correct answer
		'''
		#vl = project.get_variable_lines()[4]
		project.save()
开发者ID:xorrhks0216,项目名称:pr0ntools,代码行数:10,代码来源:test.py

示例5: test_optimize

# 需要导入模块: from pr0ntools.stitch.pto.project import PTOProject [as 别名]
# 或者: from pr0ntools.stitch.pto.project.PTOProject import parse_from_file_name [as 别名]
    def test_optimize(self):
		print 'Loading raw project...'
		project = PTOProject.parse_from_file_name('in.pto')
		print 'Creating optimizer...'
		optimizer = PTOptimizer(project)
		#self.assertTrue(project.text != None)
		print 'Running optimizer...'
		optimizer.run()
开发者ID:xorrhks0216,项目名称:pr0ntools,代码行数:10,代码来源:test.py

示例6: test_center

# 需要导入模块: from pr0ntools.stitch.pto.project import PTOProject [as 别名]
# 或者: from pr0ntools.stitch.pto.project.PTOProject import parse_from_file_name [as 别名]
	def test_center(self):
		project = PTOProject.parse_from_file_name('in.pto')
		center(project)
		(ybar, xbar) = calc_center(project)
		print 'Final xbar %f, ybar %f' % (ybar, xbar)
		project.save()
开发者ID:xorrhks0216,项目名称:pr0ntools,代码行数:8,代码来源:test.py

示例7: test_optimize_conversion

# 需要导入模块: from pr0ntools.stitch.pto.project import PTOProject [as 别名]
# 或者: from pr0ntools.stitch.pto.project.PTOProject import parse_from_file_name [as 别名]
    def test_optimize_conversion(self):
		project = PTOProject.parse_from_file_name('in.pto')
		pt = project.to_ptoptimizer()
开发者ID:xorrhks0216,项目名称:pr0ntools,代码行数:5,代码来源:test.py

示例8: test_load

# 需要导入模块: from pr0ntools.stitch.pto.project import PTOProject [as 别名]
# 或者: from pr0ntools.stitch.pto.project.PTOProject import parse_from_file_name [as 别名]
    def test_load(self):
		project = PTOProject.parse_from_file_name('in.pto')
		#self.assertTrue(project.text != None)
		self.assertEqual(len(project.image_lines), 4)
开发者ID:xorrhks0216,项目名称:pr0ntools,代码行数:6,代码来源:test.py

示例9: usage

# 需要导入模块: from pr0ntools.stitch.pto.project import PTOProject [as 别名]
# 或者: from pr0ntools.stitch.pto.project.PTOProject import parse_from_file_name [as 别名]
def usage():
	print 'optimizer <file in> [file out]'
	print 'If file out is not given it will be file in'

if __name__ == "__main__":
	from pr0ntools.stitch.pto.project import PTOProject

	if len(sys.argv) < 2:
		usage()
		sys.exit(1)
	file_name_in = sys.argv[1]
	if len(sys.argv) > 2:
		file_name_out = sys.argv[2]
	else:
		file_name_out = file_name_in
	
	print 'Loading raw project...'
	project = PTOProject.parse_from_file_name(file_name_in)
	print 'Creating optimizer...'
	optimizer = PTOptimizer(project)
	#self.assertTrue(project.text != None)
	print 'Running optimizer...'
	print 'Parsed main pre-run: %s' % str(project.parsed)
	optimizer.run()
	print 'Parsed main: %d' % project.parsed
	print 'Saving...'
	project.save_as(file_name_out)
	print 'Parsed main done: %s' % str(project.parsed)

开发者ID:xorrhks0216,项目名称:pr0ntools,代码行数:30,代码来源:optimizer.py


注:本文中的pr0ntools.stitch.pto.project.PTOProject.parse_from_file_name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。