博客
关于我
图像处理:斑点检测和连接的组件
阅读量:335 次
发布时间:2019-03-04

本文共 2538 字,大约阅读时间需要 8 分钟。

?????????????????

????????????????????????????????????????????????????????????????

????

?????????????????????????????????????????????????????????????????????????????????????????

???????

  • ???????????????????????????
  • ???????????????????????????
  • ???????????????????????????
  • ??????????????????????????????????????

???????

????????????????????

  • Laplacian of Gaussian (LoG)?????????????????????????????
  • Difference of Gaussian (DoG)?????????????????????
  • Hessian Laplace (DoH)???Hessian??????????????????
  • ?Python??????scikit-image????????????????????

    from skimage.io import imreadfrom skimage.color import rgb2grayfrom skimage.feature import blob_dog, blob_log, blob_dohimport matplotlib.pyplot as pltimport numpy as np# ????????????im_bw = rgb2gray(imread('your_image.png'))# LoG??blobs_log = blob_log(im_bw, max_sigma=30, num_sigma=10, threshold=0.1)blobs_log[:, 2] = blobs_log[:, 2] * np.sqrt(2)  # ???# DoG??blobs_dog = blob_dog(im_bw, max_sigma=30, threshold=0.1)blobs_dog[:, 2] = blobs_dog[:, 2] * np.sqrt(2)# DoH??blobs_doh = blob_doh(im_bw, max_sigma=30, threshold=0.01)# ??????plt.figure(figsize=(9, 3))for blob in [blobs_log, blobs_dog, blobs_doh]:    y, x, r = blob    plt.imshow(im_bw, interpolation='nearest')    plt.circle((x, y), r, color='yellow', linewidth=2, fill=False)plt.tight_layout()plt.show()

    ???????

    ??????????????????????????????????????????????????????????????????????????

    ????

    ?????????????????????????????????????????????????????????

    from skimage import dataimport numpy as npdef multi_dilation(im, num):    for _ in range(num):        im = np.dilation(im, np.ones((3, 3)))    return imdef multi_erosion(im, num):    for _ in range(num):        im = np.erosion(im, np.ones((3, 3)))    return im# ????im_bw = data.hawksbury()  # ????im_cleaned = multi_erosion(multi_dilation(im_bw, 5), 5)plt.imshow(im_cleaned)plt.show()

    ???????

    ??skimage??label?region_properties?????????????????????

    from skimage import dataimport numpy as npfrom skimage.segmentation import regionprops# ????im_bw = data.hawksbury()label_im = data.blobs(im_bw)plt.imshow(label_im, alpha=0.5)plt.show()# ??????props = regionprops(label_im)print(props[0].area)  # ??????????

    ????

    ??regionprops??????????

    • ????????
    • ??????????
    • ????BBox??????????
    • ??????????
    • ????????????
    • ??????????
    • ?????????????
    • ??????????????????????

    ?????????????????????????

    ??????

    ????????????????????????????

    • ???????????????????????????
    • ????????????????????????
    • ??????????????????????

    ??

    ?????????????????????????????????????????????????????????????????????????????????????????????????

    转载地址:http://eyaq.baihongyu.com/

    你可能感兴趣的文章
    Pandas-从具有嵌套列表列表的现有列创建动态列时出错
    查看>>
    Pandas-通过对列和索引的值求和来合并两个数据框
    查看>>
    pandas.DataFrame.copy(deep=True) 实际上并不创建深拷贝
    查看>>
    pandas.read_csv()的详解-ChatGPT4o作答
    查看>>
    PANDAS.READ_EXCEL()输出‘;溢出错误:日期值超出范围‘;而不存在日期列
    查看>>
    pandas100个骚操作:再见 for 循环!速度提升315倍!
    查看>>
    Pandas:对给定列求和 DataFrame 行
    查看>>
    Pandas、Matplotlib、Pyecharts数据分析实践
    查看>>
    Pandas中文官档~基础用法2
    查看>>
    Pandas中文官档~基础用法6
    查看>>
    Pandas中的GROUP BY AND SUM不丢失列
    查看>>
    pandas交换两列
    查看>>
    pandas介绍-ChatGPT4o作答
    查看>>
    pandas去除Nan值
    查看>>
    pandas实战:电商平台用户分析
    查看>>
    Pandas库常用方法、函数集合
    查看>>
    pandas打乱数据的顺序
    查看>>
    pandas改变一列值(通过apply)
    查看>>
    Pandas数据分析的环境准备
    查看>>
    Pandas数据可视化怎么做?用实战案例告诉你!
    查看>>