From a37a6bd783896b071ce18a60d1e04e3106d9b936 Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Thu, 13 Oct 2016 18:26:02 +0200 Subject: [PATCH] fix BGR <> RGB swap we are drawing on a BGR image declared as RGB, so we should not swap components here either. --- modules/highgui/src/window_QT.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/highgui/src/window_QT.cpp b/modules/highgui/src/window_QT.cpp index e64922f..bccdd24 100644 --- a/modules/highgui/src/window_QT.cpp +++ b/modules/highgui/src/window_QT.cpp @@ -843,7 +843,7 @@ void GuiReceiver::putText(void* arr, QString text, QPoint org, void* arg2) //cvScalar(blue_component, green_component, red_component[, alpha_component]) //Qt map non-transparent to 0xFF and transparent to 0 //OpenCV scalar is the reverse, so 255-font->color.val[3] - qp.setPen(QColor(font->color.val[2], font->color.val[1], font->color.val[0], 255 - font->color.val[3])); + qp.setPen(QColor(font->color.val[0], font->color.val[1], font->color.val[2], 255 - font->color.val[3])); qp.setFont(f); } qp.drawText(org, text); -- 2.7.4