SLProject  4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
CVRaulMurExtNode Class Reference

Data structure used to subdivide the Image with key points into segments. More...

#include <CVRaulMurExtNode.h>

Public Member Functions

 CVRaulMurExtNode ()
 
void DivideNode (CVRaulMurExtNode &n1, CVRaulMurExtNode &n2, CVRaulMurExtNode &n3, CVRaulMurExtNode &n4)
 

Public Attributes

CVVKeyPoint vKeys
 
CVPoint2i UL
 
CVPoint2i UR
 
CVPoint2i BL
 
CVPoint2i BR
 
list< CVRaulMurExtNode >::iterator lit
 
bool bNoMore
 

Detailed Description

Data structure used to subdivide the Image with key points into segments.

Definition at line 22 of file CVRaulMurExtNode.h.

Constructor & Destructor Documentation

◆ CVRaulMurExtNode()

CVRaulMurExtNode::CVRaulMurExtNode ( )
inline

Definition at line 25 of file CVRaulMurExtNode.h.

25 : bNoMore(false) {}

Member Function Documentation

◆ DivideNode()

void CVRaulMurExtNode::DivideNode ( CVRaulMurExtNode n1,
CVRaulMurExtNode n2,
CVRaulMurExtNode n3,
CVRaulMurExtNode n4 
)

Divides the current ExtractorNode into four ExtractorNodes. The Keypoints are also divided between the four ExtractorNodes by space.

Definition at line 20 of file CVRaulMurExtNode.cpp.

24 {
25  const int halfX = (int)(ceil(static_cast<float>(UR.x - UL.x) / 2));
26  const int halfY = (int)(ceil(static_cast<float>(BR.y - UL.y) / 2));
27 
28  // Define boundaries of childs
29  n1.UL = UL;
30  n1.UR = CVPoint2i(UL.x + halfX, UL.y);
31  n1.BL = CVPoint2i(UL.x, UL.y + halfY);
32  n1.BR = CVPoint2i(UL.x + halfX, UL.y + halfY);
33  n1.vKeys.reserve(vKeys.size());
34 
35  n2.UL = n1.UR;
36  n2.UR = UR;
37  n2.BL = n1.BR;
38  n2.BR = CVPoint2i(UR.x, UL.y + halfY);
39  n2.vKeys.reserve(vKeys.size());
40 
41  n3.UL = n1.BL;
42  n3.UR = n1.BR;
43  n3.BL = BL;
44  n3.BR = CVPoint2i(n1.BR.x, BL.y);
45  n3.vKeys.reserve(vKeys.size());
46 
47  n4.UL = n3.UR;
48  n4.UR = n2.BR;
49  n4.BL = n3.BR;
50  n4.BR = BR;
51  n4.vKeys.reserve(vKeys.size());
52 
53  // Associate points to childs
54  for (size_t i = 0; i < vKeys.size(); i++)
55  {
56  const CVKeyPoint& kp = vKeys[i];
57  if (kp.pt.x < n1.UR.x)
58  {
59  if (kp.pt.y < n1.BR.y)
60  n1.vKeys.push_back(kp);
61  else
62  n3.vKeys.push_back(kp);
63  }
64  else if (kp.pt.y < n1.BR.y)
65  n2.vKeys.push_back(kp);
66  else
67  n4.vKeys.push_back(kp);
68  }
69 
70  if (n1.vKeys.size() == 1)
71  n1.bNoMore = true;
72  if (n2.vKeys.size() == 1)
73  n2.bNoMore = true;
74  if (n3.vKeys.size() == 1)
75  n3.bNoMore = true;
76  if (n4.vKeys.size() == 1)
77  n4.bNoMore = true;
78 }
cv::Point2i CVPoint2i
Definition: CVTypedefs.h:42
cv::KeyPoint CVKeyPoint
Definition: CVTypedefs.h:60
T ceil(T a)
Definition: Utils.h:247

Member Data Documentation

◆ BL

CVPoint2i CVRaulMurExtNode::BL

Definition at line 33 of file CVRaulMurExtNode.h.

◆ bNoMore

bool CVRaulMurExtNode::bNoMore

Definition at line 35 of file CVRaulMurExtNode.h.

◆ BR

CVPoint2i CVRaulMurExtNode::BR

Definition at line 33 of file CVRaulMurExtNode.h.

◆ lit

list<CVRaulMurExtNode>::iterator CVRaulMurExtNode::lit

Definition at line 34 of file CVRaulMurExtNode.h.

◆ UL

CVPoint2i CVRaulMurExtNode::UL

Definition at line 33 of file CVRaulMurExtNode.h.

◆ UR

CVPoint2i CVRaulMurExtNode::UR

Definition at line 33 of file CVRaulMurExtNode.h.

◆ vKeys

CVVKeyPoint CVRaulMurExtNode::vKeys

Definition at line 32 of file CVRaulMurExtNode.h.


The documentation for this class was generated from the following files: