我正在尝试制作一个程序,可以从图像数据集中找到类似的图像.步骤是
现在每个图像SURF描述符将被存储为分层k-means树,现在我将每个树存储为单独的文件,或者是否可以构建某种具有所有图像描述符的单个树并在将图像添加到数据集时更新.
algorithm image-processing computer-vision feature-detection
请有人可以给我看示例代码或告诉我如何使用这个类和方法.我只想将查询图像中的SURF与应用Flann的图像集匹配.我在样本中看到了很多图像匹配代码,但仍然没有得到的是量化图像与其他图像相似程度的指标.任何帮助都感激不尽.
我正在编写一个回调函数,它具有对结构中传递给它的int向量的引用.当我尝试使用下标运算符[]访问向量中的元素时,Intellisense指示==无法比较两个元素,特别是错误是错误C2678:二进制'==':找不到带左手操作数的运算符类型'std :: vector <_Ty>'(或没有可接受的转换).但是当使用at()函数时没有问题.
//body of call back function
searchInfo* argVal = (searchInfo*) Parameter;
for(int i = argVal->inclStartPos; i < argVal->exclEndPos; ++i){
if(argVal->numVector[i] == argVal->searchNum)//problem here
argVal->result = true;
//this is the structure passed through pointer
struct searchInfo{
int inclStartPos;
int exclEndPos;
vector<int>* numVector;
int searchNum;
bool result;
};
Run Code Online (Sandbox Code Playgroud)
由于矢量的[]运算符和at()函数的工作方式差不多(这里的差异无关紧要),为什么会出错呢?