Example #1
0
    def _wrapFilter(self, src, vecs, * args):
        dest = src.copy()
        for vec in vecs:
            self._addFreq(dest, vec)

        filtered = utils.imfilter(dest, * args)
        mold, mnew = [self._arrdiff(src, arr)[0] for arr in (dest, filtered)]
        self.assertGreater(mold * 1e-10, mnew)
Example #2
0
    def _wrapFilter(self, src, vecs, * args):
        dest = src.copy()
        for vec in vecs:
            self._addFreq(dest, vec)

        filtered = utils.imfilter(dest, * args)
        mold, mnew = [self._arrdiff(src, arr)[0] for arr in (dest, filtered)]
        self.assertGreater(mold * 1e-10, mnew)
Example #3
0
def _preprocess_extend_single(im, extend, low, high, cut, rcoef, bigshape):
    im = utils.extend_by(im, extend)
    im = utils.imfilter(im, low, high, cut)
    if rcoef != 1:
        im = resample(im, rcoef)

    # Make the shape of images the same
    bg = np.zeros(bigshape, dtype=im.dtype) + utils.get_borderval(im, 5)
    im = utils.embed_to(bg, im)
    return im
Example #4
0
def _preprocess_extend_single(im, extend, low, high, cut, rcoef, bigshape):
    im = utils.extend_by(im, extend)
    im = utils.imfilter(im, low, high, cut)
    if rcoef != 1:
        im = resample(im, rcoef)

    # Make the shape of images the same
    bg = np.zeros(bigshape) + utils.get_borderval(im, 5)
    im = utils.embed_to(bg, im)
    return im
Example #5
0
def filter_images(imgs, low, high, cut):
    ret = [utils.imfilter(img, low, high, cut) for img in imgs]
    return ret
Example #6
0
def filter_images(imgs, low, high):
    # lazy import so no imports before run() is really called
    from imreg_dft import utils

    ret = [utils.imfilter(img, low, high) for img in imgs]
    return ret
Example #7
0
def filter_images(imgs, low, high):
    # lazy import so no imports before run() is really called
    from imreg_dft import utils

    ret = [utils.imfilter(img, low, high) for img in imgs]
    return ret
Example #8
0
def filter_images(imgs, low, high, cut):
    ret = [utils.imfilter(img, low, high, cut) for img in imgs]
    return ret