Strange as it is, sometimes you need to go through some not-at-all-obvious procedures to solve simple problems such as this. QLabels allow writing and displaying HTML codes so one way of setting a QLabel’s color would be by setting the color as it is done in HTML but in Qt there is another way.
You can use this method to convert an OpenCV Mat image to a Qt QImage which then can be easily turned into a QPixmap and then displayed on a QLabel. It might sound a little bit confusing but I’ll explain all of its parts. Check the method and my descriptions below: