mirror of
https://github.com/opencv/opencv.git
synced 2025-01-19 15:04:01 +08:00
Merge pull request #11073 from geordi:qt-window-pixel-values
This commit is contained in:
commit
dd259503c1
@ -3094,6 +3094,11 @@ void DefaultViewPort::drawImgRegion(QPainter *painter)
|
||||
if (nbChannelOriginImage==CV_8UC1)
|
||||
{
|
||||
QString val = tr("%1").arg(qRed(rgbValue));
|
||||
int pixel_brightness_value = qRed(rgbValue);
|
||||
int text_brightness_value = 0;
|
||||
|
||||
text_brightness_value = pixel_brightness_value > 127 ? pixel_brightness_value - 127 : 127 + pixel_brightness_value;
|
||||
painter->setPen(QPen(QColor(text_brightness_value, text_brightness_value, text_brightness_value)));
|
||||
painter->drawText(QRect(pos_in_view.x(),pos_in_view.y(),pixel_width,pixel_height),
|
||||
Qt::AlignCenter, val);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user