Skip to content

Commit

Permalink
Filter Masq, option dist hom
Browse files Browse the repository at this point in the history
  • Loading branch information
deseilligny committed Mar 13, 2018
1 parent f178570 commit e89af12
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/uti_image/ImVis/Vino_Geom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void cAppli_Vino::ShowSPC(const Pt2dr & aPClW)
std::cout << "\n";

{
Im2D_INT1 aImLogT = aNearest->ImRad();
Im2D_INT1 aImLogT = aNearest->ImLogPol();
int aZoom=10;
Pt2di aSz = aImLogT.sz();

Expand Down
4 changes: 2 additions & 2 deletions src/uti_image/NewRechPH/NH_InvarRad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ bool cAppli_NewRechPH::CalvInvariantRot(cOnePCarac & aPt)
aS2 -= ElSquare(aS1);
aS2 = sqrt(ElMax(1e-10,aS2));
ELISE_COPY(aImBuf.all_pts(),(aImBuf.in()-aS1)/aS2, aImBuf.out());
aPt.ImRad() = Im2D_INT1(aImBuf.sz().x,aImBuf.sz().y);
ELISE_COPY(aImBuf.all_pts(),Max(-128,Min(127,round_ni(aImBuf.in()*32))),aPt.ImRad().out());
aPt.ImLogPol() = Im2D_INT1(aImBuf.sz().x,aImBuf.sz().y);
ELISE_COPY(aImBuf.all_pts(),Max(-128,Min(127,round_ni(aImBuf.in()*32))),aPt.ImLogPol().out());
aPt.VectRho() = aVRho;

if (BUG)
Expand Down
11 changes: 10 additions & 1 deletion src/uti_image/NewRechPH/ParamNewRechPH.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@
<!-- Code Binaire : devrait etre 1D, mais flemme modifier xml_init et autres ... -->
<CodeBinaire Nb="1" Type="Im2D_U_INT2"> </CodeBinaire>
</OneInvRad>

<ProfilRad Nb="1" Class="true" ToReference="true">
<!-- y : NumVect , x : Rho -->
<ImProfil Nb="1" Type="Im2D_INT1"> </ImProfil>
<!-- Code Binaire : devrait etre 1D, mais flemme modifier xml_init et autres ... -->
</OneInvRad>


<OnePCarac Nb="1" Class="true" ToReference="true">
<Kind Nb="1" Type="eTypePtRemark"> </Kind>
<Pt Nb="1" Type="Pt2dr"> </Pt>
Expand All @@ -105,8 +113,9 @@
<!-- codage binaire -->
<!-- Pour visu -->
<InvR Nb="1" RefType="OneInvRad"> </InvR>
<ImRad Nb="1" Type="Im2D_INT1"> </ImRad>
<ImLogPol Nb="1" Type="Im2D_INT1"> </ImLogPol>
<VectRho Nb="1" Type="std::vector<double>"> </VectRho>
<ProfR Nb="1" RefType="ProfilRad"> </ProfR>
</OnePCarac>

<SetPCarac Nb="1" Class="true">
Expand Down
11 changes: 7 additions & 4 deletions src/uti_image/NewRechPH/StatPHom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ void cOneImSPH::TestMatch(cOneImSPH & aI2)
if ((!aV1.empty()) && (!aV2.empty()))
{
aI2.mVNearest.clear();
std::cout << "===========================================================\n";
std::cout << "*************===========================================================*************\n";
std::cout << "*************===========================================================*************\n";
std::cout << "*************===========================================================*************\n";
std::cout << "For " << eToString(aLab) << " sz=" << aV1.size() << " " << aV2.size() << "\n";

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


std::vector<double> aVD12;
Expand Down Expand Up @@ -336,8 +338,9 @@ void cAppliStatPHom::TestHom()
}
}
}
ShowStat("ECAR EPIP",20,aVREpi);
ShowStat("ECAR COMPL",20,aVRComp);
// La, on test la qualite des references , epipolaire et nuages
ShowStat("ECAR EPIP pour les points SIFT",20,aVREpi);
ShowStat("ECAR COMPLET pour les points SIFT",20,aVRComp);
/*
int aNB= 20;
std::cout << "========= ECAR EPIP ==========\n";
Expand Down
24 changes: 12 additions & 12 deletions src/uti_image/NewRechPH/cParamNewRechPH.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,14 +508,14 @@ const cOneInvRad & cOnePCarac::InvR()const
}


Im2D_INT1 & cOnePCarac::ImRad()
Im2D_INT1 & cOnePCarac::ImLogPol()
{
return mImRad;
return mImLogPol;
}

const Im2D_INT1 & cOnePCarac::ImRad()const
const Im2D_INT1 & cOnePCarac::ImLogPol()const
{
return mImRad;
return mImLogPol;
}


Expand Down Expand Up @@ -545,7 +545,7 @@ void BinaryUnDumpFromFile(cOnePCarac & anObj,ELISE_fp & aFp)
BinaryUnDumpFromFile(anObj.AutoCorrel(),aFp);
BinaryUnDumpFromFile(anObj.OK(),aFp);
BinaryUnDumpFromFile(anObj.InvR(),aFp);
BinaryUnDumpFromFile(anObj.ImRad(),aFp);
BinaryUnDumpFromFile(anObj.ImLogPol(),aFp);
BinaryUnDumpFromFile(anObj.VectRho(),aFp);
}

Expand All @@ -565,7 +565,7 @@ void BinaryDumpInFile(ELISE_fp & aFp,const cOnePCarac & anObj)
BinaryDumpInFile(aFp,anObj.AutoCorrel());
BinaryDumpInFile(aFp,anObj.OK());
BinaryDumpInFile(aFp,anObj.InvR());
BinaryDumpInFile(aFp,anObj.ImRad());
BinaryDumpInFile(aFp,anObj.ImLogPol());
BinaryDumpInFile(aFp,anObj.VectRho());
}

Expand All @@ -587,7 +587,7 @@ cElXMLTree * ToXMLTree(const cOnePCarac & anObj)
aRes->AddFils(::ToXMLTree(std::string("AutoCorrel"),anObj.AutoCorrel())->ReTagThis("AutoCorrel"));
aRes->AddFils(::ToXMLTree(std::string("OK"),anObj.OK())->ReTagThis("OK"));
aRes->AddFils(ToXMLTree(anObj.InvR())->ReTagThis("InvR"));
aRes->AddFils(::ToXMLTree(std::string("ImRad"),anObj.ImRad())->ReTagThis("ImRad"));
aRes->AddFils(::ToXMLTree(std::string("ImLogPol"),anObj.ImLogPol())->ReTagThis("ImLogPol"));
aRes->AddFils(::ToXMLTree(std::string("VectRho"),anObj.VectRho())->ReTagThis("VectRho"));
aRes->mGXml = anObj.mGXml;
XMLPopContext(anObj.mGXml);
Expand Down Expand Up @@ -627,12 +627,12 @@ void xml_init(cOnePCarac & anObj,cElXMLTree * aTree)

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

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

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

std::string Mangling( cOnePCarac *) {return "A1E622235CA23AC9FD3F";};
std::string Mangling( cOnePCarac *) {return "E0CF3BC532583685FE3F";};


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

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


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

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


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

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


std::vector<double> & cCBOneBit::Coeff()
Expand Down
6 changes: 3 additions & 3 deletions src/uti_image/NewRechPH/cParamNewRechPH.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ class cOnePCarac
cOneInvRad & InvR();
const cOneInvRad & InvR()const ;

Im2D_INT1 & ImRad();
const Im2D_INT1 & ImRad()const ;
Im2D_INT1 & ImLogPol();
const Im2D_INT1 & ImLogPol()const ;

std::vector<double> & VectRho();
const std::vector<double> & VectRho()const ;
Expand All @@ -199,7 +199,7 @@ class cOnePCarac
double mAutoCorrel;
bool mOK;
cOneInvRad mInvR;
Im2D_INT1 mImRad;
Im2D_INT1 mImLogPol;
std::vector<double> mVectRho;
};
cElXMLTree * ToXMLTree(const cOnePCarac &);
Expand Down
17 changes: 16 additions & 1 deletion src/uti_phgrm/CPP_HomFilterMasq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ int HomFilterMasq_main(int argc,char ** argv)
std::string aOriMasq3D,aNameMasq3D;
cMasqBin3D * aMasq3D = 0;
double aDistId=-1;
double aDistHom=-1;

Pt2dr aSelecTer;

Expand All @@ -111,6 +112,7 @@ int HomFilterMasq_main(int argc,char ** argv)
<< EAM(aNameMasq3D,"Masq3D",true,"File of Masq3D, Def=AperiCloud_${OriMasq3D}.ply")
<< EAM(aSelecTer,"SelecTer",true,"[Per,Prop] Period of tiling on ground selection, Prop=proporion of selected")
<< EAM(aDistId,"DistId",true,"Supress pair such that d(P1,P2) < DistId, def unused")
<< EAM(aDistHom,"DistH",true,"Distance for filtering homologous point")
);
bool aHasOri3D = EAMIsInit(&aOriMasq3D);
bool HasTerSelec = EAMIsInit(&aSelecTer);
Expand Down Expand Up @@ -145,7 +147,7 @@ int HomFilterMasq_main(int argc,char ** argv)
}
else
{
ELISE_ASSERT(EAMIsInit(&aSelecTer),"Unused OriMasq3D");
ELISE_ASSERT(EAMIsInit(&aSelecTer) || (aDistHom>=0),"Unused OriMasq3D");
}
aKeyOri = "NKS-Assoc-Im2Orient@" + aOriMasq3D;
}
Expand Down Expand Up @@ -289,6 +291,19 @@ std::cout << aNameIm1 << " # " << aNameIm2 << "\n";
aNbTestTer ++;
aNbInTer += OkTer;
}

if (aDistHom >0 )
{
Pt2dr aRP1 = aVCam[aKN1]->Ter2Capteur(aPTer);
Pt2dr aRP2 = aVCam[aKN2]->Ter2Capteur(aPTer);
double aD1 = euclid(aP1,aRP1);
double aD2 = euclid(aP2,aRP2);
if ((aD1+aD2) > aDistHom)
{
Ok = false;
std::cout << "DIST " << aD1 << " " << aD2 << "\n";
}
}
}

if (Ok && (aDistId>=0))
Expand Down

0 comments on commit e89af12

Please sign in to comment.