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

Colour confidence

parent 8a5fe815
No related branches found
No related tags found
1 merge request!122Implements #183 depth ray correspondences
This commit is part of merge request !122. Comments created here will be created in the context of that merge request.
...@@ -141,6 +141,8 @@ __global__ void correspondence_energy_vector_kernel( ...@@ -141,6 +141,8 @@ __global__ void correspondence_energy_vector_kernel(
float bestdepth = 0.0f; float bestdepth = 0.0f;
float bestweight = 0.0f; float bestweight = 0.0f;
float bestcolour = 0.0f;
float totalcolour = 0.0f;
int count = 0; int count = 0;
float contrib = 0.0f; float contrib = 0.0f;
...@@ -176,14 +178,16 @@ __global__ void correspondence_energy_vector_kernel( ...@@ -176,14 +178,16 @@ __global__ void correspondence_energy_vector_kernel(
++count; ++count;
contrib += weight; contrib += weight;
bestcolour = max(cweight, bestcolour);
totalcolour += cweight;
if (weight > bestweight) { if (weight > bestweight) {
bestweight = weight; bestweight = weight;
bestdepth = depth_adjust; bestdepth = depth_adjust;
} }
} }
const float avgweight = contrib/(float)count; const float avgcolour = totalcolour/(float)count;
const float confidence = bestweight - avgweight; const float confidence = bestcolour - avgcolour;
if (bestweight > 0.0f) { if (bestweight > 0.0f) {
float old = conf.tex2D(x,y); float old = conf.tex2D(x,y);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment