Image Component Library (ICL)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
CLSurfLib.h
Go to the documentation of this file.
00001 /********************************************************************
00002 **                Image Component Library (ICL)                    **
00003 **                                                                 **
00004 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld          **
00005 **                         Neuroinformatics Group                  **
00006 ** Website: www.iclcv.org and                                      **
00007 **          http://opensource.cit-ec.de/projects/icl               **
00008 **                                                                 **
00009 ** File   : ICLCV/src/ICLCV/CLSurfLib.h                            **
00010 ** Module : ICLCV                                                  **
00011 ** Authors: Christof Elbrechter                                    **
00012 **                                                                 **
00013 **                                                                 **
00014 ** GNU LESSER GENERAL PUBLIC LICENSE                               **
00015 ** This file may be used under the terms of the GNU Lesser General **
00016 ** Public License version 3.0 as published by the                  **
00017 **                                                                 **
00018 ** Free Software Foundation and appearing in the file LICENSE.GPL  **
00019 ** included in the packaging of this file.  Please review the      **
00020 ** following information to ensure the license requirements will   **
00021 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt                **
00022 **                                                                 **
00023 ** The development of this software was supported by the           **
00024 ** Excellence Cluster EXC 277 Cognitive Interaction Technology.    **
00025 ** The Excellence Cluster EXC 277 is a grant of the Deutsche       **
00026 ** Forschungsgemeinschaft (DFG) in the context of the German       **
00027 ** Excellence Initiative.                                          **
00028 **                                                                 **
00029 ********************************************************************/
00030 
00031 /****************************************************************************\ 
00032  * Copyright (c) 2011, Advanced Micro Devices, Inc.                           *
00033  * All rights reserved.                                                       *
00034  *                                                                            *
00035  * Redistribution and use in source and binary forms, with or without         *
00036  * modification, are permitted provided that the following conditions         *
00037  * are met:                                                                   *
00038  *                                                                            *
00039  * Redistributions of source code must retain the above copyright notice,     *
00040  * this list of conditions and the following disclaimer.                      *
00041  *                                                                            *
00042  * Redistributions in binary form must reproduce the above copyright notice,  *
00043  * this list of conditions and the following disclaimer in the documentation  *
00044  * and/or other materials provided with the distribution.                     *
00045  *                                                                            *
00046  * Neither the name of the copyright holder nor the names of its contributors *
00047  * may be used to endorse or promote products derived from this software      *
00048  * without specific prior written permission.                                 *
00049  *                                                                            *
00050  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS        *
00051  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED  *
00052  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR *
00053  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR          *
00054  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,      *
00055  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,        *
00056  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR         *
00057  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF     *
00058  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING       *
00059  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS         *
00060  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.               *
00061  *                                                                            *
00062  * If you use the software (in whole or in part), you shall adhere to all     *
00063  * applicable U.S., European, and other export laws, including but not        *
00064  * limited to the U.S. Export Administration Regulations ('EAR'), (15 C.F.R.  *
00065  * Sections 730 through 774), and E.U. Council Regulation (EC) No 1334/2000   *
00066  * of 22 June 2000.  Further, pursuant to Section 740.6 of the EAR, you       *
00067  * hereby certify that, except pursuant to a license granted by the United    *
00068  * States Department of Commerce Bureau of Industry and Security or as        *
00069  * otherwise permitted pursuant to a License Exception under the U.S. Export  *
00070  * Administration Regulations ("EAR"), you will not (1) export, re-export or  *
00071  * release to a national of a country in Country Groups D:1, E:1 or E:2 any   *
00072  * restricted technology, software, or source code you receive hereunder,     *
00073  * or (2) export to Country Groups D:1, E:1 or E:2 the direct product of such *
00074  * technology or software, if such foreign produced direct product is subject *
00075  * to national security controls as identified on the Commerce Control List   *
00076  * (currently found in Supplement 1 to Part 774 of EAR).  For the most current*
00077  * Country Group listings, or for additional information about the EAR or     *
00078  * your obligations under those regulations, please refer to the U.S. Bureau  *
00079  * of Industry and Security's website at http://www.bis.doc.gov/.             *
00080  \****************************************************************************/
00081 
00082 
00083 #pragma once
00084 
00085 #include <ICLCore/Img.h>
00086 #include <ICLCV/SurfFeature.h>
00087 #include <vector>
00088 
00089 namespace icl{
00090   namespace cv{
00091     namespace clsurf{
00092 
00094       typedef SurfFeature Ipoint;
00095 
00097       typedef std::vector<Ipoint> IpVec;
00098 
00099       
00101 
00104       class Surf {
00105         struct Data;  
00106         Data *m_data; 
00107 
00108         public:
00109     
00111         Surf(int initialPoints, int i_height, int i_width,  int octaves, 
00112              int intervals, int sample_step, float threshold); 
00113 
00114         ~Surf();
00115     
00117         const IpVec &detect(const core::ImgBase *image);
00118         
00119         private:
00121         void computeIntegralImage(const icl::core::Img32f &source);
00122     
00124         void createDescriptors(int i_width, int i_height);
00125 
00127         void getOrientations(int i_width, int i_height);
00128 
00130         void reallocateIptBuffers();
00131 
00133         void reset();
00134 
00136         const IpVec &retrieveDescriptors();
00137 
00139         void run(const icl::core::Img32f &image, bool upright);
00140 
00141       };
00142 
00143     }
00144   }
00145 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines