Skip to content

Bug in inpaint_fsr function for 16 bits / 32 bits / 64 bits images #2855

@ferreram

Description

@ferreram
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;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions