<h5 dir="auto">System information (version)</h5>
<ul dir="auto">
<li>OpenCV =&gt; 4.0.0-dev</li>
<li>Operating System / Platform =&gt; Ubuntu 16.04.05</li>
<li>Compiler =&gt; gnu</li>
</ul>
<h5 dir="auto">Detailed description</h5>
<p dir="auto">When attempting to run the <code class="notranslate">dft.py</code> sample, I got the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="daniel@FX705GM:~/opencv/samples/python$ python dft.py 
usage : python dft.py &lt;image_file&gt;
[ WARN:0] cv::samples::findFile('baboon.jpg') =&gt; '/home/daniel/opencv/samples/python/../../samples/data/baboon.jpg'
Traceback (most recent call last):
  File &quot;dft.py&quot;, line 111, in &lt;module&gt;
    cv.imshow(&quot;magnitude&quot;, log_spectrum)
cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/imgproc/src/color.hpp:261: error: (-2:Unspecified error) in function 'cv::CvtHelper&lt;VScn, VDcn, VDepth, sizePolicy&gt;::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set&lt;1&gt;; VDcn = cv::Set&lt;3, 4&gt;; VDepth = cv::Set&lt;0, 2, 5&gt;; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&amp;; cv::OutputArray = const cv::_OutputArray&amp;]'
&gt; Unsupported depth of input image:
&gt;     'VDepth::contains(depth)'
&gt; where
&gt;     'depth' is 6 (CV_64F)"><pre class="notranslate"><code class="notranslate">daniel@FX705GM:~/opencv/samples/python$ python dft.py 
usage : python dft.py &lt;image_file&gt;
[ WARN:0] cv::samples::findFile('baboon.jpg') =&gt; '/home/daniel/opencv/samples/python/../../samples/data/baboon.jpg'
Traceback (most recent call last):
  File "dft.py", line 111, in &lt;module&gt;
    cv.imshow("magnitude", log_spectrum)
cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/imgproc/src/color.hpp:261: error: (-2:Unspecified error) in function 'cv::CvtHelper&lt;VScn, VDcn, VDepth, sizePolicy&gt;::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set&lt;1&gt;; VDcn = cv::Set&lt;3, 4&gt;; VDepth = cv::Set&lt;0, 2, 5&gt;; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&amp;; cv::OutputArray = const cv::_OutputArray&amp;]'
&gt; Unsupported depth of input image:
&gt;     'VDepth::contains(depth)'
&gt; where
&gt;     'depth' is 6 (CV_64F)
</code></pre></div>
<p dir="auto">log_spectrum is float64 image, and after some digging, I found that my build is unable to display <em>any</em> images other than ones with a dtype of np.uint8. These are the error messages I get for each dtype:</p>
<p dir="auto">int8</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/imgproc/src/color.hpp:261: error: (-2:Unspecified error) in function 'cv::CvtHelper&lt;VScn, VDcn, VDepth, sizePolicy&gt;::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set&lt;1&gt;; VDcn = cv::Set&lt;3, 4&gt;; VDepth = cv::Set&lt;0, 2, 5&gt;; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&amp;; cv::OutputArray = const cv::_OutputArray&amp;]'
&gt; Unsupported depth of input image:
&gt;     'VDepth::contains(depth)'
&gt; where
&gt;     'depth' is 1 (CV_8S)"><pre class="notranslate"><code class="notranslate">cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/imgproc/src/color.hpp:261: error: (-2:Unspecified error) in function 'cv::CvtHelper&lt;VScn, VDcn, VDepth, sizePolicy&gt;::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set&lt;1&gt;; VDcn = cv::Set&lt;3, 4&gt;; VDepth = cv::Set&lt;0, 2, 5&gt;; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&amp;; cv::OutputArray = const cv::_OutputArray&amp;]'
&gt; Unsupported depth of input image:
&gt;     'VDepth::contains(depth)'
&gt; where
&gt;     'depth' is 1 (CV_8S)
</code></pre></div>
<p dir="auto">int16</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/imgproc/src/color.hpp:261: error: (-2:Unspecified error) in function 'cv::CvtHelper&lt;VScn, VDcn, VDepth, sizePolicy&gt;::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set&lt;1&gt;; VDcn = cv::Set&lt;3, 4&gt;; VDepth = cv::Set&lt;0, 2, 5&gt;; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&amp;; cv::OutputArray = const cv::_OutputArray&amp;]'
&gt; Unsupported depth of input image:
&gt;     'VDepth::contains(depth)'
&gt; where
&gt;     'depth' is 3 (CV_16S)"><pre class="notranslate"><code class="notranslate">cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/imgproc/src/color.hpp:261: error: (-2:Unspecified error) in function 'cv::CvtHelper&lt;VScn, VDcn, VDepth, sizePolicy&gt;::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set&lt;1&gt;; VDcn = cv::Set&lt;3, 4&gt;; VDepth = cv::Set&lt;0, 2, 5&gt;; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&amp;; cv::OutputArray = const cv::_OutputArray&amp;]'
&gt; Unsupported depth of input image:
&gt;     'VDepth::contains(depth)'
&gt; where
&gt;     'depth' is 3 (CV_16S)
</code></pre></div>
<p dir="auto">uint16</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/highgui/src/window_gtk.cpp:146: error: (-215:Assertion failed) dst.data == widget-&gt;original_image-&gt;data.ptr in function 'cvImageWidgetSetImage'"><pre class="notranslate"><code class="notranslate">cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/highgui/src/window_gtk.cpp:146: error: (-215:Assertion failed) dst.data == widget-&gt;original_image-&gt;data.ptr in function 'cvImageWidgetSetImage'
</code></pre></div>
<p dir="auto">int32</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/imgproc/src/color.hpp:261: error: (-2:Unspecified error) in function 'cv::CvtHelper&lt;VScn, VDcn, VDepth, sizePolicy&gt;::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set&lt;1&gt;; VDcn = cv::Set&lt;3, 4&gt;; VDepth = cv::Set&lt;0, 2, 5&gt;; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&amp;; cv::OutputArray = const cv::_OutputArray&amp;]'
&gt; Unsupported depth of input image:
&gt;     'VDepth::contains(depth)'
&gt; where
&gt;     'depth' is 4 (CV_32S)"><pre class="notranslate"><code class="notranslate">cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/imgproc/src/color.hpp:261: error: (-2:Unspecified error) in function 'cv::CvtHelper&lt;VScn, VDcn, VDepth, sizePolicy&gt;::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set&lt;1&gt;; VDcn = cv::Set&lt;3, 4&gt;; VDepth = cv::Set&lt;0, 2, 5&gt;; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&amp;; cv::OutputArray = const cv::_OutputArray&amp;]'
&gt; Unsupported depth of input image:
&gt;     'VDepth::contains(depth)'
&gt; where
&gt;     'depth' is 4 (CV_32S)
</code></pre></div>
<p dir="auto">float32</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/highgui/src/window_gtk.cpp:146: error: (-215:Assertion failed) dst.data == widget-&gt;original_image-&gt;data.ptr in function 'cvImageWidgetSetImage'"><pre class="notranslate"><code class="notranslate">cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/highgui/src/window_gtk.cpp:146: error: (-215:Assertion failed) dst.data == widget-&gt;original_image-&gt;data.ptr in function 'cvImageWidgetSetImage'
</code></pre></div>
<p dir="auto">float64</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/imgproc/src/color.hpp:261: error: (-2:Unspecified error) in function 'cv::CvtHelper&lt;VScn, VDcn, VDepth, sizePolicy&gt;::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set&lt;1&gt;; VDcn = cv::Set&lt;3, 4&gt;; VDepth = cv::Set&lt;0, 2, 5&gt;; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&amp;; cv::OutputArray = const cv::_OutputArray&amp;]'
&gt; Unsupported depth of input image:
&gt;     'VDepth::contains(depth)'
&gt; where
&gt;     'depth' is 6 (CV_64F)"><pre class="notranslate"><code class="notranslate">cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/imgproc/src/color.hpp:261: error: (-2:Unspecified error) in function 'cv::CvtHelper&lt;VScn, VDcn, VDepth, sizePolicy&gt;::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set&lt;1&gt;; VDcn = cv::Set&lt;3, 4&gt;; VDepth = cv::Set&lt;0, 2, 5&gt;; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&amp;; cv::OutputArray = const cv::_OutputArray&amp;]'
&gt; Unsupported depth of input image:
&gt;     'VDepth::contains(depth)'
&gt; where
&gt;     'depth' is 6 (CV_64F)
</code></pre></div>
<p dir="auto">Is this happening for anyone else?</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>