summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-03-19 17:57:25 +0100
committerStanislaw Halik <sthalik@misaki.pl>2019-03-19 17:57:39 +0100
commit4b3920b44cea035ab233d3ea085c5749ab27b5c5 (patch)
tree11749c66608f8deec4c30157835ecb99ac9847a7
parent8f7b50e6d2030e44249a3bf1c11eae0cfd30d77b (diff)
tracker/{pt,wii}: make sure preview frame always exists
-rw-r--r--tracker-pt/module/frame.cpp2
-rw-r--r--tracker-wii/wii_frame.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/tracker-pt/module/frame.cpp b/tracker-pt/module/frame.cpp
index c88099f1..a5b99c55 100644
--- a/tracker-pt/module/frame.cpp
+++ b/tracker-pt/module/frame.cpp
@@ -9,7 +9,6 @@ namespace pt_module {
Preview& Preview::operator=(const pt_frame& frame_)
{
const cv::Mat& frame = frame_.as_const<const Frame>()->mat;
- ensure_size(frame_copy, frame_out.cols, frame_out.rows, CV_8UC3);
if (frame.channels() != 3)
{
@@ -29,6 +28,7 @@ Preview& Preview::operator=(const pt_frame& frame_)
Preview::Preview(int w, int h)
{
ensure_size(frame_out, w, h, CV_8UC4);
+ ensure_size(frame_copy, w, h, CV_8UC3);
frame_out.setTo(cv::Scalar(0, 0, 0, 0));
}
diff --git a/tracker-wii/wii_frame.cpp b/tracker-wii/wii_frame.cpp
index 691e6b57..4d168023 100644
--- a/tracker-wii/wii_frame.cpp
+++ b/tracker-wii/wii_frame.cpp
@@ -21,7 +21,6 @@ WIIPreview& WIIPreview::operator=(const pt_frame& frame_)
{
const struct wii_info& wii = frame_.as_const<WIIFrame>()->wii;
const cv::Mat& frame = frame_.as_const<const WIIFrame>()->mat;
- ensure_size(frame_copy, frame_out.cols, frame_out.rows, CV_8UC3);
status = wii.status;
@@ -43,6 +42,7 @@ WIIPreview& WIIPreview::operator=(const pt_frame& frame_)
WIIPreview::WIIPreview(int w, int h)
{
ensure_size(frame_out, w, h, CV_8UC4);
+ ensure_size(frame_copy, w, h, CV_8UC3);
frame_out.setTo(cv::Scalar(0, 0, 0, 0));
}