Coder Social home page Coder Social logo

kkoomen / qbr Goto Github PK

View Code? Open in Web Editor NEW
601.0 23.0 99.0 19.23 MB

A webcam-based 3x3x3 rubik's cube solver written in Python 3 and OpenCV.

License: MIT License

Python 100.00%
color-detection opencv python ciede2000 webcam canny-edge-detection delta-e qbr cuber accurate

qbr's Introduction

Hi there ๐Ÿ‘‹

My name is Kim. Learning Chinese since August 2017. Software engineer since 2013.

Since 2022 back at university studying Artificial Intelligence, not because of the hype, but just because it's one of the few things I haven't learned yet that I would really like to learn.

On the road to a PhD:

  • ๐Ÿ“• Webdevelopment (4y)
  • ๐Ÿ“— Software Engineering foundation year (1y)
  • ๐Ÿ“˜ Artificial Intelligence BSc (3y)
  • ๐Ÿ“™ Pattern Recognition and Intelligent Systems MSc (2.5y)
  • ๐ŸŽ“ PhD

kkoomen GitHub stats

Top Langs

qbr's People

Contributors

aitalinassim avatar dependabot[bot] avatar eigenric avatar hikari-tsai avatar kinsiinoo avatar kkoomen avatar sematre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qbr's Issues

Color-detection is not working well

I am not sure why, but, the color detection is not working too well for me (can send some images if needed). The colors that are detected are pretty unstable/jumpy as well.

