Skip to content

Commit

Permalink
Fix more warnings in examples
Browse files Browse the repository at this point in the history
Completing #545
  • Loading branch information
mloskot committed Jan 28, 2021
1 parent 6f0a061 commit 5d63cf6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
6 changes: 5 additions & 1 deletion example/harris.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ void apply_gaussian_blur(gil::gray8_view_t input_view, gil::gray8_view_t output_
constexpr static auto filterHeight = 5ull;
constexpr static auto filterWidth = 5ull;
constexpr static double filter[filterHeight][filterWidth] = {
2, 4, 6, 4, 2, 4, 9, 12, 9, 4, 5, 12, 15, 12, 5, 4, 9, 12, 9, 4, 2, 4, 5, 4, 2,
{ 2, 4, 6, 4, 2 },
{ 4, 9, 12, 9, 4 },
{ 5, 12, 15, 12, 5},
{ 4, 9, 12, 9, 4 },
{ 2, 4, 5, 4, 2 }
};
constexpr double factor = 1.0 / 159;
constexpr double bias = 0.0;
Expand Down
10 changes: 5 additions & 5 deletions example/hessian.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ void apply_gaussian_blur(gil::gray8_view_t input_view, gil::gray8_view_t output_
constexpr static auto filter_width = 5ull;
constexpr static double filter[filter_height][filter_width] =
{
2, 4, 6, 4, 2,
4, 9, 12, 9, 4,
5, 12, 15, 12, 5,
4, 9, 12, 9, 4,
2, 4, 5, 4, 2,
{ 2, 4, 6, 4, 2 },
{ 4, 9, 12, 9, 4 },
{ 5, 12, 15, 12, 5 },
{ 4, 9, 12, 9, 4 },
{ 2, 4, 5, 4, 2 }
};
constexpr double factor = 1.0 / 159;
constexpr double bias = 0.0;
Expand Down
3 changes: 1 addition & 2 deletions example/hvstack.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "boost/gil/image_view_factory.hpp"
#include <boost/gil/image.hpp>
#include <boost/gil/image_view.hpp>
#include <cmath>
#include <numeric>
#include <stdexcept>
#include <vector>
Expand All @@ -15,7 +16,6 @@ void hstack(const std::vector<View>& views, const View& output_view)
}

auto height = views.front().height();
auto width = views.front().width();
for (const auto& view : views)
{
if (view.height() != height)
Expand Down Expand Up @@ -50,7 +50,6 @@ image<typename View::value_type> hstack(const std::vector<View>& views)
throw std::invalid_argument("empty views vector is passed - cannot create stacked image");
}

auto dimensions = views.front().dimensions();
std::ptrdiff_t full_width =
std::accumulate(views.begin(), views.end(), 0,
[](std::ptrdiff_t old, const View& view) { return old + view.width(); });
Expand Down

0 comments on commit 5d63cf6

Please sign in to comment.