本文整理汇总了C++中Tiff_Im::in方法的典型用法代码示例。如果您正苦于以下问题:C++ Tiff_Im::in方法的具体用法?C++ Tiff_Im::in怎么用?C++ Tiff_Im::in使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tiff_Im
的用法示例。
在下文中一共展示了Tiff_Im::in方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PartitionRenato
void PartitionRenato(int argc,char** argv)
{
std::string aName;
double aPropSzW=0.1,aSeuil=75;
double aPropExag = 0.1;
int aNbIter = 3;
ElInitArgMain
(
argc,argv,
LArgMain() << EAMC(aName,"Name Input"),
LArgMain() << EAM(aPropSzW,"PropSzW",true,"Prop Size of W, def =0.1")
<< EAM(aSeuil,"Seuil",true,"Threshold beetween Black & White, Def=75")
);
Tiff_Im aTIn = Tiff_Im::UnivConvStd(aName);
Pt2di aSz = aTIn.sz();
int aSzW = round_ni((euclid(aSz)*aPropSzW) / sqrt(aNbIter));
Im2D_REAL4 anIm0(aSz.x,aSz.y);
Im2D_REAL4 anIm1(aSz.x,aSz.y);
Im2D_U_INT1 aImInside(aSz.x,aSz.y,1);
ELISE_COPY(anIm0.all_pts(),255-aTIn.in(),anIm0.out());
int aNbF = 3;
for (int aKF=0 ; aKF<aNbF ; aKF++)
{
Im2D_REAL4 anImFond(aSz.x,aSz.y);
Fonc_Num aFIn = anIm0.in(0);
for (int aK=0 ; aK<aNbIter ; aK++)
aFIn = (rect_som(aFIn,aSzW)*aImInside.in(0)) / Max(1.0,rect_som(aImInside.in(0),aSzW));
ELISE_COPY(anImFond.all_pts(),aFIn,anImFond.out());
if (aKF == (aNbF-1))
{
Fonc_Num aF = anIm0.in()-anImFond.in();
aF = aF / aSeuil;
aF = (aF -0.1) / (1-2*aPropExag);
aF = Max(0.0,Min(1.0,aF));
ELISE_COPY(anIm1.all_pts(),255.0 *(1-aF),anIm1.out());
}
else
{
ELISE_COPY
(
aImInside.all_pts(),
anIm0.in() < anImFond.in()+aSeuil,
aImInside.out()
);
}
}
Tiff_Im::Create8BFromFonc(std::string("Bin-")+StdPrefix(aName)+".tif",aTIn.sz(),anIm1.in());
}
示例2: DebugDrag
void DebugDrag()
{
std::string aDir = "/media/data1/Jeux-Tests/Dragon-2/MEC2Im-Epi_Im1_Right_IMGP7511_IMGP7512.tif-Epi_Im2_Left_IMGP7511_IMGP7512.tif/";
std::string aNamePx = "Px1_Num6_DeZoom2_LeChantier.tif";
std::string aNameMasq = "AutoMask_LeChantier_Num_5.tif";
Tiff_Im aTP = Tiff_Im::StdConv(aDir+aNamePx);
Tiff_Im aTM = Tiff_Im::StdConv(aDir+aNameMasq);
double aMinPx;
ELISE_COPY
(
aTP.all_pts(),
aTP.in() * aTM.in(),
VMin(aMinPx)
);
std::cout << "MIN PX " << aMinPx << "\n";
}
示例3: TestNtt
void TestNtt(const std::string &aName)
{
Tiff_Im aTF = Tiff_Im::StdConvGen(aName,1,true);
Pt2di aSz = aTF.sz();
Im2D_REAL4 aI0(aSz.x,aSz.y);
ELISE_COPY( aTF.all_pts(),aTF.in(),aI0.out());
int aWSz=2;
TIm2D<REAL4,REAL8> aTIm(aI0);
double aSomGlob=0.0;
double aNbGlob=0.0;
for (int aKdx=-aWSz ; aKdx<=aWSz ; aKdx+=aWSz)
{
printf("## ");
for (int aKdy=-aWSz ; aKdy<=aWSz ; aKdy+=aWSz)
{
int aDx = aKdx;
int aDy = aKdy;
Pt2di aDep(aDx,aDy);
Pt2di aP;
RMat_Inertie aMat;
for (aP.x = aWSz ; aP.x<aSz.x-aWSz ; aP.x++)
{
for (aP.y=aWSz ; aP.y<aSz.y-aWSz ; aP.y++)
{
aMat.add_pt_en_place(aTIm.get(aP),aTIm.get(aP+aDep));
}
}
double aC = aMat.correlation();
aC = 1-aC;
if (dist8(aDep) == aWSz)
{
aSomGlob += aC;
aNbGlob ++;
}
printf(" %4d",round_ni(10000*(aC)));
}
printf("\n");
}
aSomGlob /= aNbGlob;
std::cout << " G:" << aSomGlob << "\n";
printf("\n\n");
}
示例4:
template <class Type> void Bench_PackB_IM<Type>::TiffVerif()
{
Pt2di SzDalle = Pt2di(mPer,64);
Tiff_Im aTifFile
(
ELISE_BFI_DATA_DIR "ex.tif",
sz,
type_of_ptr((Type *)0),
Tiff_Im::NoByte_PackBits_Compr,
Tiff_Im::BlackIsZero,
L_Arg_Opt_Tiff()
+ Arg_Tiff(Tiff_Im::ATiles(SzDalle))
);
ELISE_COPY(aTifFile.all_pts(),pck.in(),aTifFile.out());
INT VDIF;
ELISE_COPY(aTifFile.all_pts(),Abs(pck.in()-aTifFile.in()),VMax(VDIF));
BENCH_ASSERT(VDIF==0);
if (type_of_ptr((Type *)0)==GenIm::u_int1)
{
PackB_IM<U_INT1> aPack2 = aTifFile.un_load_pack_bit_U_INT1();
ELISE_COPY(aTifFile.all_pts(),Abs(pck.in()-aPack2.in()),VMax(VDIF));
BENCH_ASSERT(VDIF==0);
}
if (type_of_ptr((Type *)0)==GenIm::u_int2)
{
PackB_IM<U_INT2> aPack2 = aTifFile.un_load_pack_bit_U_INT2();
ELISE_COPY(aTifFile.all_pts(),Abs(pck.in()-aPack2.in()),VMax(VDIF));
BENCH_ASSERT(VDIF==0);
}
}
示例5: SobelTestNtt
void SobelTestNtt(const std::string &aName)
{
Tiff_Im aTF = Tiff_Im::StdConvGen(aName,1,true);
Pt2di aSz = aTF.sz();
Im2D_REAL4 aI0(aSz.x,aSz.y);
ELISE_COPY( aTF.all_pts(),aTF.in(),aI0.out());
Video_Win * aW=0;
// aW = Video_Win::PtrWStd(aSz);
if (aW)
{
ELISE_COPY(aW->all_pts(),Min(255,aI0.in()/256.0),aW->ogray());
aW->clik_in();
}
Fonc_Num aF1 = sobel(aI0.in_proj());
Fonc_Num aF2 = aI0.in_proj();
for (int aK=0 ; aK<3 ; aK++)
aF2 = rect_som(aF2,1) / 9.0;
aF2 = sobel(aF2);
if (aW)
{
ELISE_COPY(aW->all_pts(),Min(255, 200 * (aF1/Max(aF2,1e-7))),aW->ogray());
aW->clik_in();
}
double aSF1,aSF2,aSomPts;
ELISE_COPY(aI0.all_pts(),Virgule(aF1,aF2,1.0),Virgule(sigma(aSF1),sigma(aSF2),sigma(aSomPts)));
std::cout << "Indice " << aSF1 / aSF2 << "\n";
}
示例6: EstimFlatField_main
int EstimFlatField_main(int argc,char ** argv)
{
std::string aFullDir,aDir,aPat;
std::string aNameOut;
double aResol=1.0;
double aDilate=1.0;
int aNbMed = 1;
int aNbMedSsRes = 3;
bool ByMoy = false;
double TolMed = 0.25;
ElInitArgMain
(
argc,argv,
LArgMain() << EAMC(aFullDir,"Images = Dir + Pat", eSAM_IsPatFile)
<< EAMC(aResol,"Resolution "),
LArgMain() << EAM(aNbMed,"NbMed",true)
<< EAM(aNameOut,"Out",true,"Name of result")
<< EAM(aDilate,"SousResAdd",true)
<< EAM(aNbMedSsRes,"NbMedSsRes",true)
<< EAM(TolMed,"TolMed",true)
<< EAM(ByMoy,"ByMoy",true,"Average or median (def=false")
);
if (!MMVisualMode)
{
SplitDirAndFile(aDir,aPat,aFullDir);
if (aNameOut=="")
aNameOut = "FlatField.tif";
aNameOut = aDir + aNameOut;
cTplValGesInit<std::string> aTplN;
cInterfChantierNameManipulateur * aICNM = cInterfChantierNameManipulateur::StdAlloc(0,0,aDir,aTplN);
MakeXmlXifInfo(aFullDir,aICNM);
std::list<std::string> aLName = aICNM->StdGetListOfFile(aPat);
Paral_Tiff_Dev(aDir,std::vector<std::string> (aLName.begin(),aLName.end()),1,false);
Pt2di aSzIm(-1,-1);
double aNbPix=-1;
Im2D_REAL4 aImIn(1,1);
Im2D_REAL8 aFFRes1(1,1);
Pt2di aSzF(-1,-1);
int aNbIm = (int)aLName.size();
int aCpt = aNbIm;
std::vector<Im2D_REAL4> aVImRed;
// for (std::list<std::string>::const_iterator itN=aLName.begin(); itN!=aLName.end() ; itN++)
// for (std::list<std::string>::reverse_iterator itN=aLName.rbegin(); itN!=aLName.rend() ; itN++)
for (std::list<std::string>::const_iterator itN=aLName.begin(); itN!=aLName.end() ; itN++)
{
std::cout << "To Do " << aCpt << *itN << "\n";
Tiff_Im aTIn = Tiff_Im::StdConvGen(aDir+*itN,1,true);
std::string aImRefSz;
if (aSzIm.x<0)
{
aImRefSz = *itN;
aSzIm = aTIn.sz();
aImIn = Im2D_REAL4(aSzIm.x,aSzIm.y,0.0);
if (ByMoy)
aFFRes1 = Im2D_REAL8(aSzIm.x,aSzIm.y,0.0);
aNbPix = aSzIm.x*aSzIm.y;
aSzF = round_up(Pt2dr(aSzIm)/aResol);
}
else
{
if (aSzIm!=aTIn.sz())
{
std::cout << "For Image " << *itN << " sz=" << aTIn.sz() << " Ref=" << aImRefSz << " Sz=" << aSzIm << "\n";
ELISE_ASSERT(false,"Different size");
}
}
double aSom = 0;
// ELISE_COPY(aImIn.all_pts(),aTIn.in(),aImIn.out()|sigma(aSom));
Fonc_Num aFIN = aTIn.in();
ELISE_COPY(aImIn.all_pts(),Rconv(aFIN),aImIn.out()|sigma(aSom));
double aMoy = aSom/aNbPix;
if (ByMoy)
{
ELISE_COPY
(
aImIn.all_pts(),
aFFRes1.in()+(aImIn.in()/aMoy),
aFFRes1.out()
);
}
else
{
Im2D_REAL4 aIRed(aSzF.x,aSzF.y);
ELISE_COPY
//.........这里部分代码省略.........
示例7: aSzBrd
cTmpReechEpip::cTmpReechEpip
(
bool aConsChan,
const std::string & aNameOri,
Box2dr aBoxImIn,
ElDistortion22_Gen * anEpi,
Box2dr aBox,
double aStep,
const std::string & aNameOut,
const std::string & aPostMasq,
int aNumKer ,
bool Debug
) :
mBoxImIn(aBoxImIn),
mEpi (anEpi),
mStep (aStep),
mP0 (aBox._p0),
mSzEpi (aBox.sz()),
mSzRed (round_up (aBox.sz() / aStep) + Pt2di(1,1)),
mRedIMasq (mSzRed.x,mSzRed.y,0),
mRedTMasq (mRedIMasq),
mRedImX (mSzRed.x,mSzRed.y),
mRedTImX (mRedImX),
mRedImY (mSzRed.x,mSzRed.y),
mRedTImY (mRedImY)
{
cInterpolateurIm2D<REAL4> * aPtrSCI = 0;
if (aNumKer==0)
{
aPtrSCI = new cInterpolBilineaire<REAL4>;
}
else
{
cKernelInterpol1D * aKer = 0;
if (aNumKer==1)
aKer = new cCubicInterpKernel(-0.5);
else
aKer = new cSinCardApodInterpol1D(cSinCardApodInterpol1D::eTukeyApod,aNumKer,aNumKer/2,1e-4,false);
aPtrSCI = new cTabIM2D_FromIm2D<REAL4> (aKer,1000,false);
// cTabIM2D_FromIm2D<REAL4> aSSCI (&aKer,1000,false);
}
cInterpolateurIm2D<REAL4> & aSCI = *aPtrSCI;
Pt2di aPInd;
for (aPInd.x=0 ; aPInd.x<mSzRed.x ; aPInd.x++)
{
for (aPInd.y=0 ; aPInd.y<mSzRed.y ; aPInd.y++)
{
bool Ok= false;
Pt2dr aPEpi = ToFullEpiCoord(aPInd);
Pt2dr aPIm = anEpi->Inverse(aPEpi);
if ((aPIm.x>mBoxImIn._p0.x) && (aPIm.y>mBoxImIn._p0.y) && (aPIm.x<mBoxImIn._p1.x) && (aPIm.y<mBoxImIn._p1.y))
{
Pt2dr aPEpi2 = anEpi->Direct(aPIm);
if (euclid(aPEpi-aPEpi2) < 1e-2)
{
Ok= true;
mRedTMasq.oset(aPInd,Ok);
}
}
mRedTImX.oset(aPInd,aPIm.x);
mRedTImY.oset(aPInd,aPIm.y);
}
}
ELISE_COPY(mRedIMasq.all_pts(),dilat_d8(mRedIMasq.in(0),4),mRedIMasq.out());
Tiff_Im aTifOri = Tiff_Im::StdConvGen(aNameOri.c_str(),aConsChan ? -1 :1 ,true);
Tiff_Im aTifEpi = Debug ?
Tiff_Im(aNameOut.c_str()) :
Tiff_Im
(
aNameOut.c_str(),
mSzEpi,
aTifOri.type_el(),
Tiff_Im::No_Compr,
aTifOri.phot_interp()
) ;
Tiff_Im aTifMasq = aTifEpi;
bool ExportMasq = (aPostMasq!="NONE");
// std::cout << "POSTMAS " << aPostMasq << "\n";
if (ExportMasq)
{
std::string aNameMasq = StdPrefix(aNameOut)+ aPostMasq +".tif";
aTifMasq = Debug ?
Tiff_Im(aNameMasq.c_str()) :
//.........这里部分代码省略.........
示例8: PreparSift_Main
int PreparSift_Main(int argc,char ** argv)
{
double aPEg = 1.0;
double aPSrtEg = 3.0;
double aPM = 2.0;
std::string aNameIn,aNameOut="Sift.tif";
ElInitArgMain
(
argc,argv,
LArgMain() << EAMC(aNameIn,"Full name (Dir+Pattern)", eSAM_IsPatFile),
LArgMain() << EAM(aNameOut,"NameOut",true)
);
Tiff_Im aTif = Tiff_Im::StdConvGen(aNameIn,1,true);
// Init Mems
Pt2di aSz = aTif.sz();
Im2D_U_INT2 anIm(aSz.x,aSz.y);
Im1D_REAL8 aH(aNbH,0.0);
// Load image
{
Symb_FNum aFTif(aTif.in());
ELISE_COPY(aTif.all_pts(),aFTif,anIm.out()| (aH.histo().chc(aFTif)<<1) );
}
Im1D_REAL8 aHSqrt(aNbH,0.0);
ELISE_COPY(aH.all_pts(),sqrt(aH.in()),aHSqrt.out());
int aVMax =0;
// Calcul Histo
MakeFoncRepart(aH,&aVMax);
MakeFoncRepart(aHSqrt);
// Fonc Loc
Fonc_Num aFonc(Rconv(anIm.in_proj()));
Fonc_Num aS1S2 = Virgule(aFonc,Square(aFonc));
for (int aK=0 ; aK< TheNbIter ; aK++)
{
aS1S2 = rect_som(aS1S2,TheNbVois) / ElSquare(1+2*TheNbVois);
}
Symb_FNum aFS1 = aS1S2.v0();
Symb_FNum aFS2 = aS1S2.v1()-Square(aFS1);
Fonc_Num aFLoc = (anIm.in()-aFS1) / sqrt(Max(1.0,aFS2));
// aFLoc = aFLoc * 20;
aFLoc = atan(aFLoc) /(PI/2);
// Symb_FNum aFonc(aTif.in());
std::cout << "MaxMin " << aVMax << "\n";
Fonc_Num aFEg = aH.in()[anIm.in()];
Fonc_Num aFEgS = aHSqrt.in()[anIm.in()];
Fonc_Num aFM = anIm.in() * (255.0 / aVMax);
// Fonc_Num aFRes = (aFEg*aPEg + aFM * aPM + aFEgS*aPSrtEg + aFLoc) / (aPEg + aPM + aPSrtEg);
Symb_FNum aFMoy = (aFEg*aPEg + aFM * aPM + aFEgS*aPSrtEg ) / (aPEg + aPM + aPSrtEg);
Symb_FNum aFMarge = Min(64,Min(aFMoy,255-aFMoy));
Fonc_Num aFRes = aFMoy + aFMarge * aFLoc;
/*
Fonc_Num aFRes = Max(0,Min(255,aFMoy + 60 * aFLoc));
*/
Tiff_Im::Create8BFromFonc(aNameOut,aSz,aFRes);
return EXIT_SUCCESS;
}
示例9: ConputeEnveloppe
void cMMTP::ConputeEnveloppe(const cComputeAndExportEnveloppe & aCAEE,const cXML_ParamNuage3DMaille & aCurNuage)
{
mNameTargetEnv = mAppli.WorkDir() + TheDIRMergeEPI() + mAppli.PDV1()->Name() + "/NuageImProf_LeChantier_Etape_1.xml";
mNameTargetEnv = aCAEE.NuageExport().ValWithDef(mNameTargetEnv);
cXML_ParamNuage3DMaille aTargetNuage = StdGetFromSI(mNameTargetEnv,XML_ParamNuage3DMaille);
mZoomTargetEnv = aTargetNuage.SsResolRef().Val();
mSzTargetEnv = aTargetNuage.NbPixel();
double aZoomRel = mAppli.CurEtape()->DeZoomTer()/mZoomTargetEnv;
mBoxOutEnv._p0 = round_ni(Pt2dr(mBoxOutGlob._p0) * aZoomRel);
mBoxOutEnv._p1 = round_ni(Pt2dr(mBoxOutGlob._p1) * aZoomRel);
mBoxInEnv._p0 = round_ni(Pt2dr(mBoxInGlob._p0) * aZoomRel);
mBoxInEnv._p1 = round_ni(Pt2dr(mBoxInGlob._p1) * aZoomRel);
ELISE_ASSERT(mP0Tiep==Pt2di(0,0),"Too lazy to handle box maping");
double aPasPx = mAppli.CurEtape()->GeomTer().PasPxRel0();
//=============== READ PARAMS ====================
double aStepSsEch = aCAEE.SsEchFilter().Val();
int aSzFiltrer = aCAEE.SzFilter().Val();
double aProp = aCAEE.ParamPropFilter().Val();
int aDistProl = round_up( ElMax(aCAEE.ProlResolCur().Val(),aCAEE.ProlResolCible().Val()/aZoomRel) /aStepSsEch);
double aDistCum = (aCAEE.ProlDistAddMax().Val() / (aPasPx* aZoomRel));
double aDistAdd = (aCAEE.ProlDistAdd().Val()*aStepSsEch ) / (aPasPx);
std::cout << "DIST CUM " << aDistCum << " DADD " << aDistAdd << "\n";
//===================================
ElTimer aChrono;
int aSeuilNbV = 2 * (1+2*aSzFiltrer); // Au moins une bande de 2 pixel pour inferer qqch
Pt2di aSzRed = round_up(Pt2dr(mSzTiep)/aStepSsEch);
Im2D_Bits<1> aMasqRed(aSzRed.x,aSzRed.y,0);
TIm2DBits<1> aTMR(aMasqRed);
/*
TIm2D<INT2,INT> aPMaxRed(aSzRed);
TIm2D<INT2,INT> aPMinRed(aSzRed);
*/
TIm2D<REAL4,REAL> aPMaxRed(aSzRed);
TIm2D<REAL4,REAL> aPMinRed(aSzRed);
// Calcul du filtre de reduction
Pt2di aPRed;
for (aPRed.y = 0 ; aPRed.y<aSzRed.y ; aPRed.y++)
{
for (aPRed.x = 0 ; aPRed.x<aSzRed.x ; aPRed.x++)
{
Pt2di aPR1 = round_ni(Pt2dr(aPRed)*aStepSsEch);
int anX0 = ElMax(0,aPR1.x-aSzFiltrer);
int anX1 = ElMin(mSzTiep.x-1,aPR1.x+aSzFiltrer);
int anY0 = ElMax(0,aPR1.y-aSzFiltrer);
int anY1 = ElMin(mSzTiep.y-1,aPR1.y+aSzFiltrer);
std::vector<REAL> aVVals;
Pt2di aVoisR1;
for (aVoisR1.x=anX0 ; aVoisR1.x<=anX1 ; aVoisR1.x++)
{
for (aVoisR1.y=anY0 ; aVoisR1.y<=anY1 ; aVoisR1.y++)
{
if (mTImMasqInit.get(aVoisR1))
aVVals.push_back( mTCBT.get(aVoisR1));
// aVVals.push_back( mTImProf.get(aVoisR1));
}
}
if (int(aVVals.size()) >= aSeuilNbV)
{
REAL4 aVMax = KthValProp(aVVals,aProp);
REAL4 aVMin = KthValProp(aVVals,1-aProp);
aPMaxRed.oset(aPRed,aVMax);
aPMinRed.oset(aPRed,aVMin);
aTMR.oset(aPRed,1);
ELISE_ASSERT(aVMin<=aVMax,"Mic>Max !!!! in BasicMMTiep");
}
else
{
aPMaxRed.oset(aPRed,-32000);
aPMinRed.oset(aPRed, 32000);
}
}
}
//Tiff_Im::Create8BFromFonc("TDifInit.tif",aSzRed,Max(0,Min(255,Iconv(aPMaxRed._the_im.in()-aPMinRed._the_im.in()))));
Im2D_Bits<1> aNewM(1,1);
Im2D_REAL4 aNewMax = ProlongByCont (aNewM,aMasqRed,aPMaxRed._the_im,aDistProl,aDistAdd,aDistCum);
Im2D_REAL4 aNewMin = ProlongByCont (aNewM,aMasqRed,aPMinRed._the_im,aDistProl,-aDistAdd,aDistCum);
ELISE_COPY(select(aNewM.all_pts(),!aNewM.in()),0,aNewMax.out()|aNewMin.out());
// fChCo = Virgule(FX,FY)/ (aStepSsEch * aZoomRel);
// fMasq = aNewM.in(0)[fChCo];
// fMasqBin = fMasq>0.5;
//.........这里部分代码省略.........
示例10: if
void cEtapeMecComp::OneBasculeMnt
(
Pt2di aP0Sauv,
Pt2di aP1Sauv,
cBasculeRes & aBR,
float ** aDataF,
INT2 ** aDataI,
Pt2di aSzData
)
{
ELISE_ASSERT
(
mIsOptimCont,
"Basculement requiert une optimisation continue "
);
cFileOriMnt anOri;
if (aBR.Explicite().IsInit())
{
anOri = aBR.Explicite().Val();
std::string aNameXML = mAppli.FullDirResult()
+ StdPrefixGen(anOri.NameFileMnt())
+ std::string(".xml");
MakeFileXML(anOri,aNameXML);
}
else if (aBR.ByFileNomChantier().IsInit())
{
std::string aNameFile =
mAppli.WorkDir()
+ aBR.Prefixe()
+ (aBR.NomChantier().Val() ? mAppli.NameChantier() :"")
+ aBR.Postfixe();
anOri = StdGetObjFromFile<cFileOriMnt>
(
aNameFile,
mAppli.NameSpecXML(),
aBR.NameTag().Val(),
"FileOriMnt"
);
}
else
{
ELISE_ASSERT(false,"Internal Error cEtapeMecComp::OneBasculeMnt");
}
// cFileOriMnt * aPtrOri=0;
// cFileOriMnt * aPtrOri=0;
// cFileOriMnt & anOri = aBR.Ori();
// std::cout << "XML MADE \n"; getchar();
const cGeomBasculement3D * aGeomB = 0;
if (anOri.Geometrie() == eGeomMNTEuclid)
{
if (
(mAppli.GeomMNT()==eGeomMNTFaisceauIm1ZTerrain_Px1D)
|| (mAppli.GeomMNT()==eGeomMNTFaisceauIm1ZTerrain_Px2D)
)
{
aGeomB = (mAppli.PDV1()->Geom().GeoTerrainIntrinseque());
}
/*
CE CAS PARTICULIER VIENT DE CE QUE cGeomImage_Faisceau redifinit la methode
Bascule. A ete utilise avec Denis Feurer & Co pour basculer en terrain
les reultat image.
*/
else if (
(mAppli.GeomMNT()==eGeomMNTFaisceauIm1PrCh_Px1D)
|| (mAppli.GeomMNT()==eGeomMNTFaisceauIm1PrCh_Px2D)
)
{
aGeomB = &(mAppli.PDV2()->Geom());
}
else
{
ELISE_ASSERT(false,"Geometrie source non traitee dans le basculement");
}
}
else
{
ELISE_ASSERT(false,"Geometrie destination non traitee dans le basculement");
}
Pt2dr aP0 = mGeomTer.DiscToR2(Pt2di(0,0));
Pt2dr aP1 = mGeomTer.DiscToR2(Pt2di(1,1));
cBasculeMNT aBasc
(
mGeomTer,
aP0,
aP1-aP0,
anOri.OriginePlani(),
anOri.ResolutionPlani(),
aGeomB,
mIsOptimCont,
//.........这里部分代码省略.........
示例11: GrShade_main
int GrShade_main(int argc,char ** argv)
{
std::string aNameIn;
std::string aNameOut;
std::string aNameCol="";
Pt2di aP0Glob(0,0),aSzGlob(0,0);
INT aNbDir = 20;
REAL aFZ = 1.0;
REAL aPdsAnis = 0.95;
INT aBrd = -1;
std::string aTMNt = "real4";
std::string aTShade = "real4";
INT aDequant =0;
INT aVisu = 0;
REAL aHypsoDyn = -1.0;
REAL aHypsoSat = 0.5;
Pt2di aSzMaxDalles (3000,3000);
INT aSzRecDalles = 300;
std::string aModeOmbre="CielVu";
std::string modeOmbre[] = {aModeOmbre,"IgnE","Local","Med","Mixte"};
std::list<std::string> lModeOmbre(modeOmbre, modeOmbre + sizeof(modeOmbre) / sizeof(std::string) );
std::string aFileMasq="";
double aDericheFact=2.0;
int aNbIterF = 4;
double aFactExp = 0.95;
double aDyn = 1.0;
int aNbMed = 100;
int aNbIterMed = 1;
Tiff_Im::SetDefTileFile(1<<15);
std::vector<double> aVPdsFiltre;
std::string aModeColor = "IntensShade";
std::string modeColor[] = {aModeColor,"BackRGB","GrayBackRGB"};
std::list<std::string> lModeColor(modeColor, modeColor + sizeof(modeColor) / sizeof(std::string) );
double aTetaH = 25.0;
double anAzimut = 0.0;
double aDynMed = 1.0;
ElInitArgMain
(
argc,argv,
LArgMain() << EAMC(aNameIn, "File name", eSAM_IsExistFile) ,
LArgMain() << EAM(aNameOut,"Out",true)
<< EAM(aNameCol,"FileCol",true, "Color file", eSAM_IsExistFile)
<< EAM(aVisu,"Visu",true)
<< EAM(aP0Glob,"P0",true)
<< EAM(aSzGlob,"Sz",true)
<< EAM(aFZ,"FZ",true)
<< EAM(aDynMed,"DynMed",true)
<< EAM(aPdsAnis,"Anisotropie",true)
<< EAM(aNbDir,"NbDir",true)
<< EAM(aBrd,"Brd",true)
<< EAM(aTMNt,"TypeMnt",true, "Type", eSAM_None, ListOfVal(GenIm::bits1_msbf, ""))
<< EAM(aTShade,"TypeShade",true, "Type", eSAM_None, ListOfVal(GenIm::bits1_msbf, ""))
<< EAM(aDequant,"Dequant",true)
<< EAM(aHypsoDyn,"HypsoDyn",true)
<< EAM(aHypsoSat,"HypsoSat",true)
<< EAM(aSzMaxDalles,"SzMaxDalles",true)
<< EAM(aSzRecDalles,"SzRecDalles",true)
<< EAM(aModeOmbre,"ModeOmbre",true,"in {CielVu,IgnE,Local,Med,Mixte}",eSAM_None,lModeOmbre)
<< EAM(aFileMasq,"Mask",true, "Mask file", eSAM_IsExistFile)
<< EAM(aDericheFact,"DericheFact",true)
<< EAM(aNbIterF,"NbIterF",true)
<< EAM(aFactExp,"FactExp",true)
<< EAM(aDyn,"Dyn",true)
<< EAM(aVPdsFiltre,"PdsF",true,"[CielVu,Local,Grad,Med]", eSAM_NoInit)
<< EAM(aModeColor,"ModeColor",true,"Color mode", eSAM_None, lModeColor)
<< EAM(aNbMed,"NbMed",true)
<< EAM(aNbIterMed,"NbIterMed",true)
<< EAM(aTetaH,"TetaH",true)
<< EAM(anAzimut,"Azimut",true)
);
if (!MMVisualMode)
{
double aPdsDef = aVPdsFiltre.size() ? 0 : 1;
for (int aK=aVPdsFiltre.size() ; aK<4 ; aK++)
aVPdsFiltre.push_back(aPdsDef);
double aSPdsF = 0;
for (int aK=0 ; aK<4 ; aK++)
aSPdsF += aVPdsFiltre[aK];
for (int aK=0 ; aK<4 ; aK++)
aVPdsFiltre[aK] /= aSPdsF;
std::string aDir,aNameFileIn;
SplitDirAndFile(aDir,aNameFileIn,aNameIn);
bool WithHypso = (aHypsoDyn>0) || (aNameCol != "");
//.........这里部分代码省略.........
示例12: ApplyParralaxCor_main
int ApplyParralaxCor_main(int argc, char ** argv)
{
//std::string aNameIm, aNameIm2, aNameParallax, aNameDEM;
std::string aNameIm, aNameParallax;
std::string aNameOut = "";
//Reading the arguments
ElInitArgMain
(
argc, argv,
LArgMain()
<< EAMC(aNameIm, "Image to be corrected", eSAM_IsPatFile)
//<< EAMC(aNameIm2, "Other image", eSAM_IsPatFile)
<< EAMC(aNameParallax, "Paralax correction file", eSAM_IsPatFile),
//<< EAMC(aNameDEM, "DEM file", eSAM_IsPatFile),
LArgMain()
<< EAM(aNameOut, "Out", true, "Name of output image (Def=ImName_corrected.tif")
);
std::string aDir, aPatIm;
SplitDirAndFile(aDir, aPatIm, aNameIm);
cout << "Correcting " << aNameIm << endl;
if (aNameOut == "")
aNameOut = aNameIm + "_corrected.tif";
//Reading the image and creating the objects to be manipulated
Tiff_Im aTF = Tiff_Im::StdConvGen(aDir + aNameIm, 1, false);
Pt2di aSz = aTF.sz(); cout << "size of image = " << aSz << endl;
Im2D_U_INT1 aIm(aSz.x, aSz.y);
ELISE_COPY
(
aTF.all_pts(),
aTF.in(),
aIm.out()//Virgule(aImR.out(),aImG.out(),aImB.out())
);
U_INT1 ** aData = aIm.data();
//Reading the parallax correction file
Tiff_Im aTFPar = Tiff_Im::StdConvGen(aDir + aNameParallax, 1, false);
Im2D_REAL8 aPar(aSz.x, aSz.y);
ELISE_COPY
(
aTFPar.all_pts(),
aTFPar.in(),
aPar.out()//Virgule(aImR.out(),aImG.out(),aImB.out())
);
REAL8 ** aDatPar = aPar.data();
//Output container
Im2D_U_INT1 aImOut(aSz.x, aSz.y);
U_INT1 ** aDataOut = aImOut.data();
/*Things needed for RPC angle computation, not main goal of this function
//Read RPCs
RPC aRPC;
string aNameRPC1 = "RPC_" + StdPrefix(aNameIm) + ".xml";
aRPC.ReadDimap(aNameRPC1);
cout << "Dimap File " << aNameRPC1 << " read" << endl;
RPC aRPC2;
string aNameRPC2 = "RPC_" + StdPrefix(aNameIm2) + ".xml";
aRPC2.ReadDimap(aNameRPC2);
cout << "Dimap File " << aNameRPC2 << " read" << endl;
//Reading the DEM file
Tiff_Im aTFDEM = Tiff_Im::StdConvGen(aDir + aNameDEM, 1, false);
Im2D_REAL8 aDEM(aSz.x, aSz.y);
ELISE_COPY
(
aTFDEM.all_pts(),
aTFDEM.in(),
aDEM.out()
);
REAL8 ** aDatDEM = aDEM.data();
//Output angle container 1
Im2D_REAL8 aAngleBOut(aSz.x, aSz.y);
REAL8 ** aDataAngleBOut = aAngleBOut.data();
string aNameAngleB = "AngleB.tif";
//Output angle container 2
Im2D_REAL8 aAngleNOut(aSz.x, aSz.y);
REAL8 ** aDataAngleNOut = aAngleNOut.data();
string aNameAngleN = "AngleN.tif";
*/
//Pt3dr PBTest(1500,3000, 0);
//Pt3dr PWTest = aRPC.DirectRPC(PBTest);
//Pt3dr PNTest = aRPC2.InverseRPC(PWTest);
//cout << "PB0 = " << PBTest << endl;
//cout << "PW0 = " << PWTest << endl;
//cout << "PN0 = " << PNTest << endl;
//cout << aRPC.height_scale << " " << aRPC.height_off << endl;
//PBTest.z=1000;
//PWTest = aRPC.DirectRPC(PBTest);
//PNTest = aRPC2.InverseRPC(PWTest);
//cout << "PB1 = " << PBTest << endl;
//.........这里部分代码省略.........
示例13: ElImScroller
BiScroller::BiScroller
(
VideoWin_Visu_ElImScr & aVisu,
ElImScroller * ScrGray,
ElImScroller * ScrCol,
ModeFusion aModeFusion,
Elise_colour * Cols,
INT NbCol,
const std::string & mNameMasq
) :
ElImScroller (aVisu,1,Inf(ScrGray->SzU(),ScrCol?ScrCol->SzU():ScrGray->SzU()),1.0),
mMemGray (1,aVisu.SzW()),
mScrGray ( ScrGray),
mMemCol (1,aVisu.SzW()),
mScrCol (ScrCol),
mModeFusion (aModeFusion),
mVideoVisu (aVisu),
mImGray (mMemGray.Images()[0]),
mDataGray (mImGray.data()),
mImCol (mMemCol.Images()[0]),
mDataCol (mImCol.data()),
mTabRGB (3,NbCol,256),
mDataTabRGB (mTabRGB.data()),
mImR (aVisu.SzW().x,1),
mDataImR (mImR.data()[0]),
mImG (aVisu.SzW().x,1),
mDataImG (mImG.data()[0]),
mImB (aVisu.SzW().x,1),
mDataImB (mImB.data()[0]),
mTr (0.0,0.0),
mIm1Act (true),
mIm2Act (mScrCol!=0),
mImMasq (1,1)
{
mSubScrolls.push_back(mScrGray);
if (mScrCol)
mSubScrolls.push_back(mScrCol);
for (INT iCol = 0; iCol<NbCol ; iCol++)
for (INT iGray=0; iGray < 256; iGray ++)
{
Elise_colour CGray = Elise_colour::gray(iGray/255.0);
Elise_colour CCol = Cols[iCol];
Elise_colour ColMixed = som_pond(CCol,0.3,CGray);
if (iCol == 0)
ColMixed = CGray;
SetRGBEntry(iGray, iCol, ColMixed);
}
if (mNameMasq!="")
{
Tiff_Im aFM = Tiff_Im::UnivConvStd(mNameMasq);
Pt2di aSz = aFM.sz();
mImMasq=Im2D_U_INT1 (aSz.x,aSz.y);
Fonc_Num aFIn = aFM.in();
if (aModeFusion==eModeMasq)
{
aFIn = (aFM.in()!=0);
}
ELISE_COPY(aFM.all_pts(),aFIn,mImMasq.out());
}
/*
REAL DistCible = 60.0;
DistCible /= 255.0;
for (INT iCol = 0; iCol<NbCol ; iCol++)
{
Elise_colour CCol = Cols[iCol];
Elise_colour aGray = Elise_colour::gray(CCol.GrayVal());
REAL dist = ElMax(1e-10,aGray.eucl_dist(CCol));
Elise_colour vAtDit = aGray + (DistCible/dist) * (CCol-aGray);
Elise_colour v0 = vAtDit - Elise_colour::gray(vAtDit.MinRGB());
Elise_colour v1 = vAtDit + Elise_colour::gray(1.0-vAtDit.MaxRGB());
for (INT iGray=0; iGray < 256; iGray ++)
{
REAL GrayLevel = iGray/255.0;
Elise_colour ColMixed = som_pond(v0,1-GrayLevel,v1);
if (iCol == 0)
ColMixed = Elise_colour::gray(GrayLevel);
//.........这里部分代码省略.........
示例14: Luc_main_truc
int Luc_main_truc(int argc, char ** argv)
{
/*
std::string aFullPattern, aOri, aNameOut="PointsCordinates.txt";
//Reading the arguments
ElInitArgMain
(
argc, argv,
LArgMain() << EAMC(aFullPattern, "Images Pattern 1", eSAM_IsPatFile)
<< EAMC(aOri, "Orientation", eSAM_IsPatFile),
LArgMain() << EAM(aNameOut, "Out", true, "Output file (txt)")
);
string aPattern, aNameDir;
SplitDirAndFile(aNameDir, aPattern, aFullPattern);
//Reading input files
list<string> ListIm = RegexListFileMatch(aNameDir, aPattern, 1, false);
int nbIm = ListIm.size();
string oriFileName = aNameDir + aNameOut;
FILE *f = fopen(oriFileName.c_str(), "w");
for (int i = 1; i <= nbIm; i++)
{
//Processing the image
string aNameIm = ListIm.front();
ListIm.pop_front();
string aNameOut = aNameDir + aNameIm + ".tif";
//Loading the camera
string aNameCam = "Ori-" + aOri + "/Orientation-" + aNameIm + ".xml";
cInterfChantierNameManipulateur * anICNM = cInterfChantierNameManipulateur::BasicAlloc(aNameDir);
CamStenope * aCam = CamOrientGenFromFile(aNameCam, anICNM);
cout << aNameIm << " [ " << aCam->VraiOpticalCenter().x << " , " << aCam->VraiOpticalCenter().y << " , " << aCam->VraiOpticalCenter().z << " ]" << endl;
fprintf(f, "%s %0.6f %0.6f %0.6f\n", aNameIm, aCam->VraiOpticalCenter().x, aCam->VraiOpticalCenter().y, aCam->VraiOpticalCenter().z);
}
fclose(f);
*/
std::string aFullPattern1, aFullPattern2, aFile3D1, aFile3D2, aOri, aDirOut = "Visualisation/";
int aSzW = 1;
double aSzMovArea = 5;
//Reading the arguments
ElInitArgMain
(
argc, argv,
LArgMain() << EAMC(aFullPattern1, "Images Pattern 1", eSAM_IsPatFile)
<< EAMC(aFullPattern2, "Images Pattern 2", eSAM_IsPatFile)
<< EAMC(aFile3D1, "File 3D 1", eSAM_IsPatFile)
<< EAMC(aFile3D2, "File 3D 2", eSAM_IsPatFile)
<< EAMC(aOri, "Orientation", eSAM_IsPatFile),
LArgMain() << EAM(aDirOut, "Out", true, "Output folder (end with /) and/or prefix (end with another char)")
<< EAM(aSzMovArea, "SzMovArea", true, "Max magnitude of movement in meters (def=5)")
);
//Creating vector of images
std::string aDir, aPatIm1, aPatIm2;
SplitDirAndFile(aDir, aPatIm1, aFullPattern1);
SplitDirAndFile(aDir, aPatIm2, aFullPattern2);
cInterfChantierNameManipulateur * aICNM = cInterfChantierNameManipulateur::BasicAlloc(aDir);
const std::vector<std::string> * aSetIm1 = aICNM->Get(aPatIm1);
const std::vector<std::string> * aSetIm2 = aICNM->Get(aPatIm2);
std::vector<std::string> aVectIm1 = *aSetIm1;
std::vector<std::string> aVectIm2 = *aSetIm2;
cout << "Set 1 size : " << aVectIm1.size() << endl;
cout << "Set 1 : " << aVectIm1 << endl;
cout << "Set 2 size : " << aVectIm2.size() << endl;
cout << "Set 2 : " << aVectIm2 << endl;
//loading 3D models
cElNuage3DMaille * info3D1 = cElNuage3DMaille::FromFileIm(aFile3D1);
cElNuage3DMaille * info3D2 = cElNuage3DMaille::FromFileIm(aFile3D2);
cout << "Sz geom 1: " << info3D1->SzGeom() << endl;
cout << "Sz geom 2: " << info3D2->SzGeom() << endl;
cout << "Resol geom 1: " << info3D1->ResolSolGlob() << endl;
cout << "Resol geom 2: " << info3D2->ResolSolGlob() << endl;
//Loading images
vector<SpatioTempImage> aGrIm1 = LoadGrpImages(aDir, aPatIm1, aOri);
vector<SpatioTempImage> aGrIm2 = LoadGrpImages(aDir, aPatIm2, aOri);
cout << "Loaded " << aGrIm1.size() << " images for group 1 and " << aGrIm2.size() << " for group 2" << endl;
//Bulding the output file system
ELISE_fp::MkDirRec(aDir + aDirOut);
std::string aNameOut = "banane.tif";
//Reading the image and creating the objects to be manipulated
aNameOut = aDir + aDirOut + aNameOut;
Pt2di aSz( info3D1->SzGeom().x , info3D1->SzGeom().y );
Tiff_Im aTF = Tiff_Im(aNameOut.c_str(), aSz, GenIm::real4, Tiff_Im::No_Compr, Tiff_Im::BlackIsZero);
Im2D_REAL4 aIm(aSz.x, aSz.y);
//.........这里部分代码省略.........