ImageExtractor.py 文件源码

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

项目:SudokuSolver 作者: Anve94 项目源码 文件源码
def apply_blur(self, image):
        """ Adds a blur to the given image, using the kernel size
            defined in settings. """
        if ENABLE_DEBUG:
            print("DEBUG -- Attempting to apply gaussian blur to"
                  " grayscale image.")
        try:
            blurred = cv2.GaussianBlur(src=image,
                                       ksize=BLUR_KERNEL_SIZE,
                                       sigmaX=0)
        except:
            if VERBOSE_EXIT:
                print("ERROR -- Could not apply blur filter. Please check"
                      " settings and consider changing the blur kernel size.")
            exit()
        if ENABLE_PREVIEW_ALL:
            image_preview(blurred)
        if ENABLE_DEBUG:
            print("DEBUG -- Gaussian Blur succesfully applied.")
        return blurred
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号