forked from wikimedia/integration-uprightdiff
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBlockMotionSearch.h
More file actions
38 lines (27 loc) · 829 Bytes
/
BlockMotionSearch.h
File metadata and controls
38 lines (27 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <opencv2/core/core.hpp>
class BlockMotionSearch {
public:
typedef cv::Mat_<cv::Vec3b> Mat3b;
typedef cv::Mat_<int> Mat1i;
enum {NOT_FOUND = 0x7fffffff};
static Mat1i Search(const Mat3b & alice, const Mat3b & bob,
int blockSize, int windowSize)
{
BlockMotionSearch obj(alice, bob, blockSize, windowSize);
return obj.search();
}
private:
BlockMotionSearch(const Mat3b & alice, const Mat3b & bob,
int blockSize, int windowSize)
: m_source(alice), m_dest(bob), m_blockSize(blockSize), m_windowSize(windowSize)
{}
Mat1i search();
bool tryMotion(const Mat3b & sourceBlock, int dy);
bool blockEqual(const Mat3b & m1, const Mat3b & m2);
const Mat3b & m_source;
const Mat3b & m_dest;
Mat1i m_blockMotion;
const int m_blockSize;
const int m_windowSize;
int m_xIndex, m_yIndex, m_x, m_y;
};