Art_class.py 文件源码

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

项目:artorithmia 作者: alichtner 项目源码 文件源码
def extract_blur(self, plot=False):
        """
        Calculate the variance of the 2nd derivative of the image to get blur.

        Input:  plot (bool) whether or not to show the image after Laplacian
        Output: None"""
        # do on grayscale
        # check what the mean would give instead of variance
        self.bluriness = filters.laplace(color.rgb2gray(self.image)).var()
        if plot is True:
            sns.set_style("whitegrid", {'axes.grid': False})
            self.lap = filters.laplace(color.rgb2gray(self.image))
            plt.imshow(self.lap)
            plt.title('Laplacian of {}'.format(self.short_name))
            plt.show()
            plt.imshow(self.lap)
            plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号