How do I develop a pseudo Zernike Moments proposed by Al-Rawi, 2010?
Afficher commentaires plus anciens
Based on the file shared here : fast computation of PZM by Sadeq al-Rawi,how do I continue the work to compute the moments based on his proposed method (mentioned in the paper 'Fast computation of pseudo Zernike moments')? I'd tried to build full code but it give me poor performance (in term of accuracy) when I implement it into face recognition system. EDIT: MY CODE IS AS FOLLOW:
img1 = imread('exp.bmp');
N = 4; %order
img =double(img1);
S = size(img, 1);
xstep = 2/(S-1);
[X ,Y] = meshgrid(0:xstep:1,0:xstep:1);
Rd = sqrt((2.*X-S+1).^2+(S-1-2.*Y).^2)/S;
theta = atan((S-1-2.*Y)/ (2.*X-S+1));
Rd = (Rd<=1).*Rd;
imshow(Rd);
Rd =[Rd(:)];
theta =[theta(:)];
Rad = pseudo_zernike_radial_polynomials(N, Rd);
op =[];
vectr = [];
prodc = [];
PZm = [];
%algorithm 2 as in al-rawi, 2010
psi = [];
arc = atan((S/2-10)/(S-20));
a = S-20;
b = S/2-10;
na = 20;
nb = S/2+10;
ay = 20;
nay = S-20;
bx = S/2+10;
nbx = S/2-10;
for m=0:N
if mod(m,2)==0
x1 = img(a,b)+img(na, nb);
x2 = img(a, nb) +img(na,b);
y1 = ((-1)^m/2)*(img(nbx, ay)+img(bx, nay));
y2 = ((-1)^m/2)*(img(bx, ay)+img(nbx, nay));
psii = cos (m*arc)*(x1+y1+x2+y2)-1j*sin(m*arc)*(x1+y1-x2-y2);
else
x1 = img(a,b)-img(na, nb);
x2 = img(a, nb) -img(na,b);
y1 = ((-1)^m/2)*(img(nbx, ay)-img(bx, nay));
y2 = ((-1)^m/2)*(img(bx, ay)-img(nbx, nay));
psii = cos(m*arc)*(x1+x2)+sin(m*arc)*(y1-y2)+1j*(cos(m*arc)*(y1+y2)-sin(m*arc)*(x1-x2));
end
psi =[psi,psii];
end
for ord = 0:N
for lpsi =1:length(psi)
prod = psi(lpsi).*Rad(ord+1,:)';
prodc = [prodc, prod];
PZmn = ((N+1)/pi)*sum(sum(prodc(:, ord+1)));
PZm = [PZm; PZmn];
end
end
Réponses (0)
Catégories
En savoir plus sur Zernike Polynomials dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!