Skip to content
Snippets Groups Projects
Commit ad02b72b authored by Sebastian Hahta's avatar Sebastian Hahta
Browse files

linear weights to dual.hpp

parent 4c0de255
No related branches found
No related tags found
No related merge requests found
Pipeline #24362 failed
...@@ -17,11 +17,13 @@ namespace impl { ...@@ -17,11 +17,13 @@ namespace impl {
cost_a(w,h,dmin,dmax), cost_b(w,h,dmin,dmax) {} cost_a(w,h,dmin,dmax), cost_b(w,h,dmin,dmax) {}
__host__ __device__ inline unsigned short operator()(const int y, const int x, const int d) const { __host__ __device__ inline unsigned short operator()(const int y, const int x, const int d) const {
return (cost_a(y, x, d) + cost_b(y, x, d)); return cost_a(y,x,d)*wa + cost_b(y,x,d)*wb;
} }
A cost_a; A cost_a;
B cost_b; B cost_b;
float wa = 1.0;
float wb = 1.0;
}; };
} }
...@@ -41,6 +43,11 @@ public: ...@@ -41,6 +43,11 @@ public:
this->data().cost_b = cost_b.data(); this->data().cost_b = cost_b.data();
} }
void setWeights(float a, float b) {
this->data().wa = a;
this->data().wb = b;
}
static constexpr short COST_MAX = A::COST_MAX + B::COST_MAX; static constexpr short COST_MAX = A::COST_MAX + B::COST_MAX;
protected: protected:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment