main.cpp

Minimal example - funkyclaude -, 2011-11-29 03:00 pm

Download (480 Bytes)

 
1
#include <opencv2/gpu/gpu.hpp>
2
3
int main(int argc, char *argv[])
4
{
5
  int cols = 50;
6
  int rows = 5000;
7
    
8
  cv::Mat mat1 = cv::Mat::ones(cols, rows, CV_8UC1);
9
  cv::Mat mat2 = cv::Mat::ones(cols, rows, CV_8UC1);
10
  cv::gpu::GpuMat gpuMat1(mat1);
11
  cv::gpu::GpuMat gpuMat2(mat2);
12
  
13
  cv::gpu::BruteForceMatcher_GPU<cv::Hamming> matcher;
14
  std::vector<cv::DMatch> matches;
15
  
16
  while(true) {
17
    matcher.match(gpuMat1, gpuMat2, matches);
18
    matches.clear();
19
  }
20
  
21
  return 0;
22
}