Can't you keep track of the number of masked values and decrement?

Johannes Schönberger

> Am 19.09.2013 um 19:11 schrieb "Chintak Sheth" <notifications@github.com>:
> 
> In skimage/filter/_inpaint_criminisi.pyx:
> 
> > +    .. [1] A. Criminisi, P. Perez, and K. Toyama. 2004. Region filling and
> > +           object removal by exemplar-based image inpainting. Trans. Img. Proc.
> > +           13, 9 (September 2004), 1200-1212. DOI=10.1109/TIP.2004.833105.
> > +
> > +    """
> > +
> > +    offset = window // 2
> > +    inner = (slice(offset, -offset), slice(offset, -offset))
> > +    source_image = painted[inner].copy()
> > +
> > +    t_row, t_col = np.ogrid[-offset:offset + 1, -offset:offset + 1]
> > +    sigma = window / 3
> > +    gauss_mask = _gaussian(sigma, (window, window))
> > +    confidence = 1. - mask
> > +
> > +    while mask.any():
> I'll be changing mask at each iteration, so it's either mask.any() or np.nonzero iterative computation.
> 
> —
> Reply to this email directly or view it on GitHub.
>