title: possible NaN gradient direction on canny edge detector - image processing on matlab
body: <p>I'm writing my own version of <a href="http://en.wikipedia.org/wiki/Canny_edge_detector#Development_of_the_Canny_algorithm" rel="nofollow noreferrer">Canny's edge detection algorithm</a>. My question is, how can I compute the direction of gradient? I already know that:</p>
  
  <p><img src="https://i.stack.imgur.com/BkWux.png" alt="enter image description here"></p>
  
  <p>But what should I do when <b>G</b><sub>y</sub> = <b>G</b><sub>x</sub> = 0? </p>