From 14edd18d07c871c0a355d70e68350a899014dbc7 Mon Sep 17 00:00:00 2001 From: algol Date: Wed, 2 May 2018 13:11:50 +0100 Subject: bugs in NVM fixed --- .../inpainters_CPU/NonlocalMarching_Inpaint_core.c | 48 +++++++++++++++++----- Wrappers/Python/demos/demo_cpu_inpainters.py | 6 ++- Wrappers/Python/src/cpu_regularisers.pyx | 12 +++--- 3 files changed, 48 insertions(+), 18 deletions(-) diff --git a/Core/inpainters_CPU/NonlocalMarching_Inpaint_core.c b/Core/inpainters_CPU/NonlocalMarching_Inpaint_core.c index 3a846bb..a197375 100644 --- a/Core/inpainters_CPU/NonlocalMarching_Inpaint_core.c +++ b/Core/inpainters_CPU/NonlocalMarching_Inpaint_core.c @@ -42,7 +42,7 @@ float NonlocalMarching_Inpaint_main(float *Input, unsigned char *M, float *Outpu { int i, j, i_m, j_m, counter, iter, iterations_number, W_fullsize, switchmask, switchcurr, counterElements; float *Gauss_weights; - + /* copying M to M_upd */ copyIm_unchar(M, M_upd, dimX, dimY, 1); @@ -54,11 +54,11 @@ float NonlocalMarching_Inpaint_main(float *Input, unsigned char *M, float *Outpu iterations_number = 0; for (i=0; i dimX) iterations_number = dimX; } - else iterations_number = (int)(iterationsNumb/dimX); - if (iterations_number > dimX) iterations_number = dimX; - + else iterations_number = iterationsNumb; + if (iterations_number == 0) printf("%s \n", "Nothing to inpaint, zero mask!"); else { @@ -81,11 +81,38 @@ float NonlocalMarching_Inpaint_main(float *Input, unsigned char *M, float *Outpu counter++; } } + + if (trigger == 0) { + /*Matlab*/ + #pragma omp parallel for shared(Output, M_upd, Gauss_weights) private(i, j, switchmask, switchcurr) + for(j=0; j