Hi!
I'm using this code (from the internet) to mask everything outside of the circle. I'm struggeling to adapt this code to replace the circle with a rectangle. Any suggestions?
maskGabor = (img);[rNum, cNum, ~] = size(maskGabor);% Define coordiantes and radius
[xx, yy] = ndgrid((1:rNum)-centerY, (1:cNum)-centerX); % generate grid with binary mask
mask = (xx.^2 + yy.^2)>radius^2; % define area outside of cirlce that will be masked
maskGabor(mask) = color; % color is gray
Many thanks, jk
Best Answer