Skip to content

Commit

Permalink
comparison operator changed to > from >= for threshold value comp…
Browse files Browse the repository at this point in the history
…arison
  • Loading branch information
miralshah365 committed Jul 10, 2019
1 parent 0809f2d commit 3f42ff8
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions include/boost/gil/image_processing/threshold.hpp
Expand Up @@ -82,14 +82,16 @@ void threshold_binary
if (direction == threshold_direction::regular)
{
detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
[threshold_value, max_value](source_channel_t px) ->
result_channel_t { return px >= threshold_value ? max_value : 0; });
[threshold_value, max_value](source_channel_t px) -> result_channel_t {
return px > threshold_value ? max_value : 0;
});
}
else
{
detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
[threshold_value, max_value](source_channel_t px) ->
result_channel_t { return px >= threshold_value ? 0 : max_value; });
[threshold_value, max_value](source_channel_t px) -> result_channel_t {
return px > threshold_value ? 0 : max_value;
});
}
}

Expand Down Expand Up @@ -150,29 +152,33 @@ void threshold_truncate
if (direction == threshold_direction::regular)
{
detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
[threshold_value](source_channel_t px) -> result_channel_t
{ return px >= threshold_value ? threshold_value : px; });
[threshold_value](source_channel_t px) -> result_channel_t {
return px > threshold_value ? threshold_value : px;
});
}
else
{
detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
[threshold_value](source_channel_t px) -> result_channel_t
{ return px >= threshold_value ? px : threshold_value; });
[threshold_value](source_channel_t px) -> result_channel_t {
return px > threshold_value ? px : threshold_value;
});
}
}
else
{
if (direction == threshold_direction::regular)
{
detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
[threshold_value](source_channel_t px) -> result_channel_t
{ return px >= threshold_value ? px : 0; });
[threshold_value](source_channel_t px) -> result_channel_t {
return px > threshold_value ? px : 0;
});
}
else
{
detail::threshold_impl<source_channel_t, result_channel_t>(src_view, dst_view,
[threshold_value](source_channel_t px) -> result_channel_t
{ return px >= threshold_value ? 0 : px; });
[threshold_value](source_channel_t px) -> result_channel_t {
return px > threshold_value ? 0 : px;
});
}
}
}
Expand Down

0 comments on commit 3f42ff8

Please sign in to comment.