|
4 | 4 |
|
5 | 5 | /* We have the image formula w/o distorsion: |
6 | 6 |
|
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 | | -
|
13 | 7 |
|
14 | 8 | */ |
15 | 9 |
|
@@ -57,19 +51,40 @@ class cMatEssential |
57 | 51 | { |
58 | 52 | public : |
59 | 53 | 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 | + |
60 | 58 | private : |
61 | 59 | cDenseMatrix<tREAL8> mMat; |
62 | 60 | }; |
63 | 61 |
|
| 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 | + |
64 | 79 | /* ************************************** */ |
65 | 80 | /* */ |
66 | 81 | /* cHomogCpleDir */ |
67 | 82 | /* */ |
68 | 83 | /* ************************************** */ |
69 | 84 |
|
70 | 85 | cHomogCpleDir::cHomogCpleDir(const cPt3dr & aP1,const cPt3dr & aP2) : |
71 | | - mP1 (aP1), |
72 | | - mP2 (aP2) |
| 86 | + mP1 (VUnit(aP1)), |
| 87 | + mP2 (VUnit(aP2)) |
73 | 88 | { |
74 | 89 | } |
75 | 90 |
|
@@ -133,6 +148,26 @@ cMatEssential::cMatEssential(const cSetHomogCpleDir & aSetD,cLinearOverCstrSys<t |
133 | 148 | SetLine(2,mMat,cPt3dr(aSol(6),aSol(7), 1.0)); |
134 | 149 | } |
135 | 150 |
|
| 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 | + |
136 | 171 |
|
137 | 172 | }; // MMVII |
138 | 173 |
|
|
0 commit comments