copy_tests.cpp
Go to the documentation of this file.
00001 /*
00002  * copy_tests.cpp
00003  *
00004  *  Created on: Oct 20, 2010
00005  *      Author: erublee
00006  */
00007 
00008 #include "pano_core/ModelFitter.h"
00009 #include "pano_core/feature_utils.h"
00010 #include <iostream>
00011 #include <vector>
00012 using namespace cv;
00013 using namespace pano;
00014 using namespace std;
00015 int main()
00016 {
00017   ImageAtom atom;
00018   ImageAtom atom2;
00019 
00020   atom.images().load("image1.jpg","data");
00021   atom2.images().load("image2.jpg","data");
00022 
00023 
00024   vector<DMatch> matches;
00025 
00026   BriefDescriptorExtractor brief;
00027   BruteForceMatcher<HammingLUT> desc_matcher;
00028 
00029   FastFeatureDetector fast(20);
00030   atom.detect(fast);
00031   atom.extract(brief,desc_matcher);
00032   atom2.detect(fast);
00033   atom2.extract(brief,desc_matcher);
00034 
00035   BruteForceMatcher<HammingLUT> matcher;
00036   desc_matcher.clear();
00037   std::vector<Mat> d(1);
00038   d[0] =atom.features().descriptors();
00039   desc_matcher.add(d);
00040   desc_matcher.train();
00041   desc_matcher.match(atom2.features().descriptors(), matches);
00042 
00043   atom2 = atom;
00044 
00045   atom.images().load("image3.jpg","data");
00046 
00047   atom.detect(fast);
00048  // atom.extract(brief);
00049 
00050   desc_matcher.clear();
00051   d[0] = atom2.features().descriptors();
00052   desc_matcher.add(d);
00053   desc_matcher.match(atom2.features().descriptors(),matches);
00054   return 0;
00055 }


pano_core
Author(s): Ethan Rublee
autogenerated on Mon Oct 6 2014 08:04:38