Commit 191cd12a authored by sarthou's avatar sarthou
Browse files

Ready for switching the code to double precisin

parent b775485d
......@@ -30,6 +30,7 @@ void ISRandom::Search(InpaintingDataSource * const iDataProvider, bool const has
double propTime = 0, randTime = 0;
int propCount = 0, randCount = 0;
for(int i = 0; i < searchIterations; ++i){
// TODO In matlab code, it is opposed, maybe worth it to test if it differs ? (but there's no hope)
bool goForward = (i & 1) != 0;
sectionClock = std::chrono::steady_clock::now();
......@@ -115,7 +116,7 @@ int ISRandom::RandomSearch(InpaintingDataSource * const iDataProvider, bool cons
int wTemp = wValues[ii];
// X Values // TODO The 2 comes from the half patch size...
// X Values // TODO The 2 comes from the half patch size (floor)...
int randMinX = std::max(xTemp - wTemp, 2);
int randMaxX = std::min(xTemp + wTemp, levelDim->GetSizeX() - 2 - 1);
......@@ -131,16 +132,6 @@ int ISRandom::RandomSearch(InpaintingDataSource * const iDataProvider, bool cons
int randDispY = (randMaxY == randMinY ? randMaxY : rand()%(randMaxY - randMinY + 1) + randMinY);
int randDispZ = (randMaxZ == randMinZ ? randMaxZ : rand()%(randMaxZ - randMinZ + 1) + randMinZ);
// std::ofstream fichier("rand_out.txt", std::ios::app);
// if(fichier)
// {
// fichier << "(" << randDispX << ":" << randDispY << ':' << randDispZ << ")" << std::endl;
//
// fichier.close();
// }
// else
// std::cerr << "Impossible d'ouvrir le fichier !" << std::endl;
if(CheckForBetterDisplacement(iDataProvider, levelDim, hasInvalidPixels,
matIt.GetPosition(),
matIt.GetCurX(), randDispX - matIt.GetCurX(),
......@@ -286,4 +277,17 @@ void ISRandom::InitialiseDisplacementField(InpaintingDataSource * const iDataPro
volIt.GetCurX(), volIt.GetCurY(), volIt.GetCurZ(),
xDispT, yDispT, zDispT);
}while(volIt.Next());
}
}
/*Problème noté:
- Valeur du statut renvoyé dans les cas occlus/pas occlus,
- HalfPatchSize à 3 au lieu de 2 (ceil) => Corrigé
- Inverse bool in Search (bof)
*/
/*Float à modifier:
- Initialize displacement sur DispA (appel à evaluate) => template
- EvaluateDisplacement à recoder
- Check for better displacement à recoder avec template
- LoadRGBMatrixFromVideo in Double (template ? )
- Rajouter template double dans PaddedMatrix pour pouvoir utiliser Set et SetFrame
- Need to create new dataset: IDSConcrete can be changed in template, to be changed after in Downsampling*/
......@@ -19,8 +19,8 @@ private:
// Tools
// std::mt19937 randEngine = std::mt19937(0);
// TODO Hardcoded so we know what to remove later...
int patchHalfSize = 2; // Works for X, Y and Z since they're all the same...
// TODO Hardcoded so we know what to remove later... Not sure it is 2 or 3...
int patchHalfSize = 3; // Works for X, Y and Z since they're all the same...
int searchCall = 0;
InpaintingEvaluator * const iEvaluator;
......
......@@ -248,4 +248,12 @@ if __name__=="__main__":
#Compare one search iteration (at end of level iterations)
upsample_compare("Data/search_ant/L3_I8/M_SA_Post_","Data/search_ant/result_L3_I8/CppOut_SA_",\
98,"DispX",OccSmallMask,"Data/search_ant/Diff_UA_",'Matlab',"_L3_I8_F")
# Result: Mean percentage a bit higher, so there is divergence across iterations.
# Result: Mean percentage a bit higher, so there is divergence across iterations.
# Result 2: Testing with new value of HalfPatchSize (à 3), no significant change (0.4%)
"""A faire pour ce weekend ou la semaine prochaine:
- Regarder si l'inversion du booleen dans Search est positive
- Recoder l'implémentation hard coded du HalfPatchSize (pas utile mais bon au moins ce sera fait)
- Vérifier (en printant sur une vrai itération) que il n'y a pas de problème
de valeur de bord de masque lors de la fonction rand_search
"""
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment