Skip to content

Commit 8856fb4

Browse files
author
deseilligny
committed
ii
1 parent f606a98 commit 8856fb4

File tree

1 file changed

+43
-8
lines changed

1 file changed

+43
-8
lines changed

MMVII/src/PoseEstim/MatrEssPoseRel.cpp

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
/* We have the image formula w/o distorsion:
66
7-
Wasserstein
8-
knowing obly the min and not the vector , how usefull ?
9-
10-
p 26 =< N2 log N not so much ?
11-
p 30 => how many
12-
137
148
*/
159

@@ -57,19 +51,40 @@ class cMatEssential
5751
{
5852
public :
5953
cMatEssential(const cSetHomogCpleDir &,cLinearOverCstrSys<tREAL8> & aSys);
54+
/// Sigma attenuates big error E*S / (E+S) => ~E in 0 , bound to S at infty
55+
tREAL8 Cost(const cHomogCpleDir &,const tREAL8 & aSigma) const;
56+
tREAL8 AvgCost(const cSetHomogCpleDir &,const tREAL8 & aSigma) const;
57+
6058
private :
6159
cDenseMatrix<tREAL8> mMat;
6260
};
6361

62+
/* ************************************** */
63+
/* */
64+
/* cCamSimul */
65+
/* */
66+
/* ************************************** */
67+
68+
class cCamSimul
69+
{
70+
public :
71+
void AddCam(cPerspCamIntrCalib *,tREAL8 BsHMin,tREAL8 BsHMax);
72+
private :
73+
std::list<cSensorCamPC *> mListCam;
74+
};
75+
76+
77+
78+
6479
/* ************************************** */
6580
/* */
6681
/* cHomogCpleDir */
6782
/* */
6883
/* ************************************** */
6984

7085
cHomogCpleDir::cHomogCpleDir(const cPt3dr & aP1,const cPt3dr & aP2) :
71-
mP1 (aP1),
72-
mP2 (aP2)
86+
mP1 (VUnit(aP1)),
87+
mP2 (VUnit(aP2))
7388
{
7489
}
7590

@@ -133,6 +148,26 @@ cMatEssential::cMatEssential(const cSetHomogCpleDir & aSetD,cLinearOverCstrSys<t
133148
SetLine(2,mMat,cPt3dr(aSol(6),aSol(7), 1.0));
134149
}
135150

151+
tREAL8 cMatEssential::Cost(const cHomogCpleDir & aCple,const tREAL8 & aSigma) const
152+
{
153+
// tP1 Mat P2 =0
154+
cPt3dr aQ1 = VUnit(aCple.mP1 * mMat); // Q1 is orthognal to plane containing P2
155+
cPt3dr aQ2 = VUnit(mMat * aCple.mP2); // Q1 is orthognal to plane containing P2
156+
//
157+
tREAL8 aD = (std::abs(Scal(aQ1,aCple.mP2)) + std::abs(Scal(aCple.mP1,aQ2)) ) / 2.0;
158+
159+
return (aD*aSigma) / (aD+aSigma);
160+
}
161+
162+
tREAL8 cMatEssential::AvgCost(const cSetHomogCpleDir & aSetD,const tREAL8 & aSigma) const
163+
{
164+
tREAL8 aSom = 0.0;
165+
for (const auto & aCple : aSetD.mSetD)
166+
aSom += Cost(aCple,aSigma);
167+
168+
return aSom / aSetD.mSetD.size();
169+
}
170+
136171

137172
}; // MMVII
138173

0 commit comments

Comments
 (0)