Ask Your Question

Revision history [back]

there is sample here White = good pixels and Black unknow pixel : inpaintMask Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that needs to be inpainted.

Now in xphoto : in c++

    Mat img = imread("g:/lib/opencv/samples/data/lena.jpg");
    Mat mask(img.size(),CV_8UC1,Scalar(255));
    circle(mask, Point(256, 256), 50, Scalar(0), -1);
    Mat res;
    cv::xphoto::inpaint(img, mask, res, cv::xphoto::INPAINT_SHIFTMAP);
    imshow("shiftmap", res);
    waitKey();

results is

image description

Same program in python

import numpy as np
import cv2 as cv
img = cv.imread('g:/lib/opencv/samples/data/lena.jpg')![image description](/upfiles/1555490158203588.jpg)
mask = 255 * np.ones((img.shape[0],img.shape[1]),np.uint8)
mask = cv.circle(mask,(256,256),0,-1)
res = np.array(img.shape,np.uint8)
cv.xphoto.inpaint(img,mask,res,cv.xphoto.INPAINT_SHIFTMAP)
cv.imshow('e',res)
cv.waitKey()
cv.destroyAllWindows()

result is an empty image

You should post an issue python binding is wrong and mask must be modify to use same definition

there is sample here White = good pixels and Black unknow pixel : inpaintMask Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that needs to be inpainted.

Now in xphoto : in c++

    Mat img = imread("g:/lib/opencv/samples/data/lena.jpg");
    Mat mask(img.size(),CV_8UC1,Scalar(255));
    circle(mask, Point(256, 256), 50, Scalar(0), -1);
    Mat res;
    cv::xphoto::inpaint(img, mask, res, cv::xphoto::INPAINT_SHIFTMAP);
    imshow("shiftmap", res);
    waitKey();

results is

image description

Same program in python

import numpy as np
import cv2 as cv
img = cv.imread('g:/lib/opencv/samples/data/lena.jpg')![image description](/upfiles/1555490158203588.jpg)
cv.imread('g:/lib/opencv/samples/data/lena.jpg')
mask = 255 * np.ones((img.shape[0],img.shape[1]),np.uint8)
mask = cv.circle(mask,(256,256),0,-1)
res = np.array(img.shape,np.uint8)
cv.xphoto.inpaint(img,mask,res,cv.xphoto.INPAINT_SHIFTMAP)
cv.imshow('e',res)
cv.waitKey()
cv.destroyAllWindows()

result is an empty image

image description

You should post an issue python binding is wrong and mask must be modify to use same definition

there is sample here White = good pixels and Black unknow pixel : inpaintMask Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that needs to be inpainted.

Now in xphoto : in c++

    Mat img = imread("g:/lib/opencv/samples/data/lena.jpg");
    Mat mask(img.size(),CV_8UC1,Scalar(255));
    circle(mask, Point(256, 256), 50, Scalar(0), -1);
    Mat res;
    cv::xphoto::inpaint(img, mask, res, cv::xphoto::INPAINT_SHIFTMAP);
    imshow("shiftmap", res);
    waitKey();

results is

image description

Same program in python

import numpy as np
import cv2 as cv
img = cv.imread('g:/lib/opencv/samples/data/lena.jpg')
mask = 255 * np.ones((img.shape[0],img.shape[1]),np.uint8)
mask = cv.circle(mask,(256,256),0,-1)
cv.circle(mask,(256,256),50,0,-1)
res = np.array(img.shape,np.uint8)
cv.xphoto.inpaint(img,mask,res,cv.xphoto.INPAINT_SHIFTMAP)
cv.imshow('e',res)
cv.waitKey()
cv.destroyAllWindows()

result is an empty image

image description

You should post an issue python binding is wrong and mask must be modify to use same definition

there is sample here White = good pixels and Black unknow pixel : inpaintMask Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that needs to be inpainted.

Now in xphoto : in c++

    Mat img = imread("g:/lib/opencv/samples/data/lena.jpg");
    Mat mask(img.size(),CV_8UC1,Scalar(255));
    circle(mask, Point(256, 256), 50, Scalar(0), -1);
    Mat res;
    cv::xphoto::inpaint(img, mask, res, cv::xphoto::INPAINT_SHIFTMAP);
    imshow("shiftmap", res);
    waitKey();

results is

image description

Same program in python

import numpy as np
import cv2 as cv
img = cv.imread('g:/lib/opencv/samples/data/lena.jpg')
mask = 255 * np.ones((img.shape[0],img.shape[1]),np.uint8)
mask = cv.circle(mask,(256,256),50,0,-1)
cv.circle(mask,(256,256),0,-1)
res = np.array(img.shape,np.uint8)
np.zeros(img.shape,np.uint8)
cv.xphoto.inpaint(img,mask,res,cv.xphoto.INPAINT_SHIFTMAP)
cv.imshow('e',res)
cv.waitKey()
cv.destroyAllWindows()

result is an empty image

image description

You should post an issue python binding is wrong and mask must be modify to use same definition

there is sample here White = good pixels and Black unknow pixel : inpaintMask Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that needs to be inpainted.

Now in xphoto : in c++

    Mat img = imread("g:/lib/opencv/samples/data/lena.jpg");
    Mat mask(img.size(),CV_8UC1,Scalar(255));
    circle(mask, Point(256, 256), 50, Scalar(0), -1);
    Mat res;
    cv::xphoto::inpaint(img, mask, res, cv::xphoto::INPAINT_SHIFTMAP);
    imshow("shiftmap", res);
    waitKey();

results is

image description

Same program in python

import numpy as np
import cv2 as cv
img = cv.imread('g:/lib/opencv/samples/data/lena.jpg')
mask = 255 * np.ones((img.shape[0],img.shape[1]),np.uint8)
mask = cv.circle(mask,(256,256),0,-1)
res = np.zeros(img.shape,np.uint8)
cv.xphoto.inpaint(img,mask,res,cv.xphoto.INPAINT_SHIFTMAP)
cv.imshow('e',res)
cv.waitKey()
cv.destroyAllWindows()

result is an empty image

image description

You should post an issue python binding is wrong wrong and mask must be modify to use same definition