weitingchen83 / PMS-Net

This is the source code of PMS-Net: Robust Haze Removal Based on Patch Map for Single Images which has been published in CVPR 2019 Long Beach
https://weitingchen83.github.io/PMS-Net/
MIT License
19 stars 14 forks source link

When I run your 'test.py', the final dtype of recover_result is float64 which cannot saved by cv2.imwrite. #2

Closed RaybingChung closed 3 years ago

RaybingChung commented 3 years ago

When I run your 'test.py', the final dtype of recover_result is float64 which cannot saved by cv2.imwrite.

I just wonder how u store the image.

It will get the following error message:

imwrite_('result/py_recover__waterfall.tif'): cant write data: OpenCV(4.4.0) c:\users\appveyor\appdata\local\temp\1\pip-req-build-h4wtvo23\opencv\modules\imgproc\src\color.simd_helpers.hpp:94: error: (-2:Unspecified error) in function __cdecl cv::impl::anonymous-namespace::CvtHelper<struct cv::impl::anonymous namespace::Set<3,4,-1>,struct cv::impl::A0xe4950f71::Set<3,4,-1>,struct cv::impl::A0xe4950f71::Set<0,2,5>,2>::CvtHelper(const class cv::_InputArray &,const class cv::_OutputArray &,int)
 Unsupported depth of input image:
     VDepth::contains(depth)
 where
     depth' is 6 (CV_64F)

Process finished with exit code 0

Far worse, when I use your pretrained model to test your sample image 'waterfall', I just subtract the matric of recover_result to the matric cv2.imread from your sample result. Its different value ranges from -0.5576927539273697 to 196.71127494022517. Maybe the pretrained model is damaged?

RaybingChung commented 3 years ago

Maybe tiff format is not compatible enough in Win10. I just change the image format of output to bitmap, it works.