Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ped-dyn-emp/petrack
1 result
Show changes
Commits on Source (18)
Showing with 429 additions and 29 deletions
......@@ -51,6 +51,11 @@
"affiliation": "Forschungszentrum Jülich GmbH",
"name": "Schrödter, Tobias",
"orcid": "0000-0002-1071-060X"
},
{
"affiliation": "Forschungszentrum Jülich GmbH",
"name": "Klein, Janine",
"orcid": "0000-0003-0660-158X"
}
]
}
......@@ -377,6 +377,8 @@ target_sources(petrack_core PRIVATE
include/moCapSelectionWidget.h
include/personStorage.h
include/autosave.h
include/manualTrackpointMover.h
include/frameRange.h
)
target_sources(petrack_core PRIVATE
......@@ -437,6 +439,7 @@ target_sources(petrack_core PRIVATE
src/moCapSelectionWidget.cpp
src/personStorage.cpp
src/autosave.cpp
src/manualTrackpointMover.cpp
ui/about.ui
ui/codeMarker.ui
ui/colorMarker.ui
......
......@@ -591,6 +591,12 @@ private slots:
void setMoCapSize(int size);
void toggleRecoROIButtons();
void toggleTrackROIButtons();
void on_boardSizeX_valueChanged(int arg1);
void on_boardSizeY_valueChanged(int arg1);
void on_squareSize_valueChanged(double arg1);
signals:
void userChangedRecoMethod(reco::RecognitionMethod method);
......
/*
* PeTrack - Software for tracking pedestrians movement in videos
* Copyright (C) 2010-2022 Forschungszentrum Jülich GmbH,
* Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand,
* Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann
*
* 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/>.
*/
#ifndef FRAMERANGE_H
#define FRAMERANGE_H
struct FrameRange
{
int before = 0;
int after = 0;
int current = 0;
};
#endif // FRAMERANGE_H
......@@ -292,6 +292,8 @@ inline clock_t getElapsedTime()
lastTime = clock();
return diffTime;
}
bool lessThanVersion(const QString &q1, const QString &q2);
/**
* Computes the median of the values in a given vector.
......
/*
* PeTrack - Software for tracking pedestrians movement in videos
* Copyright (C) 2010-2022 Forschungszentrum Jülich GmbH,
* Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand,
* Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann
*
* 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/>.
*/
#ifndef MANUALTRACKPOINTMOVER_H
#define MANUALTRACKPOINTMOVER_H
#include "frameRange.h"
#include "personStorage.h"
class ManualTrackpointMover
{
public:
bool selectTrackPoint(
const QPointF &pos,
const PersonStorage &personStore,
const QSet<int> &peds,
const FrameRange &range);
void moveTrackPoint(const QPointF &pos, PersonStorage &personStore) const;
void setTrackPoint();
private:
PersonFrame mSelectedPerson = PersonFrame{-1, -1};
};
#endif // MANUALTRACKPOINTMOVER_H
......@@ -21,6 +21,7 @@
#ifndef PERSONSTORAGE_H
#define PERSONSTORAGE_H
#include "frameRange.h"
#include "tracker.h"
#include <vector>
......@@ -56,6 +57,7 @@ public:
bool editTrackPersonComment(const Vec2F &p, int frame, const QSet<int> &onlyVisible);
bool setTrackPersonHeight(const Vec2F &p, int frame, const QSet<int> &onlyVisible);
bool resetTrackPersonHeight(const Vec2F &p, int frame, QSet<int> onlyVisible);
void moveTrackPoint(int personID, int frame, const Vec2F &newPosition);
size_t nbPersons() const { return mPersons.size(); }
const TrackPerson &at(size_t i) const { return mPersons.at(i); }
......@@ -82,8 +84,8 @@ public:
int largestFirstFrame() const;
int largestLastFrame() const;
int smallestFirstFrame() const;
std::vector<PersonFrame>
getProximalPersons(const QPointF &pos, int frame, QSet<int> selected, int before, int after) const;
[[nodiscard]] std::vector<PersonFrame>
getProximalPersons(const QPointF &pos, QSet<int> selected, const FrameRange &frameRange) const;
void recalcHeight(float altitude);
void clear() { mPersons.clear(); }
......@@ -121,7 +123,7 @@ public:
// rueckgabewert false wenn keine hoeheninformationen in tracker datensatz vorliegt
bool printHeightDistribution();
void setMarkerHeights(const std::unordered_map<int, float> &heights);
void setMarkerID(int person, int markerIDs, bool manual = false);
void setMarkerID(int personIndex, int markerIDs, bool manual = false);
void setMarkerIDs(const std::unordered_map<int, int> &markerIDs);
void purge(int frame);
......
......@@ -39,6 +39,7 @@
#include "brightContrastFilter.h"
#include "coordItem.h"
#include "extrCalibration.h"
#include "manualTrackpointMover.h"
#include "moCapController.h"
#include "moCapPerson.h"
#include "personStorage.h"
......@@ -156,6 +157,9 @@ public slots:
void deleteTrackPointAll(PersonStorage::Direction direction);
void deleteTrackPointROI();
void deleteTrackPointInsideROI();
void moveTrackPoint(QPointF pos);
void selectPersonForMoveTrackPoint(QPointF pos);
void releaseTrackPoint();
// void showContextMenu(QPointF pos);
void updateSourceInOutFrames();
void skipToFrameWheel(int delta);
......@@ -497,6 +501,8 @@ private:
double mHeadSize;
double mCmPerPixel;
ManualTrackpointMover mManualTrackPointMover;
double mShowFPS;
bool mAutoBackTrack;
......
......@@ -48,7 +48,10 @@ public:
void wheelEvent(QWheelEvent *event) override;
void mouseDoubleClickEvent(QMouseEvent *event) override;
void keyPressEvent(QKeyEvent *event) override;
void keyReleaseEvent(QKeyEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
signals:
void mouseDoubleClick();
......@@ -59,6 +62,10 @@ signals:
void mouseRightDoubleClick(QPointF pos, int direction);
void mouseMiddleDoubleClick(PersonStorage::Direction direction);
void mouseShiftWheel(int delta);
void mouseAltPressed(QPointF pos);
void mouseAltReleased(QPointF pos);
void altReleased();
void mouseAltMoved(QPointF pos);
void colorSelected();
void setColorEvent();
};
......
......@@ -2504,6 +2504,22 @@ void Control::on_newModelCheckBox_stateChanged(int i)
}
intrError->setText(QString("invalid"));
}
void Control::on_boardSizeX_valueChanged(int x)
{
mMainWindow->getAutoCalib()->setBoardSizeX(x);
}
void Control::on_boardSizeY_valueChanged(int y)
{
mMainWindow->getAutoCalib()->setBoardSizeY(y);
}
void Control::on_squareSize_valueChanged(double s)
{
mMainWindow->getAutoCalib()->setSquareSize(s);
}
void Control::on_autoCalib_clicked()
{
mMainWindow->getAutoCalib()->autoCalib();
......@@ -3470,17 +3486,15 @@ void Control::getXml(QDomElement &elem)
{
if(subSubElem.hasAttribute("BOARD_SIZE_X"))
{
mMainWindow->getAutoCalib()->setBoardSizeX(subSubElem.attribute("BOARD_SIZE_X").toInt()); // 6
boardSizeX->setValue(subSubElem.attribute("BOARD_SIZE_X").toInt());
}
if(subSubElem.hasAttribute("BOARD_SIZE_Y"))
{
mMainWindow->getAutoCalib()->setBoardSizeY(
subSubElem.attribute("BOARD_SIZE_Y").toInt()); // 8 oder 9
boardSizeY->setValue(subSubElem.attribute("BOARD_SIZE_Y").toInt());
}
if(subSubElem.hasAttribute("SQUARE_SIZE"))
{
mMainWindow->getAutoCalib()->setSquareSize(
subSubElem.attribute("SQUARE_SIZE").toDouble()); // in cm
squareSize->setValue(subSubElem.attribute("SQUARE_SIZE").toDouble());
}
}
else if(subSubElem.tagName() == "INTRINSIC_PARAMETERS")
......
......@@ -65,7 +65,7 @@ QRectF GridItem::boundingRect() const
// event, of moving mouse while pressing a mouse button
void GridItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
{
if(!mControlWidget->getCalibGridFix())
if(!mControlWidget->getCalibGridFix() && mControlWidget->getCalibGridShow())
{
setCursor(Qt::SizeBDiagCursor);
QPointF diff = event->scenePos() -
......@@ -118,7 +118,7 @@ void GridItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
void GridItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
{
if(!mControlWidget->getCalibGridFix())
if(!mControlWidget->getCalibGridFix() && mControlWidget->getCalibGridShow())
{
if(event->button() == Qt::LeftButton)
{
......
......@@ -186,3 +186,56 @@ cv::Mat getRoi(cv::Mat &img, const QRect &roi, cv::Rect &rect, bool evenPixelNum
return img(rect);
}
#include <iostream>
#include <vector>
/**
* @brief Compares two PeTrack version strings and returns if the first version string is newer than the second one
*
* @param q1: first PeTrack version string
* @param q2: second PeTrack version string
* @throws std::invalid_argument Thrown if one of the input strings is not in the right format
* @return boolean, whether the first version is higher than the second one
*/
bool lessThanVersion(const QString &q1, const QString &q2)
{
QStringList version1 = q1.split(QLatin1Char('.'));
QStringList version2 = q2.split(QLatin1Char('.'));
std::vector<int> version1_digits;
std::vector<int> version2_digits;
for(int i = 0; i < version1.length(); ++i)
{
if(version1[i].length() == 1 && version1[i][0].isDigit())
{
version1_digits.push_back(version1[i].toInt());
}
else
{
throw std::invalid_argument("Invalid Input String!");
}
}
for(int i = 0; i < version2.length(); ++i)
{
if(version2[i].length() == 1 && version2[i][0].isDigit())
{
version2_digits.push_back(version2[i].toInt());
}
else
{
throw std::invalid_argument("Invalid Input String!");
}
}
int length = std::min(version1_digits.size(), version2_digits.size());
for(int i = 0; i < length; ++i)
{
if(version1_digits[i] > version2_digits[i])
{
return true;
}
else if(version1_digits[i] < version2_digits[i])
{
return false;
}
}
return version1_digits.size() > version2_digits.size();
}
/*
* PeTrack - Software for tracking pedestrians movement in videos
* Copyright (C) 2010-2022 Forschungszentrum Jülich GmbH,
* Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand,
* Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann
*
* 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 "manualTrackpointMover.h"
#include "pMessageBox.h"
bool ManualTrackpointMover::selectTrackPoint(
const QPointF &pos,
const PersonStorage &personStore,
const QSet<int> &peds,
const FrameRange &range)
{
auto res = personStore.getProximalPersons(pos, peds, range);
bool successfulSelection = res.size() == 1;
if(successfulSelection)
{
mSelectedPerson = res.front();
}
else if(res.size() > 1)
{
PWarning(
nullptr,
"Too many trajectories",
"PeTrack can't determine which point you meant. Try selecting fewer trajectories first.");
}
return successfulSelection;
}
void ManualTrackpointMover::moveTrackPoint(const QPointF &pos, PersonStorage &personStore) const
{
if(mSelectedPerson.personID != -1 && mSelectedPerson.frame != -1)
{
personStore.moveTrackPoint(mSelectedPerson.personID, mSelectedPerson.frame, Vec2F{pos});
}
}
void ManualTrackpointMover::setTrackPoint()
{
mSelectedPerson = {-1, -1};
}
......@@ -404,6 +404,25 @@ bool PersonStorage::resetTrackPersonHeight(const Vec2F &point, int frame, QSet<i
return false;
}
void PersonStorage::moveTrackPoint(int personID, int frame, const Vec2F &newPosition)
{
auto &person = mPersons.at(personID);
TrackPoint newPoint;
newPoint = newPosition;
newPoint.setQual(100);
if(person.trackPointExist(frame))
{
int idx = frame - person.firstFrame();
person[idx] = newPoint;
}
else
{
// only logging since this is a software bug, not a user bug; precondition of function not fulfilled
debout << "Warning: Trying to move nonexisting trackpoint of person " << personID << " at frame " << frame
<< std::endl;
}
}
// used for calculation of 3D point for all points in frame
// returns number of found points or -1 if no stereoContext available (also points without disp found are counted)
int PersonStorage::calcPosition(int /*frame*/)
......@@ -711,7 +730,7 @@ int PersonStorage::smallestFirstFrame() const
* @return list of the id of all proximal persons with the frame at which they are nearest to pos
*/
std::vector<PersonFrame>
PersonStorage::getProximalPersons(const QPointF &pos, int frame, QSet<int> selected, int before, int after) const
PersonStorage::getProximalPersons(const QPointF &pos, QSet<int> selected, const FrameRange &frameRange) const
{
std::vector<PersonFrame> result;
for(int i = 0; i < static_cast<int>(mPersons.size()); ++i)
......@@ -723,14 +742,14 @@ PersonStorage::getProximalPersons(const QPointF &pos, int frame, QSet<int> selec
double minDist = std::numeric_limits<double>::max();
int minFrame = -1;
for(int f = frame - before; f <= frame + after; ++f)
for(int f = frameRange.current - frameRange.before; f <= frameRange.current + frameRange.after; ++f)
{
if(!mPersons[i].trackPointExist(f))
{
continue;
}
auto dist = mPersons[i].trackPointAt(f).distanceToPoint(pos);
if(dist < minDist && dist < (mMainWindow.getHeadSize(nullptr, i, frame) / 2.))
if(dist < minDist && dist < (mMainWindow.getHeadSize(nullptr, i, frameRange.current) / 2.))
{
minDist = dist;
minFrame = f;
......@@ -1088,16 +1107,16 @@ void PersonStorage::setMarkerHeights(const std::unordered_map<int, float> &heigh
/**
* Sets/Overwrites the markerID for a specific person and all trackpaints belonging to that person
* @param personID internal id of persons (0 based)
* @param personIndex internal id of persons (0 based)
* @param markerIDs new marker ID
*/
void PersonStorage::setMarkerID(int personID, int markerID, bool manual)
void PersonStorage::setMarkerID(int personIndex, int markerID, bool manual)
{
if(manual)
{
mAutosave.trackPersonModified();
}
auto &person = mPersons.at(personID);
auto &person = mPersons.at(personIndex);
person.setMarkerID(markerID);
for(auto &trackPoint : person) // over TrackPoints
{
......@@ -1119,7 +1138,7 @@ void PersonStorage::setMarkerIDs(const std::unordered_map<int, int> &markerIDs)
if(markerIDs.find(personID) != std::end(markerIDs))
{
int markerID = markerIDs.at(personID);
setMarkerID(personID, markerID);
setMarkerID(i, markerID);
}
else
{
......
......@@ -34,6 +34,7 @@
#include "colorRangeWidget.h"
#include "control.h"
#include "gridItem.h"
#include "helper.h"
#include "imageItem.h"
#include "logoItem.h"
#include "moCapItem.h"
......@@ -172,6 +173,11 @@ Petrack::Petrack() :
connect(mView, &GraphicsView::mouseMiddleDoubleClick, this, &Petrack::deleteTrackPointAll);
connect(mView, &GraphicsView::mouseShiftWheel, this, &Petrack::skipToFrameWheel);
connect(mView, &GraphicsView::mouseAltDoubleClick, this, &Petrack::skipToFrameFromTrajectory);
connect(mView, &GraphicsView::mouseAltMoved, this, &Petrack::moveTrackPoint);
connect(mView, &GraphicsView::mouseAltPressed, this, &Petrack::selectPersonForMoveTrackPoint);
connect(mView, &GraphicsView::altReleased, this, &Petrack::releaseTrackPoint);
connect(mView, &GraphicsView::mouseAltReleased, this, &Petrack::releaseTrackPoint);
mPlayerWidget = new Player(mAnimation, this);
......@@ -652,16 +658,16 @@ void Petrack::openProject(QString fileName, bool openSeq) // default fileName=""
openXml(doc, openSeq);
mLastTrackerExport = mTrcFileName;
if(mControlWidget->getCalibS1Value() == 0 && mControlWidget->getCalibS2Value() == 0 &&
mControlWidget->getCalibS3Value() == 0 && mControlWidget->getCalibS4Value() == 0 &&
mControlWidget->getCalibTAUXValue() == 0 && mControlWidget->getCalibTAUYValue() == 0)
if(!lessThanVersion(root.attribute("VERSION"), QString("0.9.0")))
{
PWarning(
this,
tr("PeTrack"),
tr("You are using an old project! Therefore the old intr. calibration model is set the default"));
tr("You are using a project version lower than 0.9: Therefore, the extended intrinsic calibration "
"model is disabled."));
mControlWidget->setNewModelChecked(false);
}
updateWindowTitle();
}
}
......@@ -1618,7 +1624,9 @@ void Petrack::keyBindings()
"<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>"
"enables showing only the modified trajectory</dd>"
"<dt><kbd>Alt + double-click left mouse button</kbd></dt><dd>jumps to frame of trackpoint under cursor</dd>"
"<dt><kbd>Alt + holding left mouse button</kbd></dt><dd>moves trackpoint under cursor</dd></dl>"
"<p>Further key bindings you will find next to the entries of the menus.</p>");
PMessageBox *mb = new PMessageBox(this, tr("Key Bindings"), out, QIcon());
......@@ -4213,6 +4221,35 @@ void Petrack::deleteTrackPointInsideROI()
updateControlWidget();
mScene->update();
}
void Petrack::moveTrackPoint(QPointF pos)
{
mManualTrackPointMover.moveTrackPoint(pos, mPersonStorage);
mScene->update();
}
void Petrack::selectPersonForMoveTrackPoint(QPointF pos)
{
FrameRange range;
range.before = mControlWidget->trackShowBefore->value();
range.after = mControlWidget->trackShowAfter->value();
range.current = mPlayerWidget->getPos();
auto successfullySelected =
mManualTrackPointMover.selectTrackPoint(pos, mPersonStorage, getPedestrianUserSelection(), range);
if(successfullySelected)
{
setCursor(QCursor{Qt::CursorShape::DragMoveCursor});
}
}
void Petrack::releaseTrackPoint()
{
mManualTrackPointMover.setTrackPoint();
mAutosave.trackPersonModified();
setCursor(QCursor{});
}
void Petrack::updateSourceInOutFrames()
{
mPlayerWidget->setFrameInNum(mAnimation->getSourceInFrameNum());
......@@ -4231,8 +4268,9 @@ void Petrack::skipToFrameFromTrajectory(QPointF pos)
const auto before = mControlWidget->trackShowBefore->value();
const auto after = mControlWidget->trackShowAfter->value();
const auto currFrame = mPlayerWidget->getPos();
FrameRange frameRange{before, after, currFrame};
auto res = mPersonStorage.getProximalPersons(pos, currFrame, peds, before, after);
auto res = mPersonStorage.getProximalPersons(pos, peds, frameRange);
if(res.size() == 1)
{
......@@ -4250,6 +4288,7 @@ void Petrack::skipToFrameFromTrajectory(QPointF pos)
void Petrack::setPeTrackVersion(const std::string &petrackVersion)
{
mPetrackVersion = QString::fromStdString(petrackVersion);
updateWindowTitle();
}
void Petrack::setGitInformation(
......
......@@ -154,6 +154,16 @@ void GraphicsView::keyPressEvent(QKeyEvent *event)
}
}
void GraphicsView::keyReleaseEvent(QKeyEvent *event)
{
switch(event->key())
{
case Qt::Key_Alt:
emit altReleased();
break;
}
}
void GraphicsView::mousePressEvent(QMouseEvent *event)
{
if(event->modifiers() & Qt::ShiftModifier)
......@@ -164,9 +174,35 @@ void GraphicsView::mousePressEvent(QMouseEvent *event)
{
emit colorSelected();
}
if(event->modifiers().testFlag(Qt::AltModifier) && event->button() == Qt::LeftButton)
{
emit mouseAltPressed(mapToScene(event->pos()));
}
QGraphicsView::mousePressEvent(event);
}
void GraphicsView::mouseReleaseEvent(QMouseEvent *event)
{
if(event->modifiers().testFlag(Qt::AltModifier))
{
emit mouseAltReleased(mapToScene(event->pos()));
}
QGraphicsView::mouseReleaseEvent(event);
}
void GraphicsView::mouseMoveEvent(QMouseEvent *event)
{
if(event->modifiers().testFlag(Qt::AltModifier))
{
emit mouseAltMoved(mapToScene(event->pos()));
}
else
{
QGraphicsView::mouseMoveEvent(event);
}
}
//---------------------------------------------------------------------
......
......@@ -9,5 +9,6 @@ target_sources(petrack_tests PRIVATE
tst_moCapController.cpp
tst_recognition.cpp
tst_codeMarkerWidget.cpp
tst_helper.cpp
tst_petrack.cpp
)
/*
* PeTrack - Software for tracking pedestrians movement in videos
* Copyright (C) 2010-2021 Forschungszentrum Jülich GmbH,
* Maik Boltes, Juliane Adrian, Ricardo Martin Brualla, Arne Graf, Paul Häger, Daniel Hillebrand,
* Deniz Kilic, Paul Lieberenz, Daniel Salden, Tobias Schrödter, Ann Katrin Seemann
*
* 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 "helper.h"
#include <catch2/catch.hpp>
TEST_CASE("Petrack version strings are compared", "[lessThanVersion]")
{
CHECK(lessThanVersion(QString("0.9.1"), QString("0.9.0")));
CHECK(lessThanVersion(QString("0.9.0"), QString("0.8.0")));
CHECK(lessThanVersion(QString("1.8.0"), QString("0.9.0")));
CHECK(lessThanVersion(QString("0.9.1.1"), QString("0.9.0")));
CHECK(lessThanVersion(QString("0.9.0.0"), QString("0.9.0")));
CHECK_FALSE(lessThanVersion(QString("0.9.0"), QString("0.9.1")));
CHECK_FALSE(lessThanVersion(QString("0.8.0"), QString("0.9.0")));
CHECK_FALSE(lessThanVersion(QString("0.9.0"), QString("1.9.0")));
CHECK_FALSE(lessThanVersion(QString("0.9.0"), QString("0.9.1.1")));
CHECK_FALSE(lessThanVersion(QString("0.9.0.1"), QString("0.9.1")));
CHECK_FALSE(lessThanVersion(QString("0.9.0"), QString("0.9.0.0")));
CHECK_FALSE(lessThanVersion(QString("0.9.0"), QString("0.9.0")));
CHECK_THROWS(lessThanVersion(QString("0.8.k"), QString("0.9.0")));
CHECK_THROWS(lessThanVersion(QString("0.8.9"), QString("0.9.k")));
CHECK_THROWS(lessThanVersion(QString("0.k.9"), QString("0.9.0")));
CHECK_THROWS(lessThanVersion(QString("0.8.9"), QString("0.k.9")));
CHECK_THROWS(lessThanVersion(QString("k.8.9"), QString("0.9.0")));
CHECK_THROWS(lessThanVersion(QString("0.8.9"), QString("k.9.0")));
CHECK_THROWS(lessThanVersion(QString("0.8.9"), QString("k.9.0")));
}
......@@ -296,9 +296,7 @@
</sizepolicy>
</property>
<property name="font">
<font>
<family>Monospace</family>
</font>
<font/>
</property>
<property name="readOnly">
<bool>true</bool>
......@@ -339,9 +337,7 @@
</sizepolicy>
</property>
<property name="font">
<font>
<family>Monospace</family>
</font>
<font/>
</property>
<property name="readOnly">
<bool>true</bool>
......@@ -382,6 +378,10 @@
</property>
</widget>
</widget>
<tabstops>
<tabstop>plainTextEdit</tabstop>
<tabstop>plainTextEdit_2</tabstop>
</tabstops>
<resources>
<include location="../icons/icons.qrc"/>
</resources>
......
......@@ -482,6 +482,31 @@
</item>
</layout>
</widget>
<tabstops>
<tabstop>dictList</tabstop>
<tabstop>showDetectedCandidates</tabstop>
<tabstop>adaptiveThreshWinSizeMin</tabstop>
<tabstop>adaptiveThreshWinSizeMax</tabstop>
<tabstop>adaptiveThreshWinSizeStep</tabstop>
<tabstop>adaptiveThreshConstant</tabstop>
<tabstop>minMarkerPerimeter</tabstop>
<tabstop>maxMarkerPerimeter</tabstop>
<tabstop>polygonalApproxAccuracyRate</tabstop>
<tabstop>minCornerDistance</tabstop>
<tabstop>minDistanceToBorder</tabstop>
<tabstop>minMarkerDistance</tabstop>
<tabstop>doCornerRefinement</tabstop>
<tabstop>cornerRefinementWinSize</tabstop>
<tabstop>cornerRefinementMaxIterations</tabstop>
<tabstop>cornerRefinementMinAccuracy</tabstop>
<tabstop>markerBorderBits</tabstop>
<tabstop>perspectiveRemovePixelPerCell</tabstop>
<tabstop>perspectiveRemoveIgnoredMarginPerCell</tabstop>
<tabstop>maxErroneousBitsInBorderRate</tabstop>
<tabstop>minOtsuStdDev</tabstop>
<tabstop>errorCorrectionRate</tabstop>
<tabstop>moreInfosButton</tabstop>
</tabstops>
<resources/>
<connections/>
</ui>