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)
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
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
def filter_images(imgs, low, high, cut): ret = [utils.imfilter(img, low, high, cut) for img in imgs] return ret
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