title: iOS - Xcode - OpenCV - findContours error
body: <p><code>findContours</code> causes the following error:</p>
  
  <blockquote>
    <p>2017-09-22 16:50:05.396700+0200 OpenCVLiveCamera[7827:3041522] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles<br>
    2017-09-22 16:50:05.397011+0200 OpenCVLiveCamera[7827:3041522] [MC] Reading from public effective user settings.<br>
    OpenCV Error: Assertion failed (mtype == type0 || (CV_MAT_CN(mtype) == CV_MAT_CN(type0) &amp;&amp; ((1 &lt;&lt; type0) &amp; fixedDepthMask) != 0)) in create, file /Volumes/build-storage/build/master_iOS-mac/opencv/modules/core/src/matrix.cpp, line 2601
    libc++abi.dylib: terminating with uncaught exception of type cv::Exception: /Volumes/build-storage/build/master_iOS-mac/opencv/modules/core/src/matrix.cpp:2601: error: (-215) mtype == type0 || (CV_MAT_CN(mtype) == CV_MAT_CN(type0) &amp;&amp; ((1 &lt;&lt; type0) &amp; fixedDepthMask) != 0) in function create</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>void getContours(cv::Mat &amp;srcImage){
      cv::Mat dstImage = srcImage;
      // Convert it to gray
      cvtColor( srcImage, srcImage, CV_BGR2GRAY );
      // Threshold
      threshold(srcImage, srcImage, 192.0, 255.0, cv::THRESH_BINARY_INV);
      // Find Contours to find chains of consecutive edge pixels
      std::vector&lt;std::vector&lt;Point&gt; &gt; contours;
      findContours(srcImage, contours, CV_RETR_EXTERNAL, CV_CHAIN_APPROX_NONE);
      // Draw contours on image
      //....
  }
  </code></pre>
  
  <p>please help.
  Thank you</p>