Skip to content

Commit

Permalink
CodedTargetSimul: ray => radius
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmuller committed Oct 21, 2024
1 parent a0e20ca commit aa60309
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
22 changes: 11 additions & 11 deletions MMVII/src/CodedTarget/CodedTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class cResSimul

double BorderGlob() const ;
std::string mCom; ///< Command used to create the file
cPt2dr mRayMinMax;
cPt2dr mRadiusMinMax;
double mBorder;
double mRatioMax;
std::vector<cGeomSimDCT> mVG;
Expand Down Expand Up @@ -315,19 +315,19 @@ class cParamCodedTarget : public cMemCheck
bool mAntiClockWiseBit; ///< Do growin bits go in trigonometric sens (! visuel repair is clokwise)


double mRayOrientTablet;
double mRadiusOrientTablet;
tPt2dr mCenterOrientTablet;
double mRayCenterMiniTarget;
double mRadiusCenterMiniTarget;

bool mModeFlight; // Special mode for Patricio
bool mCBAtTop; // mean Check board at top (initial drone)
// bool mCodeCirc; // Special mode for Patricio
double mRho_0_EndCCB;// End of Central CB , here Rho=ThickN ...
double mRho_1_BeginCode;// ray where begins the coding stuff
double mRho_2_EndCode;// ray where begins the coding stuff
double mRho_3_BeginCar;// ray where begins the coding stuff
double mRho_4_EndCar; // ray where begins the coding stuff
double mRho_EndIm; // ray where begins the coding stuff
double mRho_1_BeginCode;// radius where begins the coding stuff
double mRho_2_EndCode;// radius where begins the coding stuff
double mRho_3_BeginCar;// radius where begins the coding stuff
double mRho_4_EndCar; // radius where begins the coding stuff
double mRho_EndIm; // radius where begins the coding stuff
double mSignAngle;

cPt2di mSzBin;
Expand Down Expand Up @@ -392,9 +392,9 @@ class cFullSpecifTarget : public cMemCheck
const std::string & Prefix() const; ///< Prefix used in name-generation
size_t MinHammingD() const; ///< Number of bits
tREAL8 Rho_0_EndCCB() const; /// End of Central Checkboard
tREAL8 Rho_1_BeginCode() const; /// ray where begins the coding stuff
tREAL8 Rho_2_EndCode() const; /// ray where ends the coding stuff
tREAL8 Rho_3_BeginCar() const; /// ray where ends margin after coding (and possibly carac)
tREAL8 Rho_1_BeginCode() const; /// radius where begins the coding stuff
tREAL8 Rho_2_EndCode() const; /// radius where ends the coding stuff
tREAL8 Rho_3_BeginCar() const; /// radius where ends margin after coding (and possibly carac)


bool BitIs1(bool IsWhite) const;
Expand Down
20 changes: 10 additions & 10 deletions MMVII/src/CodedTarget/cGenerateTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ void cParamCodedTarget::AddData(const cAuxAr2007 & anAuxParam)
MMVII::AddData(cAuxAr2007("ZeroIsBackGround",anAux),mZeroIsBackGround);
MMVII::AddData(cAuxAr2007("AntiClockWiseBit",anAux),mAntiClockWiseBit);

MMVII::AddData(cAuxAr2007("RayOrientTablet",anAux),mRayOrientTablet);
MMVII::AddData(cAuxAr2007("RayOrientTablet",anAux),mRadiusOrientTablet);
MMVII::AddData(cAuxAr2007("CenterOrientTablet",anAux),mCenterOrientTablet);
MMVII::AddData(cAuxAr2007("RayCenterMiniTarget",anAux),mRayCenterMiniTarget);
MMVII::AddData(cAuxAr2007("RayCenterMiniTarget",anAux),mRadiusCenterMiniTarget);

