本文整理汇总了Python中Image.Image.setOverview方法的典型用法代码示例。如果您正苦于以下问题:Python Image.setOverview方法的具体用法?Python Image.setOverview怎么用?Python Image.setOverview使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image.Image
的用法示例。
在下文中一共展示了Image.setOverview方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from Image import Image [as 别名]
# 或者: from Image.Image import setOverview [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"