zoukankan      html  css  js  c++  java
  • 提取图像兴趣点

    一般来讲,我们图像的兴趣点都有边缘(edges)和角点(corners),这是两种比较常见的兴趣点类型,我们现在来撸撸代码,看一个提取美女兴趣点的例子:

    import numpy as np
    from skimage.feature import corner_harris, corner_peaks
    from skimage.color import rgb2gray
    import matplotlib.pyplot as plt
    import skimage.io as io
    from skimage.exposure import equalize_hist
    def show_corners(corners, image):
        fig = plt.figure()
        plt.gray()
        plt.imshow(image)
        y_corner, x_corner = zip(*corners)
        plt.plot(x_corner, y_corner, 'or')
        plt.xlim(0, image.shape[1])
        plt.ylim(image.shape[0], 0)
        fig.set_size_inches(np.array(fig.get_size_inches()) * 2)
        plt.show()
    mandrill = io.imread('112.png.')
    mandrill = equalize_hist(rgb2gray(mandrill))
    corners = corner_peaks(corner_harris(mandrill), min_distance=1)
    show_corners(corners, mandrill)

    最后我们显示得到的结果红色部分就是我们的兴趣点所在位置:

    虽然结果没有深色图像的好,但也是可以很明显地看到兴趣点被我们提取出来了。

  • 相关阅读:
    (转 )Unity对Lua的编辑器拓展
    unity timeline
    unity拖尾粒子问题
    unity shader 波动圈
    linux教程
    Unity Shader 基础
    ugui拖拽
    unity shader 热扭曲 (屏幕后处理)
    英文取名神器
    lua正则表达式替换字符串
  • 原文地址:https://www.cnblogs.com/geeksongs/p/11189010.html
Copyright © 2011-2022 走看看