if (anAux.Input())
Finish();
Expand Down Expand Up @@ -221,9 +221,9 @@ cParamCodedTarget::cParamCodedTarget(int aNbPixBin) :
mWhiteBackGround (true),
mZeroIsBackGround (true),
mAntiClockWiseBit (true),
mRayOrientTablet (-1),
mRadiusOrientTablet (-1),
mCenterOrientTablet (0,0),
mRayCenterMiniTarget (-1),
mRadiusCenterMiniTarget (-1),
mModeFlight (false), // MPD => def value was not initialized ?
mCBAtTop (false),//
mDecP ({1,1}) // "Fake" init 4 now
Expand Down Expand Up @@ -253,7 +253,7 @@ void cParamCodedTarget::FinishInitOfSpec(const cSpecBitEncoding & aSpec)
anAppli.SetIfNotInit(mThickN_Car,0.3);
anAppli.SetIfNotInit(mChessboardAng,-M_PI/4.0);

anAppli.SetIfNotInit(mRayOrientTablet,0.1);
anAppli.SetIfNotInit(mRadiusOrientTablet,0.1);
anAppli.SetIfNotInit(mCenterOrientTablet,cPt2dr(0.7,0));
}
else if (aSpec.mType==eTyCodeTarget::eCERN)
Expand Down Expand Up @@ -668,10 +668,10 @@ cCodedTargetPatternIm::cCodedTargetPatternIm(cFullSpecifTarget & aSpec) :
mTeta0 (mRender.mChessboardAng),
mRhoC (mRender.mRho_0_EndCCB),
mRho2C (Square(mRhoC)),
mWOriTab (mRender.mRayOrientTablet >0),
mRayOT (mRender.mRayOrientTablet),
mWOriTab (mRender.mRadiusOrientTablet >0),
mRayOT (mRender.mRadiusOrientTablet),
mCenterOT (mRender.mCenterOrientTablet * FromPolar(1.0,(M_PI/4.0+mTeta0))),
mRayCT (mRender.mRayCenterMiniTarget),
mRayCT (mRender.mRadiusCenterMiniTarget),
mRay2CT (Square(mRayCT))
{
mDIC.InitCste(tElem(eLPT::eBackGround));
Expand Down Expand Up @@ -1078,7 +1078,7 @@ cCollecSpecArg2007 & cAppliGenCodedTarget::ArgOpt(cCollecSpecArg2007 & anArgOpt)
{
return anArgOpt
<< AOpt2007(mPatternDoImage,"PatIm","Pattern for generating image (def no generation)")
<< AOpt2007(mPCT.mRayCenterMiniTarget,"RayMCT","Rayon \"mini\" center target (for topo)",{eTA2007::HDV})
<< AOpt2007(mPCT.mRadiusCenterMiniTarget,"RayMCT","Rayon \"mini\" center target (for topo)",{eTA2007::HDV})
// << AOpt2007(mPCT.mNbBit,"NbBit","Nb Bit printed",{eTA2007::HDV})
// << AOpt2007(mPCT.mWithParity,"WPar","With parity bit",{eTA2007::HDV})
<< AOpt2007(mPCT.mThickN_WInt,"ThW0","Thickness of interior white circle",{eTA2007::HDV})
Expand All @@ -1089,7 +1089,7 @@ cCollecSpecArg2007 & cAppliGenCodedTarget::ArgOpt(cCollecSpecArg2007 & anArgOpt)
<< AOpt2007(mPCT.mChessboardAng,"Theta","Origin angle of chessboard pattern ",{eTA2007::HDV})
<< AOpt2007(mPCT.mWhiteBackGround,"WhiteBG","White back ground")
<< AOpt2007(mPCT.mModeFlight,"ModeFlight","Special mode for Patricio ",{eTA2007::HDV})
<< AOpt2007(mPCT.mRayOrientTablet,"SzOrFig","Size of \"diamond\" for orientation")
<< AOpt2007(mPCT.mRadiusOrientTablet,"SzOrFig","Size of \"diamond\" for orientation")
<< AOpt2007(mDoMarkC,"MarkC","Mark center of bits, just for verif ",{eTA2007::HDV,eTA2007::Tuning})
<< AOpt2007(mZoomShow,"ZoomShow","Zoom to generate a high resolution check images",{eTA2007::Tuning})
<< AOpt2007(mNbPixBin,"NbPixBin","Size of binary image when printing",{eTA2007::HDV})
Expand Down
18 changes: 9 additions & 9 deletions MMVII/src/CodedTarget/cSimulTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,23 @@ void AddData(const cAuxAr2007 & anAux,cGeomSimDCT & aGSD)
/* *********************************************************** */

cResSimul::cResSimul() :
mRayMinMax (15.0,60.0),
mRadiusMinMax (15.0,60.0),
mBorder (1.0),
mRatioMax (3.0)
{
}

double cResSimul::BorderGlob() const
{
return mBorder * mRayMinMax.y();
return mBorder * mRadiusMinMax.y();
}

void AddData(const cAuxAr2007 & anAux,cResSimul & aRS)
{
// Modif MPD, know that commande are quoted, they cannot be used as tag => "MMVII "toto" "b=3" " => PB!!
// MMVII::AddData(cAuxAr2007("Com",anAux),aRS.mCom);
anAux.Ar().AddComment(aRS.mCom);
MMVII::AddData(cAuxAr2007("RayMinMax",anAux),aRS.mRayMinMax);
MMVII::AddData(cAuxAr2007("RadiusMinMax",anAux),aRS.mRadiusMinMax);
MMVII::AddData(cAuxAr2007("RatioMax",anAux),aRS.mRatioMax);
MMVII::AddData(cAuxAr2007("Geoms",anAux),aRS.mVG);
}
Expand Down Expand Up @@ -128,7 +128,7 @@ class cAppliSimulCodeTarget : public cMMVII_Appli
void IncrustTarget(cGeomSimDCT & aGSD);

/// return a random value in the specified interval
double RandomRay() const;
double RandomRadius() const;


cPhotogrammetricProject mPhProj;
Expand Down Expand Up @@ -194,7 +194,7 @@ cCollecSpecArg2007 & cAppliSimulCodeTarget::ArgOpt(cCollecSpecArg2007 & anArgOpt
return
anArgOpt
<< mPhProj.DPPointsMeasures().ArgDirOutOptWithDef("Simul")
<< AOpt2007(mRS.mRayMinMax,"Rays","Min/Max ray for gen target",{eTA2007::HDV})
<< AOpt2007(mRS.mRadiusMinMax,"Radius","Min/Max radius for gen target",{eTA2007::HDV})
<< AOpt2007(mPatternNames,"PatNames","Pattern for selection of names",{eTA2007::HDV})
<< AOpt2007(mSzKernel,"SzK","Sz of Kernel for interpol",{eTA2007::HDV})
<< AOpt2007(mRS.mBorder,"Border","Border w/o target, prop to R Max",{eTA2007::HDV})
Expand All @@ -206,7 +206,7 @@ cCollecSpecArg2007 & cAppliSimulCodeTarget::ArgOpt(cCollecSpecArg2007 & anArgOpt
;
}

double cAppliSimulCodeTarget::RandomRay() const { return RandInInterval(mRS.mRayMinMax.x(),mRS.mRayMinMax.y());}
double cAppliSimulCodeTarget::RandomRadius() const { return RandInInterval(mRS.mRadiusMinMax.x(),mRS.mRadiusMinMax.y());}



Expand All @@ -217,9 +217,9 @@ void cAppliSimulCodeTarget::AddPosTarget(const cOneEncoding & anEncod)
for (int aK=0 ; aK< 200 ; aK++)
{
cPt2dr aC = aBoxGenerate.GeneratePointInside(); // generat a random point inside the box
// Compute two random ray in the given interval
double aR1 = RandomRay() ;
double aR2 = RandomRay() ;
// Compute two random radii in the given interval
double aR1 = RandomRadius() ;
double aR2 = RandomRadius() ;
OrderMinMax(aR1,aR2); // assure aR1 <= aR2

// assure that R2/R1 <= RatioMax
Expand Down

0 comments on commit aa60309

Please sign in to comment.