summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-09-03 22:36:04 +0200
committerStanislaw Halik <sthalik@misaki.pl>2021-09-03 22:36:04 +0200
commit4478909bbf018e814591077dfb98eb9b785eeadf (patch)
treee4ad1ae74fd72374d97a94f61042391a3b4b4882
parent418d07a1e5a5173ed340180dd1cbcb185ee5ddfb (diff)
tracker/neuralnet: fix copying grayscale frameopentrack-2021.1.1
It crashes later though.
-rw-r--r--tracker-neuralnet/ftnoir_tracker_neuralnet.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp b/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp
index 4a780fc1..8fd65bc9 100644
--- a/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp
+++ b/tracker-neuralnet/ftnoir_tracker_neuralnet.cpp
@@ -700,7 +700,8 @@ void neuralnet_tracker::run()
switch (img.channels)
{
case 1:
- grayscale.setTo(color);
+ grayscale.create(img.height, img.width, CV_8UC1);
+ color.copyTo(grayscale);
break;
case 3:
cv::cvtColor(color, grayscale, cv::COLOR_BGR2GRAY);