Commit a4fe3bf6 by André Anjos 💬

### More cleaning-up and test passing

parent ac24ea5d
 ... ... @@ -57,11 +57,11 @@ class MaximumCurvature (Extractor): # Do the actual filtering fx = utils.imfilter(image, hx, conv=False) fxx = utils.imfilter(image, hxx, conv=False) fy = utils.imfilter(image, hy, conv=False) fyy = utils.imfilter(image, hyy, conv=False) fxy = utils.imfilter(image, hxy, conv=False) fx = utils.imfilter(image, hx) fxx = utils.imfilter(image, hxx) fy = utils.imfilter(image, hy) fyy = utils.imfilter(image, hyy) fxy = utils.imfilter(image, hxy) f1 = 0.5*numpy.sqrt(2)*(fx + fy) # \ # f2 = 0.5*numpy.sqrt(2)*(fx - fy) # / # ... ...
 ... ... @@ -8,10 +8,10 @@ import bob.sp import bob.core def imfilter(a, b, conv=True): def imfilter(a, b): """Applies a 2D filtering between images This implementation was created to work exactly like the Matlab one. This implementation was created to work similarly like the Matlab one. Parameters: ... ... @@ -23,20 +23,16 @@ def imfilter(a, b, conv=True): with :py:func:`bob.core.convert` and the range reset to ``[0.0, 1.0]``. b (numpy.ndarray): A 64-bit float 2-dimensional :py:class:`numpy.ndarray` which represents the filter to be applied to the image conv (bool, Optional): If set, then rotates the filter ``b`` by 180 degrees before applying it to the image ``a``, with :py:func:`bob.ip.base.rotate`. which represents the filter to be applied to the image. The input filter has to be rotated by 180 degrees as we use :py:func:`scipy.signal.convolve2d` to apply it. You can rotate your filter ``b`` with the help of :py:func:`bob.ip.base.rotate`. """ if a.dtype == numpy.uint8: a = bob.core.convert(a, numpy.float64, (0,1)) if conv: b = bob.ip.base.rotate(b, 180) shape = (a.shape[0] + b.shape[0] - 1, a.shape[1] + b.shape[1] - 1) a_ext = numpy.ndarray(shape=shape, dtype=numpy.float64) bob.sp.extrapolate_nearest(a, a_ext) ... ...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!