guidedfilter: apply changes requested by @Floessie in code review
This commit is contained in:
@@ -66,7 +66,7 @@ void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2
|
|||||||
enum Op {MUL, DIVEPSILON, SUBMUL};
|
enum Op {MUL, DIVEPSILON, SUBMUL};
|
||||||
|
|
||||||
const auto apply =
|
const auto apply =
|
||||||
[=](Op op, array2D<float> &res, const array2D<float> &a, const array2D<float> &b, const array2D<float> &c=array2D<float>()) -> void
|
[multithread, epsilon](Op op, array2D<float> &res, const array2D<float> &a, const array2D<float> &b, const array2D<float> &c=array2D<float>()) -> void
|
||||||
{
|
{
|
||||||
const int w = res.width();
|
const int w = res.width();
|
||||||
const int h = res.height();
|
const int h = res.height();
|
||||||
@@ -96,13 +96,13 @@ void guidedFilter(const array2D<float> &guide, const array2D<float> &src, array2
|
|||||||
};
|
};
|
||||||
|
|
||||||
const auto f_subsample =
|
const auto f_subsample =
|
||||||
[=](array2D<float> &d, const array2D<float> &s) -> void
|
[multithread](array2D<float> &d, const array2D<float> &s) -> void
|
||||||
{
|
{
|
||||||
rescaleBilinear(s, d, multithread);
|
rescaleBilinear(s, d, multithread);
|
||||||
};
|
};
|
||||||
|
|
||||||
const auto f_mean =
|
const auto f_mean =
|
||||||
[&](array2D<float> &d, array2D<float> &s, int rad) -> void
|
[multithread](array2D<float> &d, array2D<float> &s, int rad) -> void
|
||||||
{
|
{
|
||||||
rad = LIM(rad, 0, (min(s.width(), s.height()) - 1) / 2 - 1);
|
rad = LIM(rad, 0, (min(s.width(), s.height()) - 1) / 2 - 1);
|
||||||
boxblur(s, d, rad, s.width(), s.height(), multithread);
|
boxblur(s, d, rad, s.width(), s.height(), multithread);
|
||||||
|
Reference in New Issue
Block a user