Doc update, better member initialization, removed unused lines

This commit is contained in:
Phuntsok Drak-pa
2019-04-25 01:37:35 +02:00
parent d7d02cc73d
commit 8ec3db2450
2 changed files with 45 additions and 22 deletions

View File

@@ -9,7 +9,11 @@
#include <thread>
#include <utility>
auto const thread_nbr = std::thread::hardware_concurrency();
static auto const thread_nbr = std::thread::hardware_concurrency();
///////////////////////////////////////////////////////////////////////////////
// Public //
///////////////////////////////////////////////////////////////////////////////
// constructors ///////////////////////////////////////////////////////////////
/**
@@ -185,7 +189,11 @@ void ImageManipulator::write_file() const
cv::imwrite(output_path_, generated_image_);
}
// private methods ////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Private //
///////////////////////////////////////////////////////////////////////////////
// methods ////////////////////////////////////////////////////////////////////
/**
* Calculates the euclidian distance between the reference image and the image
@@ -281,6 +289,14 @@ void ImageManipulator::write_file() const
: std::nullopt;
}
/**
* Generates views and stores them in a double vector so the tiles (views) are
* stored by column top to bottom, and within the columns left to right.
*
* \param t_cols Number of columns the reference image should be divided into
* \param t_rows Number of rows the reference image should be divided into
* \return Collection of tiles (vector<vector<ImageManipulator>>)
*/
[[nodiscard]] auto ImageManipulator::generate_tiles(int const t_cols,
int const t_rows) const
{
@@ -388,6 +404,13 @@ void ImageManipulator::update_gen_image(cv::Mat const& t_img,
spdlog::debug("remaining iter: {}\tdiff: {}", remaining_iter_, diff_);
}
/**
* Merges the tiles generated by \ref method5 into a single image. The tiles
* are organized by column top to bottom, within each they are stored in order,
* left to right. They will be merged in \ref generated_image_.
*
* \param t_tiles Collection of tiles to be merged together
*/
void ImageManipulator::merge_tiles(
std::vector<std::vector<ImageManipulator>> t_tiles)
{
@@ -499,9 +522,8 @@ void ImageManipulator::method5(bool const t_controlled_size,
int const t_submethod)
{
spdlog::debug("Beginning method5, initial difference: {}", diff_);
spdlog::debug("nb_total_iter: {}, nb_remaining_iter: {}", total_iterations_,
remaining_iter_);
spdlog::debug("Running on {} threads", thread_nbr);
auto tiles = generate_tiles((t_cols != 0) ? t_cols : t_rows, t_rows);
spdlog::debug("{} tiles", tiles.size());