# Create a mask selecting regions with interesting texture.
noisy = rank.entropy(grayscale_image, np.ones((9, 9)))
textured_regions = noisy > 4
# Note that using `colorize` here is a bit more difficult, since `rgb2hsv`
# expects an RGB image (height x width x channel), but fancy-indexing returns
# a set of RGB pixels (# pixels x channel).
masked_image = image.copy()
masked_image[textured_regions, :] *= red_multiplier
fig, (ax1, ax2) = plt.subplots(ncols=2, nrows=1, figsize=(8, 4),
sharex=True, sharey=True)
ax1.imshow(sliced_image)
ax2.imshow(masked_image)
plt.show()
存眷Linux公社微信公家号(linuxidc_com),(见https://www.linuxidc.com/Linux/2013-12/93755.htm),在Linux公社微信公家号靠山发送发送“163045”即可得到本文代码。
更多Python相关信息见Python 专题页面 https://www.linuxidc.com/topicnews.aspx?tid=17
Linux公社的RSS地点:https://www.linuxidc.com/rssFeed.aspx