agast_corner_detect.h
Go to the documentation of this file.
00001 /*
00002  * agast_corner_detect.h
00003  *
00004  *  Created on: 01.12.2010
00005  *      Author: slynen
00006  *      wrapper for the agast detector
00007  *      to be used as PTAM corner detector functor
00008  */
00009 
00010 #ifndef AGAST_CORNER_DETECT_H_
00011 #define AGAST_CORNER_DETECT_H_
00012 
00013 #include "agast7_12d.h"
00014 #include "oast9_16.h"
00015 #include <cvd/image.h>
00016 #include <cvd/byte.h>
00017 #include <opencv/cv.h>
00018 
00019 namespace agast{
00020 
00021 namespace agast7_12d{
00022 
00023 static AgastDetector7_12d detector;
00024 
00025 //libcvd
00026 __inline__ void agast_corner_detect12d(const CVD::BasicImage<CVD::byte>& im, std::vector<CVD::ImageRef>& corners, int barrier)
00027 {
00028         detector.set_imageSize(im.size().x, im.size().y);
00029         detector.set_threshold(barrier);
00030         std::vector<CvPoint> keypoints;
00031         detector.detect((unsigned char*)im.data(),keypoints);
00032         corners.reserve(keypoints.size());
00033         for(size_t i=0;i<keypoints.size();++i) //convert to imageRefs
00034         {
00035                 corners.push_back(CVD::ImageRef(keypoints.at(i).x, keypoints.at(i).y));
00036         }
00037         keypoints.clear();
00038 }
00039 
00040 //opencv
00041 __inline__ void agast_corner_detect12d(const cv::Mat& im, std::vector<CVD::ImageRef>& corners, int barrier)
00042 {
00043         detector.set_imageSize(im.size().width, im.size().height);
00044         detector.set_threshold(barrier);
00045         std::vector<CvPoint> keypoints;
00046         detector.detect((unsigned char*)im.data,keypoints);
00047         corners.reserve(keypoints.size());
00048         for(size_t i=0;i<keypoints.size();++i) //convert to imageRefs
00049         {
00050                 corners.push_back(CVD::ImageRef(keypoints.at(i).x, keypoints.at(i).y));
00051         }
00052         keypoints.clear();
00053 }
00054 
00055 }
00056 
00057 namespace oast9_16{
00058 static OastDetector9_16 detector;
00059 //libcvd
00060 __inline__ void oast_corner_detect16(const CVD::BasicImage<CVD::byte>& im, std::vector<CVD::ImageRef>& corners, int barrier)
00061 {
00062         detector.set_imageSize(im.size().x, im.size().y);
00063         detector.set_threshold(barrier);
00064         std::vector<CvPoint> keypoints;
00065         detector.detect((unsigned char*)im.data(),keypoints);
00066         corners.reserve(keypoints.size());
00067         for(size_t i=0;i<keypoints.size();++i) //convert to imageRefs
00068         {
00069                 corners.push_back(CVD::ImageRef(keypoints.at(i).x, keypoints.at(i).y));
00070         }
00071         keypoints.clear();
00072 }
00073 
00074 //opencv
00075 __inline__ void oast_corner_detect16(const cv::Mat& im, std::vector<CVD::ImageRef>& corners, int barrier)
00076 {       
00077         detector.set_imageSize(im.size().width, im.size().height);
00078         detector.set_threshold(barrier);
00079         std::vector<CvPoint> keypoints;
00080         detector.detect((unsigned char*)im.data,keypoints);
00081         corners.reserve(keypoints.size());
00082         for(size_t i=0;i<keypoints.size();++i) //convert to imageRefs
00083         {
00084                 corners.push_back(CVD::ImageRef(keypoints.at(i).x, keypoints.at(i).y));
00085         }
00086         keypoints.clear();
00087 }
00088 
00089 }
00090 
00091 }
00092 #endif /* AGAST_CORNER_DETECT_H_ */


ptam
Author(s): Markus Achtelik , Stephan Weiss , Simon Lynen
autogenerated on Sun Oct 5 2014 23:52:33