OpenCV 2.4.5,CUDA 5.0
我试图将SURF匹配器从CPU转移到GPU,但结果却很奇怪。我将knnMatch和findHomography + PerspectiveTransform与我的函数一起使用,该函数可以更精确地检查边界框的角以得到结果。
GPU部分:
const int baseImagesSize = baseImages.size();
SURF_GPU surf(1500);
surf.extended = false;
GpuMat keypoints_test_GPU, descriptors_test_GPU;
surf(frame, GpuMat(), keypoints_test_GPU, descriptors_test_GPU);
vector<float> descriptors_test_CPU;
surf.downloadDescriptors(descriptors_test_GPU, descriptors_test_CPU);
Mat descriptors_test_CPU_Mat(descriptors_test_CPU);
vector<Point2f> objs_corners(4);
BruteForceMatcher_GPU< L2<float> > matcher;
vector<KeyPoint> keypoints_test_CPU;
surf.downloadKeypoints(keypoints_test_GPU, keypoints_test_CPU);
for (int i = 0; i < baseImagesSize; ++i)
{
//Get the corners from the object
objs_corners[0] = cvPoint(0,0);
objs_corners[1] = cvPoint( baseImages[i].cols, 0 );
objs_corners[2] = cvPoint( baseImages[i].cols, baseImages[i].rows );
objs_corners[3] = cvPoint( 0, baseImages[i].rows );
//cout<<endl<<objs_corners[0]<<" "<<objs_corners[1]<<" "<<objs_corners[2]<<" …Run Code Online (Sandbox Code Playgroud) 如何在我的make-file中使用选项-std=c99或-std=gnu99编译我的C代码?
-include ../../../Common/C/Make.cfg
### target ###
TARGET_NAME = myRec
### Objects, sources ###
# C source files
CSRCS = \
myRec.c
LDLIBS ?= -lNBiometrics -lNMedia -lNCore
include ../../../Common/C/Make.rules
Run Code Online (Sandbox Code Playgroud)