Skip to content

Commit

Permalink
Update Circ-Code-Target example, doc and commands with new GCP handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmuller committed Jan 27, 2025
1 parent b2e8212 commit bbb33ac
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 26 deletions.
12 changes: 6 additions & 6 deletions MMVII/Doc/Tutorial/UseCase01.tex
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ \subsection{Estimate pose with known calibration}


\begin{lstlisting}
MMVII OriBundleAdj ".*_Scaled.tif" Resec BA GCPW=[1,1] DataDir=Test
MMVII OriBundleAdj ".*_Scaled.tif" Resec BA GCP2D=[[Test,1]] GCP3D=[[Test,1]]
\end{lstlisting}

% ------------------------------------------------------------------
Expand All @@ -613,14 +613,14 @@ \subsection{Complete the target}
validate the uncoded targets :

\begin{lstlisting}
MMVII CodedTargetCompleteUncoded .*_Scaled.tif BA 1.0 InObjMesInstr=Test
MMVII CodedTargetCompleteUncoded .*_Scaled.tif BA 1.0 InObjMesInstr=Test InObjCoordWorld=Test
\end{lstlisting}

All the measure are stored in the folder {\tt Completed} (by default). We can make a
bundle adjustment with these new measures :

\begin{lstlisting}
MMVII OriBundleAdj ".*_Scaled.tif" BA BA2 GCPW=[1,1] DataDir=Completed
MMVII OriBundleAdj ".*_Scaled.tif" BA BA2 GCP2D=[[Completed,1]] GCP3D=[[Test,1]]
\end{lstlisting}


Expand Down Expand Up @@ -781,16 +781,16 @@ \subsection{OriBundleAdj}
Then, you can compute the Boresight matrixes with {\tt OriBundleAdj}. You need to complete the parameter ClinoDirIn to compute the clinometers calibration

\begin{lstlisting}
MMVII OriBundleAdj AllImClino.xml BA_Br BA_Clino GCPDir=Clino_Filtered GCPW=[1,0.1] PPFzCal=.* ClinoDirIn=INIT_CLINO ClinoDirOut=CALIB_CLINO InMeasureClino=clinoMeasures
MMVII OriBundleAdj AllImClino.xml BA_Br BA_Clino GCP2D=[[Clino_Filtered,0.1]] GCP3D=[[Clino_Filtered,1]] PPFzCal=.* ClinoDirIn=INIT_CLINO ClinoDirOut=CALIB_CLINO InMeasureClino=clinoMeasures
\end{lstlisting}

Parameters of {\tt ClinoInit} are :
\begin{itemize}
\item AllImClino.xml : name of images
\item BA$\_$Br : orientation of camera
\item BA$\_$Clino : orientation of camera after the bundle adjustment
\item GCPDir=Clino$\_$Filtered : directory for GCP
\item GCPW=[1,0.1] : GCP weights
\item GCP2D: Clino$\_$Filtered is the directory for image measurements of GCPs, with a weight factor of 0.1
\item GCP3D: Clino$\_$Filtered is the directory for world coordinates of GCPs, with a weight factor of 1
\item PPFzCal=.* : freeze internal calibration
\item ClinoDirIn=INIT$\_$CLINO : approximation of the two Boresight matrixes computed with {\tt ClinoInit}
\item ClinoDirOut=CALIB$\_$CLINO : name of directory where clinometers calibrations will be saved
Expand Down
14 changes: 7 additions & 7 deletions MMVII/MMVII-UseCaseDataSet/Circ-Code-Target/InfoNew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ MMVII OriCreateCalib ".*tif" CalibInit

REM Import GCP , we fix a coordinate system "Pannel", purely local, mainly for documentation
MMVII ImportGCP Data-Aux/Positions-3D-14bit_lookup.txt NXYZBla Test NbDigName=3 ChSys=[LocalPannel]
MMVII CodedTargetCircExtract ".*_Scaled.tif" CERN_Nbb14_Freq14_Hamm1_Run1000_1000_FullSpecif.xml DiamMin=8 OutPointsMeasure=Test
MMVII CodedTargetCircExtract ".*_Scaled.tif" CERN_Nbb14_Freq14_Hamm1_Run1000_1000_FullSpecif.xml DiamMin=8 OutObjMesInstr=Test

REM pose estimation init : resection + bundle
MMVII OriPoseEstimSpaceResection .*tif Test CalibInit Resec ThrRej=10 DirFiltered=Filt
MMVII OriBundleAdj .*tif Resec BA GCPW=[1,1] GCPDir=Filt
MMVII OriPoseEstimSpaceResection .*tif Test Test CalibInit Resec ThrRej=10 DirFiltered=Filt
MMVII OriBundleAdj .*tif Resec BA GCP2D=[[Filt,1]] GCP3D=[[Test,1]]

REM research uncoded target + new bundle
MMVII CodedTargetCompleteUncoded .*_Scaled.tif BA 1.0 InPointsMeasure=Test ThRay=[1.05,4.7,5.3]
MMVII OriBundleAdj .*tif BA BA2 GCPW=[1,1,1,5] GCPDir=Completed/
MMVII CodedTargetCompleteUncoded .*_Scaled.tif BA 1.0 InObjMesInstr=Test InObjCoordWorld=Test ThRay=[1.05,4.7,5.3]
MMVII OriBundleAdj .*tif BA BA2 GCP2D=[[Completed,1,1,5]] GCP3D=[[Test,1]]

REM Generate a report on GCP quality
MMVII ReportGCP .*tif Completed BA2
MMVII ReportGCP .*tif Test Completed BA2

