title: How to fill with nearest neighbor pixel in some missing pixels on c++ here is my code
body: <pre><code>int depth_i=1,depth_j=1;
  for(depth_i=1;depth_i&lt;DepthShow.rows;depth_i++)
      {
          unsigned char * pixel_depth = DepthShow.ptr&lt;unsigned char&gt;(depth_i);
  
          for(depth_j=1;depth_j&lt;DepthShow.cols;depth_j++)
              {
              if(pixel_depth[depth_j]==0) //*
                          pixel_depth[depth_j]=500;   //*
              }
      }
  </code></pre>
  
  <p>I am using kinect sensor and opencv
  in commented lines //* if 1*1 pixel is missing then fills value of 500. I want to fill with nearest neighbor pixel instead of 500.</p>
  
  <p>Some one help me to apply   Nearest neighbor pixel on c++</p>