Facebook
From Violet Leech, 9 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 777
  1. %loop through image and apply mask randomly
  2. for i = 1 : step.h : input.h - window.h-step.h
  3.     for j = 1 : step.w : input.w - window.w-step.w
  4.        
  5.         % extract part of the image
  6.         window.current = input.image(i : i + window.h - 1, j : j + window.w - 1, :);
  7.        
  8.         % apply mask randomly
  9.         color = round(rand(1) * 5) + 1;
  10.         mask.current = mask.(fn{color});
  11.        
  12.         % apply
  13.        
  14.        
  15.     end
  16. end