{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Holefill - Holefill.m clear tic Constants Change patchL to...

Info icon This 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); jFillMax = max(jFill); jFillMin = min(jFill); if ((iFillMin <= patchL) | (iFillMax > imRows - patchL) | ...
Image of page 1

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern