Newer
Older
/*
* PeTrack - Software for tracking pedestrians movement in videos
* Copyright (C) 2023 Forschungszentrum Jülich GmbH, IAS-7
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <QtOpenGL>
#include <QtWidgets>
#include "alignmentGridBox.h"
#include "analysePlot.h"
#include "animation.h"
#include "autoCalib.h"
#include "autosaveSettings.h"
#include "backgroundItem.h"
#include "calibFilter.h"
#include "codeMarkerWidget.h"
#include "coordItem.h"
#include "coordinateSystemBox.h"
#include "editMoCapDialog.h"
#include "extrinsicBox.h"
#include "helper.h"
#include "intrinsicBox.h"
#include "multiColorMarkerItem.h"
#include "multiColorMarkerWidget.h"
#include "openMoCapDialog.h"
#include "pMessageBox.h"
#include "petrack.h"
#include "player.h"
#include "roiItem.h"
#include "stereoItem.h"
#include "stereoWidget.h"
#include "worldImageCorrespondence.h"
#include <QtPrintSupport/QPrintDialog>
#include <QtPrintSupport/QPrinter>
#include <cmath>
int Petrack::trcVersion = 0;
// Reihenfolge des anlegens der objekte ist sehr wichtig
Petrack::Petrack(QString petrackVersion) :
mExtrCalibration(mPersonStorage),
mPetrackVersion(std::move(petrackVersion)),
mAuthors(IO::readAuthors(QCoreApplication::applicationDirPath() + "/.zenodo.json"))
mHeadSize = -1;
mCmPerPixel = -1;
mScene = nullptr;
mTracker = nullptr;
mTrackerReal = nullptr; // damit beim zeichnen von control mit analysePlot nicht auf einen feheler laeuft
mStatusLabelFPS = nullptr;
mStatusLabelPosReal = nullptr;
mImageItem = nullptr;
mRecognitionChanged = true;
mTrackChanged = true;
mCoordItem = nullptr;
mImage = nullptr;
setLoading(true);
setAcceptDrops(true);
int space = 2;
mBrightContrastFilter.disable();
mBorderFilter.disable();
mSwapFilter.disable();
mBackgroundFilter.disable();
mTrackingRoiItem = new RoiItem(this, Qt::blue);
connect(mTrackingRoiItem, &RoiItem::changed, this, [=]() { this->setTrackChanged(true); });
mTrackingRoiItem->setZValue(4); // groesser heisst weiter oben
mRecognitionRoiItem = new RoiItem(this, Qt::green);
connect(mRecognitionRoiItem, &RoiItem::changed, this, [=]() { this->setRecognitionChanged(true); });
mRecognitionRoiItem->setZValue(5); // groesser heisst weiter oben
// setup control
auto updateImageCallback = [this]()
{
if(!isLoading())
{
updateImage();
}
};
auto updateStatusPos = [this]() { setStatusPosReal(); };
auto updateHeadSize = [this]() { setHeadSize(); };
auto getBorderSize = [this]() { return getImageBorderSize(); };
auto *filterBeforeBox = new FilterBeforeBox(
nullptr, // reparented when added to layout
*getBackgroundFilter(),
*getBrightContrastFilter(),
*getBorderFilter(),
*getSwapFilter(),
updateImageCallback);
auto *intrinsicBox = new IntrinsicBox(this, *getAutoCalib(), *getCalibFilter(), updateImageCallback);
auto *extrinsicBox = new ExtrinsicBox(this, *getExtrCalibration());
mImageItem = new ImageItem(this, nullptr);
auto *coordSysBox = new CoordinateSystemBox(
this,
updateStatusPos,
updateHeadSize,
getBorderSize,
*intrinsicBox,
*extrinsicBox,
*mImageItem,
mExtrCalibration);
auto *gridBox = new AlignmentGridBox(this);
mControlWidget = new Control(
*this,
*mScene,
mReco,
*mTrackingRoiItem,
*mRecognitionRoiItem,
mMissingFrames,
filterBeforeBox,
intrinsicBox,
extrinsicBox,
coordSysBox,
gridBox);
connect(mImageItem, &ImageItem::imageChanged, mControlWidget, &Control::imageSizeChanged);
mWorldImageCorrespondence = &mControlWidget->getWorldImageCorrespondence();
mStereoWidget = new StereoWidget(this);
mStereoWidget->setWindowFlags(Qt::Window);
mStereoWidget->setWindowTitle("Stereo parameter");
mColorRangeWidget = new ColorRangeWidget(this);
mColorRangeWidget->setWindowFlags(Qt::Window);
mColorRangeWidget->setWindowTitle("Color range");
mColorMarkerWidget = new ColorMarkerWidget(this);
mColorMarkerWidget->setWindowFlags(Qt::Window);
mColorMarkerWidget->setWindowTitle("Color marker parameter");
mCodeMarkerWidget = new CodeMarkerWidget(this, mReco.getCodeMarkerOptions(), nullptr);
mCodeMarkerWidget->setWindowFlags(Qt::Window);
mCodeMarkerWidget->setWindowTitle("Code marker parameter");
mMultiColorMarkerWidget = new MultiColorMarkerWidget(this);
mMultiColorMarkerWidget->setWindowFlags(Qt::Window);
mMultiColorMarkerWidget->setWindowTitle("MultiColor marker parameter");
mAnimation = new Animation(this);
Loading
Loading full blame...