Wednesday, May 30. 2007Separable vs. non-separable latticesI used P. Prinz’ toolbox to compute a 2D dual atom on a separable lattice and on a quincunx lattice. It shows that even if both lattices have same redundancy, the dual might be better localized on the quincunx lattice: In this example, the norm difference of the “quincunx dual” to the original is about 0.1, and that between the “separable dual” and the original is almost 1.0. To achieve more similarity on the separable lattice, one has to take a higher redundancy. I’m still not sure what the term “separability” actually expresses for 4D lattices: There exist position lattices (on the image space), frequency lattices (on the FT space), and TF-lattices (for both dimensions). If the atom is separable into its two dimensions, then one can compute the two 1D duals and obtain the 2D dual from their tensor product. If one takes two quincunxes for computing those two 1D duals, does this correspond to a non-separable 4D PF-lattice? In the case of 1D signals, a separable TF-lattice means that there’s always the same set of frequencies taken at every position. A quincunx lattice means that there are two different sets of frequencies chosen alternately while walking along the position points. Maybe the same interpretation works for the 2D case. I haven’t analyzed Prinz’ routine yet, but I think that he takes a rectangular (separable) frequency lattice and shifts it alternately by a half of the lattice-point distance while walking along the position spots. Should one try to use a quincunx position lattice? Well, I’ll have to experminent with that. HGFei asked me to contact Søndergaard, because that topic of non-separability is currently not only “hot” for myself.
Posted by Stephan Paukner
in Master's Thesis
at
12:39
| Comments (0)
| Trackbacks (0)
Defined tags for this entry: mathematics
Friday, May 25. 2007Dilated + rotated 2D GaussianI’ve finally improved my script that computes a dilated and rotated 2D Gaussian with respect to low memory consumption. It applies a dilation and rotation matrix to the 2D domain. I published it under the GNU GPLv2, so if you find any improvements, you are forced to share them. I still have the impression that it is rather slow, but I currently don’t know how to do it better. Of course, it has to be evaluated on function g=nsgauss(p,q,vdil,hdil,rot) % Computes a non-separable (dilated + rotated) 2D Gaussian % Usage: g = nsgauss(p, q, vdil, hdil, rot); % Input: p,q .... size of g % vdil ... vertical dilation factor (before rotation) % hdil ... horizontal dilation factor (before rotation) % rot .... rotation angle, e.g. pi/4 % Example: % norm(nsgauss(p,q,1,1,0) - gaussnk(p)’*gaussnk(q)) == eps % % Version 0.2-20070525 % by Stephan Paukner {stephan+math at paukner dot cc} % Licensed under the GNU General Public License v2 % $Id: nsgauss.m,v 1.2 2007/05/25 10:14:52 ps Exp ps $ D=[1/vdil 0; 0 1/hdil]; %dilation matrix R=[cos(rot) -sin(rot); sin(rot) cos(rot)]’; %’%rotation matrix sp=sqrt(p); sq=sqrt(q); g=zeros(1,p*q); for jp=-3:3 for jq=-3:3 [x y]=meshgrid( (0:p-1)/sp + jp*sp , (0:q-1)/sq + jq*sq ); v=D*R*[x(:)’; y(:)’]; g=g+exp(-pi*(v(1,:).^2 + v(2,:).^2)); end end g=reshape(g,q,p)’; %’ g=g/norm(g,’fro’);
CODE: > tic; g1=gaussnk(600)’ * gaussnk(800); toc
Elapsed time is 0.100037 seconds.
> tic; g2=nsgauss(600,800,1,1,0); toc
Elapsed time is 19.163170 seconds.
> compnorm(g1,g2);
quotient of norms: norm(x)/norm(y) = 1
difference of normalized versions = 1.344e-16
Monday, May 21. 20072D dual via 1D dualYesterday I finally wrote a routine which computes a non-separable (dilated and rotated) 2D Gaussian. It takes parameters for horizontal and vertical dilation of the 2D Gaussian which is then rotated by a corresponding parameter. If it is neither dilated nor rotated, it is numerically identical to the pure 2D Gaussian. It has With this I could finally reproduce a graphic from the paper “2D-GA Based on 1D Algorithms”: It shows (1) a non-separable 2D atom with relatively prime height and width, (2) the atom mapped to vector shape, (3) the dual of that vector with regard to some combined time and frequency steps, and (4) the dual vector reshaped to an image. The question remains about how to finally do GA using these two 2D atoms. The only ways I found so far was either building the 1D Gabor system (of the atom shaped as vector) or computing a sampled STFT by that 1D vector; this works because modulations stay modulations. However, in the case of separable 2D atoms, this can be done in another way, as I’ll show in another article. Friday, May 18. 2007Images to vectors: Correct isomorphismI always wondered why it didn’t work to compute the dual Gabor atom by using the image-to-vector methods I explained previously [1,2,3]. Dr. Kaiblinger showed me that the correct way was to use that special isomorphism that walks along the diagonal of the image. Because width and height have to be relatively prime, that path spans the whole image space. And because there are no jumps over pixels, 2D-modulations stay 1D-modulations. This is not yet proved formally, but I can already show first experiments: CODE: > p=64; q=75; idx=linind(p,q); %index vector
> img=zeros(p,q); N=p*q
N = 4800
> img(idx(1:50))=1; imagesc(img); %step 50
> img(idx(1:100))=1; imagesc(img); %step 100
> img(idx(1:1000))=1; imagesc(img); %step 1000
> img(idx(1:4000))=1; imagesc(img); %step 4000
A 2D-frequency is given as a tensor product of two 1D-frequencies with signal lengths p and q, respectively. If their modulation parameters are given as kp and kq, then the corresponding 2D-modulation is given by a 1D-modulation of length N and parameter CODE: > kp=4; frp = exp(2*pi*i*(0:p-1) * kp/p);
> kq=3; frq = exp(2*pi*i*(0:q-1) * kq/q);
> frpq = frp’ * frq; size(frpq)
ans =
64 75
> imagesc(real(frpq)) CODE: > kN = mod(kq*p-kp*q, N)
kN = 4692
> frN = exp(2*pi*i*(0:N-1) * kN/N);
> plot(real(frN(1:1000))) CODE: > frN2=zeros(p,q);
> frN2(idx)=frN;
> compnorm(frpq, frN2)
quotient of norms: norm(x)/norm(y) = 1
difference of normalized versions = 1.478e-12
ans = 1.4780e-12 So those two 2D-frequencies are really identical. The plot of the second one is identical to the first one, so we skip it here. Now we want to see if the 2D-dual of a separable 2D atom obtained by that isomorphism is identical to the tensor product of the two 1D-duals. Continue reading "Images to vectors: Correct isomorphism"
(Page 1 of 1, totaling 4 entries)
|
AboutCalendarArchivesCategoriesShow tagged entriesandroid antenna anti-spam apache austria automobile ballooning bash bluetooth bug career cloud collecting cooking crypto cw debian diy dreams education electronics event fail fashion finance flickr fuerteventura fun gentoo geography german gnu-linux gnucash google google earth graphics guitar hardware history image processing internet kernel kids language lanzarote lhc lifestyle linkroll literature ltd machine learning making mallorca mathematics matlab migration munich music nautilus numismatics octave perl philately philosophy phone photo gear photography physics podcast politics postfix private programming public transport rant religion review salzburg samsung science security social web software statistics storage sustainability symbian tablet time lapse transceiver tv usenet venice video virtualization wordplay work www yahoo youtube
Syndicate This BlogFollow meBookmarks
Powered by |