<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 4 pre</li>
<li>Operating System / Platform =&gt; Ubuntu 18.04</li>
<li>Compiler =&gt; GCC  7.3.0<br>
-DWITH_QT=ON -DWITH_OPENGL=ON</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">following code<br>
int main(){<br>
cv::Mat1f img = cv::Mat1f::zeros(100,100);<br>
cv::imshow("img",img);<br>
cv::waitKey(0);<br>
return 0;<br>
}<br>
will crash with the following exception:<br>
opencv/modules/highgui/src/window_QT.cpp:2561: error: (-215:Assertion failed) dst.data == image2Draw_mat-&gt;data.ptr in function 'updateImage'</p>
<p dir="auto">Note the image type cv::Mat1w will also crash. Actualy given the error almost everything except rgb8 and grey8 will crash.</p>
<ul dir="auto">
<li>OpenCV =&gt; master</li>
<li>Operating System / Platform =&gt; Windows 64 Bit</li>
<li>Compiler =&gt; mingw64 / 7.2.0</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">regression after: <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/opencv/opencv/commit/11eafca3e2a4cbc62f1309d25db0ea3ed9a6ea8e/hovercard" href="https://github.com/opencv/opencv/commit/11eafca3e2a4cbc62f1309d25db0ea3ed9a6ea8e"><tt>11eafca</tt></a></p>
<p dir="auto">the <code class="notranslate">cvConvertImage()</code> calls <a href="https://github.com/opencv/opencv/commit/11eafca3e2a4cbc62f1309d25db0ea3ed9a6ea8e#diff-baec79d9f6cf2a8b605a5d9aad326540L1214">were removed</a>.<br>
while code was added to adapt the colorspace, there is no more depth conversion to CV_8U</p>
<h5 dir="auto">Steps to reproduce</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="//Mat m(400,400,CV_32FC3,Scalar(1.0));
Mat m(400,400,CV_16U,Scalar(255));
imshow(&quot;win&quot;,m);
waitKey();"><pre class="notranslate"><code class="notranslate">//Mat m(400,400,CV_32FC3,Scalar(1.0));
Mat m(400,400,CV_16U,Scalar(255));
imshow("win",m);
waitKey();
</code></pre></div>
<p dir="auto">leading to:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="OpenCV(4.0.0-pre) Error: Assertion failed (dst.data == (uchar*)dst_ptr) in cvShowImage, file C:\p\opencv\modules\highgui\src\window_w32.cpp, line 1230"><pre class="notranslate"><code class="notranslate">OpenCV(4.0.0-pre) Error: Assertion failed (dst.data == (uchar*)dst_ptr) in cvShowImage, file C:\p\opencv\modules\highgui\src\window_w32.cpp, line 1230
</code></pre></div>
<p dir="auto">apart from the windows version (tried here), others will be affected:</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> window_w32.cpp</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> window_cocoa.mm</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> window_gtk.cpp</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> window_QT.cpp</li>
</ul>