title: Prewitt operator implementation against MATLAB edge function?
body: <p>Using <code>conv2</code> I'm implementing Prewitt operator for edge detection. This is what I'm trying:</p>
  
  <pre><code>b=[-1 -1 -1;0 0 0;1 1 1]/256;
  c=[-1 0 1; -1 0 1; -1 0 1]/256;
  Gx=abs(conv2(openImage,c,'same'));
  Gy=abs(conv2(openImage,b,'same'));
  G = sqrt( Gx.^2 + Gy.^2);
  </code></pre>
  
  <p>where <code>openImage</code> is a grayscale image, and then I compare against MATLAB's implementation with <code>edge</code>:</p>
  
  <pre><code>edge(openImage,'Prewitt', [], 'both', 'nothinning');
  </code></pre>
  
  <p>So, when I compare both images:</p>
  
  <p><img src="https://i.stack.imgur.com/TBmqWh.png" alt="enter image description here"></p>
  
  <p>So as it can bee seen they're not exactly the same, however I'm pretty sure about the implementation. What's the reason of it?</p>