From 22e7d0c58d7c18b2ed7d8006663473548d1ed01e Mon Sep 17 00:00:00 2001 From: pgovyadi Date: Tue, 7 Jul 2015 11:13:30 -0500 Subject: [PATCH] Minor changes in order to accomodate better tracking of edges on a smaller field. --- stim/cuda/cost.h | 3 ++- stim/gl/gl_spider.h | 23 +++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/stim/cuda/cost.h b/stim/cuda/cost.h index 5724614..2734f6d 100644 --- a/stim/cuda/cost.h +++ b/stim/cuda/cost.h @@ -67,7 +67,8 @@ void get_diff (float *result) float valIn = tex2D(texIn, x, y)/255.0; float valTemp = Template(x); - result[idx] = abs(valIn-valTemp); + //result[idx] = abs(valIn-valTemp); + result[idx] = abs(valIn); } diff --git a/stim/gl/gl_spider.h b/stim/gl/gl_spider.h index b7f9f9a..52e50bd 100644 --- a/stim/gl/gl_spider.h +++ b/stim/gl/gl_spider.h @@ -156,15 +156,21 @@ class gl_spider : public virtual gl_texture void genDirectionVectors(float solidAngle = M_PI) { + float x = 0.0; + vec Y(1.0,0.0,0.0); + vec pos(0.0,0.0,0.0); + vec mag(1.0, 1.0, 1.0); + vec dir(0.0, 0.0, 1.0); + vec d_s = direction.cart2sph().norm(); vec temp; int dim = (sqrt(numSamples)-1)/2; float p0 = -M_PI; float dt = solidAngle/(2.0 * ((float)dim + 1.0)); float dp = p0/(2.0*((float)dim + 1.0)); - for(int i = -dim; i <= dim; i++){ for(int j = -dim; j <= dim; j++){ + //Create linear index temp[0] = d_s[0]; //rotate vector @@ -314,6 +320,7 @@ class gl_spider : public virtual gl_texture } ///@param v_x x-coordinate in buffer-space, ///@param v_y y-coordinate in buffer-space. + ilVertex2f(0.0, j*10.0); ///Samples the texturespace and places a sample in the provided coordinates ///of bufferspace. void @@ -751,9 +758,9 @@ class gl_spider : public virtual gl_texture void Step() { - findOptimalDirection(); - findOptimalPosition(); - findOptimalScale(); + // findOptimalDirection(); + // findOptimalPosition(); + // findOptimalScale(); branchDetection(); } @@ -797,13 +804,13 @@ class gl_spider : public virtual gl_texture x=r0*cos(i*2.0*M_PI/360.0); y=r0*sin(i*2.0*M_PI/360.0); glTexCoord3f(x,y,z0); - glVertex2f(0.0, j*10.0+10.0); + glVertex2f(0.0, j*0.1+0.1); glTexCoord3f(x,y,z1); - glVertex2f(20.0, j*10.0+10.0); + glVertex2f(20.0, j*0.1+0.1); glTexCoord3f(xold,yold,z1); - glVertex2f(20.0, j*10.0); + glVertex2f(20.0, j*0.1); glTexCoord3f(xold,yold,z0); - glVertex2f(0.0, j*10.0); + glVertex2f(0.0, j*0.1); xold=x; yold=y; j++; -- libgit2 0.21.4