latest version v1.9 - last update 10 Apr 2010 |
00001 /* 00002 * Copyright (C) 2003, 2004, 2005, 2006 00003 * Lehrstuhl fuer Technische Informatik, RWTH-Aachen, Germany 00004 * 00005 * This file is part of the LTI-Computer Vision Library (LTI-Lib) 00006 * 00007 * The LTI-Lib is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public License (LGPL) 00009 * as published by the Free Software Foundation; either version 2.1 of 00010 * the License, or (at your option) any later version. 00011 * 00012 * The LTI-Lib is distributed in the hope that it will be 00013 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty 00014 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with the LTI-Lib; see the file LICENSE. If 00019 * not, write to the Free Software Foundation, Inc., 59 Temple Place - 00020 * Suite 330, Boston, MA 02111-1307, USA. 00021 */ 00022 00023 00024 /*-------------------------------------------------------------------- 00025 * project ....: LTI-Lib: Image Processing and Computer Vision Library 00026 * file .......: ltiMinimumSpanningTreeOfKeytype.h 00027 * authors ....: Jens Paustenbach 00028 * organization: LTI, RWTH Aachen 00029 * creation ...: 8.5.2003 00030 * revisions ..: $Id: ltiMinimumSpanningTreeOfKeytype.h,v 1.6 2006/02/08 12:37:18 ltilib Exp $ 00031 */ 00032 00033 #ifndef _LTI_MINIMUM_SPANNING_TREE_OF_KEYTYPE_H_ 00034 #define _LTI_MINIMUM_SPANNING_TREE_OF_KEYTYPE_H_ 00035 00036 #include "ltiMinimumSpanningTree.h" 00037 #include "ltiL2Distance.h" 00038 00039 namespace lti { 00040 /** 00041 * Computes a minimum spanning tree. 00042 * This class computes a minimum spanning tree from a matrix where each 00043 * element in the matrix represents one key (data point), e.g. a matrix 00044 * of rgbPixel (which is an image). 00045 */ 00046 template <class K, class V=int, class Distantor=l2SquareDistantor<K> > 00047 class minimumSpanningTreeOfKeytype 00048 : public minimumSpanningTree<K,V,Distantor> { 00049 public: 00050 00051 /** 00052 * This class uses the same parameters as its base class 00053 */ 00054 typedef typename minimumSpanningTree<K,V,Distantor>::parameters parameters; 00055 /** 00056 * Distance type 00057 */ 00058 typedef typename 00059 minimumSpanningTree<K,V,Distantor>::distance_type distance_type; 00060 00061 /** 00062 * Key Value Type 00063 */ 00064 typedef typename 00065 minimumSpanningTree<K,V,Distantor>::key_value_type key_value_type; 00066 00067 /** 00068 * default constructor 00069 */ 00070 minimumSpanningTreeOfKeytype(); 00071 00072 /** 00073 * Construct a functor using the given parameters 00074 */ 00075 minimumSpanningTreeOfKeytype(const parameters& par); 00076 00077 /** 00078 * copy constructor 00079 * @param other the object to be copied 00080 */ 00081 minimumSpanningTreeOfKeytype(const minimumSpanningTreeOfKeytype& other); 00082 00083 /** 00084 * destructor 00085 */ 00086 virtual ~minimumSpanningTreeOfKeytype(); 00087 00088 /** 00089 * returns the name of this type ("minimumSpanningTreeOfKeytype") 00090 */ 00091 virtual const char* getTypeName() const; 00092 00093 /** 00094 * computes the minimum spanning tree of the given data in matrix 00095 * @param src the data that is used for building 00096 * @param datas data set 00097 * @param graph the tree will be returned here. 00098 * @return true if apply successful or false otherwise. 00099 */ 00100 bool apply(const matrix<K>& src,const matrix<V>& datas, 00101 weightedGraph<K,V,distance_type>& graph) const; 00102 00103 /** 00104 * copy data of "other" functor. 00105 * @param other the functor to be copied 00106 * @return a reference to this functor object 00107 */ 00108 minimumSpanningTreeOfKeytype& copy(const minimumSpanningTreeOfKeytype& other); 00109 00110 /** 00111 * alias for copy member 00112 * @param other the functor to be copied 00113 * @return a reference to this functor object 00114 */ 00115 minimumSpanningTreeOfKeytype& operator=(const minimumSpanningTreeOfKeytype& other); 00116 00117 /** 00118 * returns a pointer to a clone of this functor. 00119 */ 00120 virtual functor* clone() const; 00121 00122 /** 00123 * returns used parameters 00124 */ 00125 const parameters& getParameters() const; 00126 00127 }; 00128 } 00129 00130 #include "ltiMinimumSpanningTreeOfKeytype_template.h" 00131 00132 #endif