art_plot.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:artorithmia 作者: alichtner 项目源码 文件源码
def plot_hsv(image, bins=12):
    """
    Plot HSV histograms of image
    INPUT: image with HSV channels
    OUPUT: plot of HSV histograms and color spectrum
    """
    sns.set_style("whitegrid", {'axes.grid': False})
    fig = plt.figure(figsize=(12, 5))
    plt.subplots_adjust(top=2, bottom=1, wspace=.5, hspace=0)
    plt.subplot(231)
    plt.hist(image[:, :, 0].flatten(), bins=bins, color='gray')
    plt.title('Hue')
    plt.subplot(232)
    plt.hist(image[:, :, 1].flatten(), bins=bins, color='gray')
    plt.title('Saturation')
    plt.subplot(233)
    plt.hist(image[:, :, 2].flatten(), bins=bins, color='gray')
    plt.title('Value')
    plt.subplot(234)
    plt.imshow(all_hues, extent=(0, 1, 0, 0.2))
    plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号