Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/micmacIGN/micmac
Browse files Browse the repository at this point in the history
  • Loading branch information
deseilligny committed Nov 28, 2024
2 parents df39a72 + 1f6f466 commit ecb68f3
Show file tree
Hide file tree
Showing 9 changed files with 1,616 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_mmvii.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ jobs:
# dll for GDAL (CGDAL require PROJ too)
cp blosc.dll cfitsio.dll charset.dll comerr64.dll freetype.dll freexl.dll gdal.dll geos.dll geos_c.dll geotiff.dll gssapi64.dll ${MMVII_BINDIR}/
cp hdf.dll hdf5.dll hdf5_cpp.dll hdf5_hl.dll ${MMVII_BINDIR}/
cp iconv.dll k5sprt64.dll krb5_64.dll lcms2.dll libbz2.dll libexpat.dll libkea.dll liblz4.dll libminizip.dll libpng16.dll ${MMVII_BINDIR}/
cp iconv.dll k5sprt64.dll krb5_64.dll lcms2.dll libbz2.dll libexpat.dll libjpeg.dll libkea.dll liblz4.dll libminizip.dll libpng16.dll ${MMVII_BINDIR}/
cp libpq.dll libsharpyuv.dll libssl-3-x64.dll libwebp.dll libxml2.dll ${MMVII_BINDIR}/
cp mfhdf.dll netcdf.dll openjp2.dll pcre2-8.dll poppler.dll spatialite.dll tiledb.dll xdr.dll xerces-c_3_2.dll zip.dll ${MMVII_BINDIR}/
Expand Down
31 changes: 16 additions & 15 deletions MMVII/src/Bench/BenchGlob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,20 +366,6 @@ cAppli_MMVII_Bench::cAppli_MMVII_Bench (const std::vector<std::string> & aVArgs,
mNumBugRecall (-1),
mDoBUSD (false)
{
if (The_MMVII_DebugLevel < The_MMVII_DebugLevel_InternalError_tiny)
{
StdOut() << "WARNN MMVII Bench requires highest level of debug " << std::endl ; getchar();
}
else
{
/*
MMVII_INTERNAL_ASSERT_always
(
The_MMVII_DebugLevel >= The_MMVII_DebugLevel_InternalError_tiny,
"MMVII Bench requires highest level of debug"
);
*/
}
}


Expand All @@ -394,7 +380,22 @@ cAppliBenchAnswer cAppli_MMVII_Bench::BenchAnswer() const

int cAppli_MMVII_Bench::Exe()
{
if (!IsInit(&mShow))
if (The_MMVII_DebugLevel < The_MMVII_DebugLevel_InternalError_tiny)
{
StdOut() << "WARNN MMVII Bench requires highest level of debug " << std::endl ;
}
else
{
/*
MMVII_INTERNAL_ASSERT_always
(
The_MMVII_DebugLevel >= The_MMVII_DebugLevel_InternalError_tiny,
"MMVII Bench requires highest level of debug"
);
*/
}

if (!IsInit(&mShow))
mShow = IsInit(&mPat); // Becoz, if mPat init, few bench => we can display msg

cParamExeBench aParam(mPat,mKeyBug,mLevMin,mShow);
Expand Down
1 change: 0 additions & 1 deletion MMVII/src/BundleAdjustment/cAppliBundAdj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ int cAppliBundlAdj::Exe()
mPhProj.DPPointsMeasures().SetDirInIfNoInit(mDataDir);
mPhProj.DPMulTieP().SetDirInIfNoInit(mDataDir);
mPhProj.DPRigBloc().SetDirInIfNoInit(mDataDir); // RIGIDBLOC
mPhProj.DPClinoMeters().SetDirInIfNoInit(mDataDir); // CLINOBLOC

mPhProj.FinishInit();

Expand Down
4 changes: 2 additions & 2 deletions MMVII/src/CodedTarget/CodedTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class cGeomSimDCT
/// defaut constructor usefull for serialization
cGeomSimDCT();
/// constructor used afetr randoming generating parameters
cGeomSimDCT(const cOneEncoding & anEncod,const cPt2dr& aC,const double& aR1,const double& aR2);
cGeomSimDCT(const cOneEncoding & anEncod,const cPt2dr& aC,const double& aR1,const double& aR2, const std::string & aName);
/// Do to simulated target intersect, used to avoid overlapping target in images
bool Intersect(const cGeomSimDCT & aG2) const ;

Expand All @@ -148,7 +148,7 @@ class cGeomSimDCT
cPt2dr mCornEl2; ///< Theoreticall corner 2 of ellipse
double mR1; ///< "small" size of deformaed rectangle
double mR2; ///< "big " size ....
// std::string mName;
std::string mName;
};
/// method for serializing cGeomSimDCT
void AddData(const cAuxAr2007 & anAux,cGeomSimDCT & aGSD);
Expand Down
17 changes: 13 additions & 4 deletions MMVII/src/CodedTarget/cSimulTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ void cGeomSimDCT::Translate(const cPt2dr & aTr)
}


