Skip to content

Commit 723499d

Browse files
committed
Edit comments
1 parent 86dc505 commit 723499d

File tree

2 files changed

+23
-333
lines changed

2 files changed

+23
-333
lines changed

include/boost/gil/extension/numeric/convolve.hpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ void convolve_1d(
375375
/// \brief Provides functionality for performing correlation between the kernel and buffer.
376376
/// Kernel size is to be provided through constructor for all instances.
377377
/// This correlator is specifically used in 2D correlation.
378+
/// \tparam PixelAccum Specifies tha data type which will be used for creating buffer container
379+
/// utilized for holding source image pixels after applying appropriate boundary manipulations.
378380
template <typename PixelAccum>
379381
class correlator_n_2d
380382
{
@@ -399,6 +401,9 @@ class correlator_n_2d
399401
/// \brief Provides functionality for performing correlation between the kernel and buffer.
400402
/// Kernel size is a template parameter and must be compulsorily specified while using.
401403
/// This correlator is specifically used in 2D correlation.
404+
/// \tparam kernel_dimension Stores vertical/horizontal length of kernel used for correlation.
405+
/// \tparam PixelAccum Specifies tha data type which will be used for creating buffer container
406+
/// utilized for holding source image pixels after applying appropriate boundary manipulations.
402407
template <std::size_t kernel_dimension, typename PixelAccum>
403408
struct correlator_k_2d
404409
{
@@ -439,7 +444,7 @@ void correlate_2d_impl(SrcView src_view, Kernel kernel, DstView dst_view,
439444
long unsigned int const left_extrapolation_size = kernel.left_size();
440445
long unsigned int const right_extrapolation_size = kernel.right_size();
441446

442-
bool explicit_fill = 1;
447+
bool explicit_fill = true;
443448
long unsigned int col = 0, row = 0;
444449
PixelAccum zero_pixel;
445450
pixel_zeros_t<PixelAccum>()(zero_pixel);
@@ -456,7 +461,7 @@ void correlate_2d_impl(SrcView src_view, Kernel kernel, DstView dst_view,
456461

457462
for (row = upper_extrapolation_size; row < src_view.height() - lower_extrapolation_size; ++row)
458463
{
459-
if (row - upper_extrapolation_size)
464+
if (row - upper_extrapolation_size > 0)
460465
{
461466
for (col = 0; col < src_view.width(); ++col)
462467
{
@@ -567,7 +572,7 @@ void correlate_2d_impl(SrcView src_view, Kernel kernel, DstView dst_view,
567572
}
568573
else if (option == boundary_option::extend_reflection)
569574
{
570-
explicit_fill = 0;
575+
explicit_fill = false;
571576
long unsigned int row_bound =
572577
kernel.size() - upper_extrapolation_size > upper_extrapolation_size ?
573578
kernel.size() - upper_extrapolation_size : upper_extrapolation_size;
@@ -660,7 +665,7 @@ void correlate_2d_impl(SrcView src_view, Kernel kernel, DstView dst_view,
660665
}
661666
}
662667

663-
if (explicit_fill)
668+
if (explicit_fill == true)
664669
{
665670
for (col = 0; col < src_view.width(); ++col)
666671
{
@@ -673,7 +678,7 @@ void correlate_2d_impl(SrcView src_view, Kernel kernel, DstView dst_view,
673678

674679
for (row = 0; row < src_view.height() - lower_extrapolation_size; ++row)
675680
{
676-
if (row)
681+
if (row > 0)
677682
{
678683
for (long unsigned int temp_col = 0; temp_col < left_extrapolation_size; ++temp_col)
679684
{
@@ -854,7 +859,7 @@ void correlate_2d_impl(SrcView src_view, Kernel kernel, DstView dst_view,
854859
template <typename Kernel, typename Container_1d>
855860
bool separate(Kernel const kernel, Container_1d& sep_ker_vertical, Container_1d& sep_ker_horizontal)
856861
{
857-
bool is_rank_1 = 1;
862+
bool is_rank_1 = true;
858863
sep_ker_vertical[0] = 1;
859864
for (std::size_t row = 1; row < kernel.size(); ++row)
860865
{
@@ -867,14 +872,14 @@ bool separate(Kernel const kernel, Container_1d& sep_ker_vertical, Container_1d&
867872
auto transformed_elem = mul_factor * kernel.at(col, 0);
868873
if (transformed_elem != kernel.at(col, row))
869874
{
870-
is_rank_1 = 0;
875+
is_rank_1 = false;
871876
break;
872877
}
873878
}
874-
if (is_rank_1 == 0)
879+
if (is_rank_1 == false)
875880
break;
876881
}
877-
if (is_rank_1)
882+
if (is_rank_1 == true)
878883
{
879884
for (std::size_t col = 0; col < kernel.size(); ++col)
880885
sep_ker_horizontal[col] = kernel.at(col, 0);
@@ -913,7 +918,7 @@ void correlate_2d(SrcView src_view, Kernel kernel, DstView dst_view,
913918

914919
std::vector<typename Kernel::value_type> sep_ker_vertical(kernel.size());
915920
std::vector<typename Kernel::value_type> sep_ker_horizontal(kernel.size());
916-
if (detail::separate(kernel, sep_ker_vertical, sep_ker_horizontal))
921+
if (detail::separate(kernel, sep_ker_vertical, sep_ker_horizontal) == true)
917922
{
918923
kernel_1d<typename Kernel::value_type> ver_kernel(sep_ker_vertical.begin(), kernel.size(),
919924
kernel.center_y());
@@ -960,7 +965,7 @@ void correlate_2d_fixed(SrcView src_view, Kernel kernel, DstView dst_view,
960965

961966
std::vector<typename Kernel::value_type> sep_ker_vertical(kernel.size());
962967
std::vector<typename Kernel::value_type> sep_ker_horizontal(kernel.size());
963-
if (detail::separate(kernel, sep_ker_vertical, sep_ker_horizontal))
968+
if (detail::separate(kernel, sep_ker_vertical, sep_ker_horizontal) == true)
964969
{
965970
kernel_1d_fixed<typename Kernel::value_type, Kernel::static_size> ver_kernel(
966971
sep_ker_vertical.begin(), kernel.center_y());

0 commit comments

Comments
 (0)