1 Star 0 Fork 2

UyghurWeb/Hand

forked from eezprince/Hand 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
mainwindow.cpp 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
eezprince 提交于 2015-01-17 17:01 . eyes
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "facerecognizerstrategy.h"
#include <QFileDialog>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
m_timer = new QTimer(this);
m_recognizer = new Recognizer();
}
MainWindow::~MainWindow()
{
delete m_recognizer;
delete ui;
}
void MainWindow::on_pushButton_clicked()
{
/*Mat edges;
for(;;)
{
Mat frame;
cap>>frame;
cvtColor(frame,edges, CV_BGR2GRAY);
GaussianBlur(edges, edges,Size(7,7),1.5,1.5);
Canny(edges, edges,0,90,3);
imshow("qq",edges);
int c=waitKey(33);
if(c==27) break;
}*/
if (!m_recognizer->openCamera())
qDebug("fuck");
else
{
connect(m_timer, SIGNAL(timeout()), this, SLOT(onTimeout()));
m_timer->start(33);
}
}
void MainWindow::on_pushButton_2_clicked()
{
m_recognizer->closeCamera();
m_timer->stop();
disconnect(m_timer, SIGNAL(timeout()), this, SLOT(onTimeout()));
}
void MainWindow::onTimeout()
{
ui->label->setPixmap(QPixmap::fromImage(Mat2QImage::ConvertToQImage(m_recognizer->getFrame(0.5))));
ui->label->resize(ui->label->pixmap()->size());
}
void MainWindow::on_pushButton_3_clicked()
{
m_recognizer->setRecognizerStrategy(new FaceRecognizerStrategy());
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/UyghurWeb/Hand.git
git@gitee.com:UyghurWeb/Hand.git
UyghurWeb
Hand
Hand
master

搜索帮助