本文整理匯總了Python中region.Region.median_filter方法的典型用法代碼示例。如果您正苦於以下問題:Python Region.median_filter方法的具體用法?Python Region.median_filter怎麽用?Python Region.median_filter使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類region.Region
的用法示例。
在下文中一共展示了Region.median_filter方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1:
# 需要導入模塊: from region import Region [as 別名]
# 或者: from region.Region import median_filter [as 別名]
if args.overlay_gps:
region.overlay_gps(gpx_manager.gpx, thickness=int(args.thickness),
elevation_delta=args.overlay_delta)
if region.aspect_ratio < 0:
height = width / region.aspect_ratio
else:
height = width * region.aspect_ratio
height = height / region.distance_ratio # correct for lng distance diff
medfilt_filename_suffix = ""
if args.median_filter != '-1':
print "median filtering"
region.median_filter(kernel_size=int(args.median_filter))
medfilt_filename_suffix = "-medfilt_%s" % args.median_filter
fig = plt.figure(frameon=False)
fig.set_size_inches(width, height)
fig.set_dpi(dpi)
ax = plt.Axes(fig, [0., 0., 1., 1.])
ax.set_axis_off()
fig.add_axes(ax)
# log_out = np.log1p(region.outfile)
colormaps = [m for m in cm.datad if not m.endswith("_r")]
colormap = cm.get_cmap(args.color_map)
ax.imshow(region.outfile, aspect='normal', interpolation='bilinear',
cmap=colormap, alpha=1.0)