Is there any filter method keeping the 16-bit image? [closed]
Hello,
I am trying to filter the 16bit grayscale image with 16bit grayscale PSF. I tried cv::filter2D(inputImage, outputImage, -1, psf) where inputImage and psf are originally 16bit grayscale tiff files. But when I tried to convert outputImage using imwrite, it is unexpectedly compressed into 8bit image.
Did I do anything wrong? How can I filter the 16bit grayscale image with keeping 16bit grayscale?
My environment is OpenCV 3.4.1 and Visual Studio 2015.
https://docs.opencv.org/master/d4/d86...
can you addyour code to the question ?
Here is very simlified my implementation.
what is "outputFile" ?
writing CV_64 images is not supported from imwrite(). you probably need a conversion back to CV_16U, and an appropriate image format, like tiff or png
Thank you for great advice. I found if the image type is not supported on imwrite(), imwrite() forcedly converts the image into CV_8U. Converting the type into CV_16U went expectedly. Thanks!