Skip to content
Snippets Groups Projects
Commit 8a5fe815 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Revert to best cost

parent 3478218d
No related branches found
No related tags found
1 merge request!122Implements #183 depth ray correspondences
...@@ -139,7 +139,7 @@ __global__ void correspondence_energy_vector_kernel( ...@@ -139,7 +139,7 @@ __global__ void correspondence_energy_vector_kernel(
const uchar4 colour1 = c1.tex2D(x, y); const uchar4 colour1 = c1.tex2D(x, y);
float depth_accum = 0.0f; float bestdepth = 0.0f;
float bestweight = 0.0f; float bestweight = 0.0f;
int count = 0; int count = 0;
float contrib = 0.0f; float contrib = 0.0f;
...@@ -176,20 +176,20 @@ __global__ void correspondence_energy_vector_kernel( ...@@ -176,20 +176,20 @@ __global__ void correspondence_energy_vector_kernel(
++count; ++count;
contrib += weight; contrib += weight;
depth_accum += depth_adjust * weight;
if (weight > bestweight) { if (weight > bestweight) {
bestweight = weight; bestweight = weight;
bestdepth = depth_adjust;
} }
} }
const float avgweight = contrib/(float)count; const float avgweight = contrib/(float)count;
const float confidence = bestweight - avgweight; const float confidence = bestweight - avgweight;
if (contrib > 0.0f) { if (bestweight > 0.0f) {
float old = conf.tex2D(x,y); float old = conf.tex2D(x,y);
if (bestweight * confidence > old) { if (bestweight * confidence > old) {
dout(x,y) = depth_accum / contrib; dout(x,y) = bestdepth;
conf(x,y) = bestweight * confidence; conf(x,y) = bestweight * confidence;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment