本文整理匯總了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)