Note that there are some explanatory texts on larger screens.

plurals
  1. POGabor Phase ?? my values are too small
    primarykey
    data
    text
    <p>Hi every one >> hope you all are doing fine </p> <p>I wanted to ask you about calculating the phase values for an image ,, you see I used the Gabor wavlet like so :</p> <pre><code>k = ( Kmax / ( f ^ v ) ) * exp( 1i * u * pi / 8 );% Wave Vector kn2 = ( abs( k ) ) ^ 2; GW = zeros ( R , C ); for m = -R/2 + 1 : R/2 for n = -C/2 + 1 : C/2 GW(m+R/2,n+C/2) = ( kn2 / Delt2 ) * exp( -0.5 * kn2 * ( m ^ 2 + n ^ 2 ) / Delt2) * ( exp( 1i * ( real( k ) * m + imag ( k ) * n ) ) - exp ( -0.5 * Delt2 ) ); end end I=imread('a.pgm'); Myimage=conv2(I,double(GW),'same'); </code></pre> <p>then I called the image and the filter with different orientations and scales and stored the phase in P then I wanted to quantize it with rang 4 i:</p> <pre><code>close all; clear all; clc; % Parameter Setting R = 32; C = 32; Kmax = pi; f = sqrt( 2 ); Delt = 2 * pi; Delt2 = Delt * Delt; % Show the Gabor Wavelets for v=1:7 %v = 1 : 7 for u = 1:5 % u= 1: 5 [GW,Myimage]= GaborWavelet ( R, C, Kmax, f, u, v, Delt2 ); % Create the Gabor wavelets figure; subplot( 5, 8, v * 7 + u ),imshow ( real( GW ) ,[]); % Show the real part of Gabor wavelets end figure ; subplot( 1, 5, v + 1 ),imshow ( abs( GW ),[]); % Show the magnitude of Gabor wavelets end %clear I; R=real(GW); I=imag(GW); M=abs(Myimage); P=atan(imag(Myimage)/real(Myimage)); &lt;&lt;&lt;&lt; is this even right ?? %P=atan(I/R); save P P; [xx,yy] = size (P); DATA =zeros(size(P)); for i=1:48 for j=1:48 for zz=1:3 if (360* zz/4) &lt;= abs(P(i,j))&amp;&amp; abs(P(i,j))&lt;(360*(zz+1)/4) DATA(i,j)=zz ; end; end; end; end; save DATA DATA ; </code></pre> <p>But the data is so small like : -1.49279186693682 1.50990968797986 -1.39225915272978 0.966151874072431</p> <p>which leads to quantized value of 0 >> Where did I go wrong </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload