Updated by Andrey Kamaev almost 13 years ago

The @cv::OutputArray::create@ cv::OutputArray::create function will crash if it is called on a submatrix that is already the correct size and type.
Here is an example (Windows 7 x64 Visual Studio 2010):

<pre><code class="cpp">

cv::Mat mat(cv::Size(512, 512), CV_8U);
cv::Size submatSize = cv::Size(256, 256);
cv::OutputArray outputArray = mat(cv::Rect(cv::Point(), submatSize));
array<int, 2> sizeArray = {submatSize.width, submatSize.height};
// This will cause an assertion to fail, even though the submatrix is the correct size and type.
outputArray.create(sizeArray.size(), sizeArray.data(), mat.type());
</code></pre>

Back