Direct Graphical Models  v.1.7.0
SquareNeighborhood.h
1 // Square Neighbourhood structure inferface
2 // Written by Sergey G. Kosov in 2015 for Project X
3 #pragma once
4 
5 namespace DirectGraphicalModels { namespace fex
6 {
15  typedef struct SqNeighbourhood
16  {
17  int leftGap;
18  int rightGap;
19  int upperGap;
20  int lowerGap;
22 
32  };
33 
42  inline SqNeighbourhood sqNeighbourhood(int leftGap, int rightGap, int upperGap, int lowerGap)
43  {
44  SqNeighbourhood nbhd;
45  nbhd.leftGap = leftGap;
46  nbhd.rightGap = rightGap;
47  nbhd.upperGap = upperGap;
48  nbhd.lowerGap = lowerGap;
49  return nbhd;
50  }
56  inline SqNeighbourhood sqNeighbourhoodAll(int R) { return sqNeighbourhood(R, R, R, R); }
65  {
67  switch (location) {
68  case BP_CENTER:
69  break;
70  case BP_LEFT:
71  nbhd.leftGap = 0;
72  nbhd.rightGap = 2 * R;
73  break;
74  case BP_RIGHT:
75  nbhd.leftGap = 2 * R;
76  nbhd.rightGap = 0;
77  break;
78  case BP_TOP:
79  nbhd.upperGap = 0;
80  nbhd.lowerGap = 2 * R;
81  break;
82  case BP_BOTTOM:
83  nbhd.upperGap = 2 * R;
84  nbhd.lowerGap = 0;
85  break;
86  }
87  return nbhd;
88  }
89 } }
The base point is located in the neighborhood's right boundry.
int rightGap
Distance from the base point to the neighborhood's right boundary.
int leftGap
Distance from the base point to the neighborhood's left boundary.
int lowerGap
Distance from the base point to the neighborhood's lower boundary.
SqNeighbourhood sqNeighbourhoodAll(int R)
Initializes the square neighborhood structure with all the same values (base point in the center) ...
The base point is located in the neighborhood's lower boundry.
SqNeighbourhood sqNeighbourhood(int leftGap, int rightGap, int upperGap, int lowerGap)
Initializes the square neighborhood structure.
int upperGap
Distance from the base point to the neighborhood's upper boundary.
The base point is located in the neighborhood's center.
The base point is located at the neighborhood's left boundry.
The base point is located in the neighborhood's upper boundry.
struct DirectGraphicalModels::fex::SqNeighbourhood SqNeighbourhood
Square neighborhood structure.
BasePointLocation
Some special cases of the base point location inside the neighborhood.