Holefill - % Holefill.m clear; tic; % % Constants % %...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
% Holefill.m clear; tic; % % Constants % % Change patchL to change the patch size used (patch size is 2*patchL+1). patchL = 10; patchSize = 2 * patchL + 1; randomPatchSD = 1; % Standard deviation for random patch selection showResults = 1; % % Read input image % im = double(imread('donkey.jpg'))/255; [imRows, imCols, imBands] = size(im); % % Define hole and texture regions. This will use regions.mat if it exists, % but otherwise will allow the user to select the regions. % fid = fopen('regions.mat'); if (fid ~= -1) % file exists % Read regions from disk disp('Loading regions'); fclose(fid); load 'regions.mat' fillRegion textureRegion else % file does not exist % User define fill region disp('Select fill region'); fillRegion = roipoly(im); % User define texture region disp('Select texture region'); textureRegion = roipoly(im); % Save regions to disk save 'regions.mat' fillRegion textureRegion; end; % else % % Get coordinates for hole and texture regions % [iFill, jFill] = find(fillRegion); nFill = length(iFill); % Number of pixels to be filled iFillMax = max(iFill); iFillMin = min(iFill);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/29/2009 for the course CS cpsc425 taught by Professor Ed during the Winter '09 term at The University of British Columbia.

Page1 / 4

Holefill - % Holefill.m clear; tic; % % Constants % %...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online