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

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

[Octave-bug-tracker] [bug #46570] Image package: wrong result with edge


From: Avinoam Kalma
Subject: [Octave-bug-tracker] [bug #46570] Image package: wrong result with edge
Date: Wed, 02 Dec 2015 22:37:19 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36

Follow-up Comment #4, bug #46570 (project octave):



>> im = ones(5,5);
>> im(3,3) = 0;
>> h1 = fspecial("sobel");
>> h3 = h1';

>> strength1 = sqrt( conv2(im, h1, "same").^2 + ...
                 conv2(im, h3, "same").^2 )
strength1 =

   4.24264   4.00000   4.00000   4.00000   4.24264
   4.00000   1.41421   2.00000   1.41421   4.00000
   4.00000   2.00000   0.00000   2.00000   4.00000
   4.00000   1.41421   2.00000   1.41421   4.00000
   4.24264   4.00000   4.00000   4.00000   4.24264

>> strength2 = sqrt( imfilter(im, h1, "replicate").^2 + ...
                 imfilter(im, h3, "replicate").^2 )
strength2 =

   0.00000   0.00000   0.00000   0.00000   0.00000
   0.00000   1.41421   2.00000   1.41421   0.00000
   0.00000   2.00000   0.00000   2.00000   0.00000
   0.00000   1.41421   2.00000   1.41421   0.00000
   0.00000   0.00000   0.00000   0.00000   0.00000



so conv2(im, h1, "same") gives spurious edges on the borders while
imfilter(im, h1, "replicate") doesn't. 
So it seems that imfilter is better than conv2.

imfilter with "replicate" has zero edges on the borders, which also seems to
be good. 
What do you think?



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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