Commit 22e7d0c58d7c18b2ed7d8006663473548d1ed01e

Authored by Pavel Govyadinov
1 parent f31bf86d

Minor changes in order to accomodate better tracking of edges on a smaller field.

Showing 2 changed files with 17 additions and 9 deletions   Show diff stats
stim/cuda/cost.h
... ... @@ -67,7 +67,8 @@ void get_diff (float *result)
67 67  
68 68 float valIn = tex2D(texIn, x, y)/255.0;
69 69 float valTemp = Template(x);
70   - result[idx] = abs(valIn-valTemp);
  70 + //result[idx] = abs(valIn-valTemp);
  71 + result[idx] = abs(valIn);
71 72 }
72 73  
73 74  
... ...
stim/gl/gl_spider.h
... ... @@ -156,15 +156,21 @@ class gl_spider : public virtual gl_texture<T>
156 156 void
157 157 genDirectionVectors(float solidAngle = M_PI)
158 158 {
  159 + float x = 0.0;
  160 + vec<float> Y(1.0,0.0,0.0);
  161 + vec<float> pos(0.0,0.0,0.0);
  162 + vec<float> mag(1.0, 1.0, 1.0);
  163 + vec<float> dir(0.0, 0.0, 1.0);
  164 +
159 165 vec<float> d_s = direction.cart2sph().norm();
160 166 vec<float> temp;
161 167 int dim = (sqrt(numSamples)-1)/2;
162 168 float p0 = -M_PI;
163 169 float dt = solidAngle/(2.0 * ((float)dim + 1.0));
164 170 float dp = p0/(2.0*((float)dim + 1.0));
165   -
166 171 for(int i = -dim; i <= dim; i++){
167 172 for(int j = -dim; j <= dim; j++){
  173 +
168 174 //Create linear index
169 175  
170 176 temp[0] = d_s[0]; //rotate vector
... ... @@ -314,6 +320,7 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
314 320 }
315 321 ///@param v_x x-coordinate in buffer-space,
316 322 ///@param v_y y-coordinate in buffer-space.
  323 + ilVertex2f(0.0, j*10.0);
317 324 ///Samples the texturespace and places a sample in the provided coordinates
318 325 ///of bufferspace.
319 326 void
... ... @@ -751,9 +758,9 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
751 758 void
752 759 Step()
753 760 {
754   - findOptimalDirection();
755   - findOptimalPosition();
756   - findOptimalScale();
  761 + // findOptimalDirection();
  762 + // findOptimalPosition();
  763 + // findOptimalScale();
757 764 branchDetection();
758 765 }
759 766  
... ... @@ -797,13 +804,13 @@ class gl_spider : public virtual gl_texture&lt;T&gt;
797 804 x=r0*cos(i*2.0*M_PI/360.0);
798 805 y=r0*sin(i*2.0*M_PI/360.0);
799 806 glTexCoord3f(x,y,z0);
800   - glVertex2f(0.0, j*10.0+10.0);
  807 + glVertex2f(0.0, j*0.1+0.1);
801 808 glTexCoord3f(x,y,z1);
802   - glVertex2f(20.0, j*10.0+10.0);
  809 + glVertex2f(20.0, j*0.1+0.1);
803 810 glTexCoord3f(xold,yold,z1);
804   - glVertex2f(20.0, j*10.0);
  811 + glVertex2f(20.0, j*0.1);
805 812 glTexCoord3f(xold,yold,z0);
806   - glVertex2f(0.0, j*10.0);
  813 + glVertex2f(0.0, j*0.1);
807 814 xold=x;
808 815 yold=y;
809 816 j++;
... ...