octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #45088] image package: rangefilt requires doma


From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #45088] image package: rangefilt requires domain and image to have equal number of dimensions
Date: Sat, 25 Mar 2017 22:45:17 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #19, bug #45088 (project octave):

The error here is the same as what happens in stdfilt, and the same reason why
we get an error on medfilt2 and ordfiltn.  And they all call
__spatial_filtering__ which is the function that requires input to have the
same dimension.  I would prefer to fix __spatial_filtering__ instead to be
smarter about it (there's no reason to require the same number of dimensions)
than to replicate the padding in all those functions.

But on the specific case of rangefilt, I think that the function is completely
wrong. From reading the documentation, I would guess that we could just use:


imdilate (im, domain) - imerode (im, domain)


But the results are different.  Reading the Matlab documentation suggests me
the same so I think that rangefilt is just giving completely wrong values:


octave-cli-4.3.0+:16> a = magic(5)
a =

   17   24    1    8   15
   23    5    7   14   16
    4    6   13   20   22
   10   12   19   21    3
   11   18   25    2    9

octave-cli-4.3.0+:17> rangefilt(a, ones(3)) # this looks completely wrong
ans =

   38   34   23   21   18
   37   23   23   25   20
   23   19   22   38   38
   15   22   41   34   32
   19   22   41   34   24



See that the center point of the 5x5 matrix, is not the max - min of the
points on that point.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45088>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]