From 4478909bbf018e814591077dfb98eb9b785eeadf Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 3 Sep 2021 22:36:04 +0200 Subject: tracker/neuralnet: fix copying grayscale frame It crashes later though. --- tracker-neuralnet/ftnoir_tracker_neuralnet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tracker-neuralnet') 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); -- cgit v1.2.3