title: 8-neighboorhood in vector from nonZeroCoordinates
body: <p>From an edge image 8UC1 obtained from Canny operator, I want to go through all white pixels and find their 8-neighboorhood. </p>
  
  <p>As a first step, I apply </p>
  
  <pre><code>findNonZero(edgesFromCanny, nonZeroCoordinates);
  </code></pre>
  
  <p>to obtain just all white pixels to increase computational time. 
  The coordinates of those pixels in <em>nonZeroCoordinates</em> are then ordered in a row-wise manner, so that p(x=100, y =1) can be far away from p(x=100, y=2) in the <em>nonZeroCoordinates</em> Mat (column-wise), while p(x=100, y =1) and p(x=101, y =1) are subsequent in <em>nonZeroCoordinates</em> (if they are edges). </p>
  
  <p>How can I (fast) retrieve the 8-neighboorhood of p(x=100, y=1) taking into account, it is an edge, too? </p>