cGeomSimDCT::cGeomSimDCT(const cOneEncoding & anEncod,const cPt2dr& aC,const double& aR1,const double& aR2):
cGeomSimDCT::cGeomSimDCT(const cOneEncoding & anEncod, const cPt2dr& aC, const double& aR1, const double& aR2, const std::string &aName):
mResExtr (nullptr),
mEncod (anEncod),
// mNum (aNum),
mC (aC),
mR1 (aR1),
mR2 (aR2)
mR2 (aR2),
mName(aName)
{
}

Expand Down Expand Up @@ -215,7 +216,7 @@ void cAppliSimulCodeTarget::AddPosTarget(const cOneEncoding & anEncod)
double aRsmall = aRbig*RandInInterval(mRS.mRatioMinMax);

// check if there is already a selected target overlaping
cGeomSimDCT aGSD(anEncod,aC,aRsmall,aRbig);
cGeomSimDCT aGSD(anEncod,aC,aRsmall,aRbig,anEncod.Name());
bool GotClose = false;
for (const auto& aG2 : mRS.mVG)
GotClose = GotClose || aG2.Intersect(aGSD);
Expand All @@ -230,6 +231,9 @@ void cAppliSimulCodeTarget::AddPosTarget(const cOneEncoding & anEncod)

void cAppliSimulCodeTarget::IncrustTarget(cGeomSimDCT & aGSD)
{
// We want that random is different for each image, but deterministic, independent of number of pixel noise drawn
cRandGenerator::TheOne()->setSeed(HashValue(mNameIm+"*"+aGSD.mName,true));

// [1] -- Load and scale image of target
tIm aImT = Convert((tElem*)nullptr,mSpec->OneImTarget(aGSD.mEncod).DIm());
aImT = aImT.GaussDeZoom(mDownScale,5);
Expand Down Expand Up @@ -369,11 +373,16 @@ int cAppliSimulCodeTarget::Exe()
{
if (MatchRegex(anEncod.Name(),mPatternNames))
{
// We want that random is different for each image, but deterministic for one given image
cRandGenerator::TheOne()->setSeed(HashValue(mNameIm+"/"+anEncod.Name(),true));
AddPosTarget(anEncod);
StdOut() << "Target " << anEncod.Name() << " " << mRS.mVG.back().mC << std::endl;
//StdOut() << "Target " << anEncod.Name() << " " << mRS.mVG.back().mC << std::endl;
}
}

if (!mRS.mVG.empty())
StdOut() << "1st target " << mRS.mVG[0].mName << " " << mRS.mVG[0].mC << std::endl;

for (auto & aG : mRS.mVG)
{
IncrustTarget(aG);
Expand Down
32 changes: 2 additions & 30 deletions MMVII/src/ImagesBase/FileImages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#include <gdal_priv.h>

#include "MMVII_Sys.h" //FIXME CM: Used by Convert_JPG. Delete when Convert_JPG refactored
//#ifdef MMVII_KEEP_MMV1_IMAGE //FIXME CM: Used by code at end of this file. Remove comment when refactored
#ifdef MMVII_KEEP_MMV1_IMAGE
# include "V1VII.h"
//#endif
#endif

using namespace MMVII;

Expand Down Expand Up @@ -842,34 +842,6 @@ double DifAbsInVal(const std::string & aN1,const std::string & aN2,double aDef)
}


// FIXME CM: rewrite ImageOfString_10x8, ImageOfString_DCT from MMV1
template <const int aNbBit> cIm2D<tU_INT1> BitsV1ToV2(const Im2D_Bits<aNbBit> & aImV1)
{
cIm2D<tU_INT1> aImV2(ToMMVII(aImV1.sz()));
cDataIm2D<tU_INT1>& aDImV2 = aImV2.DIm();

for (const auto & aPixV2 : aDImV2)
{
aDImV2.SetV(aPixV2,aImV1.GetI(ToMMV1(aPixV2)));
}


return aImV2;
}


cIm2D<tU_INT1> ImageOfString_10x8(const std::string & aStr ,int aSpace)
{
Im2D_Bits<1> aImV1 = cElBitmFont::BasicFont_10x8().BasicImageString(aStr,aSpace);
return BitsV1ToV2(aImV1);
}

cIm2D<tU_INT1> ImageOfString_DCT(const std::string & aStr ,int aSpace)
{
Im2D_Bits<1> aImV1 = cElBitmFont::FontCodedTarget().BasicImageString(aStr,aSpace);
return BitsV1ToV2(aImV1);
}


// FIXME CM: Rewrite Convert_JPG with special API from cDataFileIm2D / CDataIm2D.toFile()
void Convert_JPG(const std::string & aNameIm,bool DeleteAfter,tREAL8 aQuality,const std::string & aPost)
Expand Down
Loading

0 comments on commit ecb68f3

Please sign in to comment.