本文整理汇总了Python中PythonMagick.Image.max方法的典型用法代码示例。如果您正苦于以下问题:Python Image.max方法的具体用法?Python Image.max怎么用?Python Image.max使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PythonMagick.Image
的用法示例。
在下文中一共展示了Image.max方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from PythonMagick import Image [as 别名]
# 或者: from PythonMagick.Image import max [as 别名]
avg_stack = avg_stack + img
if max_int_stack_file is not None:
max_int_stack = np.zeros((h,w,c), dtype=img.dtype)
max_int_stack = max_int_stack + img
# Maximum intensities need to be 32-bit to prevent overflow
max_pix_intensities = np.zeros((h,w), dtype='uint32')
max_pix_intensities = max_pix_intensities + img.sum(axis=2)
if max_dev_stack_file is not None:
max_dev_stack = np.zeros((h,w,c), dtype=img.dtype)
max_dev_stack = max_dev_stack + img
max_pix_deviations = np.zeros((h,w), dtype='uint16')
max_pix_deviations = max_pix_deviations + img.std(axis=2)
if max_col_diff_stack_file is not None:
max_col_diff_stack = np.zeros((h,w,c), dtype=img.dtype)
max_col_diff_stack = max_col_diff_stack + img
max_col_diffs = img.max(axis=2)-img.min(axis=2)
if median_stack_file is not None:
# Import HDF5 library
import h5py
median_stack = np.zeros((h,w,c), dtype=img.dtype)
# Create a HDF5 file for temporary storage space for median stack
# calculations. The file is memorymapped, so access from the
# program is easy, but amount of disk-I/O will be huge.
median_hdf_file = median_stack_file[:-3]
median_hdf_file = median_hdf_file + 'H5'
median_hdf_fid = h5py.File(median_hdf_file,'w')
# Datasets will be h-high, w-wide and n_files-deep with the same
# bit-depth as the input images
hdf_R = median_hdf_fid.create_dataset('R', (h,w,n_files), dtype=img.dtype)
hdf_G = median_hdf_fid.create_dataset('G', (h,w,n_files), dtype=img.dtype)
hdf_B = median_hdf_fid.create_dataset('B', (h,w,n_files), dtype=img.dtype)