00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include <cvd/image.h>
00021 #include <cvd/convolution.h>
00022 #include <cvd/vision.h>
00023 #include <cvd/image_convert.h>
00024
00025 #include <vector>
00026 #include <gvars3/instances.h>
00027
00028 #include "susan.h"
00029
00030 using namespace std;
00031 using namespace CVD;
00032 using namespace GVars3;
00033
00034
00035
00036
00037
00038
00039
00040
00041 extern "C"
00042 {
00043 void free_haxored_memory();
00044 int* susan(unsigned char* in, int x_size, int y_size, float dt, int bt);
00045 }
00046
00047
00048 void SUSAN::operator()(const CVD::Image<CVD::byte>& im, std::vector<CVD::ImageRef>& corners, unsigned int N) const
00049 {
00050 float dt = GV3::get<float>("susan.dt", 4.0, 1);
00051 int* c = susan(const_cast<byte*>(im.data()), im.size().x, im.size().y, dt, N);
00052
00053 int n = c[0];
00054
00055 for(int i=0; i < n; i++)
00056 corners.push_back(ImageRef(c[2*i+2], c[2*i+3]));
00057
00058 free_haxored_memory();
00059 }