map.py 文件源码

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

项目:sudokuextract 作者: hbldh 项目源码 文件源码
def _extraction_iterator_map(image, use_local_thresholding=False, apply_gaussian=False, n=5):

    if apply_gaussian:
        img = gaussian_filter(image, (3.0, 3.0))
    else:
        img = image

    for edges in iter_blob_contours(img, n=n):
        try:
            warped_image = geometry.warp_image_by_interp_borders(edges, img)
            sudoku, bin_image = geometry.split_image_into_sudoku_pieces_adaptive_global(
                warped_image, otsu_local=use_local_thresholding, apply_gaussian=apply_gaussian)
        except SudokuExtractError as e:
            pass
        except Exception as e:
            # Try next blob
            raise
        else:
            yield sudoku, bin_image
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号