function [A,CM,ift] = Appell_rotation_invariants(img,r,p,t,thres,center,radius,coef) % Appellovy rotační invarianty A % CM jsou Appellovy komplexní momenty před normalizací na rotaci % % img obrázek % r maximální řád momentů % p='U' momenty U, p='V' momenty V, % t typ normalizace k rotaci % t=1; odečte se příslušný násobek fáze c_12 % t=2; vynásobí se příslušnou mocninou c_12 % thres práh absolutní hodnoty normalizačního momentu % If center=1 center of the image is mapped onto the center of the unit disk. % If center=2 centroid of the image is mapped onto the center of the unit disk. % If radius=1, the most distant corner is mapped onto the unit circle. % If radius=2, the most distant nonzero pixel is mapped onto the unit circle. % If radius=3, the sqrt(m00), is mapped onto the unit circle. % coef - the radius mapped onto the unit circle is multiplied by coef (implicitly 1). % It should be set so all objects from a database were mapped into % the unit disk. % AM = am(img, r); % AM = am_normalized(img,r,1,1,1); % [M,N] = meshgrid(0:r); % AM = AM./sqrt(factorial(M+N)).*gamma((M+N)/2+1)./factorial(M)./factorial(N); % AH = amdef(img,r,r); % AM = am_f(img,r); % [su,sv]=deal(zeros(1,r+1)); % for ri=0:r % for p=0:ri % q=ri-p; % su(ri+1)=su(ri+1)+abs(AH(p+1,q+1)); % sv(ri+1)=sv(ri+1)+abs(AM(p+1,q+1)); % end % su(ri+1)=su(ri+1)/(ri+1); % sv(ri+1)=sv(ri+1)/(ri+1); % end % [M,N] = meshgrid(0:r); % AM = AM.*(M+N+1)./sqrt(pi.*factorial(M+N).^1.5.*gamma((M+N)/2+1)); % AM = am_pseudonormalized(img,r,p,1,3,0.56); % AM = am_pseudonormalized(img,r,p,2,3,1); AM = am_pseudonormalized(img,r,p,center,radius,coef); CM = cmfromgm(r,AM); % A = RotInvs(CM,r,t); [A,ift] = RotInvsSym(CM,r,t,thres); end