title: OpenCV InputArray/OutputArray
body: <p>I had just compile the last version of OpenCV 2.3. And their decision to change all Matrix input/output into InputArray/OutputArray messes everything up. The same piece of code that was working well under OpenCV 2.2 is now worthless.</p>
  
  <p>There's two solutions I would accept:</p>
  
  <ol>
  <li><p>Showing me where I can download OpenCV 2.2 for Linux, with all modules, it's important that stitching is not missing (I tried to find a suitable one, but stitching is always missing!).</p></li>
  <li><p>Help me solve what I'm describing below.</p></li>
  <li><p>OpenCV 2.4, even if still beta, has fixed this and I should move to this version instead!</p></li>
  </ol>
  
  <p>I have this exception message:</p>
  
  <pre><code>OpenCV Error: Assertion failed (k == STD_VECTOR_MAT) in getMat, file /home/widgg/opencv/trunk/modules/core/src/matrix.cpp, line 928
  terminate called after throwing an instance of 'cv::Exception'
    what():  /home/widgg/opencv/trunk/modules/core/src/matrix.cpp:928: error: (-215) k == STD_VECTOR_MAT in function getMat
  </code></pre>
  
  <p>In gdb, this is the stack:</p>
  
  <pre><code>#0  0x00007ffff5df3445 in __GI_raise (sig=&lt;optimized out&gt;) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
  #1  0x00007ffff5df6bab in __GI_abort () at abort.c:91
  #2  0x00007ffff674169d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
  #3  0x00007ffff673f846 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
  #4  0x00007ffff673f873 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
  #5  0x00007ffff673f96e in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
  #6  0x00007ffff77fca51 in cv::error(cv::Exception const&amp;) () from /usr/local/lib/libopencv_core.so.2.3
  #7  0x00007ffff791306d in cv::_InputArray::getMat(int) const () from /usr/local/lib/libopencv_core.so.2.3
  #8  0x00007ffff796064c in cv::perspectiveTransform(cv::_InputArray const&amp;, cv::_OutputArray const&amp;, cv::_InputArray const&amp;) () from /usr/local/lib/libopencv_core.so.2.3
  </code></pre>
  
  <p>finally, here's my code when I'm calling cv::perspectiveTransform:</p>
  
  <pre><code>std::vector&lt;cv::Point2f&gt; corners(4);
  
  cv::Mat cur_image = imread("my_image.jpg");
  
  std::vector&lt;cv::Point2f&gt; img_corners(4);
  
  img_corners[0] = cv::Point2f(0, 0);
  
  img_corners[1] = cv::Point2f(cur_image.cols, 0);
  
  img_corners[2] = cv::Point2f(cur_image.cols, cur_image.rows);
  
  img_corners[3] = cv::Point2f(0, cur_image.rows);
  
  cur_image.release();
  
  cv::perspectiveTransform(img_corners, corners, m_transf);
  </code></pre>
  
  <p>And cv::Mat m_transf  = (Mat_ &lt; double > (3,3) &lt;&lt; 1, 0, 0, 0, 1, 0, 0, 0, 1);, that's its value when it's first used, and it crashes at that place!</p>
  
  <p>I have a similar problem with cv::FindHomography. The thing is that code was executing properly yesterday and now, this InputArray/OuputArray thing screw everything up.</p>
  
  <p>It's very annoying, please help!</p>
  
  <p>Also, I found this report here: <a href="http://upstream-tracker.org/compat_reports/opencv/2.2.0_to_2.3.0/abi_compat_report.html" rel="nofollow" title="OpenCV 2.2 to 2.3 compatibility report">OpenCV 2.2 Vs. 2.3</a> and it's not a good sign! There should be a workaround for this!</p>