title: Apply sobel filter for edge detection in emgucv
body: <p>I am trying to apply Sobel filter on my picture to  detect edges as you can see here :</p>
  
  <pre><code>Image&lt;Gray, Byte&gt; imgProcessed1;
  private void Form1_Load(object sender, EventArgs e)
  {
  
  
  
      Image&lt;Bgr, Byte&gt; imgProcessed=new Image&lt;Bgr, byte&gt;(@"C:\Users\Public\Pictures\Sample Pictures\1.jpg");
  
      imgProcessed1 = imgProcessed.Convert&lt;Gray, byte&gt;();
      Image&lt;Gray, Single&gt; img_final = (imgProcessed1.Sobel(1, 0, 5));
      pictureBox1.Image = img_final.ToBitmap();
  }
  </code></pre>
  
  <p>but the result is very unusual ,i am so new in opencv.</p>
  
  <p>my output</p>
  
  <p><a href="https://i.stack.imgur.com/64qin.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/64qin.png" alt="enter image description here"></a></p>
  
  <p>I need this result.</p>
  
  <p><a href="https://i.stack.imgur.com/aER4p.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aER4p.jpg" alt="enter image description here"></a></p>
  
  <p>i just need to apply this filter </p>
  
  <p><a href="https://i.stack.imgur.com/5hhYt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5hhYt.png" alt="enter image description here"></a></p>