|
| drwnImageInPainter (unsigned _patchRadius=DEFAULT_RADIUS, bool _bAllowFromFilled=false) |
| construct an image inpainter object
|
|
virtual | ~drwnImageInPainter () |
| destructor
|
|
cv::Mat | fill (const cv::Mat &image, const cv::Mat &fillMask) const |
| inpaint the pixels within fillMask
|
|
cv::Mat | fill (const cv::Mat &image, const cv::Mat &fillMask, const cv::Mat ©Mask) const |
| inpaint the pixels within fillMask using only pixels from copyMask
|
|
cv::Mat | fill (const cv::Mat &image, const cv::Mat &fillMask, const cv::Mat ©Mask, const cv::Mat &ignoreMask) const |
| inpaint the pixels within fillMask using only pixels from copyMask and ignoring matching against pixels in ignoreMask
|
|
virtual void | monitor (const cv::Mat &image, const cv::Mat &mask) const |
| monitor function called each iteration (can be used to show progress)
|
|
Performs exemplar-based image inpainting.
Completes a masked part of an image with patches copied from other regions in the image. Motivated by the image completion algorithm of Criminisi et al., IEEE TIP, 2004 using the PatchMatch algorithm of Barnes et al. for finding patch candidates. An example code snippet is provided below:
cv::Mat img = cv::imread(imageFilename, CV_LOAD_IMAGE_COLOR);
DRWN_ASSERT_MSG(img.data, "could not read image from " << imageFilename);
cv::Mat mask = cv::Mat::zeros(img.rows, img.cols, CV_8UC1);
cv::rectangle(mask, cv::Point(img.cols / 4, img.rows / 4),
cv::Point(3 * img.cols / 4, 3 * img.rows / 4), cv::Scalar(0xff), -1);
inpainter.bVisualize = true;
cv::Mat output = inpainter.fill(img, mask);
cv::imwrite(outputFilename, output);