title: How can avoid including zeros when using the opencv Filter2D function?
body: <p>I am using the <code>Filter2D</code> function in <code>opencv-python</code> on a satellite image that have several black-fill values (zeros) around the edges. Here you can find an example of what I am talking about: <a href="https://landsat.gsfc.nasa.gov/wp-content/uploads/2013/06/truecolor.jpg" rel="nofollow noreferrer">https://landsat.gsfc.nasa.gov/wp-content/uploads/2013/06/truecolor.jpg</a></p>
  
  <p>When I use <code>Filter2D</code> on that image, the pixels from the black-filled area are considered valid values, creating edge artifacts. How can I not include the zeros in the calculation? For example, in IDL I can use the "missing" and "invalid" fields like this:</p>
  
  <pre><code>output = CONVOL(input, kernel, /EDGE_TRUNCATE, MISSING=0.0, INVALID=0.0, /NAN, /NORMALIZE)
  </code></pre>
  
  <p>and avoid issues at the edges,but I cannot find a similar functionality in opencv. How can get around this issue?</p>