09 Oct 2013
Extracts a patch from an image, given the center location and size of the patch.
function p = getPatch(I,x,y,wx,wy)
%% Returns the patch around the location (x,y) in the image 'I' and the patch 'p' is of size 'wy X wx'
% x - the x-coordinate of center
% y - the y-coordinate of center
% wx - the width of the patch in x - direction
% wy - the width of the patch in y- direction
% p - the patch
% X is horizontal direction
% Y is vertical direction
% if no 'wy' is inputted, wy=wx
% if the center of the patch is near boundary, p may be smaller than what you asked for;
% in that case, the patch present within the image region is returned
% Author : Mopuri K Reddy, SERC, IISc, INDIA.
% Date : 10/10/2013.
error('ERROR : Missing Input argument(s)');