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


Python Image.getBandSelection方法代码示例

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


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

示例1: main

# 需要导入模块: from Image import Image [as 别名]
# 或者: from Image.Image import getBandSelection [as 别名]
def main(args):
	try:

		# Initializing 
		init = pyossimtest.Init.instance()
		init.initialize()


		#Input and open image file
		imageFileName = raw_input()
		img = Image()

		if img.open(imageFileName):
			print "Opened: " + str(imageFileName)

		# Display bands selection
		bands = list()
		bands = img.getBandSelection()
		print bands

		if bands is not None:
			i = 0
			for i in range(0, len(bands)):
				print "band[" + i + "]: " + bands[i]

			i = 0
			for i in range(0, len(bands)):
				bands[i] = len(bands) - i + 1

			img.selectBands(bands)

		else:
			print "Image.getBandSelection returned Null"


		#Set the histogram
		ext = str("his")
		im = imageFileName.split('.')
		im[0] = im[0] + ext
		his = str(im[0])
	
		if img.setHistogram(his):
			his2 = img.getHistogramFile()
			print "Image.getHistogramFile() result: " + his2
		else:
			print "Image.getHistogramFile() returned false!"
	

		#Set the overview
		ext = str("ovr")
		im = imageFileName.split('.')
		im[0] = im[0] + ext
		ovr = str(im[0])
	
		if img.setOverview(ovr):
			ovr2 = img.getOverviewFile()
			print "Image.getOverviewFile() result: " + ovr2
		else:
			print "Image.getOverviewFile() returned false!"
	
	
	except(Exception):
		print "Caught Exception"
开发者ID:renyu310,项目名称:ossim-svn,代码行数:65,代码来源:ossimImageTest.py


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