summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/module/point_extractor.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2021-09-27 12:27:22 +0200
committerStanislaw Halik <sthalik@misaki.pl>2021-09-27 12:28:20 +0200
commit4596d0bf8d8659411ea9dbc380336ad01c366f7b (patch)
tree3e9c5527678dce72c2145a59d46113d3d089e5ad /tracker-pt/module/point_extractor.cpp
parentdeff5fda016a18fd1d5a8a2b6c0611245757aaff (diff)
cv, tracker/pt: use cv::Mat::create()
Diffstat (limited to 'tracker-pt/module/point_extractor.cpp')
-rw-r--r--tracker-pt/module/point_extractor.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/tracker-pt/module/point_extractor.cpp b/tracker-pt/module/point_extractor.cpp
index d8a23fcf..9814d974 100644
--- a/tracker-pt/module/point_extractor.cpp
+++ b/tracker-pt/module/point_extractor.cpp
@@ -87,21 +87,17 @@ PointExtractor::PointExtractor(const QString& module_name) : s(module_name)
void PointExtractor::ensure_channel_buffers(const cv::Mat& orig_frame)
{
- if (ch[0].rows != orig_frame.rows || ch[0].cols != orig_frame.cols)
- for (cv::Mat1b& x : ch)
- x = cv::Mat1b(orig_frame.rows, orig_frame.cols);
+ for (cv::Mat1b& x : ch)
+ x.create(orig_frame.rows, orig_frame.cols);
}
void PointExtractor::ensure_buffers(const cv::Mat& frame)
{
const int W = frame.cols, H = frame.rows;
- if (frame_gray.rows != W || frame_gray.cols != H)
- {
- frame_gray = cv::Mat1b(H, W);
- frame_bin = cv::Mat1b(H, W);
- frame_gray_unmasked = cv::Mat1b(H, W);
- }
+ frame_gray.create(H, W);
+ frame_bin.create(H, W);
+ frame_gray_unmasked.create(H, W);
}
void PointExtractor::extract_single_channel(const cv::Mat& orig_frame, int idx, cv::Mat1b& dest)