susan.cc

00001 /*
00002 
00003     This file is part of the FAST-ER machine learning system.
00004     Copyright (C) 2008  Edward Rosten and Los Alamos National Laboratory
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License along
00017     with this program; if not, write to the Free Software Foundation, Inc.,
00018     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
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 // SUSAN interface
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 }

Generated on Mon Mar 2 12:47:12 2009 for FAST-ER by  doxygen 1.5.3