www.pudn.com > watermarking-with-Hus-moments.rar > calcir.m, change:2015-06-28,size:496b


function [ arry] = calcir(f,r) 
% in tabe braye mohasebeh moment haye 7 dayereh ast  
imageSize = size(f); 
ci = [r, r, 80];     % center and radius of circle ([c_row, c_col, r]) 
[xx,yy] = ndgrid((1:imageSize(1))-ci(1),(1:imageSize(2))-ci(2)); 
mask = uint8((xx.^2 + yy.^2)<ci(3)^2); 
croppedImage = uint8(zeros(size(f))); 
croppedImage(:,:,1) = f(:,:,1).*mask; 
croppedImage(:,:,2) = f(:,:,2).*mask; 
croppedImage(:,:,3) = f(:,:,3).*mask; 
% imshow(croppedImage); 
arry=croppedImage; 
 
end