The bulk of the software was
written in Matlab. Examples,
Program Flow, and Function
Synopsis are shown below.
run example.m in Matlab
im,
regionMask, method (= ‘Oliveira’) ® inpaintRegion ® reconstruct ® createIntensityMap ® relax ® out
im,
regionMask, method (= ‘Elder’) ® inpaintRegion ® edgeDetect ® getBoundaryEdgePoints
® prolongEdges ® reconstruct ® createIntensityMap ® relax ® out
function out = inpaintRegion(im, regionMask, method)
out
º grayscale image array
im º grayscale image array
regionMask
º mask of the gap to be inpainted
method º ‘Oliveira’ for simple diffusion from gap boundary, ‘Elder’ for Elder-influenced edge prolongation and diffusion from gap boundary
function edgeList = edgeDetect (im)
edgeList
º list of edge elements
edge
º edge structure
edge.i
edge.j
edge.I
edge.theta
edge.Id
edge.Il
edge.blur
im º grayscale image array
function out = reconstruct(edgeList, regionMask, boundaryMask,
boundaryMap)
out
º grayscale image array (valid only inside regionMask)
edgeList
º list of edge elements
regionMask
º mask of the gap to be inpainted
boundaryMask
º mask of the region boundary
boundaryMap
º intensity map of the values on the boundary
function [intensityMask,
intensityMap] = createIntensityMap(edgeList,
boundaryMask, boundaryMap)
intensityMask
º mask showing where intensityMap is valid
intensityMap
º intensity map derived from the boundary map and the
edge from edgeList
edgeList
º list of edge elements
boundaryMask
º mask of the region boundary
boundaryMap
º intensity map of the values on the boundary
function u = relax(regionMask, intensityMask, intensityMap,
method)
u º solution to Laplace’s equation given the boundary conditions (in intensityMap)
regionMask
º mask of the gap to be inpainted
intensityMask
º mask showing where intensityMap is valid
intensityMap
º intensity map derived from the boundary map and the
edge from edgeList
method
º ‘gauss’ for Gauss-Seidel method, ‘multigrid’ for
multigrid method (valid only for a square regionMask with length of a power of
2)