summaryrefslogtreecommitdiffhomepage
path: root/cv
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-04-17 16:36:45 +0200
committerStanislaw Halik <sthalik@misaki.pl>2017-04-17 16:37:11 +0200
commit5b286bc5595196637d60e63ffea106ce73c1aa7c (patch)
tree1332d78d0e655f556dde4ec3beded45cca0fb74d /cv
parent4f05b2a5af42381cb998b2a29cd82b14c9e67466 (diff)
cv/video-widget, pose-widget: use premultiplied argb32 surface
Diffstat (limited to 'cv')
-rw-r--r--cv/video-widget.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/cv/video-widget.cpp b/cv/video-widget.cpp
index acaf06a6..e688732c 100644
--- a/cv/video-widget.cpp
+++ b/cv/video-widget.cpp
@@ -12,7 +12,7 @@
cv_video_widget::cv_video_widget(QWidget* parent) :
QWidget(parent), freshp(false)
{
- connect(&timer, SIGNAL(timeout()), this, SLOT(update_and_repaint()));
+ connect(&timer, SIGNAL(timeout()), this, SLOT(update_and_repaint()), Qt::DirectConnection);
timer.start(65);
}
@@ -33,12 +33,12 @@ void cv_video_widget::update_image(const cv::Mat& frame)
freshp = true;
if (_frame2.cols != _frame.cols || _frame2.rows != _frame.rows)
- _frame2 = cv::Mat(_frame.rows, _frame.cols, CV_8UC3);
+ _frame2 = cv::Mat(_frame.rows, _frame.cols, CV_8UC4);
if (_frame3.cols != w || _frame3.rows != h)
- _frame3 = cv::Mat(h, w, CV_8UC3);
+ _frame3 = cv::Mat(h, w, CV_8UC4);
- cv::cvtColor(_frame, _frame2, cv::COLOR_RGB2BGR);
+ cv::cvtColor(_frame, _frame2, cv::COLOR_BGR2BGRA);
const cv::Mat* img_;
@@ -53,7 +53,7 @@ void cv_video_widget::update_image(const cv::Mat& frame)
const cv::Mat& img = *img_;
- texture = QImage((const unsigned char*) img.data, w, h, QImage::Format_RGB888);
+ texture = QImage((const unsigned char*) img.data, w, h, QImage::Format_ARGB32_Premultiplied);
}
}