Open4
OpenCV 画像修復アルゴリズムを試す
INPAINT_NS
)
Navier-Stokes, Fluid Dynamics, and Image and Video Inpainting (
import cv2
import numpy as np
img = cv2.imread(filename="input.png")
mask = cv2.imread(filename="mask.png", flags=0)
dst = cv2.inpaint(src=img, inpaintMask=mask, inpaintRadius=3, flags=cv2.INPAINT_NS)
# 表示
cv2.imshow(winname="dst", mat=dst)
cv2.waitKey(0)
cv2.destroyAllWindows()
# 保存
cv2.imwrite(filename="output_ns.png", img=dst)
INPAINT_TELEA
)
An Image Inpainting Technique Based on the Fast Marching Method (
import cv2
import numpy as np
img = cv2.imread(filename="input.png")
mask = cv2.imread(filename="mask.png", flags=0)
dst = cv2.inpaint(src=img, inpaintMask=mask, inpaintRadius=3, flags=cv2.INPAINT_TELEA)
# 表示
cv2.imshow(winname="dst", mat=dst)
cv2.waitKey(0)
cv2.destroyAllWindows()
# 保存
cv2.imwrite(filename="output_telea.png", img=dst)
xphoto.INPAINT_SHIFTMAP
)
Statistics of Patch Offsets for Image Completion (