forked from situkangsayur/MouseHandTrackingLK
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHistogramWindow.cpp
More file actions
executable file
·55 lines (45 loc) · 1.6 KB
/
HistogramWindow.cpp
File metadata and controls
executable file
·55 lines (45 loc) · 1.6 KB
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
/**
* MouseHandTracking is an application to control mouse pointer of the computer with hand gesture via camera
* Copyright (C) 2011 Hendri Karisma
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* contact author at situkangsayur[at]gmail[dot]com
*/
#include "HistogramWindow.h"
HistogramWindow::HistogramWindow(QWidget *parent) : QWidget(parent) {
QVBoxLayout *layout = new QVBoxLayout;
widgetHistogram= new QHistogramWidget(this);
layout->addWidget(widgetHistogram);
setLayout(layout);
resize(320, 200);
histogram = new ConHistogram();
startTimer(100); // 0.1-second timer
}
void HistogramWindow::setSet(int s){
this->set = s;
}
void HistogramWindow::setImage(IplImage *image){
this->img= image;
}
void HistogramWindow::timerEvent(QTimerEvent*) {
if(img != 0){
if(set==1){
histogram->setFrame(img);
histogram->progressImage();
widgetHistogram->putImage(histogram->getHistimg());
std::cout<<"in == 1"<<endl;
}
}
}