资源经验分享提取图像兴趣点

提取图像兴趣点

2019-11-27 | |  75 |   0

原标题:提取图像兴趣点

原文来自:博客园      原文链接:https://www.cnblogs.com/geeksongs/p/11189010.html


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

import numpy as npfrom skimage.feature import corner_harris, corner_peaksfrom skimage.color import rgb2gray
import matplotlib.pyplot as plt
import skimage.io as iofrom 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)

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

01.png

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

免责声明:本文来自互联网新闻客户端自媒体,不代表本网的观点和立场。

合作及投稿邮箱:E-mail:editor@tusaishared.com

上一篇:计算多个文档之间的文本相似程度

下一篇:kmeans均值聚类算法实现

用户评价
全部评价

热门资源

  • Python 爬虫(二)...

    所谓爬虫就是模拟客户端发送网络请求,获取网络响...

  • TensorFlow从1到2...

    原文第四篇中,我们介绍了官方的入门案例MNIST,功...

  • TensorFlow从1到2...

    “回归”这个词,既是Regression算法的名称,也代表...

  • 机器学习中的熵、...

    熵 (entropy) 这一词最初来源于热力学。1948年,克...

  • TensorFlow2.0(10...

    前面的博客中我们说过,在加载数据和预处理数据时...