当前位置: 首页 > news >正文

RootSIFT---SIFT图像特征的扩展

RootSIFT是论文 Three things everyone should know to improve object retrieval - 2012所提出的

在这里插入图片描述
A Comparative Analysis of RootSIFT and SIFT Methods for Drowsy Features Extraction - 2020

当比较直方图时,使用欧氏距离通常比卡方距离或Hellinger核时的性能差,但是在使用 SIFT 特征点为什么一直都使用欧氏距离呢?

不论是对 SIFT 特征点进行匹配,还是对 SIFT 特征集合进行聚类得到视觉词汇表,又或者对图像进行BoW编码,都使用的是欧氏距离. 但是 SIFT 特征描述子本质上也是一种直方图,为什么对 SIFT 特征描述子进行比较的时候要使用欧氏距离呢,有没有一种更精确的比较方法呢?

SIFT 描述子统计的是关键点邻域的梯度直方图.

论文作者认为之所以一直使用欧氏距离来测量 SIFT 特征的相似度,是由于在 SIFT 提出时,使用的是欧氏距离的度量,可以找出一种比较欧氏距离更为精确的度量方法. 故,提出了RootSift 对 SIFT 特征进行扩展.

具体操作如下:

在提取到 SIFT 描述向量 x x x 后,进行如下处理,即可得到 RootSIFT:

[1] - 对特征向量 x x x 进行 l 1 l_1 l1 的归一化得到 x ′ x' x ;

[2] - 对 x ′ x' x的每一个元素求平方根;

[3] - 进行 l 2 l_2 l2归一化.(可选)

  • [3]中,是否进行l2归一化,有些不一致. 在[RootSIFT]论文 中并没有指出需要进行 l2 归一化,但是在 presentation, 却有 l2归一化.

参考:图像检索(4):IF-IDF,RootSift,VLAD – RootSIFT

1. RootSIFT 实现

Python 实现如:

  • https://www.pyimagesearch.com/2015/04/13/implementing-rootsift-in-python-and-opencv/
  • https://github.com/jrosebr1/imutils/blob/master/imutils/feature/rootsift.py
import numpy as np
import cv2class RootSIFT:def __init__(self):# initialize the SIFT feature extractor#OpenCV2.4# self.extractor = cv2.DescriptorExtractor_create("SIFT")#OpenCV3+self.extractor = cv2.xfeatures2d.SIFT_create()def compute(self, image, kps, eps=1e-7):# compute SIFT descriptorskps, descs = self.extractor.compute(image, kps)# if there are no keypoints or descriptors, return an empty tupleif len(kps) == 0:return ([], None)# apply the Hellinger kernel by first L1-normalizing and taking the# square-rootdescs /= (descs.sum(axis=1, keepdims=True) + eps)descs = np.sqrt(descs)#descs /= (np.linalg.norm(descs, axis=1, ord=2) + eps)# return a tuple of the keypoints and descriptorsreturn (kps, descs)
#
image = cv2.imread("test.jpg")
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)# detect Difference of Gaussian keypoints in the image
sift = cv2.xfeatures2d.SIFT_create()
kps, descs = sift.detectAndCompute(img1, None)
print "SIFT: kps=%d, descriptors=%s " % (len(kps), descs.shape)# extract RootSIFT descriptors
root_sift = RootSIFT()
(kps, descs) = root_sift.compute(image, kps)
print "RootSIFT: kps=%d, descriptors=%s " % (len(kps), descs.shape)

C++ 实现:

for(int i = 0; i < siftFeature.rows; i ++)
{// Conver to float typeMat f;siftFeature.row(i).convertTo(f,CV_32FC1);normalize(f,f,1,0,NORM_L1); // l1 normalizesqrt(f,f); // sqrt-root  root-siftrootSiftFeature.push_back(f);
}

2. 基于 RootSIFT 的相似图搜索

在这里插入图片描述

http://www.lryc.cn/news/192637.html

相关文章:

  • ChatGPT角色扮演教程,Prompt词分享
  • zabbix监控——自定义监控内容
  • 中断机制-中断协商机制、中断方法
  • three.js入门 —— 实现第一个3D案例
  • 《动手学深度学习 Pytorch版》 8.4 循环神经网络
  • 什么是物联网阀控水表?
  • Kafka 开启SASL/SCRAM认证 及 ACL授权(一)认证
  • 关于智能控制领域中模糊控制算法的概述
  • 剖析伦敦银最新价格走势图
  • 通用人工智能技术(深度学习,大模型,Chatgpt,多模态,强化学习,具身智能)
  • makefile的特性-部分语法记录
  • 【Java 进阶篇】JavaScript 正则表达式(RegExp)详解
  • 51单片机之串口通信例程
  • Hadoop高可用集群(HA)一键启动脚本
  • C#开发的OpenRA游戏之金钱系统(1)
  • Puppeteer监听网络请求、爬取网页图片(二)
  • GoLang连接mysql数据库
  • 软件工程与计算总结(八)软件设计基础
  • someip 入门
  • C# 使用Parallel去执行并行下载
  • @Component 和 @Bean的区别
  • 百度测试开发工程师面试心得
  • 发现更多美景!XnViewMP for Mac/Windows 图片浏览软件
  • 城市广告牌安全传感器特点有哪些?
  • 源码部署lamt架构
  • 【Java 进阶篇】JavaScript Math对象详解
  • geecg-uniapp 路由修改 页面创建 (2)
  • 微信开发者工具下载
  • ctfshow萌新计划web9-14(正则匹配绕过)
  • 【数据结构】单链表按位序插入元素e【前插】(带头结点的和不带头结点的)这篇很重要,文字说明比起其他篇是正确的