summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-10-16 23:29:51 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-10-17 03:16:10 +0200
commit6f757249bb9f3dc7b5f1a0fb892bc52a462c3f0a (patch)
treeca6aa4cad267d7160f40ece3265ee5e006bcd491
parent4157874768594164e1d5b366e5a9cb9bc931e761 (diff)
ui tweaks: lcd float display, linux camera path
Signed-off-by: Stanislaw Halik <sthalik@misaki.pl>
-rw-r--r--facetracknoir/facetracknoir.cpp33
1 files changed, 21 insertions, 12 deletions
diff --git a/facetracknoir/facetracknoir.cpp b/facetracknoir/facetracknoir.cpp
index 197e9fa6..0e7e25ec 100644
--- a/facetracknoir/facetracknoir.cpp
+++ b/facetracknoir/facetracknoir.cpp
@@ -264,6 +264,15 @@ void FaceTrackNoIR::GetCameraNameDX() {
pEnumCat->Release();
}
pSysDevEnum->Release();
+#else
+ for (int i = 0; i < 16; i++) {
+ char buf[128];
+ sprintf(buf, "/dev/video%d", i);
+ if (access(buf, R_OK | W_OK) == 0) {
+ ui.cameraName->setText(QString(buf));
+ break;
+ }
+ }
#endif
}
@@ -753,14 +762,14 @@ void FaceTrackNoIR::showHeadPose() {
const QString format("%1");
tracker->getHeadPose(newdata);
- ui.lcdNumX->display(format.arg(newdata[TX], 0, 'f', 1));
- ui.lcdNumY->display(format.arg(newdata[TY], 0, 'f', 1));
- ui.lcdNumZ->display(format.arg(newdata[TZ], 0, 'f', 1));
+ ui.lcdNumX->display(newdata[TX]);
+ ui.lcdNumY->display(newdata[TY]);
+ ui.lcdNumZ->display(newdata[TZ]);
- ui.lcdNumRotX->display(format.arg(newdata[Yaw], 0, 'f', 1));
- ui.lcdNumRotY->display(format.arg(newdata[Pitch], 0, 'f', 1));
- ui.lcdNumRotZ->display(format.arg(newdata[Roll], 0, 'f', 1));
+ ui.lcdNumRotX->display(newdata[Yaw]);
+ ui.lcdNumRotY->display(newdata[Pitch]);
+ ui.lcdNumRotZ->display(newdata[Roll]);
//
// Get the output-pose and also display it.
@@ -769,13 +778,13 @@ void FaceTrackNoIR::showHeadPose() {
ui.pose_display->rotateBy(newdata[Yaw], newdata[Roll], newdata[Pitch]);
- ui.lcdNumOutputPosX->display(format.arg(newdata[TX], 0, 'f', 1));
- ui.lcdNumOutputPosY->display(format.arg(newdata[TY], 0, 'f', 1));
- ui.lcdNumOutputPosZ->display(format.arg(newdata[TZ], 0, 'f', 1));
+ ui.lcdNumOutputPosX->display(newdata[TX]);
+ ui.lcdNumOutputPosY->display(newdata[TY]);
+ ui.lcdNumOutputPosZ->display(newdata[TZ]);
- ui.lcdNumOutputRotX->display(format.arg(newdata[Yaw], 0, 'f', 1));
- ui.lcdNumOutputRotY->display(format.arg(newdata[Pitch], 0, 'f', 1));
- ui.lcdNumOutputRotZ->display(format.arg(newdata[Roll], 0, 'f', 1));
+ ui.lcdNumOutputRotX->display(newdata[Yaw]);
+ ui.lcdNumOutputRotY->display(newdata[Pitch]);
+ ui.lcdNumOutputRotZ->display(newdata[Roll]);
if (_curve_config) {
_curve_config->update();