CCSTInpainter

PURPOSE ^

SYNOPSIS ^

This is a script file.

DESCRIPTION ^

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 classdef CCSTInpainter < FDPDEInpainter    
0002     % Continous Curvature Splines in Tension (CCST) inpainter
0003     % Implements the method in:
0004     %   Smith, W. H. F, and P. Wessel, 1990, Gridding with continuous curvature splines in tension, Geophysics, 55, 293-305.
0005     % Should mimic GMT surface (http://gmt.soest.hawaii.edu/doc/latest/surface.html)
0006     
0007     properties
0008         tension = 1e-2; % Tension parameter. Set it to 1 for harmonic interpolation and to 0 for biharmonic interpolation. Any value in between is a mix of both.
0009         laplacianStencil = [];
0010     end
0011     
0012     methods
0013         function obj = CCSTInpainter(varargin)
0014             obj@FDPDEInpainter(varargin{:});                        
0015             varargin = obj.removeParentParametersFromVarargin(varargin{:});
0016             
0017             p = inputParser;
0018             validTension = @(x) isscalar(x) && x >= 0 && x <=1;
0019             addParameter(p, 'Tension', 0, validTension);            
0020             parse(p, varargin{:});
0021             
0022             obj.tension = p.Results.Tension;
0023             
0024             % Compute the stencils
0025             obj.laplacianStencil = laplacian5PointsStencil(obj.hx, obj.hy);
0026         end
0027         
0028         function f = stepFun(obj, f, mask)
0029             laplacian = conv2(f, obj.laplacianStencil, 'same');
0030             biharmonic = conv2(laplacian, obj.laplacianStencil, 'same');
0031             
0032             f = (1-obj.tension).*biharmonic - obj.tension.*laplacian;
0033         end                
0034     end
0035 end

Generated on Thu 10-Dec-2020 17:34:27 by m2html © 2005