代码拉取完成,页面将自动刷新
同步操作将从 zhouxiang/ccface 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Window 2.2
import QtQuick.Dialogs 1.2
import OpenCV 1.0
ApplicationWindow {
title: qsTr("Hello World")
width: 640
height: 480
visible: true
menuBar: MenuBar {
Menu {
title: qsTr("&File")
MenuItem {
text: qsTr("&Open")
onTriggered: {
//messageDialog.show(qsTr("Open OpenCV triggered"));
opencvCamera.m_run = true
}
}
MenuItem {
text: qsTr("&Close")
onTriggered: {
//messageDialog.show(qsTr("Open OpenCV triggered"));
opencvCamera.m_run = false
}
}
MenuItem {
text: qsTr("E&xit")
onTriggered: Qt.quit();
}
}
}
OpenCVcamera {
id:opencvCamera
m_cameraId: 0
m_run: false
//width: 320
//height: 240
}
OpenCVshowFrame {
//anchors.centerIn: parent
anchors {left:parent.left; top:parent.top}
id:opencvShowFrame
m_capture: opencvCamera
m_frameRate: 33
m_run: true
width: 640
height: 380
onWho:{
console.log(i);
messageDialog.show(qsTr("ID:") + i);
}
}
Label {
id:label
anchors {left: parent.left;top:opencvShowFrame.bottom;topMargin: 10}
text: qsTr("")
}
TextField {
id:employeeId
y: 0
anchors {left: parent.left;top:label.bottom; topMargin: 5}
width: 80
height: 30
anchors.leftMargin: 0
validator: RegExpValidator {
regExp: /[0-9]+/
}
placeholderText:qsTr("ID")
}
Button {
id:button
text: qsTr("save")
anchors {left: employeeId.right;top:employeeId.top}
onClicked: {
if (employeeId.text.length !== 0 && opencvCamera.m_run) {
opencvShowFrame.setLabel(parseInt(employeeId.text))
console.log(parseInt(employeeId.text))
opencvShowFrame.startTrain()
messageDialog.show(qsTr("OK!"))
}
}
}
Button {
id:button2
text: qsTr("select")
anchors {right: parent.right;top:button.top}
onClicked: {
if (opencvCamera.m_run) {
opencvShowFrame.startPredict();
}
}
}
MessageDialog {
id: messageDialog
title: qsTr("May I have your attention, please?")
function show(caption) {
messageDialog.text = caption;
messageDialog.open();
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。