本文整理汇总了Python中Stack.stack方法的典型用法代码示例。如果您正苦于以下问题:Python Stack.stack方法的具体用法?Python Stack.stack怎么用?Python Stack.stack使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stack
的用法示例。
在下文中一共展示了Stack.stack方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: image
# 需要导入模块: import Stack [as 别名]
# 或者: from Stack import stack [as 别名]
if __name__ == "__main__":
argParser = argparse.ArgumentParser(description="Calibrate, register, and stack astrophotography images")
argParser.add_argument("images", nargs='+', metavar="image", help="Input images to stack")
argParser.add_argument("--reference", nargs='?', metavar="image", help="Reference image (not included in stack)")
argParser.add_argument("--out", nargs='?', metavar="filename", help="Output file (mean)")
argParser.add_argument("--outstdev", nargs='?', metavar="filename", help="Output file (stdev)")
argParser.add_argument("--dump_dir", nargs='?', metavar="directory", help="Output directory for image dumps")
argParser.add_argument("--dump_format", nargs='?', metavar="extension", help="Output format for image dumps")
argParser.add_argument("--dump_stars", action="store_true", help="Dump found stars to an image")
argParser.add_argument("--dump_flat", action="store_true", help="Dump flattened image (which is what the star finder uses)")
argSuccess = True
try:
args = argParser.parse_args()
except (Exception, SystemExit):
argSuccess = False
if argSuccess:
ImageIo.initConfig(args.dump_dir, args.dump_format)
Register.initConfig(args.dump_stars, args.dump_flat)
list = ImageIo.loadImageGlob(args.images)
reference = None
if args.reference is not None:
reference = ImageIo.loadImage(args.reference)
reg = Register.register(reference, list)
stack, stackDev = Stack.stack(reg)
if args.out is not None:
ImageIo.saveImage(stack, args.out)
if args.outstdev is not None:
ImageIo.saveImage(stackDev, args.outstdev)