function b = normalizeperimage(a) imlab = getident(a,'image'); ll = unique(imlab); b = a; for i=1:ll I = find(imlab==i); wsc = scalem(a(I,:),'variance'); b(I,:) = a(I,:)*wsc; end