REM compute an initial value of the block
MMVII BlockCamInit .*tif BA2 "(.*)_(.*)_Scaled.tif" [1,2] "[(.*)@(.*),$1_$2_Scaled.tif,@]" Rig

REM make a compensation with rigid block
MMVII OriBundleAdj .*tif BA2 BA3 GCPW=[1,1,1,5] GCPDir=Completed/ BRDirIn=Rig BRW=[1e-2,1e-5]
MMVII OriBundleAdj .*tif BA2 BA3 GCP2D=[[Completed,1,1,5]] GCP3D=[[Test,1]] BRDirIn=Rig BRW=[1e-2,1e-5]



15 changes: 8 additions & 7 deletions MMVII/MMVII-UseCaseDataSet/Circ-Code-Target/InfoNew.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
set -e
set -x
# GENERATE TARGET SPECIFICATION
MMVII CodedTargetGenerateEncoding CERN 14
MMVII CodedTargetGenerate CERN_Nbb14_Freq14_Hamm1_Run1000_1000_SpecEncoding.xml
Expand All @@ -15,24 +16,24 @@ MMVII OriCreateCalib ".*tif" CalibInit
# Import GCP , we fix a coordinate system "Pannel", purely local, mainly for documentation
#
MMVII ImportGCP Data-Aux/Positions-3D-14bit_lookup.txt NXYZBla Test NbDigName=3 ChSys=[LocalPannel]
MMVII CodedTargetCircExtract ".*_Scaled.tif" CERN_Nbb14_Freq14_Hamm1_Run1000_1000_FullSpecif.xml DiamMin=8 OutPointsMeasure=Test
MMVII CodedTargetCircExtract ".*_Scaled.tif" CERN_Nbb14_Freq14_Hamm1_Run1000_1000_FullSpecif.xml DiamMin=8 OutObjMesInstr=Test

# pose estimation init : resection + bundle
MMVII OriPoseEstimSpaceResection .*tif Test CalibInit Resec ThrRej=10 DirFiltered=Filt
MMVII OriBundleAdj .*tif Resec BA GCPW=[1,1] GCPDir=Filt
MMVII OriPoseEstimSpaceResection .*tif Test Test CalibInit Resec ThrRej=10 DirFiltered=Filt
MMVII OriBundleAdj .*tif Resec BA GCP2D=[[Filt,1]] GCP3D=[[Test,1]]

# research uncoded target + new bundle
MMVII CodedTargetCompleteUncoded .*_Scaled.tif BA 1.0 InPointsMeasure=Test ThRay=[1.05,4.7,5.3]
MMVII OriBundleAdj .*tif BA BA2 GCPW=[1,1,1,5] GCPDir=Completed/
MMVII CodedTargetCompleteUncoded .*_Scaled.tif BA 1.0 InObjMesInstr=Test InObjCoordWorld=Test ThRay=[1.05,4.7,5.3]
MMVII OriBundleAdj .*tif BA BA2 GCP2D=[[Completed,1,1,5]] GCP3D=[[Test,1]]

# Generate a report on GCP quality
MMVII ReportGCP .*tif Completed BA2
MMVII ReportGCP .*tif Test Completed BA2

# compute an initial value of the block
MMVII BlockCamInit .*tif BA2 "(.*)_(.*)_Scaled.tif" [1,2] '[(.*)@(.*),$1_$2_Scaled.tif,@]' Rig

# make a compensation with rigid block
MMVII OriBundleAdj .*tif BA2 BA3 GCPW=[1,1,1,5] GCPDir=Completed/ BRDirIn=Rig BRW=[1e-2,1e-5]
MMVII OriBundleAdj .*tif BA2 BA3 GCP2D=[[Completed,1,1,5]] GCP3D=[[Test,1]] BRDirIn=Rig BRW=[1e-2,1e-5]



7 changes: 1 addition & 6 deletions MMVII/src/CodedTarget/cCompleteUncodeTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ cCollecSpecArg2007 & cAppliCompletUncodedTarget::ArgOpt(cCollecSpecArg2007 & anA
{
return
anArgOpt
<< mPhProj.DPGndPt3D().ArgDirInputOptWithDef("Std")
<< mPhProj.DPGndPt2D().ArgDirInputOptWithDef("Std")
<< mPhProj.DPGndPt2D().ArgDirOutOptWithDef("Completed")
<< AOpt2007(mThreshRay,"ThRay","Threshold for ray [RatioMax,RMin,RMax]",{{eTA2007::ISizeV,"[3,3]"}})
Expand Down Expand Up @@ -238,12 +239,6 @@ int cAppliCompletUncodedTarget::Exe()


mPhProj.SaveMeasureIm(mImageM);
// Save GCP because they will probaly be re-used, but do it only once at first call, else risk of simultaneaous writting
if (KthCall()==0)
{
//mPhProj.SaveGCP(mMesImGCP,"");
mPhProj.CpGCP();
}

aNameE = cSaveExtrEllipe::NameFile(mPhProj,mMesImGCP.MesImInitOfName(mNameIm),false);
SaveInFile(mVSEE,aNameE);
Expand Down
1 change: 1 addition & 0 deletions MMVII/src/OrientReport/GCPQuality.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,7 @@ int cAppli_CGPReport::Exe()

mPhProj.DPGndPt3D().CheckDirExists(true, true);
mPhProj.DPGndPt2D().CheckDirExists(true, true);
mPhProj.DPOrient().CheckDirExists(true, true);

auto nameSubDir = mPhProj.DPOrient().DirIn() + "_Mes-"+ mPhProj.DPGndPt3D().DirIn()
+ "-"+ mPhProj.DPGndPt2D().DirIn();
Expand Down

0 comments on commit bbb33ac

Please sign in to comment.