summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Core/inpainters_CPU/NonlocalMarching_Inpaint_core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Core/inpainters_CPU/NonlocalMarching_Inpaint_core.c b/Core/inpainters_CPU/NonlocalMarching_Inpaint_core.c
index d6cdf93..3a846bb 100644
--- a/Core/inpainters_CPU/NonlocalMarching_Inpaint_core.c
+++ b/Core/inpainters_CPU/NonlocalMarching_Inpaint_core.c
@@ -56,7 +56,9 @@ float NonlocalMarching_Inpaint_main(float *Input, unsigned char *M, float *Outpu
if (M[i] == 1) iterations_number++;
}
}
- else iterations_number = iterationsNumb;
+ else iterations_number = (int)(iterationsNumb/dimX);
+ if (iterations_number > dimX) iterations_number = dimX;
+
if (iterations_number == 0) printf("%s \n", "Nothing to inpaint, zero mask!");
else {