Image Component Library (ICL)
CLSurfLib.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLCV/src/ICLCV/CLSurfLib.h **
10 ** Module : ICLCV **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 /****************************************************************************\
32  * Copyright (c) 2011, Advanced Micro Devices, Inc. *
33  * All rights reserved. *
34  * *
35  * Redistribution and use in source and binary forms, with or without *
36  * modification, are permitted provided that the following conditions *
37  * are met: *
38  * *
39  * Redistributions of source code must retain the above copyright notice, *
40  * this list of conditions and the following disclaimer. *
41  * *
42  * Redistributions in binary form must reproduce the above copyright notice, *
43  * this list of conditions and the following disclaimer in the documentation *
44  * and/or other materials provided with the distribution. *
45  * *
46  * Neither the name of the copyright holder nor the names of its contributors *
47  * may be used to endorse or promote products derived from this software *
48  * without specific prior written permission. *
49  * *
50  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
51  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
52  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR *
53  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR *
54  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
55  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
56  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
57  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
58  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
59  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
60  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
61  * *
62  * If you use the software (in whole or in part), you shall adhere to all *
63  * applicable U.S., European, and other export laws, including but not *
64  * limited to the U.S. Export Administration Regulations ('EAR'), (15 C.F.R. *
65  * Sections 730 through 774), and E.U. Council Regulation (EC) No 1334/2000 *
66  * of 22 June 2000. Further, pursuant to Section 740.6 of the EAR, you *
67  * hereby certify that, except pursuant to a license granted by the United *
68  * States Department of Commerce Bureau of Industry and Security or as *
69  * otherwise permitted pursuant to a License Exception under the U.S. Export *
70  * Administration Regulations ("EAR"), you will not (1) export, re-export or *
71  * release to a national of a country in Country Groups D:1, E:1 or E:2 any *
72  * restricted technology, software, or source code you receive hereunder, *
73  * or (2) export to Country Groups D:1, E:1 or E:2 the direct product of such *
74  * technology or software, if such foreign produced direct product is subject *
75  * to national security controls as identified on the Commerce Control List *
76  * (currently found in Supplement 1 to Part 774 of EAR). For the most current*
77  * Country Group listings, or for additional information about the EAR or *
78  * your obligations under those regulations, please refer to the U.S. Bureau *
79  * of Industry and Security's website at http://www.bis.doc.gov/. *
80  \****************************************************************************/
81 
82 
83 #pragma once
84 
85 #include <ICLUtils/CompatMacros.h>
86 #include <ICLCore/Img.h>
87 #include <ICLCV/SurfFeature.h>
88 #include <vector>
89 #ifdef ICL_HAVE_OPENCL
90 #include <ICLUtils/CLProgram.h>
91 #include <ICLUtils/CLKernel.h>
92 #include <ICLUtils/CLBuffer.h>
93 #endif
94 using namespace icl::utils;
95 
96 namespace icl{
97 
98  namespace cv{
99  namespace clsurf{
100 
103 
105  typedef std::vector<Ipoint> IpVec;
106 
107 
109 
112  class Surf {
113  struct Data;
114  Data *m_data;
115  void createKernels();
116 
117  public:
118 
120  ICLCV_API Surf(int initialPoints, int i_height, int i_width, int octaves,
121  int intervals, int sample_step, float threshold);
122 
123  ICLCV_API ~Surf();
124 
126  ICLCV_API const IpVec &detect(const core::ImgBase *image);
127 
128  private:
129 
144  void computeIntegralImage(const icl::core::Img32f &source);
145 
147  void createDescriptors(int i_width, int i_height);
148 
150  void getOrientations(int i_width, int i_height);
151 
153  void reallocateIptBuffers();
154 
156  void reset();
157 
159  const IpVec &retrieveDescriptors();
160 
162  void run(const icl::core::Img32f &image, bool upright);
163 
164  };
165 
166  }
167  }
168 }
Definition: Any.h:38
CLKernel scanImageKernel
Definition: CLSurfLib.h:137
undocument this line if you encounter any issues!
Definition: Any.h:37
CLKernel normalizeDescriptorsKernel
Definition: CLSurfLib.h:142
Wrapper for an OpenCL Kernel.
Definition: CLKernel.h:72
SurfFeature Ipoint
again, we use the generic Ipoint here!
Definition: CLSurfLib.h:102
#define ICLCV_API
Definition: CompatMacros.h:177
CLKernel createDescrtptorsKernel
Definition: CLSurfLib.h:131
CLKernel transposeKernel
Definition: CLSurfLib.h:138
CLKernel getOrientationStep1Kernel
Definition: CLSurfLib.h:132
CLKernel scan4Kernel
Definition: CLSurfLib.h:136
OpenCL-based Surf Feature detector implmentation (by AMD)
Definition: CLSurfLib.h:112
CLKernel scanKernel
Definition: CLSurfLib.h:135
Generic SURF Feature type.
Definition: SurfFeature.h:42
CLKernel getOrientationStep2Kernel
Definition: CLSurfLib.h:133
Data * m_data
hidden implementation
Definition: CLSurfLib.h:113
CLKernel hessian_detKernel
Definition: CLSurfLib.h:134
CLKernel transposeImageKernel
Definition: CLSurfLib.h:139
std::vector< Ipoint > IpVec
used typedef for vector of interest points
Definition: CLSurfLib.h:105
CLKernel non_max_supressionKernel
Definition: CLSurfLib.h:141
CLProgram program
Definition: CLSurfLib.h:130
CLKernel nearestNeighborKernel
Definition: CLSurfLib.h:140
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
Main class for OpenCL based accelleration.
Definition: CLProgram.h:259