pyramid-matcher.h

Go to the documentation of this file.
00001 // Copyright 2007, Massachusetts Institute of Technology.
00002 // The use of this code is permitted for research only. There is
00003 // absolutely no warranty for this software.
00004 //
00005 // Author: John Lee (jjl@mit.edu)
00006 //
00007 #ifndef PYRAMIDS_PYRAMID_MATCHER_H
00008 #define PYRAMIDS_PYRAMID_MATCHER_H
00009 
00010 #include "histograms/bin.h"
00011 #include "histograms/multi-resolution-histogram.h"
00012 #include "util/bin-weight-scheme.h"
00013 
00014 namespace libpmk {
00015 
00017 class PyramidMatcher {
00018 public:
00020 
00024   static double GetPyramidMatchCost(const MultiResolutionHistogram& hist1,
00025                                     const MultiResolutionHistogram& hist2,
00026                                     BinWeightScheme bin_weight_scheme);
00027 
00029 
00033   static double GetPyramidMatchSimilarity(
00034     const MultiResolutionHistogram& hist1,
00035     const MultiResolutionHistogram& hist2,
00036     BinWeightScheme bin_weight_scheme);
00037 
00038 private:
00039   enum MatchReturnType { COST, SIMILARITY };
00040   class MatchNode {
00041   public:
00042     MatchNode(Bin* n, Bin* c, double i, MatchNode* p) :
00043       node_(n), counterpart_(c), intersection_(i), parent_(p),
00044       marked_(false) { }
00045     Bin* node_;
00046     Bin* counterpart_;
00047     double intersection_;
00048     MatchNode* parent_;
00049     bool marked_;
00050   };
00051 
00052   static double MatchPyramids(const MultiResolutionHistogram& hist1,
00053                               const MultiResolutionHistogram& hist2,
00054                               MatchReturnType return_type,
00055                               BinWeightScheme bin_weight_scheme);
00056 };
00057 }  // namespace libpmk
00058 
00059 #endif  // PYRAMIDS_PYRAMID_MATCHER_H

Generated on Fri Sep 21 11:39:04 2007 for libpmk2 by  doxygen 1.5.1