【发布时间】:2015-11-19 13:16:52
【问题描述】:
我正在使用 Qt 在 Android 上开发人脸识别应用程序。我的用户界面中有一个 QtQuickWidget;设法让 QtQuick 相机工作;但无法在 C++ 中获取帧。
我尝试了答案Qt QML Camera to C++ QImage on Android,这看起来像是问题的“解决方案”但是:ui->quickWidget->rootObject()->childItems() 没有相机项目.. 它有所有其他项目(按钮 1,vf)。所以 findChild 失败了。
请求对此有所了解。提前致谢。 QML:
import QtQuick 2.5
import QtMultimedia 5.5
Item {
id: camvf
Camera {
id: cam
objectName: "cam"
}
VideoOutput {
id: vf
objectName: "vf"
source: cam
width: parent.width
height: parent.height-100
anchors.top: parent.top
focus : visible // to receive focus and capture key events when visible
autoOrientation: true
}
Rectangle {
id: button1
objectName: "button1"
anchors.top:vf.bottom
width: parent.width
height: 100
}
}
【问题讨论】: