System information (version)
- OpenCV => 4.5
- Operating System / Platform => Ubuntu 18.04
- Compiler => GCC
Detailed description
When calling inpaint function from xphoto module with INPAINT_FSR_(BEST/FAST) parameter, there is an OpenCV exception if the provided src image is different than CV_8U.
This behavior is due to the call to : "src.convertTo(src, CV_8U, 1/257.0)" whereas src is a const reference argument.
Steps to reproduce
#include <opencv2/xphoto/inpainting.hpp>
int main()
{
cv::Mat input_16U_img = cv::Mat::zeros(cv::Size(500,500), CV_16U);
cv::Mat mask = cv::Mat::zeros(input_16U_img.size(), CV_8U);
cv::Mat out_img;
cv::xphoto::inpaint(input_16U_img, mask, out_img, cv::xphoto::INPAINT_FSR_FAST);
return 0;
}