title: OpenCV Error: Assertion failed (!fixedSize() || ((Mat*)obj)->size.operator()() == Size(cols, rows)) in create,
body: <p>I get this runtime error using threads with my function defined as:</p>
  
  <pre><code>void doubleThresholding(InputArray imgin, OutputArray imgout, uchar T1,
                          uchar T2, InputArray mask)
  </code></pre>
  
  <p>It is a function that segment an image using double thresholding, where InputArray and OutputArray are OpenCV classes. </p>
  
  <p>This is the part of code that create the thread object:</p>
  
  <pre><code>Mat nusegmB;   
  thread t1(doubleThresholding,rgb[0],nusegmB,55,60,cytosegm);
  t1.join();
  </code></pre>
  
  <p>I try using std::ref() on rgb[0], nusegmB and cytosegm but does not compile. I get this message error:</p>
  
  <pre><code>error: no type named ‘type’ in ‘class std::result_of&lt;void (*(cv::Mat, std::reference_wrapper&lt;cv::Mat&gt;, int, int, cv::Mat))(const cv::_InputArray&amp;, const cv::_OutputArray&amp;, unsigned char, unsigned char, const cv::_InputArray&amp;)&gt;’
  </code></pre>
  
  <p>If I don't use threads, I have not any problem. </p>