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

AttributeError: module 'cv2.cv2' has no attribute 'freetype'` #20

Closed
AhmedDawoud3 opened this issue May 21, 2021 · 2 comments
Closed

AttributeError: module 'cv2.cv2' has no attribute 'freetype'` #20

AhmedDawoud3 opened this issue May 21, 2021 · 2 comments

Comments

@AhmedDawoud3
Copy link

AhmedDawoud3 commented May 21, 2021

Windows

Traceback (most recent call last):
  File "k:\Project\qbr\src\qbr.py", line 83, in <module>
    Qbr(args.normalize).run()
  File "k:\Project\qbr\src\qbr.py", line 39, in run
    state = webcam.run()
  File "k:\Project\qbr\src\video.py", line 504, in run
    self.draw_current_language(frame)
  File "k:\Project\qbr\src\video.py", line 343, in draw_current_language
    (textsize_width, textsize_height), _ = self.get_text_size(text)
  File "k:\Project\qbr\src\video.py", line 276, in get_text_size
    ft2 = self.get_freetype2_font()
  File "k:\Project\qbr\src\video.py", line 263, in get_freetype2_font
    ft2 = cv2.freetype.createFreeType2()
AttributeError: module 'cv2.cv2' has no attribute 'freetype'
@kkoomen
Copy link
Owner

kkoomen commented May 21, 2021

Duplicate of #14

@kkoomen kkoomen marked this as a duplicate of #14 May 21, 2021
@kkoomen kkoomen closed this as completed May 21, 2021
kkoomen added a commit that referenced this issue Nov 5, 2022
@kkoomen
Copy link
Owner

kkoomen commented Nov 5, 2022

Hi. I just released a new version which uses pillow to draw the text and have completely removed the opencv-contrib-python dependency. Reinstall the dependencies with pip3 install -r requirements.txt and then run ./src/qbr.py should be working without the error that freetype doesn't exists.

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

No branches or pull requests

2 participants