Issue 1:
System information (version)

OpenCV => 4.0.0-dev

Operating System / Platform => Ubuntu 16.04.05

Compiler => gnu

Detailed description

When attempting to run the dft.py sample, I got the following error:

daniel@FX705GM:~/opencv/samples/python$ python dft.py
usage : python dft.py <image_file>
[ WARN:0] cv::samples::findFile('baboon.jpg') => '/home/daniel/opencv/samples/python/../../samples/data/baboon.jpg'
Traceback (most recent call last):
File "dft.py", line 111, in <module>
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<VScn, VDcn, VDepth, sizePolicy>::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set<1>; VDcn = cv::Set<3, 4>; VDepth = cv::Set<0, 2, 5>; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&; cv::OutputArray = const cv::_OutputArray&]'
> Unsupported depth of input image:
> 'VDepth::contains(depth)'
> where
> 'depth' is 6 (CV_64F)

log_spectrum is float64 image, and after some digging, I found that my build is unable to display any images other than ones with a dtype of np.uint8. These are the error messages I get for each dtype:

int8

cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/imgproc/src/color.hpp:261: error: (-2:Unspecified error) in function 'cv::CvtHelper<VScn, VDcn, VDepth, sizePolicy>::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set<1>; VDcn = cv::Set<3, 4>; VDepth = cv::Set<0, 2, 5>; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&; cv::OutputArray = const cv::_OutputArray&]'
> Unsupported depth of input image:
> 'VDepth::contains(depth)'
> where
> 'depth' is 1 (CV_8S)

int16

cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/imgproc/src/color.hpp:261: error: (-2:Unspecified error) in function 'cv::CvtHelper<VScn, VDcn, VDepth, sizePolicy>::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set<1>; VDcn = cv::Set<3, 4>; VDepth = cv::Set<0, 2, 5>; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&; cv::OutputArray = const cv::_OutputArray&]'
> Unsupported depth of input image:
> 'VDepth::contains(depth)'
> where
> 'depth' is 3 (CV_16S)

uint16

cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/highgui/src/window_gtk.cpp:146: error: (-215:Assertion failed) dst.data == widget->original_image->data.ptr in function 'cvImageWidgetSetImage'

int32

cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/imgproc/src/color.hpp:261: error: (-2:Unspecified error) in function 'cv::CvtHelper<VScn, VDcn, VDepth, sizePolicy>::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set<1>; VDcn = cv::Set<3, 4>; VDepth = cv::Set<0, 2, 5>; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&; cv::OutputArray = const cv::_OutputArray&]'
> Unsupported depth of input image:
> 'VDepth::contains(depth)'
> where
> 'depth' is 4 (CV_32S)

float32

cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/highgui/src/window_gtk.cpp:146: error: (-215:Assertion failed) dst.data == widget->original_image->data.ptr in function 'cvImageWidgetSetImage'

float64

cv2.error: OpenCV(4.0.0-dev) /home/daniel/opencv/modules/imgproc/src/color.hpp:261: error: (-2:Unspecified error) in function 'cv::CvtHelper<VScn, VDcn, VDepth, sizePolicy>::CvtHelper(cv::InputArray, cv::OutputArray, int) [with VScn = cv::Set<1>; VDcn = cv::Set<3, 4>; VDepth = cv::Set<0, 2, 5>; cv::SizePolicy sizePolicy = (cv::SizePolicy)2u; cv::InputArray = const cv::_InputArray&; cv::OutputArray = const cv::_OutputArray&]'
> Unsupported depth of input image:
> 'VDepth::contains(depth)'
> where
> 'depth' is 6 (CV_64F)

Is this happening for anyone else?

Issue 2:
OpenCV => master

Operating System / Platform => Windows 64 Bit

Compiler => mingw64 / 7.2.0

Detailed description

regression after: 11eafca

the cvConvertImage() calls were removed.

while code was added to adapt the colorspace, there is no more depth conversion to CV_8U

Steps to reproduce

//Mat m(400,400,CV_32FC3,Scalar(1.0));
Mat m(400,400,CV_16U,Scalar(255));
imshow("win",m);
waitKey();

leading to:

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

apart from the windows version (tried here), others will be affected:

window_w32.cpp

window_cocoa.mm

window_gtk.cpp

window_QT.cpp