BTW, i already have a suggestion for a new coolor-detection scheme and would love to push it as a PR for you to review/pull if you want. At the moment your Repo is locked for pushing new branches/PRs :(.

Error in calibration

File "/Users/binbinzhu/Code/qbr/src/qbr.py", line 82, in
Qbr(args.normalize).run()
File "/Users/binbinzhu/Code/qbr/src/qbr.py", line 38, in run
state = webcam.run()
File "/Users/binbinzhu/Code/qbr/src/video.py", line 519, in run
self.draw_current_color_to_calibrate()
File "/Users/binbinzhu/Code/qbr/src/video.py", line 306, in draw_current_color_to_calibrate
_, textsize_height = self.get_text_size(text, font_size)
File "/Users/binbinzhu/Code/qbr/src/video.py", line 289, in get_text_size
return self.get_font(size).getsize(text)
AttributeError: 'FreeTypeFont' object has no attribute 'getsize'

It works after rolling back to Pillow==9.5

Make code a bit more PEP8 compatible

Would be great if the code could be a bit more PE8-friendly, having static-checkers and PyCharm not warn on too many lines.

BTW, i already have this ready and would love to push it as a PR for you to review/pull if you want. At the moment your Repo is locked for pushing new branches/PRs :(.

Add PyCharm idea files to gitignore

Would be nice if PyCharm idea files could also be in the gitignore file.

BTW, i already have this ready and would love to push it as a PR for you to review/pull if you want. At the moment your Repo is locked for pushing new branches/PRs :(.

Getting error in installation

can't install the requirements.txt file. That's all the error I'm getting --

error: subprocess-exited-with-error
  
  ร— Building wheel for numpy (pyproject.toml) did not run successfully.
  โ”‚ exit code: 1
  โ•ฐโ”€> [1246 lines of output]
INFO: CCompilerOpt.cache_flush[817] : write cache to path -> /private/var/folders/rt/3jcw80yd5bbgq7_c89cf2sfr0000gn/T/pip-install-2uo0qkr7/numpy_aa84c7662faa46dd92edf70a8758acf0/build/temp.macosx-10.9-universal2-3.11/ccompiler_opt_cache_clib.py
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

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

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)

A little bug that I ran into

First off, this is an amazing project. I used it to also make my own mechanical Rubix Cube solver and the scanner works great. I modified it to fit exactly what I needed, and it was easy to follow.

When I was working on installing it, one problem kept occurring. I ran the installation on multiple computers and got the same errors. Maybe this was just on my computer but I think it could also happen on others (or I could just be wrong, not sure). This was the error I was receiving:
Traceback (most recent call last):
File "/Users/
__________/qbr/./src/qbr.py", line 8, in
from video import webcam
File "/Users/qbr/src/video.py", line 6, in
from colordetection import color_detector
File "/Users/
/qbr/src/colordetection.py", line 8, in
from config import config
File "/Users//qbr/src/config.py", line 37, in
config = Config()
^^^^^^^^
File "/Users/
/qbr/src/config.py", line 20, in init
os.mkdir(self.config_dir)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/________/.config/qbr'

I figured out how to solve the problem, but I thought it anyone else runs into the same problem, this might help.

1: Go to config.py, then on line 11 change "/.config/qbr" to "/qbr/src"
I belive that the way that it is structured right now does not get the correct file, but the qbr/src selects the correct file

2: The next step I did was move the demo photos from outside the src files into it moving it from the qbr file to src. I also think this is because it is not finding the photos due to its location.

I worked on this with a partner who helped me figure some of this stuff out so I could be wrong, but it worked for me and it may come in handy for some if running into a similar problem.

Add some (multiple?) dependency management

Would be great if there were requirement.txt or even Pipfile (pipenv) support in the Repo.

BTW, i already have this ready and would love to push it as a PR for you to review/pull if you want. At the moment your Repo is locked for pushing new branches/PRs :(.

Support for Windows

Please have a look and if you can help, think can help a lot of people on windows environment.

C:\Users\maiqu\Documents\repos\qbr>pip3 install -r requirements.txt
Requirement already satisfied: cffi==1.14.4 in c:\python39\lib\site-packages (from -r requirements.txt (line 1)) (1.14.4)
Requirement already satisfied: future==0.18.2 in c:\python39\lib\site-packages (from -r requirements.txt (line 2)) (0.18.2)
Requirement already satisfied: kociemba==1.2.1 in c:\python39\lib\site-packages (from -r requirements.txt (line 3)) (1.2.1)
Requirement already satisfied: numpy==1.20.1 in c:\python39\lib\site-packages (from -r requirements.txt (line 4)) (1.20.1)
Requirement already satisfied: opencv-python==4.5.1.48 in c:\python39\lib\site-packages (from -r requirements.txt (line 5)) (4.5.1.48)
Requirement already satisfied: opencv-contrib-python==4.5.1.48 in c:\python39\lib\site-packages (from -r requirements.txt (line 6)) (4.5.1.48)
Requirement already satisfied: pycparser==2.20 in c:\python39\lib\site-packages (from -r requirements.txt (line 7)) (2.20)
Requirement already satisfied: pydocstyle==5.1.1 in c:\python39\lib\site-packages (from -r requirements.txt (line 8)) (5.1.1)
Requirement already satisfied: python-i18n==0.3.9 in c:\python39\lib\site-packages (from -r requirements.txt (line 9)) (0.3.9)
Requirement already satisfied: snowballstemmer==2.1.0 in c:\python39\lib\site-packages (from -r requirements.txt (line 10)) (2.1.0)

C:\Users\maiqu\Documents\repos\qbr>python src\qbr.py
Traceback (most recent call last):
File "C:\Users\maiqu\Documents\repos\qbr\src\qbr.py", line 8, in
from video import webcam
File "C:\Users\maiqu\Documents\repos\qbr\src\video.py", line 6, in
from colordetection import color_detector
File "C:\Users\maiqu\Documents\repos\qbr\src\colordetection.py", line 8, in
from config import config
File "C:\Users\maiqu\Documents\repos\qbr\src\config.py", line 37, in
config = Config()
File "C:\Users\maiqu\Documents\repos\qbr\src\config.py", line 20, in init
os.mkdir(self.config_dir)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\Users\maiqu/.config/qbr'

C:\Users\maiqu\Documents\repos\qbr>

Typo in README.md

line #91 in the README.md file has a typo: "lef" which should be corrected to "left"

(ORIGINAL)
...

### Amount of sides scanned (bottom lef corner)

In the bottom left corner is shown the amount of sides scanned. This is so you
know if you've scanned in all sides before pressing `ESC`.

...

(EDIT)
...

### Amount of sides scanned (bottom left corner)

In the bottom left corner is shown the amount of sides scanned. This is so you
know if you've scanned in all sides before pressing `ESC`.

...

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

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'

error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

I get:

dmd@atto โ€ฆ/qbr on ๎‚  master via ๐Ÿ v3.9.6 (env) took 14s
โœ–1 โฏ ./src/qbr.py
Traceback (most recent call last):
  File "/Users/dmd/qbr/./src/qbr.py", line 82, in <module>
    Qbr(args.normalize).run()
  File "/Users/dmd/qbr/./src/qbr.py", line 38, in run
    state = webcam.run()
  File "/Users/dmd/qbr/src/video.py", line 477, in run
    grayFrame = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.error: OpenCV(4.5.1) /private/var/folders/nz/vv4_9tw56nv9k3tkvyszvwg80000gn/T/pip-req-build-p3unqtkr/opencv/modules/imgproc/src/color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cvtColor'

(Request) Re-code/Delete part of the code that causes: (module 'cv2.cv2' has no attribute 'freetype').

Hi @kkoomen, first of all, I know the issue regarding: (module 'cv2.cv2' has no attribute 'freetype') has been already discussed. Because I could not find any solution to this, i was wondering if you knew any other method or way to "re-code" the project so that the problematic part of the code is eliminated, (even if this means that it will have less functionalities). Thank you in advanced, (amazing work btw).

setup.py install for kociemba error

I got out my old MacBook to run this program natively, but am unfortunately running into more problems. In this case it seems to be an issue with installing kociemba. Below are the error messages:

Running setup.py install for kociemba ... error
ERROR: Command errored out with exit status 1:
 command: /Users/benadmin/Desktop/qbr_new/qbr/env/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/s3/fnjbxfc56qsg4mv754_c66100000gp/T/pip-install-hmrl842e/kociemba_d13851209ca6400a96cf6a7da4a0fcb9/setup.py'"'"'; __file__='"'"'/private/var/folders/s3/fnjbxfc56qsg4mv754_c66100000gp/T/pip-install-hmrl842e/kociemba_d13851209ca6400a96cf6a7da4a0fcb9/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/s3/fnjbxfc56qsg4mv754_c66100000gp/T/pip-record-zxvnkqy3/install-record.txt --single-version-externally-managed --compile --install-headers /Users/benadmin/Desktop/qbr_new/qbr/env/include/site/python3.9/kociemba
     cwd: /private/var/folders/s3/fnjbxfc56qsg4mv754_c66100000gp/T/pip-install-hmrl842e/kociemba_d13851209ca6400a96cf6a7da4a0fcb9/
Complete output (76 lines):
WARNING: The wheel package is not available.
Warning: 'classifiers' should be a list, got type 'tuple'
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.9
creating build/lib.macosx-10.9-x86_64-3.9/kociemba
copying kociemba/command_line.py -> build/lib.macosx-10.9-x86_64-3.9/kociemba
copying kociemba/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/kociemba
copying kociemba/build_ckociemba.py -> build/lib.macosx-10.9-x86_64-3.9/kociemba
creating build/lib.macosx-10.9-x86_64-3.9/kociemba/cprunetables
copying kociemba/cprunetables/FRtoBR_Move -> build/lib.macosx-10.9-x86_64-3.9/kociemba/cprunetables
copying kociemba/cprunetables/URFtoDLF_Move -> build/lib.macosx-10.9-x86_64-3.9/kociemba/cprunetables
copying kociemba/cprunetables/MergeURtoULandUBtoDF -> build/lib.macosx-10.9-x86_64-3.9/kociemba/cprunetables
copying kociemba/cprunetables/URtoDF_Move -> build/lib.macosx-10.9-x86_64-3.9/kociemba/cprunetables
copying kociemba/cprunetables/twistMove -> build/lib.macosx-10.9-x86_64-3.9/kociemba/cprunetables
copying kociemba/cprunetables/URtoUL_Move -> build/lib.macosx-10.9-x86_64-3.9/kociemba/cprunetables
copying kociemba/cprunetables/Slice_URtoDF_Parity_Prun -> build/lib.macosx-10.9-x86_64-3.9/kociemba/cprunetables
copying kociemba/cprunetables/Slice_Twist_Prun -> build/lib.macosx-10.9-x86_64-3.9/kociemba/cprunetables
copying kociemba/cprunetables/flipMove -> build/lib.macosx-10.9-x86_64-3.9/kociemba/cprunetables
copying kociemba/cprunetables/UBtoDF_Move -> build/lib.macosx-10.9-x86_64-3.9/kociemba/cprunetables
copying kociemba/cprunetables/Slice_URFtoDLF_Parity_Prun -> build/lib.macosx-10.9-x86_64-3.9/kociemba/cprunetables
copying kociemba/cprunetables/Slice_Flip_Prun -> build/lib.macosx-10.9-x86_64-3.9/kociemba/cprunetables
creating build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba
copying kociemba/pykociemba/color.py -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba
copying kociemba/pykociemba/edge.py -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba
copying kociemba/pykociemba/tools.py -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba
copying kociemba/pykociemba/cubiecube.py -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba
copying kociemba/pykociemba/__init__.py -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba
copying kociemba/pykociemba/facecube.py -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba
copying kociemba/pykociemba/coordcube.py -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba
copying kociemba/pykociemba/corner.py -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba
copying kociemba/pykociemba/search.py -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba
copying kociemba/pykociemba/facelet.py -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba
creating build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba/prunetables
copying kociemba/pykociemba/prunetables/MergeURtoULandUBtoDF.pkl -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba/prunetables
copying kociemba/pykociemba/prunetables/twistMove.pkl -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba/prunetables
copying kociemba/pykociemba/prunetables/Slice_Flip_Prun.pkl -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba/prunetables
copying kociemba/pykociemba/prunetables/URtoDF_Move.pkl -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba/prunetables
copying kociemba/pykociemba/prunetables/FRtoBR_Move.pkl -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba/prunetables
copying kociemba/pykociemba/prunetables/flipMove.pkl -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba/prunetables
copying kociemba/pykociemba/prunetables/Slice_URFtoDLF_Parity_Prun.pkl -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba/prunetables
copying kociemba/pykociemba/prunetables/Slice_URtoDF_Parity_Prun.pkl -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba/prunetables
copying kociemba/pykociemba/prunetables/UBtoDF_Move.pkl -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba/prunetables
copying kociemba/pykociemba/prunetables/URtoUL_Move.pkl -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba/prunetables
copying kociemba/pykociemba/prunetables/URFtoDLF_Move.pkl -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba/prunetables
copying kociemba/pykociemba/prunetables/Slice_Twist_Prun.pkl -> build/lib.macosx-10.9-x86_64-3.9/kociemba/pykociemba/prunetables
creating build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba
creating build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba/include
copying kociemba/ckociemba/include/facecube.h -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba/include
copying kociemba/ckociemba/include/edge.h -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba/include
copying kociemba/ckociemba/include/prunetable_helpers.h -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba/include
copying kociemba/ckociemba/include/cubiecube.h -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba/include
copying kociemba/ckociemba/include/facelet.h -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba/include
copying kociemba/ckociemba/include/color.h -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba/include
copying kociemba/ckociemba/include/corner.h -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba/include
copying kociemba/ckociemba/include/search.h -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba/include
copying kociemba/ckociemba/include/coordcube.h -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba/include
copying kociemba/ckociemba/coordcube.c -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba
copying kociemba/ckociemba/search.c -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba
copying kociemba/ckociemba/facecube.c -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba
copying kociemba/ckociemba/cubiecube.c -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba
copying kociemba/ckociemba/prunetable_helpers.c -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba
copying kociemba/ckociemba/solve.c -> build/lib.macosx-10.9-x86_64-3.9/kociemba/ckociemba
running build_ext
generating cffi module 'build/temp.macosx-10.9-x86_64-3.9/kociemba.ckociembawrapper.c'
creating build/temp.macosx-10.9-x86_64-3.9
building 'kociemba.ckociembawrapper' extension
creating build/temp.macosx-10.9-x86_64-3.9/build
creating build/temp.macosx-10.9-x86_64-3.9/build/temp.macosx-10.9-x86_64-3.9
creating build/temp.macosx-10.9-x86_64-3.9/kociemba
creating build/temp.macosx-10.9-x86_64-3.9/kociemba/ckociemba
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -Ikociemba/ckociemba/include -I/Users/benadmin/Desktop/qbr_new/qbr/env/include -I/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c build/temp.macosx-10.9-x86_64-3.9/kociemba.ckociembawrapper.c -o build/temp.macosx-10.9-x86_64-3.9/build/temp.macosx-10.9-x86_64-3.9/kociemba.ckociembawrapper.o -std=c99 -O3 -D_XOPEN_SOURCE=700
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------

ERROR: Command errored out with exit status 1: /Users/benadmin/Desktop/qbr_new/qbr/env/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/s3/fnjbxfc56qsg4mv754_c66100000gp/T/pip-install-hmrl842e/kociemba_d13851209ca6400a96cf6a7da4a0fcb9/setup.py'"'"'; file='"'"'/private/var/folders/s3/fnjbxfc56qsg4mv754_c66100000gp/T/pip-install-hmrl842e/kociemba_d13851209ca6400a96cf6a7da4a0fcb9/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/s3/fnjbxfc56qsg4mv754_c66100000gp/T/pip-record-zxvnkqy3/install-record.txt --single-version-externally-managed --compile --install-headers /Users/benadmin/Desktop/qbr_new/qbr/env/include/site/python3.9/kociemba Check the logs for full command output.

I'm on MacOS Catalina with Python 3.9.6 and made sure to use pip3. Thanks for any help, I'm not very experienced with Python.

module 'cv2.cv2' has no attribute 'freetype'

Been having trouble getting qbr running for the past week or so, long story short, now running it in a Linux Mint VM and thought I'd ask for some help.

The issue I am now stuck on is "module 'cv2.cv2' has no attribute 'freetype'" when I run "python3 qbr.py".

I have done a lot of testing and am able to access my webcam through opencv from another script I wrote. I am also fairly positive that I have all the dependencies properly installed.

The full output is as follows:

(env) ben@ben-VirtualBox:~/qbr-2/qbr/src$ python3 qbr.py
Traceback (most recent call last):
File "qbr.py", line 84, in
Qbr(args.normalize).run()
File "qbr.py", line 40, in run
state = webcam.run()
File "/home/ben/qbr-2/qbr/src/video.py", line 504, in run
self.draw_current_language(frame)
File "/home/ben/qbr-2/qbr/src/video.py", line 343, in draw_current_language
(textsize_width, textsize_height), _ = self.get_text_size(text)
File "/home/ben/qbr-2/qbr/src/video.py", line 276, in get_text_size
ft2 = self.get_freetype2_font()
File "/home/ben/qbr-2/qbr/src/video.py", line 263, in get_freetype2_font
ft2 = cv2.freetype.createFreeType2()
AttributeError: module 'cv2.cv2' has no attribute 'freetype'

Thanks for any help.

Error on pip3 install -r requirements.txt

Hello

I'm on linux (Ubuntu 22.04.1 LTS)

The command
pip3 install -r requirements.txt
gives an error

in

Collecting opencv-python==4.5.1.48
Using cached opencv-python-4.5.1.48.tar.gz (88.3 MB)
Installing build dependencies ... -

After a long time

Installing build dependencies ... error
error: subprocess-exited-with-error
ร— pip subprocess to install build dependencies did not run successfully.
โ”‚ exit code: 1
โ•ฐโ”€> [865 lines of output]
Ignoring numpy: markers 'python_version == "3.6" and platform_machine != "aarch64"' don't match your environment
Ignoring numpy: markers 'python_version >= "3.6" and sys_platform == "linux" and platform_machine == "aarch64"' don't match your environment
Ignoring numpy: markers 'python_version == "3.7" and platform_machine != "aarch64"' don't match your environment
Ignoring numpy: markers 'python_version == "3.8" and platform_machine != "aarch64"' don't match your environment

Freetype Attribute not found

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

Completely new with CV. Found this a cool project to start with. I was unable to find a solution for the AttributeError.
Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.