add option to perform additional polishing pass with 3x3 patches

This commit is contained in:
Ondrej Jamriska
2018-10-03 12:23:02 +02:00
parent 9f59b13cb7
commit 5e483f122c
8 changed files with 135 additions and 90 deletions

View File

@@ -30,10 +30,11 @@ void ebsynthRun(int ebsynthBackend,
int* numSearchVoteItersPerLevel,
int* numPatchMatchItersPerLevel,
int* stopThresholdPerLevel,
int extraPass3x3,
void* outputNnfData,
void* outputImageData)
{
void (*backendDispatch)(int,int,int,int,void*,void*,int,int,void*,void*,float*,float*,float,int,int,int,int*,int*,int*,void*,void*) = 0;
void (*backendDispatch)(int,int,int,int,void*,void*,int,int,void*,void*,float*,float*,float,int,int,int,int*,int*,int*,int,void*,void*) = 0;
if (ebsynthBackend==EBSYNTH_BACKEND_CPU ) { backendDispatch = ebsynthRunCpu; }
else if (ebsynthBackend==EBSYNTH_BACKEND_CUDA) { backendDispatch = ebsynthRunCuda; }
@@ -60,6 +61,7 @@ void ebsynthRun(int ebsynthBackend,
numSearchVoteItersPerLevel,
numPatchMatchItersPerLevel,
stopThresholdPerLevel,
extraPass3x3,
outputNnfData,
outputImageData);
}
@@ -256,6 +258,7 @@ int main(int argc,char** argv)
printf(" -searchvoteiters <number>\n");
printf(" -patchmatchiters <number>\n");
printf(" -stopthreshold <value>\n");
printf(" -extrapass3x3\n");
printf(" -backend [cpu|cuda]\n");
printf("\n");
return 1;
@@ -290,6 +293,7 @@ int main(int argc,char** argv)
int numSearchVoteIters = 6;
int numPatchMatchIters = 4;
int stopThreshold = 5;
int extraPass3x3 = 0;
int backend = ebsynthBackendAvailable(EBSYNTH_BACKEND_CUDA) ? EBSYNTH_BACKEND_CUDA : EBSYNTH_BACKEND_CPU;
{
@@ -369,6 +373,11 @@ int main(int argc,char** argv)
argi++;
}
else if (argi<args.size() && args[argi]=="-extrapass3x3")
{
extraPass3x3 = 1;
argi++;
}
else
{
printf("error: unrecognized option '%s'\n",args[argi].c_str());
@@ -510,6 +519,7 @@ int main(int argc,char** argv)
printf("searchvoteiters: %d\n",numSearchVoteIters);
printf("patchmatchiters: %d\n",numPatchMatchIters);
printf("stopthreshold: %d\n",stopThreshold);
printf("extrapass3x3: %s\n",extraPass3x3!=0?"yes":"no");
printf("backend: %s\n",backendToString(backend).c_str());
ebsynthRun(backend,
@@ -532,6 +542,7 @@ int main(int argc,char** argv)
numSearchVoteItersPerLevel.data(),
numPatchMatchItersPerLevel.data(),
stopThresholdPerLevel.data(),
extraPass3x3,
NULL,
output.data());