Skip to content
Advertisement

OpenCV text and shapes look vague on my PC compared to other PC

I have a python script that draws text and shapes using the OpenCV library. The text and shapes look great on my Ubuntu PC (ran in VirtualBox) with 1920×1080 resolution. When I run the exact script on my own Windows 11 system with the same 1920×1080 resolution it looks really vague.

This is is the main part of the OpenCV code:

WINDOW_NAME = 'OpenCV Window'
BLACK_IMG = np.zeros((1080,1920,3), np.uint8)

cv.namedWindow(WINDOW_NAME, cv.WINDOW_NORMAL)
cv.setWindowProperty(WINDOW_NAME, cv.WND_PROP_FULLSCREEN, cv.WINDOW_FULLSCREEN)

while True:
    img = BLACK_IMG.copy()

    # [some code of drawing the shapes and text here]

    cv.imshow(WINDOW_NAME, cv.cvtColor(img, cv.COLOR_BGR2RGB))
    if cv.waitKey(1) == 27: # esc
        sys.exit()

This is the view on my PC (Windows 11):

PC that looks vague

This is the view on the other PC (Ubuntu in VirtualBox):

PC that looks great

Advertisement

Answer

I found the problem. In my Windows settings my screen is set to 1920×1080, but when I go to http://whatismyscreenresolution.net/ it seems that the real resolution is 1280×720.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement