title: Substitute function of bwdist in C++
body: <p>I am implementing a code of Matlab in C++. In Matlab they have used <strong>bwdist</strong> to calculate the euclidean distance.</p>
  
  <p>I am using the function <strong>distanceTransform</strong> to get the same result as in Matlab, but the results are drastically different.</p>
  
  <pre><code>float tests[5][5] = {{0, 0, 0, 0,0},{0, 0, 0, 0,0},{0, 0, 1, 0,0},{0, 0, 0, 0,0},{0 , 0 , 0 , 0,0}};
      Mat test(5,5,CV_8UC1,&amp;tests);
      Mat test_result = Mat::zeros(5,5,CV_32FC1);
      distanceTransform(test,test_result,CV_DIST_L1,3);
  </code></pre>
  
  <p>C++ Result is given below.</p>
  
  <pre><code>test_result = [0, 0, 0, 0, 0; 0, 0, 0, 0, 0; 0, 0, 0, 0, 0; 0, 0, 0, 0, 0; 0, 0, 0, 0, 0]
  </code></pre>
  
  <p>All zeros while using in OpenCV.
  Whereas the Matlab Result is something different.</p>
  
  <pre><code>  2.8284    2.2361    2.0000    2.2361    2.8284
    2.2361    1.4142    1.0000    1.4142    2.2361
    2.0000    1.0000         0    1.0000    2.0000
    2.2361    1.4142    1.0000    1.4142    2.2361
    2.8284    2.2361    2.0000    2.2361    2.8284
  </code></pre>
  
  <p>Please suggest me some way to get the same result in C++/OpenCv too, as there is in Matlab.</p>