00001 #ifndef interest_h
00002 #define interest_h
00003
00004
00005 #include "fl/convolve.h"
00006 #include "fl/matrix.h"
00007
00008 #include <set>
00009
00010
00011 namespace fl
00012 {
00013
00014
00015 class InterestOperator
00016 {
00017 public:
00018 virtual void run (const Image & image, std::multiset<PointInterest> & result) = 0;
00019 virtual void run (const Image & image, std::vector<PointInterest> & result);
00020 };
00021
00022
00023
00024
00025 class InterestHarris : public InterestOperator
00026 {
00027 public:
00028 InterestHarris (int neighborhood = 5, int maxPoints = 5000, float thresholdFactor = 0.02);
00029
00030 virtual void run (const Image & image, std::multiset<PointInterest> & result);
00031
00032 NonMaxSuppress nms;
00033 FilterHarris filter;
00034 int maxPoints;
00035 float thresholdFactor;
00036 };
00037
00038 class InterestHarrisLaplacian : public InterestOperator
00039 {
00040 public:
00041 InterestHarrisLaplacian (int maxPoints = 5000, float thresholdFactor = 0.02, float neighborhood = 1, float firstScale = 1, float lastScale = 25, int extraSteps = 20, float stepSize = -1);
00042
00043 virtual void run (const Image & image, std::multiset<PointInterest> & result);
00044
00045 std::vector<FilterHarris> filters;
00046 std::vector<Laplacian> laplacians;
00047 int maxPoints;
00048 float thresholdFactor;
00049 float neighborhood;
00050 int firstStep;
00051 int extraSteps;
00052 float stepSize;
00053 };
00054
00055 class InterestLaplacian : public InterestOperator
00056 {
00057 public:
00058 InterestLaplacian (int maxPoints = 5000, float thresholdFactor = 0.02, float neighborhood = 1, float firstScale = 1, float lastScale = 25, int extraSteps = 20, float stepSize = -1);
00059
00060 virtual void run (const Image & image, std::multiset<PointInterest> & result);
00061
00062 std::vector<Laplacian> laplacians;
00063 int maxPoints;
00064 float thresholdFactor;
00065 float neighborhood;
00066 int firstStep;
00067 int extraSteps;
00068 float stepSize;
00069 };
00070
00075 class InterestHessian : public InterestOperator
00076 {
00077 public:
00078 InterestHessian (int maxPoints = 5000, float thresholdFactor = 0.02, float neighborhood = 1, float firstScale = 1, float lastScale = 25, int extraSteps = 20, float stepSize = -1);
00079
00080 virtual void run (const Image & image, std::multiset<PointInterest> & result);
00081
00082 std::vector<FilterHessian> filters;
00083 std::vector<Laplacian> laplacians;
00084 int maxPoints;
00085 float thresholdFactor;
00086 float neighborhood;
00087 int firstStep;
00088 int extraSteps;
00089 float stepSize;
00090 };
00091
00100 class InterestDOG : public InterestOperator
00101 {
00102 public:
00103 InterestDOG (float firstScale = 1.6f, float lastScale = INFINITY, int extraSteps = 3);
00104
00105 virtual void run (const Image & image, std::multiset<PointInterest> & result);
00106
00107 bool isLocalMax (float value, ImageOf<float> & dog, int x, int y);
00108 bool notOnEdge (ImageOf<float> & dog, int x, int y);
00109 float fitQuadratic (std::vector< ImageOf<float> > & dogs, int s, int x, int y, Vector<float> & result);
00110
00111 std::vector<Image> pyramid;
00112 std::vector<float> scales;
00113 float firstScale;
00114 float lastScale;
00115 int steps;
00116 int crop;
00117 bool storePyramid;
00118 float thresholdEdge;
00119 float thresholdPeak;
00120 };
00121 }
00122
00123
00124 #endif