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' #24

Closed
joseluislo12 opened this issue Sep 20, 2021 · 2 comments
Closed

AttributeError: module 'cv2.cv2' has no attribute 'freetype' #24

joseluislo12 opened this issue Sep 20, 2021 · 2 comments

Comments

@joseluislo12
Copy link

I'm trying to execute the program but after run ./src/qbr.py I get

Traceback (most recent call last): File "./src/qbr.py", line 82, in <module> Qbr(args.normalize).run() File "./src/qbr.py", line 38, in run state = webcam.run() File "/.../qbr/src/video.py", line 504, in run self.draw_current_language(frame) File "/.../qbr/src/video.py", line 343, in draw_current_language (textsize_width, textsize_height), _ = self.get_text_size(text) File "/.../qbr/src/video.py", line 276, in get_text_size ft2 = self.get_freetype2_font() File "/.../qbr/src/video.py", line 263, in get_freetype2_font ft2 = cv2.freetype.createFreeType2() AttributeError: module 'cv2.cv2' has no attribute 'freetype'

I'm using Debian 10 as a Virtual Machine (VirtualBox)

@kkoomen
Copy link
Owner

kkoomen commented Sep 21, 2021

Duplicate of #21

@kkoomen kkoomen marked this as a duplicate of #21 Sep 21, 2021
@kkoomen kkoomen closed this as completed Sep 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