Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

putText antialiasing doesn't work with float images #20996

Open
rggjan opened this issue Nov 3, 2021 · 0 comments
Open

putText antialiasing doesn't work with float images #20996

rggjan opened this issue Nov 3, 2021 · 0 comments

Comments

@rggjan
Copy link

rggjan commented Nov 3, 2021

In python, using:

cv2.putText(frame, text, org, font_face, font_scale, color, lineType=cv2.LINE_AA)

doesn't produce antialiased text when frame is of type np.float32.

Changing it to:

frame = (frame*255).astype(np.uint8)
cv2.putText(frame, text, org, font_face, font_scale, color, lineType=cv2.LINE_AA)

and using

color=(255, 255, 255) instead of color=(1, 1, 1)

then nicely antialiases the text...

This is with opencv-python-headless=4.4.0.42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants