cisst-saw
Loading...
Searching...
No Matches
msh3AlgPDTreeMLP.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3// ****************************************************************************
4//
5// Copyright (c) 2014, Seth Billings, Russell Taylor, Johns Hopkins University
6// All rights reserved.
7//
8// Redistribution and use in source and binary forms, with or without
9// modification, are permitted provided that the following conditions are
10// met:
11//
12// 1. Redistributions of source code must retain the above copyright
13// notice, this list of conditions and the following disclaimer.
14//
15// 2. Redistributions in binary form must reproduce the above copyright
16// notice, this list of conditions and the following disclaimer in the
17// documentation and/or other materials provided with the distribution.
18//
19// 3. Neither the name of the copyright holder nor the names of its
20// contributors may be used to endorse or promote products derived from
21// this software without specific prior written permission.
22//
23// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34//
35// ****************************************************************************
36
37#ifndef _msh3AlgPDTreeMLP_h
38#define _msh3AlgPDTreeMLP_h
39
43
44// Always include last!
45#include <cisstMesh/mshExport.h>
46
48{
49 //
50 // Implements the most-likely point algorithm for PD tree search under anisotropic noise
51 //
52
53 //--- Algorithm Parameters ---//
54
55 protected:
56
58
59 // must set these before doing the search using the
60 // method for initializing a sample search
61 vct3x3 sampleXfm_M; // covariance of transformed sample point
62 vct3 sample_M_Eig; // eigenvalues of sample covariance in order of decreasing magnitude
63
64 // these are computed automatically
65 vct3x3 M; // effective measurement error covariance for a node & sample pair
66 vct3x3 N; // decomposition of inv(M) = N'N
67 double Dmin; // inverse sqrt of largest eigenvalue of M
68 // (or the sqrt of the smallest eigenvalue of inv(M))
69 double MinLogM; // lower bound on the log component of error for this node
70
71 //--- Algorithm Methods ---//
72
73 public:
74
75 // constructor
79
80 // destructor
81 virtual ~msh3AlgPDTreeMLP() {}
82
83 // must call this prior to beginning search for each sample
84 // sampleXfm_M ~ noise covariance of the transformed sample point
85 // sample_M_Eig ~ eigenvalues of the sample covariance (in order of decreasing magnitude)
87
88 protected:
89
91 void ComputeCovDecomposition_NonIter(const vct3x3 &M, vct3x3 &Minv, vct3x3 &N, vct3x3 &Ninv, double &det_M);
92 void ComputeCovDecomposition_NonIter(const vct3x3 &M, vct3x3 &Minv, double &det_M);
93
94 //--- PD Tree Interface Methods ---//
95
96 int NodeMightBeCloser(const vct3 &v,
97 msh3PDTreeNode *node,
98 double ErrorBound);
99
100 virtual double FindClosestPointOnDatum(const vct3 &v,
101 vct3 &closest,
102 int datum) = 0;
103
104 virtual int DatumMightBeCloser(const vct3 &v,
105 int datum,
106 double ErrorBound) = 0;
107};
108
109#endif
Definition EllipsoidOBBIntersectionSolver.h:50
msh3PDTreeBase * pTree
Definition msh3AlgPDTree.h:56
msh3AlgPDTree(msh3PDTreeBase *pTree)
vct3x3 N
Definition msh3AlgPDTreeMLP.h:66
double MinLogM
Definition msh3AlgPDTreeMLP.h:69
vct3 sample_M_Eig
Definition msh3AlgPDTreeMLP.h:62
virtual ~msh3AlgPDTreeMLP()
Definition msh3AlgPDTreeMLP.h:81
void ComputeCovDecomposition_NonIter(const vct3x3 &M, vct3x3 &Minv, double &det_M)
msh3AlgPDTreeMLP(msh3PDTreeBase *pTree)
Definition msh3AlgPDTreeMLP.h:76
void InitializeSampleSearch(vct3x3 sampleXfm_M, vct3 sample_M_Eig)
double Dmin
Definition msh3AlgPDTreeMLP.h:67
vct3x3 M
Definition msh3AlgPDTreeMLP.h:65
void ComputeCovDecomposition_NonIter(const vct3x3 &M, vct3x3 &Minv, vct3x3 &N, vct3x3 &Ninv, double &det_M)
vct3x3 sampleXfm_M
Definition msh3AlgPDTreeMLP.h:61
EllipsoidOBBIntersectionSolver IntersectionSolver
Definition msh3AlgPDTreeMLP.h:57
virtual int DatumMightBeCloser(const vct3 &v, int datum, double ErrorBound)=0
int NodeMightBeCloser(const vct3 &v, msh3PDTreeNode *node, double ErrorBound)
void ComputeNodeMatchCov(msh3PDTreeNode *node)
virtual double FindClosestPointOnDatum(const vct3 &v, vct3 &closest, int datum)=0
Definition msh3PDTreeBase.h:55
Definition msh3PDTreeNode.h:56
#define CISST_EXPORT
Definition cmnExportMacros.h:50
Macros to export the symbols of cisstMesh (in a Dll).
vctFixedSizeMatrix< double, 3, 3 > vct3x3
Definition vctFixedSizeMatrixTypes.h:59
vctFixedSizeVector< double, 3 > vct3
Definition vctFixedSizeVectorTypes.h:46