标签: surf

如何在积分图像上应用框过滤器?(冲浪)

假设我有一个灰度(8 位)图像并假设我有一个从同一图像创建的完整图像。图像分辨率为720x576. 根据 SURF 算法,每个八度音阶由 4 个盒式滤波器组成,它们由它们一侧的像素数定义。

第一个八度使用带有9x9, 15x15, 21x21 and 27x27像素的过滤器。
第二个八度使用带15x15, 27x27, 39x39 and 51x51像素的过滤器。
第三个八度使用带27x27, 51x51, 75x75 and 99x99像素的过滤器。如果图像足够大并且我猜720x576 足够大(对吗??!!),则添加第四个八度音程,51x51, 99x99, 147x147 and 195x195. 这些八度音程彼此部分重叠以提高插值结果的质量。

// so, we have:
//
// 9x9   15x15  21x21   27x27
// 15x15 27x27  39x39   51x51
// 27x27 51x51  75x75   99x99
// 51x51 99x99 147x147 195x195
Run Code Online (Sandbox Code Playgroud)

问题是:每个过滤器中的值
什么?我应该对这些值进行硬编码,还是应该计算它们?
如何准确地(在数字上)将过滤器应用于积分图像?

此外,计算黑森州行列式我发现了两个近似:
det(HessianApprox) = DxxDyy ? (0.9Dxy)^2
det(HessianApprox) = DxxDyy …

image-processing computer-vision surf

3
推荐指数
1
解决办法
6430
查看次数

OpenCV将图像,关键点和描述符保存到文件中

我正在使用SURF/FLANN探测器,我正在寻找将图像,点,描述符保存到文件中,这样我就可以比较这个图像,然后将它指向第二个图像并指向我但是当我得到以下错误时试着写:

In file included from detectFlannPoints.cpp:4:0:
/usr/local/include/opencv2/features2d/features2d.hpp:112:17: note: void cv::write(cv::FileStorage&, const string&, const std::vector<cv::KeyPoint>&)
/usr/local/include/opencv2/features2d/features2d.hpp:112:17: note:   candidate expects 3 arguments, 4 provided
Run Code Online (Sandbox Code Playgroud)

这是我用来编写的代码:

  FileStorage fs("Keypoints.yml", FileStorage::WRITE);
  write(fs, "templateImageOne", keypoints_1, tempDescriptors_1);
  fs.release();
Run Code Online (Sandbox Code Playgroud)

我不确定在哪里可以指定额外的参数(tempDescriptors_1),因为它可以正常删除这个arg.

代码立即高于写代码:

  //Detect the keypoints using SURF Detector
  int minHessian = 400;
  SurfFeatureDetector detector( minHessian );
  std::vector<KeyPoint> keypoints_1;
  detector.detect( img_1, keypoints_1 );
  //-- Step 2: Calculate descriptors (feature vectors)
  SurfDescriptorExtractor extractor;
  Mat tempDescriptors_1;
  extractor.compute( img_1, keypoints_1, tempDescriptors_1 );
 //-- Draw keypoints
  Mat img_keypoints_1;
  drawKeypoints( img_1, keypoints_1, img_keypoints_1, …
Run Code Online (Sandbox Code Playgroud)

c++ opencv image-processing surf flann

3
推荐指数
1
解决办法
6058
查看次数

将IplImage转换为CvMat

这是gpu冲浪代码:

#include <iostream>
#include <iomanip>
#include "opencv2/contrib/contrib.hpp"
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <opencv2/imgproc/imgproc_c.h>
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"

using namespace std;
using namespace cv;
using namespace cv::gpu;

void help()
{
cout << "\nThis program demonstrates using SURF_GPU features detector, descriptor extractor and BruteForceMatcher_GPU" << endl;
cout << "\nUsage:\n\tmatcher_simple_gpu <image1> <image2>" << endl;
}
int main(int argc, char* argv[])
{

GpuMat img1(imread("C:\\OpenCV2.3\\opencv2.3\\bin\\Debug\\tsucuba_left.png", CV_LOAD_IMAGE_GRAYSCALE));
SURF_GPU surf;
// detecting keypoints & computing descriptors
GpuMat keypoints1GPU, keypoints2GPU;
GpuMat descriptors1GPU, descriptors2GPU;
surf(img1, …
Run Code Online (Sandbox Code Playgroud)

opencv cuda gpu iplimage surf

2
推荐指数
1
解决办法
3万
查看次数

我如何在objC中实现SURF?

我需要在objc iOS中实现SURF算法.我搜索了openCV,并尝试实现以下示例

jonmarimbaishai jaffe

这些例子不起作用,我需要让它们中的任何一个工作,所以至少我可以放心,是的,SURF也可以在iOS上运行.我试图从头开始构建,但我完全融入了短路.

我试图在jonmarimba的例子中使用openCV 2.4.2.

并尝试使用X5 4.3的iOS5.1.1

opencv objective-c surf ios

2
推荐指数
1
解决办法
2025
查看次数

camshift和opencv的组合

我正在尝试使用OpenCV进行对象检测作业.但有些东西让我感到困惑.像camshift和kalman滤波器这样的跟踪和预测算法可以完成跟踪任务,而SURF匹配方法也可以做到这一点.

我不太明白这两种方法之间的区别.我已经完成了一些基于feature2d(使用了SURF)和OpenCV教程的motion_analysis_and_object_tracking(使用camshift)的编码.看起来他们只是一个目的的两种手段.我是对的还是我错过了一些概念?

将camshift跟踪与SURF特征匹配相结合是一种好方法吗?也许可以应用更多的东西,比如轮廓匹配?

opencv object-detection surf feature-detection video-tracking

2
推荐指数
1
解决办法
3268
查看次数

功能检测算法和其他疑问有哪些功能

我正在通过特征检测算法,很多事情似乎都不清楚.对于图像处理的初学者来说,原始论文很难理解.如果这些得到回答,我们将很高兴

  1. SURF和SIFT正在检测哪些功能?
  2. 是否有必要在灰度图像上计算这些?
  3. 术语"描述符"用简单的词语表示什么.
  4. 通常,选择/提取了多少个功能?是否有标准?
  5. Hessian矩阵的大小决定了什么?
  6. 被检测的特征的大小是多少?据说特征的大小是blob的大小.因此,如果图像的大小是M*N,那么是否会有M*N n个特征?

这些问题可能看起来太微不足道了,但请帮助..

matlab opencv feature-extraction surf

2
推荐指数
1
解决办法
1307
查看次数

使用OpenCV和C++实现SURF时出现错误cv :: SURF :: SURF(double,int,int,bool,bool)

未实现OpenCV SURF功能的可能重复

我的错误代码是:

错误LNK2019:函数_main中引用的未解析的外部符号"public:__thiscall cv :: SURF :: SURF(double,int,int,bool,bool)"(?? 0SURF @ cv @@ QAE @ NHH_N0 @ Z)

我不知道如何解决它.

我的代码是:

#include <opencv\cv.h>
#include <opencv\highgui.h>
#include <iostream>
#include <conio.h>
#include <opencv2\nonfree\features2d.hpp>
#include <opencv2\legacy\legacy.hpp>
#include <opencv2\core\core.hpp>
#include <stdio.h>

using namespace cv;
using namespace std;

int main()
{
    Mat img_1 = imread("kmu1.jpg", CV_LOAD_IMAGE_GRAYSCALE);
    Mat img_2 = imread("all.jpg", CV_LOAD_IMAGE_GRAYSCALE);

    if(!img_1.data || !img_2.data)
    {
        cout << "could not open or find the image" << endl;
        return -1;
    }

    int minHessian = 400;
    SURF surf( …
Run Code Online (Sandbox Code Playgroud)

c++ opencv surf

2
推荐指数
1
解决办法
4573
查看次数

OpenCV iOS - 显示从drawMatches返回的图像

我是OpenCV的新手.我正试图在iOS上的OpenCV中使用FLANN/SURF在图像之间绘制功能匹配.我正在关注这个例子:

http://docs.opencv.org/doc/tutorials/features2d/feature_flann_matcher/feature_flann_matcher.html#feature-matching-with-flann

这是我的代码,稍加一些修改(将示例中的代码包装在一个函数中,该函数返回一个UIImage作为结果并从bundle中读取起始图像):

UIImage* SURFRecognition::test()
{
    UIImage *img1 = [UIImage imageNamed:@"wallet"];
    UIImage *img2 = [UIImage imageNamed:@"wallet2"];

    Mat img_1;
    Mat img_2;

    UIImageToMat(img1, img_1);
    UIImageToMat(img2, img_2);

    if( !img_1.data || !img_2.data )
    {
        std::cout<< " --(!) Error reading images " << std::endl;
    }

    //-- Step 1: Detect the keypoints using SURF Detector
    int minHessian = 400;

    SurfFeatureDetector detector( minHessian );

    std::vector<KeyPoint> keypoints_1, keypoints_2;

    detector.detect( img_1, keypoints_1 );
    detector.detect( img_2, keypoints_2 );

    //-- Step 2: Calculate descriptors (feature vectors)
    SurfDescriptorExtractor extractor;

    Mat descriptors_1, descriptors_2; …
Run Code Online (Sandbox Code Playgroud)

opencv computer-vision surf feature-detection flann

2
推荐指数
1
解决办法
2599
查看次数

AttributeError:模块“cv2.cv2”没有属性“SURF_create”,2.模块“cv2.cv2”没有属性“xfeatures2d”

我正在尝试使用 SIFT 和 SURF。
在我的笔记本电脑上,我有 OpenCV 版本 = 4.5.1.48,还添加了版本 4.5.1.48 的 OpenCV-contrib-python
我在遵循文档后收到错误 SIFT 在遵循文档后完美工作,但 SURF 不起作用并给我错误以下代码

代码1

surf = cv.xfeatures2d.SURF_create()   
AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d'
Run Code Online (Sandbox Code Playgroud)

代码2

surf = cv2.SURF_create()   
AttributeError: module 'cv2.cv2' has no attribute 'SURF_create'
Run Code Online (Sandbox Code Playgroud)

在阅读了 Stack Overflow 上的许多答案后,我更改了 OpenCV 的版本并做了很多事情,但没有任何效果对我有用

我也读到专利即将到期,但在我的案例中没有任何效果,请告诉我我是否在某个地方错了

python opencv surf sift

2
推荐指数
1
解决办法
1万
查看次数

跟踪对象时出现SURF错误

我试图通过为每个帧调用SURF函数来在视频中找到一个对象...这是SURF函数{

void Identify_SURF_Frame (Mat img_object , Mat img_scene , CvRect in_box) 
{ 
//-- Step 1: Detect the keypoints using SURF Detector
int minHessian = 1;
SurfFeatureDetector detector( minHessian , 15 , 3 );
std::vector<KeyPoint> keypoints_object, keypoints_scene;
detector.detect( img_object, keypoints_object );
detector.detect( img_scene, keypoints_scene );

//-- Step 2: Calculate descriptors (feature vectors)
SurfDescriptorExtractor extractor;
Mat descriptors_object, descriptors_scene;
extractor.compute( img_object, keypoints_object, descriptors_object );
extractor.compute( img_scene, keypoints_scene, descriptors_scene );

//-- Step 3: Matching descriptor vectors using FLANN matcher
//FlannBasedMatcher matcher;
BruteForceMatcher < L2 …
Run Code Online (Sandbox Code Playgroud)

macos opencv surf

1
推荐指数
1
解决办法
1264
查看次数

OpenCV计算时间检测功能

我正在尝试计算我的程序从图像中检测关键点所需的时间。如果在我的 C++ 程序中我执行两次(使用相同的图像),则两者之间存在巨大差异。第一次大约用 600-800 毫秒,第二次只用 100-200 毫秒。

有谁知道发生了什么事?

这是我获取时间的代码:

struct timeval t1, t2;

Ptr<SURF> detector = SURF::create(400);

gettimeofday(&t1, 0x0);

detector->detect( imagen1, keypoints_1 );

gettimeofday(&t2, 0x0);

int milliSeconds = Utils::calculateDiff(t1, t2);
Run Code Online (Sandbox Code Playgroud)

这是我计算差异的代码:

static int calculateDiff(timeval t1, timeval t2)
{
    return (t2.tv_sec - t1.tv_sec) * 1000 + (t2.tv_usec - t1.tv_usec)/1000;
}
Run Code Online (Sandbox Code Playgroud)

这是一个示例:

样本

c++ opencv surf feature-detection

0
推荐指数
1
解决办法
9876
查看次数

Python opencv 3 SIFT特征提取

我想更改以下两个用opencv 2.3编写的命令.

fea_det=cv2.FeatureDetector_create("SIFT")
des_ext=cv2.DescriptorExtractor_create("SIFT")
Run Code Online (Sandbox Code Playgroud)

在opencv 3中,我知道有一个创建SIFT的命令,所以

fea_det=cv2.xfeatures2d.SIFT_create()
Run Code Online (Sandbox Code Playgroud)

但是我应该为des_ext使用什么?我问cv2.DescriptorExtractor_create("SIFT")opencv 3 中" " 的等效代码是什么?

python opencv feature-extraction surf sift

0
推荐指数
1
解决办法
3993
查看次数