title: Filter OpenCV Mat for NAN values
body: <p>Is there a direct way to create a mask where values in a <code>cv::Mat_&lt;double&gt;</code> are compared against NAN?</p>
  
  <pre><code>cv::Mat_&lt;real&gt; mat = ...
  cv::Mat_&lt;uchar&gt; mask = (mat == NAN);
  </code></pre>
  
  <p>does not work because <code>f == NAN</code> is always false, even if <code>f</code> was assigned <code>NAN</code>. And there seems to be no overload of <code>isnan()</code> for matrices.</p>