Newer
Older
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
//
// if(iNumCompressors)
// {
// ICINFO* picinfo = new ICINFO[iNumCompressors];
// COMPVARS* comp = new COMPVARS[iNumCompressors];
// char *c;
//
// //
// // Retreive information about these compressors.
// //
// aviFile.enumerateCompressors(mIplImgFiltered->height, mIplImgFiltered->width, 8*mIplImgFiltered->nChannels, picinfo, iNumCompressors);
//
// for (int i=0; i<iNumCompressors; i++)
// {
// c = (char*) &(picinfo[i].fccHandler);
// debout << c[0] << c[1] << c[2] << c[3] << " " << (char *) picinfo[i].szName << endl;
// comp[i].cbSize = picinfo[i].dwSize;
// //comp[i].lQ = 100.; //picinfo[i].;
// comp[i].dwFlags = picinfo[i].dwFlags;
// comp[i].fccHandler = picinfo[i].fccHandler;
// comp[i].fccType = picinfo[i].fccType;
// //comp[i].cbState = ;
// //comp[i].lpState = ;
// }
//
// //
// // Set the compressor to the first one found.
// //
// //aviFile.setCompressor(comp);
//
// delete [] picinfo;
// }
if (saveView)
{
if (mCropZoomViewAct->isChecked())
viewImage = new QImage(mView->viewport()->width(), mView->viewport()->height(), QImage::Format_RGB32);
else
viewImage = new QImage((int) mScene->width(), (int) mScene->height(), QImage::Format_RGB32);
painter = new QPainter();
}
//CvSize size;
//size.width = mIplImgFiltered->width;
//size.height = mIplImgFiltered->height;
if (convert8To24bit)
mult = 3;
else
mult = 1;
//debout << "width: " << mIplImgFiltered->width << " height: " << mIplImgFiltered->height << endl;
//debout << "width: " << mView->viewport()->width() << " height: " << mView->viewport()->height() << endl;
//debout << "width: " << mScene->width() << " height: " << mScene->height() << endl;
//debout << "channels: " << mIplImgFiltered->nChannels << endl;
// debout << "viewImage: " << viewImage->depth() << endl;
bool ok = false;
if( saveView )
ok = aviFile.open(dest.toStdString().c_str(), viewImage->width(), viewImage->height(), viewImage->depth(), mAnimation->getFPS());
else
ok = aviFile.open(dest.toStdString().c_str(), mImg.cols, mImg.rows, mult*8*mImg.channels(), mAnimation->getFPS());
////vw = new cv::VideoWriter;
////vw->open(dest.toStdString().c_str(), CV_FOURCC_DEFAULT, mAnimation->getFPS(), size);
//// -1 muss unter linux durch CV_FOURCC('P','I','M','1') ist mpeg1 oder CV_FOURCC('M','J','P','G') ersetzt werden oder CV_FOURCC_DEFAULT
//// CV_FOURCC('D','I','B',' ') == 0 bedeutet rgb unkomprimiert - siehe http://opencvlibrary.sourceforge.net/VideoCodecs
//if (autoSave)
// videoWriter = cvCreateVideoWriter(dest.toStdString().c_str(), CV_FOURCC_DEFAULT, mAnimation->getFPS(), size); //, int is_color=1
//else
// videoWriter = cvCreateVideoWriter(dest.toStdString().c_str(), 0, mAnimation->getFPS(), size); //, int is_color=1
//// if codec is not supported or no codec is selected
//if (!videoWriter)
// return;
if (!ok)
{
debout << "Error: opening AVI file: " << dest.toStdString().c_str() << endl;
return;
}
}
// mPlayerWidget->skipToFrame(0); // koennte man auch weglassen, dann wurde von aktueller pos film geschrieben!!!
if (!saveVideo)
{
if (saveView)
{
if (mCropZoomViewAct->isChecked())
viewImage = new QImage(mView->viewport()->width(), mView->viewport()->height(), QImage::Format_RGB32);
else
viewImage = new QImage((int) mScene->width(), (int) mScene->height(), QImage::Format_RGB32);
painter = new QPainter();
}
// test, if fileformat is supported
if (mAnimation->isVideo())
{
// calculate string length of sequence number
while ((rest/=10) > 0)
numLength++;
fileName = (dest + "/" + mAnimation->getFileBase() + "%1.png").arg(mPlayerWidget->getPos(), numLength, 10, QChar('0'));
}
else
fileName = dest + "/" + mAnimation->getCurrentFileName();
if (saveView)
{
painter->begin(viewImage);
if (mCropZoomViewAct->isChecked())
mView->render(painter);
else
mScene->render(painter);
painter->end();
if (viewImage->save(fileName)) //, const char * format = 0 (format wird aus dateinamen geholt), int quality = -1 default normal (0..100)
{
formatIsSaveAble = true;
mPlayerWidget->frameForward();
}
}
else if (mImage->save(fileName)) //, const char * format = 0 (format wird aus dateinamen geholt), int quality = -1 default normal (0..100)
{
formatIsSaveAble = true;
mPlayerWidget->frameForward();
}
}
else if ((mImgFiltered.channels() == 1) /*&& convert8To24bit*/)
{
Size size;
size.width = mImgFiltered.cols;
size.height = mImgFiltered.rows;
iplImgFilteredBGR.create(size, CV_8UC3);
}
QProgressDialog progress("", "Abort save", 0, progEnd, this);
progress.setWindowModality(Qt::WindowModal); // blocks main window
if (saveVideo)
{
if (saveView)
progress.setLabelText("Save video view...");
else
progress.setLabelText("Save video...");
}else
{
if (saveView)
progress.setLabelText("Save view sequence...");
else
progress.setLabelText("Save image sequence...");
}
do
{
progress.setValue(mPlayerWidget->getPos()-memPos); // -mempos nur, wenn nicht an den anfang gesprungen wird
qApp->processEvents();
if (progress.wasCanceled())
break;
if (saveVideo)
{
// video sequence
if (saveView)
{
painter->begin(viewImage);
if (mCropZoomViewAct->isChecked())
mView->render(painter);
else
mScene->render(painter);
painter->end();
}
// debout << "nChannels: " << mIplImgFiltered->nChannels << endl;
if ((mImgFiltered.channels() == 1) /* && convert8To24bit*/)
{
//cvCvtColor(mIplImgFiltered, iplImgFilteredBGR, CV_GRAY2BGR);
cvtColor(mImg, iplImgFilteredBGR, COLOR_GRAY2BGR);
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
if( saveView )
writeFrameRet = aviFile.appendFrame((const unsigned char*) viewImage->bits(), true); // 2. param besagt, ob vertikal gespiegel werden soll
else
writeFrameRet = aviFile.appendFrame((const unsigned char*) iplImgFilteredBGR.data, true); // 2. param besagt, ob vertikal gespiegel werden soll
}
else
{
if( saveView ){
// debout << "." << endl;
writeFrameRet = aviFile.appendFrame((const unsigned char*) viewImage->bits(), true); // 2. param besagt, ob vertikal gespiegel werden soll
}else{
writeFrameRet = aviFile.appendFrame((const unsigned char*) mImg.data, true); // 2. param besagt, ob vertikal gespiegel werden soll
}
}
if (!writeFrameRet)
{
progress.setValue(progEnd);
QMessageBox::critical(this, tr("PeTrack"), tr("Cannot save %1 maybe because of wrong file extension or unsupported codec.").arg(dest));
break;
}
}
else
{
// single frame sequence
if (saveView)
{
painter->begin(viewImage);
if (mCropZoomViewAct->isChecked())
mView->render(painter);
else
mScene->render(painter);
painter->end();
}
if (mAnimation->isVideo())
{
fileName = (dest + "/" + mAnimation->getFileBase() + "%1.png").arg(mPlayerWidget->getPos(), numLength, 10, QChar('0'));
if (saveView)
saveRet = viewImage->save(fileName);
else
saveRet = mImage->save(fileName);
}
else if (formatIsSaveAble)
{
fileName = dest + "/" + mAnimation->getCurrentFileName();
if (saveView)
saveRet = viewImage->save(fileName);
else
saveRet = mImage->save(fileName);
}
else
{
fileName = dest + "/" + QFileInfo(mAnimation->getCurrentFileName()).completeBaseName() + ".png";
if (saveView)
saveRet = viewImage->save(fileName);
else
saveRet = mImage->save(fileName, "PNG"); //, int quality = -1 default normal (0..100)
}
if (!saveRet)
{
progress.setValue(progEnd);
QMessageBox::critical(this, tr("PeTrack"), tr("Cannot save %1.").arg(fileName));
break;
}
}
}
while (mPlayerWidget->frameForward());
if (!saveVideo && saveView)
{
delete viewImage;
delete painter;
}
// bei abbruch koennen es auch mPlayerWidget->getPos() frames sein, die bisher geschrieben wurden
//-memPos nur, wenn nicht an den anfang gesprungen wird
debout << "wrote " << mPlayerWidget->getPos()+1-memPos << " of " << mAnimation->getNumFrames() << " frames." << endl;
progress.setValue(progEnd);
if (saveVideo)
{
aviFile.close();
//cvReleaseVideoWriter(&videoWriter);
// if (iplImgFilteredBGR)
// cvReleaseImage(&iplImgFilteredBGR);
}
mPlayerWidget->skipToFrame(memPos);
lastDir = dest;
}
}
void Petrack::saveView(QString dest) //default = ""
{
static QString lastFile;
if(mImage)
{
// if no destination file or folder is given
if (dest.isEmpty())
{
if (lastFile.isEmpty() && !mSeqFileName.isEmpty())
lastFile = QFileInfo(mSeqFileName).path();
// alle unetrstuetzen fileformate erhaelt man mit
// QImageReader::supportedImageFormats() and QImageWriter::supportedImageFormats()
// gif muss nicht dabei sein, dazu muss qt mit -qt-gif uebersetzt worden sein
dest = QFileDialog::getSaveFileName(this, tr("Select image file"), lastFile,
tr("PDF (*.pdf);;Postscript (*.ps *.eps);;Windows bitmaps (*.bmp);;JPEG (*.jpeg *.jpg);;Portable network graphics (*.png);;Portable image format (*.pbm *.pgm *.ppm);;X11 Bitmap or Pixmap (*.xbm *.xpm);;Pixel Images (*.bmp *.jpeg *.jpg *.png *.pbm *.pgm *.ppm *.xbm *.xpm);;All supported types (*pdf *ps *.eps *.bmp *.jpeg *.jpg *.png *.pbm *.pgm *.ppm *.xbm *.xpm);;All files (*.*)"));
}
if (!dest.isEmpty())
{
if (dest.right(4) == ".pdf" || dest.right(3) == ".ps" || dest.right(4) == ".eps")
{
QPrinter printer(QPrinter::ScreenResolution); // HighResolution?
printer.setColorMode(QPrinter::Color);
//printer.setPageSize(QPrinter::A4);
//printer.setOutputFormat(QPrinter::PdfFormat); //QPrinter::PostScriptFormat automatisch durch dateiendung
printer.setOutputFileName(dest);
QPainter painter(&printer);
if (mCropZoomViewAct->isChecked())
mView->render(&painter);
else
mScene->render(&painter);
}
else
{
// schwarzer rand links und unten?!
QImage *img;
if (mCropZoomViewAct->isChecked())
img = new QImage(mView->viewport()->width(), mView->viewport()->height(), QImage::Format_RGB32);
else
img = new QImage((int) mScene->width(), (int) mScene->height(), QImage::Format_RGB32);
QPainter painter(img);
if (mCropZoomViewAct->isChecked())
mView->render(&painter);
else
mScene->render(&painter);
painter.end();
if (!img->save(dest)) //, "PNG"
QMessageBox::critical(this, tr("PeTrack"), tr("Cannot save %1 maybe because of wrong file extension.").arg(dest));
delete img;
}
lastFile = dest;
}
}
}
void Petrack::saveImage(QString dest) //default = ""
{
static QString lastFile;
if(mImage)
{
// if no destination file or folder is given
if (dest.isEmpty())
{
if (lastFile.isEmpty() && !mSeqFileName.isEmpty())
lastFile = QFileInfo(mSeqFileName).path();
// alle unetrstuetzen fileformate erhaelt man mit
// QImageReader::supportedImageFormats() and QImageWriter::supportedImageFormats()
// gif muss nict dabei sein, dazu muss qt mit -qt-gif uebesetz worden sein
dest = QFileDialog::getSaveFileName(this, tr("Select image file"), lastFile,
tr("PDF (*.pdf);;Postscript (*.ps *.eps);;Windows bitmaps (*.bmp);;JPEG (*.jpeg *.jpg);;Portable network graphics (*.png);;Portable image format (*.pbm *.pgm *.ppm);;X11 Bitmap or Pixmap (*.xbm *.xpm);;Pixel Images (*.bmp *.jpeg *.jpg *.png *.pbm *.pgm *.ppm *.xbm *.xpm);;All supported types (*pdf *ps *.eps *.bmp *.jpeg *.jpg *.png *.pbm *.pgm *.ppm *.xbm *.xpm);;All files (*.*)"));
}
if (!dest.isEmpty())
{
if (dest.right(4) == ".pdf" || dest.right(3) == ".ps" || dest.right(4) == ".eps")
{
QPrinter printer(QPrinter::ScreenResolution); // HighResolution?
printer.setColorMode(QPrinter::Color);
//printer.setPageSize(QPrinter::A4);
//printer.setOutputFormat(QPrinter::PdfFormat); //QPrinter::PostScriptFormat automatisch durch dateiendung
printer.setOutputFileName(dest);
QPainter painter(&printer);
QRect rect = painter.viewport();
QSize size = mImage->size();
size.scale(rect.size(), Qt::KeepAspectRatio);
painter.setViewport(rect.x(), rect.y(), size.width(), size.height());
painter.setWindow(mImage->rect());
painter.drawImage(0, 0, *mImage);
}
else
{
if (!mImage->save(dest)) //, "PNG"
QMessageBox::critical(this, tr("PeTrack"), tr("Cannot save %1 maybe because of wrong file extension.").arg(dest));
}
lastFile = dest;
}
}
}
void Petrack::print()
{
if(mImage)
{
// HighResolution font zu gross! und laengere laufzeit und eher overflow
// aber so pixelig und keine schoenen linien
QPrinter printer(QPrinter::ScreenResolution); //ScreenResolution, HighResolution// liefert zu hause: QWin32PrintEngine::initialize: GetPrinter failed ()
printer.setPageSize(QPrinter::A4);
QPrintDialog dialog(&printer, this);
//printer.setOutputFormat(QPrinter::PostScriptFormat);
if (dialog.exec()) {
QPainter painter(&printer);
mView->render(&painter);
// QRect rect = painter.viewport();
// QSize size = imageWidget->pixmap()->size();
// size.scale(rect.size(), Qt::KeepAspectRatio);
// painter.setViewport(rect.x(), rect.y(), size.width(), size.height());
// painter.setWindow(imageWidget->pixmap()->rect());
// painter.drawPixmap(0, 0, *imageWidget->pixmap());
// // print the upper half of the viewport into the lower.
// // half of the page.
// QRect viewport = view.viewport()->rect();
// view.render(&painter,
// QRectF(0, printer.height() / 2,
// printer.width(), printer.height() / 2),
// viewport.adjusted(0, 0, 0, -viewport.height() / 2));
}
}
else
QMessageBox::critical(this, tr("PeTrack"), tr("Nothing to print!"));
}
void Petrack::resetSettings()
{
mAnimation->reset();
openXml(mDefaultSettings);
// resetUI();
}
void Petrack::about()
{
//People/Pedestrian/Person tracking
QMessageBox::about(this, tr("About PeTrack"),
tr("<p><b>PeTrack</b> - Pedestrian tracking<br>" //
"Version " VERSION "<br>"
"(Build " COMPILE_DATE " " COMPILE_TIME ")</p>"
"<p>by Maik Boltes, Daniel Salden<br>"
"© Forschungszentrum Juelich GmbH</p>"));
//© © © (c)
// folgender befehl wird erst nach About-Fenster ausgefuehrt und ersetzt Icon im Hauptfenster
//QApplication::activeWindow()->setWindowIcon(QIcon(":/icon"));
// siehe auch Petrack::Petrack()
}
void Petrack::commandLineOptions()
{
//QTextBrowser(this);
//static QMessageBox* mb = NULL;
//if (mb == NULL)
//{
QMessageBox* mb = new QMessageBox(this); //QMessageBox mb(this);
mb->setAttribute(Qt::WA_DeleteOnClose);
mb->setWindowTitle(tr("Command line options"));
//mb->setWindowModality(Qt::NonModal);
mb->setModal(false); // if you want it non-modal
mb->setText(commandLineOptionsString);
mb->setStandardButtons(QMessageBox::Ok);
//}
//"<style>spantab {padding-left: 4em; margin-left:5em}</style><span class=\"tab\"></span>"
//"<p>Only to convert a video <kbd>video.avi</kbd> with settings stored in a petrack project file <kbd>project.pet</kbd> to an image sequence to be stored in the directory <kbd>folder</kbd> call:<br>"
//"<code>petrack.exe -project project.pet </code><br>"
//" <code>-sequence video.avi </code><br>"
//" <code>-autoSave folder</code></p>"
//To generate trajectories from a single image sequence frame000.jpg to frame345.jpg
//with settings stored in project.pet, export tracker file tracker_file and exit
//with saving the project to project.pet again:
//petrack.exe -project project.pet -sequence frame000.jpg -autoTrack tracker_file -autoSave project.pet
//For more information (especially key bindings) see http://www.fz-juelich.de/jsc/petrack/.
//Normal usage is interactive usage.
mb->show(); //mb->exec(); //mb->open();
// QMessageBox::about(this, tr("Command line options"), tr(
//"Beside the space bar all bindings only affect inside the image.<p>"
//"Space bar<br>blavbla"));
//Usage: petrack [-help|-?] [[-project] project.pet] [-sequence image_sequence_or_video] [-autoSave|-autosave image_folder_or_video|project.pet|tracker_file] [-autoTrack|-autotrack tracker_file] [-autoPlay|-autoplay tracker_file]
//Usage:
// ------
// petrack [-help|-?] [[-project] project.pet] [-sequence image_sequence_or_video] [-autoSave|-autosave image_folder_or_video|project.pet|tracker_file] [-autoTrack|-autotrack tracker_file] [-autoPlay|-autoplay tracker_file]
// -help|-? shows help information for command line options
// -project optional option to set project file to project.pet; otherwise the argument without option flag is used as project file
// -sequence loads image sequence or video image_sequence_or_video; option overwrites SRC attribute in project file
// -autoSave|-autosave if the argument ends with pet, a project file will be written to proj.pet at the end;
// if the argument ends with txt, dat or trav, the trajectories will be written in a format according to the suffix of tracker_file;
// otherwise image_folder_or_video is the folder to store the image sequence or a name of a video file for the direct export;
// in all cases PeTrack ends after finishing the work
// -autoTrack|-autotrack calculates automatically the trajectories of marked pedestrians and stores the result to tracker_file
// -autoPlay|-autoplay plays the video or image sequence and stores the trajectories to tracker_file
}
void Petrack::keyBindings()
{
QMessageBox* mb = new QMessageBox(this);
mb->setAttribute(Qt::WA_DeleteOnClose);
mb->setWindowTitle(tr("Command line options"));
mb->setModal(false); // if you want it non-modal
mb->setText(tr(
"<p>Beside the space bar all bindings only affect inside the image.</p>"
"<dl><dt><kbd>Space bar</kbd></dt><dd>toggles between pause and last play direction</dd>"
"<dt><kbd>Mouse scroll wheel</kbd></dt><dd>zooms in and out to or from the pixel of the image at the position of the mouse pointer</dd>"
"<dt><kbd>Shift + mouse scroll wheel</kbd></dt><dd>plays forwards or backwards frame by frame</dd>"
"<dt><kbd>Holding left mouse button</kbd></dt><dd>moves image</dd>"
"<dt><kbd>Arrows up/down</kbd></dt><dd>zoom in/out</dd>"
"<dt><kbd>Arrows left/right</kbd></dt><dd>frame back/forward</dd>"
"<dt><kbd>Double-click left mouse button</kbd></dt><dd>opens video or image sequence</dd>"
"<dt><kbd>Ctrl + double-click left mouse button</kbd></dt><dd>inserts new or moves near trackpoint</dd>"
"<dt><kbd>Ctrl + Shift + double-click left mouse button</kbd></dt><dd>splits near trackpoint before actual frame</dd>"
"<dt><kbd>Ctrl + double-click right mouse button</kbd></dt><dd>deletes a trajectory of a near trackpoint</dd>"
"<dt><kbd>Shift + double-click right mouse button</kbd></dt><dd>deletes the past part of a trajectory of a near trackpoint</dd>"
"<dt><kbd>Alt + double-click right mouse button</kbd></dt><dd>deletes the future part of a trajectory of a near trackpoint</dd>"
"<dt><kbd>Ctrl + double-click middle mouse button</kbd></dt><dd>deletes all trajectories</dd>"
"<dt><kbd>Shift + double-click middle mouse button</kbd></dt><dd>deletes the past part of all trajectories</dd>"
"<dt><kbd>Alt + double-click middle mouse button</kbd></dt><dd>deletes the future part of all trajectories</dd>"
"<dt><kbd>Shift + t</kbd></dt><dd>toggles tracking online calculation</dd>"
"<dt><kbd>Shift + double-click left mouse button</kbd></dt><dd>inserts new or moves near trackpoint and enables showing only the modified trajectory</dd></dl>"
"<p>Further key bindings you will find next to the entries of the menus.</p>"
));
//"Beside the space bar all bindings only affect inside the image.<p>"
//"Space bar<br>"
//" toggles between pause and last play direction<br>"
//"Mouse scroll wheel<br>"
//" zooms in and out to or from the pixel of the image at the position of the mouse pointer<br>"
//"Shift + mouse scroll wheel<br>"
//" plays forwards or backwards<br>"
//"Holding left mouse button<br>"
//" moves image<br>"
//"Arrows<br>"
//" moves image<br>"
//"Double-click left mouse button<br>"
//" opens video or image sequence<br>"
//"Ctrl + double-click left mouse button<br>"
//" inserts new or moves near trackpoint<br>"
//"Ctrl + double-click right mouse button<br>"
//" deletes a trajectory of a near trackpoint<br>"
//"Shift + double-click right mouse button<br>"
//" deletes the past part of a trajectory of a near trackpoint<br>"
//"Alt + double-click right mouse button<br>"
//" deletes the future part of a trajectory of a near trackpoint<br>"
//"Ctrl + double-click middle mouse button<br>"
//" deletes all trajectories<br>"
//"Shift + double-click middle mouse button<br>"
//" deletes the past part of all trajectories<br>"
//"Alt + double-click middle mouse button<br>"
//" deletes the future part of all trajectories<br>"
//"Shift + t<br>"
//" toggles tracking online calculation<br>"
//"Shift + double-click left mouse button<br>"
//" inserts new or moves near trackpoint and enables showing only the modified trajectory<p>"
//"Further key bindings you will find next to the entries of the menus."
mb->setStandardButtons(QMessageBox::Ok);
mb->show();
//QMessageBox::about(NULL, tr("Key bindings"), tr(
}
void Petrack::onlineHelp()
{
static QUrl url("http://www.fz-juelich.de/jsc/petrack/");
if (!(QDesktopServices::openUrl(url)))
QMessageBox::critical(this, tr("PeTrack"), tr("Cannot open external browser<br>with url ") + url.toString() + "!");
}
void Petrack::antialias()
{
mView->setRenderHint(QPainter::Antialiasing, mAntialiasAct->isChecked());
}
void Petrack::opengl()
{
mView->setViewport(mOpenGLAct->isChecked() ? new QGLWidget(QGLFormat(QGL::SampleBuffers)) : new QWidget);
// alten freigeben wegen new????
}
void Petrack::reset()
{
mViewWidget->resetView();
}
void Petrack::fitInView()
{
mViewWidget->fitInView();
}
void Petrack::fitInROI()
{
mViewWidget->fitInROI(getRecoRoiItem()->rect());
// what about trackingRoi???
}
void Petrack::setGlobalFont()
{
bool ok;
QFont font = QFontDialog::getFont(&ok, this->font(), this);
if (ok) {
this->setFont(font); // font is set to the font the user selected
} else {
// the user canceled the dialog; font is set to the initial
// value, in this case Times, 12.
}
//static QFont font("Courier", 10, QFont::Normal); //Times Helvetica, Normal Bold // QFont("Times", 12)
//this->setFont(font);
}
void Petrack::showHideControlWidget()
{
// show | hide Control
mViewWidget->hideControls(mHideControlsAct->isChecked());
}
void Petrack::setCamera()
{
#ifndef STEREO_DISABLED
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
if (mAnimation)
{
if (mCameraLeftViewAct->isChecked())
{
if ((mAnimation->getCamera()) != cameraLeft)
mAnimation->setCamera(cameraLeft); // war: hier wird direkt bei Umstellung neu gelesen
else
return;
}
else if (mCameraRightViewAct->isChecked())
{
if ((mAnimation->getCamera()) != cameraRight)
mAnimation->setCamera(cameraRight); // war: hier wird direkt bei Umstellung neu gelesen
else
return;
}
else // kann eigentlich nicht vorkommen
{
mAnimation->setCamera(cameraUnset);
return;
}
updateImage(mAnimation->getFrameAtIndex(mAnimation->getCurrentFrameNum())); // wird nur aufgerufen, wenn left / right sich geaendert hat
//mPlayerWidget->updateImage();
//mPlayerWidget->skipToFrame(mPlayerWidget->getPos()); // machtpasue!!
//updateImage(true); // nur dies aufrufen, wenn nicht links rechts gleichzeitig gehalten wird
}
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
}
void Petrack::createActions()
{
mOpenSeqAct = new QAction(tr("&Open Sequence"), this);
mOpenSeqAct->setShortcut(tr("Ctrl+Shift+O"));
connect(mOpenSeqAct, SIGNAL(triggered()), this, SLOT(openSequence()));
mOpenCameraAct = new QAction(tr("Open Camera Stream"), this);
//mOpenCameraAct->setShortcut(tr("Ctrl+C")); // because of some reason it is sometimes fired with Ctrl+LeftMouseButton ==> so disabled (it's also not really needed)
connect(mOpenCameraAct, SIGNAL(triggered()), this, SLOT(openCameraLiveStream()));
mSaveSeqVidAct = new QAction(tr("Save Video"), this);
//mSaveSeqVidAct->setShortcut(tr("Ctrl+E"));
mSaveSeqVidAct->setEnabled(false);
connect(mSaveSeqVidAct, SIGNAL(triggered()), this, SLOT(saveVideo()));
mSaveSeqVidViewAct = new QAction(tr("Save Video View"), this);
mSaveSeqVidViewAct->setShortcut(tr("Ctrl+E"));
mSaveSeqVidViewAct->setEnabled(false);
connect(mSaveSeqVidViewAct, SIGNAL(triggered()), this, SLOT(saveVideoView()));
mSaveSeqImgAct = new QAction(tr("Save Image S&equence"), this);
mSaveSeqImgAct->setShortcut(tr("Ctrl+F"));
mSaveSeqImgAct->setEnabled(false);
connect(mSaveSeqImgAct, SIGNAL(triggered()), this, SLOT(saveImageSequence()));
mSaveSeqViewAct = new QAction(tr("Save View S&equence"), this);
// mSaveSeqViewAct->setShortcut(tr("Ctrl+F"));
mSaveSeqViewAct->setEnabled(false);
connect(mSaveSeqViewAct, SIGNAL(triggered()), this, SLOT(saveViewSequence()));
mOpenPrAct = new QAction(tr("&Open Project"), this);
mOpenPrAct->setShortcut(tr("Ctrl+O"));
connect(mOpenPrAct, SIGNAL(triggered()), this, SLOT(openProject()));
mSavePrAct = new QAction(tr("&Save Project As"), this);
mSavePrAct->setShortcut(tr("Ctrl+Shift+S"));
connect(mSavePrAct, SIGNAL(triggered()), this, SLOT(saveProject()));
mSaveAct = new QAction(tr("&Save Project"), this);
mSaveAct->setShortcut(tr("Ctrl+S"));
connect(mSaveAct, SIGNAL(triggered()), this, SLOT(saveSameProject()));
mSaveImageAct = new QAction(tr("&Save Image"), this);
mSaveImageAct->setShortcut(tr("Ctrl+I"));
mSaveImageAct->setEnabled(false);
connect(mSaveImageAct, SIGNAL(triggered()), this, SLOT(saveImage()));
mSaveViewAct = new QAction(tr("&Save View"), this);
mSaveViewAct->setShortcut(tr("Ctrl+V"));
mSaveViewAct->setEnabled(false);
connect(mSaveViewAct, SIGNAL(triggered()), this, SLOT(saveView()));
mPrintAct = new QAction(tr("&Print"), this);
mPrintAct->setShortcut(tr("Ctrl+P"));
mPrintAct->setEnabled(false);
connect(mPrintAct, SIGNAL(triggered()), this, SLOT(print()));
mResetSettingsAct = new QAction(tr("&Reset Settings"), this);
// mResetSettingsAct->setShortcut(tr("Ctrl+R"));
mResetSettingsAct->setEnabled(false); // da es noch nicht fehlerfrei funktioniert
connect(mResetSettingsAct, SIGNAL(triggered()), this, SLOT(resetSettings()));
mExitAct = new QAction(tr("E&xit"), this);
mExitAct->setShortcut(tr("Ctrl+Q"));
connect(mExitAct, SIGNAL(triggered()), this, SLOT(close()));
mAntialiasAct = new QAction(tr("&Antialias"), this);
mAntialiasAct->setShortcut(tr("Ctrl+A"));
mAntialiasAct->setCheckable(true);
connect(mAntialiasAct, SIGNAL(triggered()), this, SLOT(antialias()));
mFontAct = new QAction(tr("&Font"), this);
connect(mFontAct, SIGNAL(triggered()), this, SLOT(setGlobalFont()));
mHideControlsAct = new QAction(tr("&Hide controls"), this);
mHideControlsAct->setShortcut(tr("Ctrl+H"));
mHideControlsAct->setCheckable(true);
connect(mHideControlsAct, SIGNAL(triggered()), this, SLOT(showHideControlWidget()));
connect(mHideControlsAct, SIGNAL(changed()),this, SLOT(showHideControlWidget()));
mCropZoomViewAct = new QAction(tr("&Transform while saving"), this); //Crop and zoom while saving
mCropZoomViewAct->setCheckable(true);
mOpenGLAct = new QAction(tr("Open&GL"), this);
mOpenGLAct->setShortcut(tr("Ctrl+G"));
mOpenGLAct->setCheckable(true);
connect(mOpenGLAct, SIGNAL(triggered()), this, SLOT(opengl()));
mResetAct = new QAction(tr("&Reset"), this);
mResetAct->setShortcut(tr("Ctrl+R"));
connect(mResetAct, SIGNAL(triggered()), this, SLOT(reset()));
mFitViewAct = new QAction(tr("Fit in window"), this); // Resize to window; fit in view; show all; in fenster einpassen
mFitViewAct->setShortcut(tr("Ctrl+0"));
connect(mFitViewAct, SIGNAL(triggered()), this, SLOT(fitInView()));
mFitROIAct = new QAction(tr("Fit in region of interest"), this); // Resize ROI to window; fit in view;
mFitROIAct->setShortcut(tr("Ctrl+1"));
connect(mFitROIAct, SIGNAL(triggered()), this, SLOT(fitInROI()));
mCameraGroupView = new QActionGroup(this);
//mCameraGroupView->addAction(mCameraLeftViewAct);
//mCameraGroupView->addAction(mCameraRightViewAct);
mCameraLeftViewAct = new QAction(tr("&Left"), mCameraGroupView);
mCameraLeftViewAct->setShortcut(tr("Ctrl++Shift+L"));
mCameraLeftViewAct->setCheckable(true);
connect(mCameraLeftViewAct, SIGNAL(triggered()), this, SLOT(setCamera()));
mCameraRightViewAct = new QAction(tr("&Right"), mCameraGroupView);
mCameraRightViewAct->setShortcut(tr("Ctrl++Shift+R"));
mCameraRightViewAct->setCheckable(true);
connect(mCameraRightViewAct, SIGNAL(triggered()), this, SLOT(setCamera()));
mCameraRightViewAct->setChecked(true); // right wird als default genommen, da reference image in triclops auch right ist // erste trj wurden mit left gerechnet
mFixToRealtime = new QAction(tr("&Realtime"));
connect(mFixToRealtime, &QAction::triggered, mPlayerWidget, [&](){mPlayerWidget->fixSpeedRelativeToRealtime(1.0);});
mFixTo2p00 = new QAction(tr("&x2"));
connect(mFixTo2p00, &QAction::triggered, mPlayerWidget, [&](){mPlayerWidget->fixSpeedRelativeToRealtime(2.0);});
mFixTo1p75 = new QAction(tr("&x1.75"));
connect(mFixTo1p75, &QAction::triggered, mPlayerWidget, [&](){mPlayerWidget->fixSpeedRelativeToRealtime(1.75);});
mFixTo1p50 = new QAction(tr("&x1.5"));
connect(mFixTo1p50, &QAction::triggered, mPlayerWidget, [&](){mPlayerWidget->fixSpeedRelativeToRealtime(1.5);});
mFixTo1p25 = new QAction(tr("&x1.25"));
connect(mFixTo1p25, &QAction::triggered, mPlayerWidget, [&](){mPlayerWidget->fixSpeedRelativeToRealtime(1.25);});
mFixTo0p75 = new QAction(tr("&x0.75"));
connect(mFixTo0p75, &QAction::triggered, mPlayerWidget, [&](){mPlayerWidget->fixSpeedRelativeToRealtime(0.75);});
mFixTo0p50 = new QAction(tr("&x0.5"));
connect(mFixTo0p50, &QAction::triggered, mPlayerWidget, [&](){mPlayerWidget->fixSpeedRelativeToRealtime(0.5);});
mFixTo0p25 = new QAction(tr("&x0.25"));
connect(mFixTo0p25, &QAction::triggered, mPlayerWidget, [&](){mPlayerWidget->fixSpeedRelativeToRealtime(0.25);});
mFixUnlimited = new QAction(tr("&Unlimited"));
connect(mFixUnlimited, &QAction::triggered, mPlayerWidget, [&](){mPlayerWidget->setPlayerSpeedFixed(false);});
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
// -------------------------------------------------------------------------------------------------------
QSignalMapper* signalMapper = new QSignalMapper(this);
mDelPastAct = new QAction(tr("&Past part of all trj."), this);
connect(mDelPastAct, SIGNAL(triggered()), signalMapper, SLOT(map()));
signalMapper->setMapping(mDelPastAct, -1);
connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(deleteTrackPointAll(int))); // -1
mDelFutureAct = new QAction(tr("&Future part of all trj."), this);
connect(mDelFutureAct, SIGNAL(triggered()), signalMapper, SLOT(map()));
signalMapper->setMapping(mDelFutureAct, 1);
connect(signalMapper, SIGNAL(mapped(int)), this, SLOT(deleteTrackPointAll(int))); // 1
mDelAllRoiAct = new QAction(tr("&Trj. moving through ROI"), this);
connect(mDelAllRoiAct, SIGNAL(triggered()), this, SLOT(deleteTrackPointROI()));
mDelPartRoiAct = new QAction(tr("Part of Trj. inside &ROI"), this);
connect(mDelPartRoiAct, SIGNAL(triggered()), this, SLOT(deleteTrackPointInsideROI()));
// -------------------------------------------------------------------------------------------------------
mCommandAct = new QAction(tr("&Command line options"), this);
connect(mCommandAct, SIGNAL(triggered()), this, SLOT(commandLineOptions()));
mKeyAct = new QAction(tr("&Key bindings"), this);
connect(mKeyAct, SIGNAL(triggered()), this, SLOT(keyBindings()));
mAboutAct = new QAction(tr("&About"), this);
connect(mAboutAct, SIGNAL(triggered()), this, SLOT(about()));
mOnlineHelpAct = new QAction(tr("Online &Help"), this);
mOnlineHelpAct->setShortcut(tr("Ctrl+H"));
connect(mOnlineHelpAct, SIGNAL(triggered()), this, SLOT(onlineHelp()));
}
void Petrack::createMenus()
{
mFileMenu = new QMenu(tr("&File"), this);
mFileMenu->addAction(mOpenPrAct);
mFileMenu->addAction(mSaveAct);
mFileMenu->addAction(mSavePrAct);
mFileMenu->addSeparator();
mFileMenu->addAction(mOpenSeqAct);
mFileMenu->addAction(mOpenCameraAct);
mFileMenu->addAction(mSaveSeqVidAct);
mFileMenu->addAction(mSaveSeqVidViewAct);
mFileMenu->addAction(mSaveImageAct);
mFileMenu->addAction(mSaveSeqImgAct);
mFileMenu->addAction(mSaveViewAct);
mFileMenu->addAction(mSaveSeqViewAct);
mFileMenu->addAction(mPrintAct);
mFileMenu->addSeparator();
mFileMenu->addAction(mResetSettingsAct);
mFileMenu->addSeparator();
mFileMenu->addAction(mExitAct);
mViewMenu = new QMenu(tr("&View"), this);
mViewMenu->addAction(mAntialiasAct);
mViewMenu->addAction(mOpenGLAct);
mViewMenu->addAction(mCropZoomViewAct);
mCameraMenu = mViewMenu->addMenu(tr("&Camera"));
mCameraMenu->addAction(mCameraLeftViewAct);
mCameraMenu->addAction(mCameraRightViewAct);
mFixPlaybackSpeedMenu = mViewMenu->addMenu(tr("&Max playback speed"));
mFixPlaybackSpeedMenu->addAction(mFixToRealtime);
mFixPlaybackSpeedMenu->addAction(mFixUnlimited);
mFixPlaybackSpeedMenu->addAction(mFixTo2p00);
mFixPlaybackSpeedMenu->addAction(mFixTo1p75);
mFixPlaybackSpeedMenu->addAction(mFixTo1p50);
mFixPlaybackSpeedMenu->addAction(mFixTo1p25);
mFixPlaybackSpeedMenu->addAction(mFixTo0p75);
mFixPlaybackSpeedMenu->addAction(mFixTo0p50);
mFixPlaybackSpeedMenu->addAction(mFixTo0p25);
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
mViewMenu->addSeparator();
mViewMenu->addAction(mFitViewAct);
mViewMenu->addAction(mFitROIAct);
mViewMenu->addAction(mResetAct);
mViewMenu->addSeparator();
mViewMenu->addAction(mFontAct);
mViewMenu->addSeparator();
mViewMenu->addAction(mHideControlsAct);
mDeleteMenu = new QMenu(tr("&Delete"), this);
mDeleteMenu->addAction(mDelPastAct);
mDeleteMenu->addAction(mDelFutureAct);
mDeleteMenu->addAction(mDelAllRoiAct);
mDeleteMenu->addAction(mDelPartRoiAct);
mHelpMenu = new QMenu(tr("&Help"), this);
mHelpMenu->addAction(mCommandAct);
mHelpMenu->addAction(mKeyAct);
mHelpMenu->addAction(mAboutAct);
mHelpMenu->addAction(mOnlineHelpAct);
menuBar()->addMenu(mFileMenu);
menuBar()->addMenu(mViewMenu);
menuBar()->addMenu(mDeleteMenu);
menuBar()->addMenu(mHelpMenu);
mCameraMenu->setEnabled(false);
}
void Petrack::createStatusBar()
{
QFont f("Courier", 12, QFont::Bold); //Times Helvetica, Normal
statusBar()->setMaximumHeight(28);
statusBar()->showMessage(tr("Ready"));
statusBar()->addPermanentWidget(mStatusLabelStereo = new QLabel(" "));
statusBar()->addPermanentWidget(mStatusLabelTime = new QLabel(" "));
statusBar()->addPermanentWidget(mStatusLabelFPS = new QLabel(" "));
statusBar()->addPermanentWidget(mStatusPosRealHeight = new QDoubleSpinBox());
connect(mStatusPosRealHeight, SIGNAL(valueChanged(double)), this, SLOT(setStatusPosReal()));
//mStatusPosRealHeight->setEnabled(false); // temporaer, damit nichts eingetragen werden kann!!!!!!
statusBar()->addPermanentWidget(mStatusLabelPosReal = new QLabel(" "));
statusBar()->addPermanentWidget(mStatusLabelPos = new QLabel(" "));
statusBar()->addPermanentWidget(mStatusLabelColor = new QLabel(" "));
mStatusLabelStereo->setFont(f);
mStatusLabelStereo->setMinimumWidth(200);
mStatusLabelTime->setFont(f);
mStatusLabelTime->setMinimumWidth(200);
//mStatusLabelTime->setAlignment(Qt::AlignRight); ??? verschiebt text nach oben???!!!
mStatusLabelFPS->setFont(f);
mStatusLabelFPS->setMinimumWidth(80);
mStatusLabelFPS->setAutoFillBackground(true);
mStatusLabelFPS->setToolTip("Click to adapt play rate to fps rate");
//mStatusLabelFPS->setFrameStyle(QFrame::VLine);
mStatusPosRealHeight->setRange(-999.9, 9999.9); // in cm
mStatusPosRealHeight->setDecimals(1);
mStatusPosRealHeight->setFont(f);
mStatusLabelPosReal->setFont(f);
mStatusLabelPosReal->setMinimumWidth(340);
// mStatusLabelPosReal->setFrameStyle(QFrame::Sunken|QFrame::Panel);
mStatusLabelPos->setFont(f);
mStatusLabelPos->setMinimumWidth(100);
//mStatusLabelPos->setFrameStyle(QFrame::VLine|QFrame::Sunken);
// debout << mStatusLabelPos->frameWidth() <<endl; ???? warum 0, daher wird auch sunken, vline nicht richtig gesetzt!!!!
mStatusLabelColor->setFont(f);
mStatusLabelColor->setMinimumWidth(90);
mStatusLabelColor->setAutoFillBackground(true);
}
void Petrack::resetUI()
{
///ToDo:
///
/// Reset all UI elements to default settings
/// Noetig damit alle UI Elemente, welche in der neu geladenen Projekt-Datei z.B. noch nicht vorhanden sind, auf sinnvolle Werte gesetzt werden.
/// Anderenfalls kommt es evtl. beim nacheinander laden verschiedener Projekte zu einem Programmabsturz
///
return;
/// sequence , height
mSeqFileName = "";
mAnimation->free();
if( mImage )
{
mImage->fill(QColor::fromRgb(255,255,255));
mImageItem->setImage(mImage);
mLogoItem->show();
}
mStatusPosRealHeight->setValue(180.0);
/// calibration params
/// image filters
mControlWidget->filterBrightContrast->setCheckState(Qt::Unchecked);
mControlWidget->filterBrightParam->setValue(0);
mControlWidget->filterContrastParam->setValue(0);
mControlWidget->filterBorder->setCheckState(Qt::Unchecked);
mControlWidget->filterBorderParamSize->setValue(0);
QColor defaultBorder = Qt::black;
getBorderFilter()->getBorderColR()->setValue(defaultBorder.red());
getBorderFilter()->getBorderColG()->setValue(defaultBorder.green());
getBorderFilter()->getBorderColB()->setValue(defaultBorder.blue());
mControlWidget->filterBg->setCheckState(Qt::Unchecked);
mControlWidget->filterBgDeleteNumber->setValue(3);
mControlWidget->filterBgDeleteTrj->setCheckState(Qt::Checked);
mControlWidget->filterBgShow->setCheckState(Qt::Unchecked);
mControlWidget->filterBgUpdate->setCheckState(Qt::Unchecked);
getBackgroundFilter()->setFilename(NULL);
getBackgroundFilter()->reset();
mControlWidget->filterSwap->setCheckState(Qt::Unchecked);
mControlWidget->filterSwapH->setCheckState(Qt::Unchecked);
mControlWidget->filterSwapV->setCheckState(Qt::Unchecked);
/// intrinsic params
mControlWidget->apply->setCheckState(Qt::Unchecked);
mControlWidget->fx->setValue(1000);
mControlWidget->fy->setValue(1000);
mControlWidget->cx->setValue(960);
mControlWidget->cx->setMinimum(0);
mControlWidget->cx->setMaximum(mControlWidget->cx->value()*2);
mControlWidget->cy->setValue(540);
mControlWidget->cx->setMinimum(0);
mControlWidget->cy->setMaximum(mControlWidget->cy->value()*2);
mControlWidget->r2->setValue(0);
mControlWidget->r4->setValue(0);
mControlWidget->r6->setValue(0);
mControlWidget->tx->setValue(0);
mControlWidget->ty->setValue(0);
//mControlWidget->k4->setValue(0);
//mControlWidget->k5->setValue(0);
//mControlWidget->k6->setValue(0);
mControlWidget->quadAspectRatio->setCheckState(Qt::Unchecked);
mControlWidget->fixCenter->setCheckState(Qt::Unchecked);
mControlWidget->tangDist->setCheckState(Qt::Checked);
getAutoCalib()->setBoardSizeX(6);
getAutoCalib()->setBoardSizeY(8);
getAutoCalib()->setSquareSize(5.0);
getAutoCalib()->setCalibFiles(QStringList());
/// extrinsic params
mControlWidget->trans1->setValue(0);
mControlWidget->trans2->setValue(0);
mControlWidget->trans3->setValue(-500);
mControlWidget->rot1->setValue(0);
mControlWidget->rot2->setValue(0);
mControlWidget->rot3->setValue(0);
getExtrCalibration()->setExtrCalibFile(NULL);
/// coord system
mControlWidget->coordShow->setCheckState(Qt::Unchecked);
mControlWidget->coordFix->setCheckState(Qt::Unchecked);
mControlWidget->coordTab->setCurrentIndex(0);
// 3D
mControlWidget->coord3DTransX->setValue(0);
mControlWidget->coord3DTransY->setValue(0);
mControlWidget->coord3DTransZ->setValue(0);
mControlWidget->coord3DAxeLen->setValue(200);
mControlWidget->coord3DSwapX->setCheckState(Qt::Unchecked);
mControlWidget->coord3DSwapY->setCheckState(Qt::Unchecked);
mControlWidget->coord3DSwapZ->setCheckState(Qt::Unchecked);
mControlWidget->extCalibPointsShow->setCheckState(Qt::Unchecked);
mControlWidget->extVanishPointsShow->setCheckState(Qt::Unchecked);
// 2D
mControlWidget->coordTransX->setValue(0);
mControlWidget->coordTransY->setValue(0);
mControlWidget->coordRotate->setValue(0);
mControlWidget->coordScale->setValue(100);