You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.5 KiB
C

3 years ago
#pragma once
#include <vector>
#include <utility> // std::pair
3 years ago
#include <opencv2/opencv.hpp> // all opencv header
3 years ago
#include "hdrplus/burst.h"
3 years ago
namespace hdrplus
{
3 years ago
class align
{
public:
align() = default;
~align() = default;
/**
* @brief Run alignment on burst of images
*
* @param burst_images collection of burst images
* @param aligements alignment in pixel value pair.
* Outer most vector is per alternative image.
* Inner most two vector is for horizontle & verticle tiles
*/
void process( const hdrplus::burst& burst_images, \
std::vector<std::vector<std::vector<std::pair<int, int>>>>& aligements );
3 years ago
private:
// From original image to coarse image
const std::vector<int> inv_scale_factors = { 1, 2, 4, 4 };
const std::vector<int> distances = { 1, 2, 2, 2 }; // L1 / L2 distance
3 years ago
const std::vector<int> grayimg_search_radious = { 1, 4, 4, 4 };
const std::vector<int> grayimg_tile_sizes = { 16, 16, 16, 8 };
const int num_levels = 4;
3 years ago
};
3 years ago
void align_image_level( \
const cv::Mat& ref_img, \
const cv::Mat& alt_img, \
const std::vector<std::vector<std::pair<int, int>>>& reftiles_start, \
std::vector<std::vector<std::pair<int, int>>>& prev_aligement, \
std::vector<std::vector<std::pair<int, int>>>& alignment, \
int scale_factor_prev_curr, \
int tile_size, \
int prev_tile_size, \
int search_radiou, \
int distance );
3 years ago
} // namespace hdrplus