This repository has been archived by the owner on Jun 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
blockmatching.cpp
71 lines (58 loc) · 1.73 KB
/
blockmatching.cpp
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include "blockmatching.h"
BlockMatching::BlockMatching() : QThread()
{
this->cbfSize = 3;
}
BlockMatching::~BlockMatching(){
delete this->firstFrame;
delete this->secondFrame;
}
/**
*
*/
void BlockMatching::setFirstFrame(QString firstFramePath){
this->firstFrameIsSet = true;
this->firstFrameIsSet = this->firstFrame->load(firstFramePath);
}
void BlockMatching::setFirstFrame(QImage *firstFrame){
this->firstFrameIsSet = true;
this->firstFrame = firstFrame;
}
/**
*
*/
void BlockMatching::setSecondFrame(QString secondFramePath){
this->secondFrameIsSet = true;
this->secondFrameIsSet = this->secondFrame->load(secondFramePath);
}
void BlockMatching::setSecondFrame(QImage *secondFrame){
this->secondFrameIsSet = true;
this->secondFrame = secondFrame;
}
/**
*
*/
void BlockMatching::setConstraitmentSizes(int patternSize, int windowSize){
this->blockSize = patternSize;
this->searchWindowSize = windowSize;
}
QList<QPair<QPoint,QPoint> > BlockMatching::getWhatToDraw(){
return this->toDraw;
}
void BlockMatching::setCoeficient(int value){
this->duplicatesCounter = value;
qDebug() << this->duplicatesCounter;
}
bool BlockMatching::pointInSearchWindow(QPoint point, QPoint searchWindow_Top_Left_Coord){
if(point.x() < searchWindow_Top_Left_Coord.x() || point.x() > searchWindow_Top_Left_Coord.x()+this->searchWindowSize)
return false;
if(point.y() < searchWindow_Top_Left_Coord.y() || point.x() > searchWindow_Top_Left_Coord.y()+this->searchWindowSize)
return false;
return true;
}
void BlockMatching::setHistorySize(int value){
this->historySize = value;
}
void BlockMatching::setOperationType(OperationType type){
this->operationType = type;
}