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

UniformWindow Struct Reference

#include <mpiprobsearchaux.h>

List of all members.

Public Member Functions

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)
bool is_validscale (const int scale)
bool is_validscale (const double scale)
void set_scalebounds (const int s)
void set_scalebounds (const double s)
 UniformWindow (const int s, const int ns)
 UniformWindow (const double s)

Public Attributes

double m_curhypscale
int m_intscalebounddown
int m_intscaleboundup
int m_intscaledev
double m_minstride
int m_numscales
double m_scalebounddown
double m_scaleboundup
double m_scaledev
double m_shiftpct


Constructor & Destructor Documentation

UniformWindow const double  s  )  [inline]
 

Definition at line 82 of file mpiprobsearchaux.h.

References s.

00082 : m_scaledev(s) {};

UniformWindow const int  s,
const int  ns
[inline]
 

Definition at line 83 of file mpiprobsearchaux.h.

References s.

00083 : m_intscaledev(s), m_numscales(ns) {};


Member Function Documentation

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
 

Definition at line 199 of file mpiprobsearchaux.cpp.

References min(), TBox::scale, TBox::size, TBox::x, and TBox::y.

Referenced by MPColorFeatSearch::searchFeature().

00199                                                                                                                                                                                                                 {
00200         
00201         double shift_tnew = lw_tnew.scale*shiftPct;
00202         if (shift_tnew < minStride) shift_tnew = minStride;
00203 
00204         double hrhyp = hr * lw_tnew.scale / shift_tnew;
00205   double cx_t = hx_t + (scale_t / 2);
00206   double cy_t = hy_t + (scale_t / 2);
00207   double x_tnew = cx_t - lw_tnew.scale/2;
00208   double y_tnew = cy_t - lw_tnew.scale/2;
00209   lw_tnew.x = x_tnew/shift_tnew - hrhyp;
00210   lw_tnew.y = y_tnew/shift_tnew - hrhyp;
00211 
00212   lw_tnew.x = floor(lw_tnew.x);
00213         lw_tnew.y = floor(lw_tnew.y);
00214         lw_tnew.size = floor (2*hrhyp + 1 + .5);
00215 
00216         if (lw_tnew.size < 1) lw_tnew.size = 1;
00217 
00218         /* make the window fit  -- must overlap at least one hypothesis */
00219         lw_tnew.x  = min(lw_tnew.x, numx-1);
00220         lw_tnew.y  = min(lw_tnew.y ,numy-1); 
00221         if ((lw_tnew.x + lw_tnew.size ) < 1) { /* move up until upper end is at least at 1. */
00222                 lw_tnew.x = 1-lw_tnew.size;
00223   }
00224         if ((lw_tnew.y + lw_tnew.size) < 1) { /* move up until upper end is at least at 1. */
00225                 lw_tnew.y = 1-lw_tnew.size;  
00226         }
00227 
00229         /* not sure if this is best way to do this -- turns even sized kernels into odd */
00230         if ( ((int)scale_t % 2 == 0) != ((int)lw_tnew.size % 2 == 0))
00231                 lw_tnew.size++;
00232 //      if (((int)(lw_tnew.size) % 2 == 0) &&
00233 //                      ((int)(scale_t) % 2 != 0))
00234 //              lw_tnew.size++;
00236 
00237         /* The derivation as written by John Hershey: 
00238                 h_t(s, i, j).x = i * shift
00239                 h_t(s, i, j).y = j * shift
00240 
00241                 c.x = h_t(s, i, j).x + s/2
00242                 c.y = h_t(s, i, j).y + s/2
00243 
00244                 x' = c.x - s'/2
00245                 y' = c.y - s'/2
00246 
00247                 i' = x'/shift'
00248                 j' = y'/shift'
00249 
00250                 hrhyp = hr * s' / shift'
00251 
00252                 box.i = i' - hrhyp
00253                 box.j = j' - hrhyp
00254                 box.s = 2*hrhyp
00255 
00256                         or
00257 
00258                 -hrhyp + (h_t(s,i,j).x + s/2 - s' / 2) / shift'
00259 
00260                 lw_tnew.x = -hrhyp + ((hx_t + scale_t/2 - lw_tnew.scale/2) / shift_tnew) ;
00261                 lw_tnew.y = -hrhyp + ((hy_t + scale_t/2 - lw_tnew.scale/2) / shift_tnew) ;
00262         */
00263 }

Here is the call graph for this function:

bool is_validscale const int  scale  ) 
 

Definition at line 189 of file mpiprobsearchaux.cpp.

References m_intscalebounddown.

00189                                                  {
00190         return (scale >= m_intscalebounddown && scale <= m_intscaleboundup);
00191 }

bool is_validscale const double  scale  ) 
 

Definition at line 183 of file mpiprobsearchaux.cpp.

References m_scalebounddown.

Referenced by MPColorFeatSearch::searchFeature().

00183                                                     {
00184         return (scale >= m_scalebounddown && scale <= m_scaleboundup);
00185 }

void set_scalebounds const int  s  ) 
 

Definition at line 176 of file mpiprobsearchaux.cpp.

References m_intscalebounddown, m_intscaleboundup, and s.

00176                                                {
00177         m_intscaleboundup = s + m_intscaledev;
00178         m_intscalebounddown = s - m_intscaledev;
00179 }

void set_scalebounds const double  s  ) 
 

Definition at line 167 of file mpiprobsearchaux.cpp.

References m_scalebounddown, m_scaleboundup, m_scaledev, and s.

Referenced by MPColorFeatSearch::searchFeature().

00167                                                   {
00168         //m_curhypscale = s;
00169         double adjscaledev = m_scaledev * s;
00170         m_scaleboundup = s + adjscaledev;
00171         m_scalebounddown = s - adjscaledev;
00172 }


Member Data Documentation

double m_curhypscale
 

Definition at line 65 of file mpiprobsearchaux.h.

int m_intscalebounddown
 

Definition at line 78 of file mpiprobsearchaux.h.

Referenced by is_validscale(), and set_scalebounds().

int m_intscaleboundup
 

Definition at line 77 of file mpiprobsearchaux.h.

Referenced by set_scalebounds().

int m_intscaledev
 

Definition at line 75 of file mpiprobsearchaux.h.

double m_minstride
 

Definition at line 67 of file mpiprobsearchaux.h.

int m_numscales
 

Definition at line 76 of file mpiprobsearchaux.h.

double m_scalebounddown
 

Definition at line 72 of file mpiprobsearchaux.h.

Referenced by is_validscale(), and set_scalebounds().

double m_scaleboundup
 

Definition at line 71 of file mpiprobsearchaux.h.

Referenced by set_scalebounds().

double m_scaledev
 

Definition at line 70 of file mpiprobsearchaux.h.

Referenced by set_scalebounds().

double m_shiftpct
 

Definition at line 66 of file mpiprobsearchaux.h.


The documentation for this struct was generated from the following files:
Generated on Mon Nov 8 17:08:42 2004 for MPT by  doxygen 1.3.9.1