18 #ifndef PIC_FEATURES_MATCHING_MOTION_ESTIMATION_HPP 19 #define PIC_FEATURES_MATCHING_MOTION_ESTIMATION_HPP 23 #include "../image.hpp" 24 #include "../util/std_util.hpp" 25 #include "../features_matching/patch_comp.hpp" 49 unsigned int currentTile = tiles->
getNext();
51 if(currentTile < tiles->tiles.
size()) {
52 int x = tiles->
tiles[currentTile].startX;
53 int y = tiles->
tiles[currentTile].startY;
73 float tmp_err =
pmc->
getSSD(x0, y0, x1, y1);
83 for(
int k=y; k<y_e; k++) {
84 for(
int l=x; l<x_e; l++) {
86 float *data = (*imgOut)(l, k);
129 if(img0 == NULL || img1 == NULL) {
143 float nPixels = float(img0->
nPixels());
144 float tmp = ceilf(log10f(nPixels));
152 this->width = img0->
width;
153 this->height = img0->
height;
172 int numCores = std::thread::hardware_concurrency();
174 std::thread **thrd =
new std::thread*[numCores];
176 for(
int i = 0; i < numCores; i++) {
177 thrd[i] =
new std::thread(
182 for(
int i = 0; i < numCores; i++) {
int shift
Definition: motion_estimation.hpp:35
int halfBlockSize
Definition: motion_estimation.hpp:35
T * delete_s(T *data)
delete_s
Definition: std_util.hpp:123
bool isSimilarType(const Image *img)
isSimilarType checks if the current image is similar to img; i.e. if they have the same width...
~MotionEstimation()
Definition: motion_estimation.hpp:115
The PatchComp class.
Definition: patch_comp.hpp:36
int blockSize
Definition: motion_estimation.hpp:35
static Image * execute(Image *img0, Image *img1, int blockSize, int maxRadius, Image *imgOut)
Execute.
Definition: motion_estimation.hpp:198
float getSSD(int x0, int y0, int x1, int y1)
getSSD
Definition: patch_comp.hpp:177
The MotionEstimation class.
Definition: motion_estimation.hpp:32
int nPixels() const
nPixels computes the number of pixels.
Definition: image.hpp:499
MotionEstimation(Image *img0, Image *img1, int blockSize, int maxRadius)
MotionEstimation.
Definition: motion_estimation.hpp:108
The TileList class.
Definition: tile_list.hpp:33
uint getNext()
getNext returns the index of the next tile to process.
Image * process(Image *imgOut)
execute
Definition: motion_estimation.hpp:163
int width
Definition: motion_estimation.hpp:36
int height
Definition: motion_estimation.hpp:36
The Image class stores an image as buffer of float.
Definition: image.hpp:60
PatchComp * pmc
Definition: motion_estimation.hpp:37
void processAux(TileList *tiles, Image *imgOut)
processAux
Definition: motion_estimation.hpp:44
Definition: bilateral_separation.hpp:25
#define MAX(a, b)
Definition: math.hpp:73
int width
Definition: image.hpp:80
int height
Definition: image.hpp:80
void setup(Image *img0, Image *img1, int blockSize, int maxRadius)
setup
Definition: motion_estimation.hpp:127
std::vector< Tile > tiles
tiles a list of tiles
Definition: tile_list.hpp:50