Skip to content

Commit e89af12

Browse files
committed
Filter Masq, option dist hom
1 parent f178570 commit e89af12

7 files changed

Lines changed: 51 additions & 24 deletions

File tree

src/uti_image/ImVis/Vino_Geom.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ void cAppli_Vino::ShowSPC(const Pt2dr & aPClW)
330330
std::cout << "\n";
331331

332332
{
333-
Im2D_INT1 aImLogT = aNearest->ImRad();
333+
Im2D_INT1 aImLogT = aNearest->ImLogPol();
334334
int aZoom=10;
335335
Pt2di aSz = aImLogT.sz();
336336

src/uti_image/NewRechPH/NH_InvarRad.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ bool cAppli_NewRechPH::CalvInvariantRot(cOnePCarac & aPt)
369369
aS2 -= ElSquare(aS1);
370370
aS2 = sqrt(ElMax(1e-10,aS2));
371371
ELISE_COPY(aImBuf.all_pts(),(aImBuf.in()-aS1)/aS2, aImBuf.out());
372-
aPt.ImRad() = Im2D_INT1(aImBuf.sz().x,aImBuf.sz().y);
373-
ELISE_COPY(aImBuf.all_pts(),Max(-128,Min(127,round_ni(aImBuf.in()*32))),aPt.ImRad().out());
372+
aPt.ImLogPol() = Im2D_INT1(aImBuf.sz().x,aImBuf.sz().y);
373+
ELISE_COPY(aImBuf.all_pts(),Max(-128,Min(127,round_ni(aImBuf.in()*32))),aPt.ImLogPol().out());
374374
aPt.VectRho() = aVRho;
375375

376376
if (BUG)

src/uti_image/NewRechPH/ParamNewRechPH.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@
8888
<!-- Code Binaire : devrait etre 1D, mais flemme modifier xml_init et autres ... -->
8989
<CodeBinaire Nb="1" Type="Im2D_U_INT2"> </CodeBinaire>
9090
</OneInvRad>
91+
92+
<ProfilRad Nb="1" Class="true" ToReference="true">
93+
<!-- y : NumVect , x : Rho -->
94+
<ImProfil Nb="1" Type="Im2D_INT1"> </ImProfil>
95+
<!-- Code Binaire : devrait etre 1D, mais flemme modifier xml_init et autres ... -->
96+
</OneInvRad>
97+
98+
9199
<OnePCarac Nb="1" Class="true" ToReference="true">
92100
<Kind Nb="1" Type="eTypePtRemark"> </Kind>
93101
<Pt Nb="1" Type="Pt2dr"> </Pt>
@@ -105,8 +113,9 @@
105113
<!-- codage binaire -->
106114
<!-- Pour visu -->
107115
<InvR Nb="1" RefType="OneInvRad"> </InvR>
108-
<ImRad Nb="1" Type="Im2D_INT1"> </ImRad>
116+
<ImLogPol Nb="1" Type="Im2D_INT1"> </ImLogPol>
109117
<VectRho Nb="1" Type="std::vector<double>"> </VectRho>
118+
<ProfR Nb="1" RefType="ProfilRad"> </ProfR>
110119
</OnePCarac>
111120

112121
<SetPCarac Nb="1" Class="true">

src/uti_image/NewRechPH/StatPHom.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ void cOneImSPH::TestMatch(cOneImSPH & aI2)
179179
if ((!aV1.empty()) && (!aV2.empty()))
180180
{
181181
aI2.mVNearest.clear();
182-
std::cout << "===========================================================\n";
182+
std::cout << "*************===========================================================*************\n";
183+
std::cout << "*************===========================================================*************\n";
184+
std::cout << "*************===========================================================*************\n";
183185
std::cout << "For " << eToString(aLab) << " sz=" << aV1.size() << " " << aV2.size() << "\n";
184186

185187
std::vector<double> aVD22;
@@ -190,7 +192,7 @@ void cOneImSPH::TestMatch(cOneImSPH & aI2)
190192
aI2.mVNearest.push_back(aP);
191193
aVD22.push_back(aDist);
192194
}
193-
mAppli.ShowStat("Nearest D for ",20,aVD22);
195+
mAppli.ShowStat("Distribution du point le plus proche avec meme carac",20,aVD22);
194196

195197

196198
std::vector<double> aVD12;
@@ -336,8 +338,9 @@ void cAppliStatPHom::TestHom()
336338
}
337339
}
338340
}
339-
ShowStat("ECAR EPIP",20,aVREpi);
340-
ShowStat("ECAR COMPL",20,aVRComp);
341+
// La, on test la qualite des references , epipolaire et nuages
342+
ShowStat("ECAR EPIP pour les points SIFT",20,aVREpi);
343+
ShowStat("ECAR COMPLET pour les points SIFT",20,aVRComp);
341344
/*
342345
int aNB= 20;
343346
std::cout << "========= ECAR EPIP ==========\n";

src/uti_image/NewRechPH/cParamNewRechPH.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -508,14 +508,14 @@ const cOneInvRad & cOnePCarac::InvR()const
508508
}
509509

510510

511-
Im2D_INT1 & cOnePCarac::ImRad()
511+
Im2D_INT1 & cOnePCarac::ImLogPol()
512512
{
513-
return mImRad;
513+
return mImLogPol;
514514
}
515515

516-
const Im2D_INT1 & cOnePCarac::ImRad()const
516+
const Im2D_INT1 & cOnePCarac::ImLogPol()const
517517
{
518-
return mImRad;
518+
return mImLogPol;
519519
}
520520

521521

@@ -545,7 +545,7 @@ void BinaryUnDumpFromFile(cOnePCarac & anObj,ELISE_fp & aFp)
545545
BinaryUnDumpFromFile(anObj.AutoCorrel(),aFp);
546546
BinaryUnDumpFromFile(anObj.OK(),aFp);
547547
BinaryUnDumpFromFile(anObj.InvR(),aFp);
548-
BinaryUnDumpFromFile(anObj.ImRad(),aFp);
548+
BinaryUnDumpFromFile(anObj.ImLogPol(),aFp);
549549
BinaryUnDumpFromFile(anObj.VectRho(),aFp);
550550
}
551551

@@ -565,7 +565,7 @@ void BinaryDumpInFile(ELISE_fp & aFp,const cOnePCarac & anObj)
565565
BinaryDumpInFile(aFp,anObj.AutoCorrel());
566566
BinaryDumpInFile(aFp,anObj.OK());
567567
BinaryDumpInFile(aFp,anObj.InvR());
568-
BinaryDumpInFile(aFp,anObj.ImRad());
568+
BinaryDumpInFile(aFp,anObj.ImLogPol());
569569
BinaryDumpInFile(aFp,anObj.VectRho());
570570
}
571571

@@ -587,7 +587,7 @@ cElXMLTree * ToXMLTree(const cOnePCarac & anObj)
587587
aRes->AddFils(::ToXMLTree(std::string("AutoCorrel"),anObj.AutoCorrel())->ReTagThis("AutoCorrel"));
588588
aRes->AddFils(::ToXMLTree(std::string("OK"),anObj.OK())->ReTagThis("OK"));
589589
aRes->AddFils(ToXMLTree(anObj.InvR())->ReTagThis("InvR"));
590-
aRes->AddFils(::ToXMLTree(std::string("ImRad"),anObj.ImRad())->ReTagThis("ImRad"));
590+
aRes->AddFils(::ToXMLTree(std::string("ImLogPol"),anObj.ImLogPol())->ReTagThis("ImLogPol"));
591591
aRes->AddFils(::ToXMLTree(std::string("VectRho"),anObj.VectRho())->ReTagThis("VectRho"));
592592
aRes->mGXml = anObj.mGXml;
593593
XMLPopContext(anObj.mGXml);
@@ -627,12 +627,12 @@ void xml_init(cOnePCarac & anObj,cElXMLTree * aTree)
627627

628628
xml_init(anObj.InvR(),aTree->Get("InvR",1)); //tototo
629629

630-
xml_init(anObj.ImRad(),aTree->Get("ImRad",1)); //tototo
630+
xml_init(anObj.ImLogPol(),aTree->Get("ImLogPol",1)); //tototo
631631

632632
xml_init(anObj.VectRho(),aTree->Get("VectRho",1)); //tototo
633633
}
634634

635-
std::string Mangling( cOnePCarac *) {return "A1E622235CA23AC9FD3F";};
635+
std::string Mangling( cOnePCarac *) {return "E0CF3BC532583685FE3F";};
636636

637637

638638
std::vector< cOnePCarac > & cSetPCarac::OnePCarac()
@@ -691,7 +691,7 @@ void xml_init(cSetPCarac & anObj,cElXMLTree * aTree)
691691
xml_init(anObj.OnePCarac(),aTree->GetAll("OnePCarac",false,1));
692692
}
693693

694-
std::string Mangling( cSetPCarac *) {return "00FB91C136438280FE3F";};
694+
std::string Mangling( cSetPCarac *) {return "55544900B54811F1FE3F";};
695695

696696

697697
cOnePCarac & cSRPC_Truth::P1()
@@ -748,7 +748,7 @@ void xml_init(cSRPC_Truth & anObj,cElXMLTree * aTree)
748748
xml_init(anObj.P2(),aTree->Get("P2",1)); //tototo
749749
}
750750

751-
std::string Mangling( cSRPC_Truth *) {return "208C32A1E44ECED3FBBF";};
751+
std::string Mangling( cSRPC_Truth *) {return "605FA27E9728E3ABFBBF";};
752752

753753

754754
std::vector< cSRPC_Truth > & cSetRefPCarac::SRPC_Truth()
@@ -841,7 +841,7 @@ void xml_init(cSetRefPCarac & anObj,cElXMLTree * aTree)
841841
xml_init(anObj.SRPC_Rand(),aTree->GetAll("SRPC_Rand",false,1));
842842
}
843843

844-
std::string Mangling( cSetRefPCarac *) {return "86C0DAE397FC78B5FD3F";};
844+
std::string Mangling( cSetRefPCarac *) {return "D1AF655A5B3CE59CFE3F";};
845845

846846

847847
std::vector<double> & cCBOneBit::Coeff()

src/uti_image/NewRechPH/cParamNewRechPH.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ class cOnePCarac
179179
cOneInvRad & InvR();
180180
const cOneInvRad & InvR()const ;
181181

182-
Im2D_INT1 & ImRad();
183-
const Im2D_INT1 & ImRad()const ;
182+
Im2D_INT1 & ImLogPol();
183+
const Im2D_INT1 & ImLogPol()const ;
184184

185185
std::vector<double> & VectRho();
186186
const std::vector<double> & VectRho()const ;
@@ -199,7 +199,7 @@ class cOnePCarac
199199
double mAutoCorrel;
200200
bool mOK;
201201
cOneInvRad mInvR;
202-
Im2D_INT1 mImRad;
202+
Im2D_INT1 mImLogPol;
203203
std::vector<double> mVectRho;
204204
};
205205
cElXMLTree * ToXMLTree(const cOnePCarac &);

src/uti_phgrm/CPP_HomFilterMasq.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ int HomFilterMasq_main(int argc,char ** argv)
8989
std::string aOriMasq3D,aNameMasq3D;
9090
cMasqBin3D * aMasq3D = 0;
9191
double aDistId=-1;
92+
double aDistHom=-1;
9293

9394
Pt2dr aSelecTer;
9495

@@ -111,6 +112,7 @@ int HomFilterMasq_main(int argc,char ** argv)
111112
<< EAM(aNameMasq3D,"Masq3D",true,"File of Masq3D, Def=AperiCloud_${OriMasq3D}.ply")
112113
<< EAM(aSelecTer,"SelecTer",true,"[Per,Prop] Period of tiling on ground selection, Prop=proporion of selected")
113114
<< EAM(aDistId,"DistId",true,"Supress pair such that d(P1,P2) < DistId, def unused")
115+
<< EAM(aDistHom,"DistH",true,"Distance for filtering homologous point")
114116
);
115117
bool aHasOri3D = EAMIsInit(&aOriMasq3D);
116118
bool HasTerSelec = EAMIsInit(&aSelecTer);
@@ -145,7 +147,7 @@ int HomFilterMasq_main(int argc,char ** argv)
145147
}
146148
else
147149
{
148-
ELISE_ASSERT(EAMIsInit(&aSelecTer),"Unused OriMasq3D");
150+
ELISE_ASSERT(EAMIsInit(&aSelecTer) || (aDistHom>=0),"Unused OriMasq3D");
149151
}
150152
aKeyOri = "NKS-Assoc-Im2Orient@" + aOriMasq3D;
151153
}
@@ -289,6 +291,19 @@ std::cout << aNameIm1 << " # " << aNameIm2 << "\n";
289291
aNbTestTer ++;
290292
aNbInTer += OkTer;
291293
}
294+
295+
if (aDistHom >0 )
296+
{
297+
Pt2dr aRP1 = aVCam[aKN1]->Ter2Capteur(aPTer);
298+
Pt2dr aRP2 = aVCam[aKN2]->Ter2Capteur(aPTer);
299+
double aD1 = euclid(aP1,aRP1);
300+
double aD2 = euclid(aP2,aRP2);
301+
if ((aD1+aD2) > aDistHom)
302+
{
303+
Ok = false;
304+
std::cout << "DIST " << aD1 << " " << aD2 << "\n";
305+
}
306+
}
292307
}
293308

294309
if (Ok && (aDistId>=0))

0 commit comments

Comments
 (0)