Skip to content

Commit

Permalink
[ref] tracking: refactore class member
Browse files Browse the repository at this point in the history
  • Loading branch information
bgallois committed Mar 17, 2022
1 parent 02bbe59 commit 27fadfd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion FastTrack.pri
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = 6.2.4.2
VERSION = 6.2.4.3
16 changes: 9 additions & 7 deletions src/tracking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,17 +694,18 @@ void Tracking::imageProcessing() {
while (m_im < m_stopImage) {
try {
// Reads the next image in the image sequence and applies the image processing workflow
if (!video->getNext(m_visuFrame)) {
UMat visuFrame;
if (!video->getNext(visuFrame)) {
m_error += QString::number(m_im) + ", ";
m_im++;
emit progress(m_im);
continue;
}
if (param_registration != 0) {
registration(m_background, m_visuFrame, param_registration - 1);
registration(m_background, visuFrame, param_registration - 1);
}

(statusBinarisation) ? (subtract(m_background, m_visuFrame, m_binaryFrame)) : (subtract(m_visuFrame, m_background, m_binaryFrame));
(statusBinarisation) ? (subtract(m_background, visuFrame, m_binaryFrame)) : (subtract(visuFrame, m_background, m_binaryFrame));
binarisation(m_binaryFrame, 'b', param_thresh);

if (param_kernelSize != 0 && param_morphOperation != 8) {
Expand All @@ -714,7 +715,7 @@ void Tracking::imageProcessing() {

if (m_ROI.width != 0 || m_ROI.height != 0) {
m_binaryFrame = m_binaryFrame(m_ROI);
m_visuFrame = m_visuFrame(m_ROI);
visuFrame = visuFrame(m_ROI);
}

// Detects the objects and extracts parameters
Expand Down Expand Up @@ -856,9 +857,10 @@ void Tracking::startProcess() {
}

// First frame
video->getImage(m_im, m_visuFrame);
UMat visuFrame;
video->getImage(m_im, visuFrame);

(statusBinarisation) ? (subtract(m_background, m_visuFrame, m_binaryFrame)) : (subtract(m_visuFrame, m_background, m_binaryFrame));
(statusBinarisation) ? (subtract(m_background, visuFrame, m_binaryFrame)) : (subtract(visuFrame, m_background, m_binaryFrame));

binarisation(m_binaryFrame, 'b', param_thresh);

Expand All @@ -869,7 +871,7 @@ void Tracking::startProcess() {

if (m_ROI.width != 0) {
m_binaryFrame = m_binaryFrame(m_ROI);
m_visuFrame = m_visuFrame(m_ROI);
visuFrame = visuFrame(m_ROI);
}

m_out = objectPosition(m_binaryFrame, param_minArea, param_maxArea);
Expand Down
1 change: 0 additions & 1 deletion src/tracking.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ class Tracking : public QObject {
static bool importTrackingResult(const QString &path, QSqlDatabase db);

UMat m_binaryFrame; /*!< Binary image CV_8U */
UMat m_visuFrame; /*!< Image 8 bit CV_8U */
vector<vector<Point3d>> m_out; /*!< Objects information at iteration minus one */
vector<vector<Point3d>> m_outPrev; /*!< Objects information at current iteration */

Expand Down

0 comments on commit 27fadfd

Please sign in to comment.