summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-06-14 11:45:53 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-06-14 18:14:46 +0200
commita8da0d997048007d3feb2e3814ba93bbfd4d4ef8 (patch)
treec4042dd751232a2c759ab68c9bcf372e1a2861fb
parent2f0d5047d3fbe3958f2663c1ac7e7a2ecccc9336 (diff)
tracker/{aruco,pt}: disable opencv multithreading
Less overhead this way.
-rw-r--r--tracker-aruco/ftnoir_tracker_aruco.cpp10
-rw-r--r--tracker-pt/ftnoir_tracker_pt.cpp2
2 files changed, 10 insertions, 2 deletions
diff --git a/tracker-aruco/ftnoir_tracker_aruco.cpp b/tracker-aruco/ftnoir_tracker_aruco.cpp
index 30f53485..b222ebbb 100644
--- a/tracker-aruco/ftnoir_tracker_aruco.cpp
+++ b/tracker-aruco/ftnoir_tracker_aruco.cpp
@@ -24,14 +24,18 @@ typedef struct {
int height;
} resolution_tuple;
-static resolution_tuple resolution_choices[] = {
+static resolution_tuple resolution_choices[] =
+{
{ 640, 480 },
{ 320, 240 },
{ 320, 200 },
{ 0, 0 }
};
-Tracker::Tracker() : stop(false), layout(nullptr), videoWidget(nullptr)
+Tracker::Tracker() :
+ stop(false),
+ layout(nullptr),
+ videoWidget(nullptr)
{
}
@@ -77,6 +81,8 @@ void Tracker::getRT(cv::Matx33d& r_, cv::Vec3d& t_)
void Tracker::run()
{
+ cv::setNumThreads(0);
+
int rint = s.resolution;
if (rint < 0 || rint >= (int)(sizeof(resolution_choices) / sizeof(resolution_tuple)))
rint = 0;
diff --git a/tracker-pt/ftnoir_tracker_pt.cpp b/tracker-pt/ftnoir_tracker_pt.cpp
index 950dde71..6ff19479 100644
--- a/tracker-pt/ftnoir_tracker_pt.cpp
+++ b/tracker-pt/ftnoir_tracker_pt.cpp
@@ -76,6 +76,8 @@ bool Tracker_PT::get_focal_length(float& ret)
void Tracker_PT::run()
{
+ cv::setNumThreads(0);
+
#ifdef PT_PERF_LOG
QFile log_file(QCoreApplication::applicationDirPath() + "/PointTrackerPerformance.txt");
if (!log_file.open(QIODevice::WriteOnly | QIODevice::Text)) return;