The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

mpiprobsearchaux.h

Go to the documentation of this file.
00001 #ifndef __MPIPROBSEARCHAUX__H__
00002 #define __MPIPROBSEARCHAUX__H__
00003 
00004 #include "integralimage.h"
00005 #include "box.h"
00006 #include <vector>
00007 
00008 using namespace std;
00009 
00010 /* ================================================================ */
00011 
00012 struct XYPair {
00013         int x, y;
00014         XYPair(int _x = 0, int _y = 0) : x(_x), y(_y) {};
00015 };
00016 
00017 /* ================================================================ */
00018 
00019 struct HypothesesPerScale {
00020         double m_scale;
00021         double m_shift;
00022         int m_numX;
00023         int m_numY;
00024         TIntegral<double> m_intimage;
00025         TIntegral<double> m_intones;
00026 
00027         HypothesesPerScale(const int numX, const int numY) : m_intimage(numX, numY), m_intones(numX, numY) {};
00028         void setParams (const double scale, const double shift, const int numX, const int numY);
00029         void makezero();
00030 };
00031 
00032 /* ================================================================ */
00033 
00034 typedef std::vector<HypothesesPerScale *> VHPS;
00035 
00036 class ScalePyramid {
00037 private:
00038         VHPS m_scale_pyramid;
00039         std::vector<double> m_scales;
00040         int m_numscales;
00041         int m_numhyp;
00042         int m_imageWidth;
00043         int m_imageHeight;
00044 
00045 public:
00046         ScalePyramid() {};
00047         ScalePyramid(const int imageWidth, const int imageHeight);
00048         void set_imagedims(const int imageWidth, const int imageHeight);
00049         void compute_scales(const double scaleUp, const int minSize, const int minScaleUp);
00050         void set_numhyp(const double stride, const int minStride);
00051         void initPyramid(const double stride, const int minStride);
00052         double get_shiftamount(const int minStride, const double stride, const double d);
00053         int get_numScales();
00054         void add_hypothesesPerScale(const double scale, const double shift, const int numX, const int numY, const int numhyp);
00055         HypothesesPerScale &get_hypothesesPerScale(const int index);
00056         int get_numhyp();
00057         void makezero();
00058         void copy(ScalePyramid &copyto);
00059         ~ScalePyramid();
00060 };
00061 
00062 /* ================================================================ */
00063 
00064 struct UniformWindow {
00065         double m_curhypscale;
00066         double m_shiftpct;
00067         double m_minstride;
00068 
00069         /* for scale deviations proportional to current scale */
00070         double m_scaledev;
00071         double m_scaleboundup;
00072         double m_scalebounddown;
00073 
00074         /* for scale deviations in number of scales */
00075         int m_intscaledev;
00076         int m_numscales;
00077         int m_intscaleboundup;
00078         int m_intscalebounddown;
00079 
00080         /* constructors  - first one for scale deviations proportional to current state
00081                 and second one for deviations defined as number of scales       */
00082         UniformWindow(const double s) : m_scaledev(s) {};
00083         UniformWindow(const int s, const int ns) : m_intscaledev(s), m_numscales(ns) {};
00084 
00085         void set_scalebounds(const double s);
00086         void set_scalebounds(const int s);
00087         bool is_validscale(const double scale);
00088         bool is_validscale(const int scale);
00089         void get_location_window(const double s, TBox<double> &lw, const double hr, const int hx, const int hy, const double shiftPct, const int minStride, const int numx, const int numy );
00090 };
00091 
00092 /* ================================================================ */
00093 
00094 #endif  __MPIPROBSEARCHAUX__H__
00095 

Generated on Mon Nov 8 17:07:44 2004 for MPT by  doxygen 1.3.9.1