diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-16 08:59:21 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-16 08:59:21 +0100 |
commit | 6cf93c06abad63721bf66f695587a98377b6178d (patch) | |
tree | af029c638c9a62d6c34bc95a4dc3060c5d2f8921 /tracker-pt/frame.cpp | |
parent | 88849a1ca4b7c253f7427d361443a496c1b5fe28 (diff) |
cv/video-frame, tracker/pt: add hidpi preview support
Diffstat (limited to 'tracker-pt/frame.cpp')
-rw-r--r-- | tracker-pt/frame.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/tracker-pt/frame.cpp b/tracker-pt/frame.cpp index ca72bd16..79cf62fc 100644 --- a/tracker-pt/frame.cpp +++ b/tracker-pt/frame.cpp @@ -12,8 +12,7 @@ using namespace pt_module; Preview& Preview::operator=(const pt_frame& frame_) { const cv::Mat& frame = frame_.as_const<const Frame>()->mat; - const int w = frame.cols, h = frame.rows; - ensure_size(frame_copy, w, h, CV_8UC3); + ensure_size(frame_copy, frame_out.cols, frame_out.rows, CV_8UC3); if (frame.channels() != 3) { @@ -21,9 +20,9 @@ Preview& Preview::operator=(const pt_frame& frame_) return *this; } - const bool need_resize = w != frame_out.cols || h != frame_out.rows; + const bool need_resize = frame.cols != frame_out.cols || frame.rows != frame_out.rows; if (need_resize) - cv::resize(frame, frame_copy, cv::Size(frame_resize.cols, frame_resize.rows), 0, 0, cv::INTER_NEAREST); + cv::resize(frame, frame_copy, cv::Size(frame_out.cols, frame_out.rows), 0, 0, cv::INTER_NEAREST); else frame.copyTo(frame_copy); @@ -32,7 +31,6 @@ Preview& Preview::operator=(const pt_frame& frame_) Preview::Preview(int w, int h) { - ensure_size(frame_resize, w, h, CV_8UC4); ensure_size(frame_out, w, h, CV_8UC4); frame_out.setTo(cv::Scalar(0, 0, 0, 0)); |