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.detail' has no attribute 'WAVE_CORRECT_AUTO' #22

Closed
ma-xq opened this issue Aug 16, 2022 · 18 comments
Closed
Labels
needs investigation Collect and attach more details (build flags, stacktraces, input dumps, etc)

Comments

@ma-xq
Copy link

ma-xq commented Aug 16, 2022

I installed it by pip,but it showed me AttributeError: module 'cv2.detail' has no attribute 'WAVE_CORRECT_AUTO'.What should I do?
C:\Users\Administrator>pip install stitching
Requirement already satisfied: stitching in d:\python\anaconda3\lib\site-package
s (0.3.0)
Requirement already satisfied: largestinteriorrectangle in d:\python\anaconda3\l
ib\site-packages (from stitching) (0.1.1)
Requirement already satisfied: opencv-python>=4.0.1 in d:\python\anaconda3\lib\s
ite-packages (from stitching) (4.2.0.34)
Requirement already satisfied: numpy>=1.14.5 in d:\python\anaconda3\lib\site-pac
kages (from opencv-python>=4.0.1->stitching) (1.21.6)
Requirement already satisfied: numba in d:\python\anaconda3\lib\site-packages (f
rom largestinteriorrectangle->stitching) (0.41.0)
Requirement already satisfied: llvmlite>=0.26.0dev0 in d:\python\anaconda3\lib\s
ite-packages (from numba->largestinteriorrectangle->stitching) (0.26.0)

@lukasalexanderweber
Copy link
Member

your opencv version seems pretty old (4.2.0). Please consider upgrading and let me know if it worked

@ma-xq
Copy link
Author

ma-xq commented Aug 16, 2022

It worked. But another error occured.
numba.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
Cannot unify array(uint32, 2d, A) and array(uint32, 1d, A) for 's', defined at ~\largestinteriorrectangle\lir_basis.py (100)

@lukasalexanderweber
Copy link
Member

Try also upgrading numba

@ma-xq
Copy link
Author

ma-xq commented Aug 16, 2022

Try also upgrading numba

After installing llvmlite-0.39.0 numba-0.56.0,new error occurred as below.
File "D:\Python\Anaconda3\lib\site-packages\numba\core\entrypoints.py", line 48, in init_all
eps = importlib_metadata.entry_points()
TypeError: entry_points() missing 1 required positional argument: 'name'

@lukasalexanderweber lukasalexanderweber added the needs investigation Collect and attach more details (build flags, stacktraces, input dumps, etc) label Aug 17, 2022
@lukasalexanderweber
Copy link
Member

are you on windows 11? maybe related to https://github.com/lukasalexanderweber/stitching_tutorial/issues/11

@ma-xq
Copy link
Author

ma-xq commented Aug 17, 2022

are you on windows 11? maybe related to lukasalexanderweber/stitching_tutorial#11
No, I'm on windows 7, python 3.7.1. I think there may be some environment errors in numba, because different version of numba brings different errors after I tried numba-0.41.0, 0.56.0, 0.55.0, 0.50.0. Thank you very much for solving my problem.

@lukasalexanderweber
Copy link
Member

have you found a sollution?

@ma-xq
Copy link
Author

ma-xq commented Aug 17, 2022

No.

@lukasalexanderweber
Copy link
Member

so you are using anaconda.

You could try setting up a new virtual environment and install stitching there:

# Open Anaconda Prompt (base):
# Create new environment with Python 3.8:
conda create -n stitching python=3.8
# Activate your new Python 3.8 environment:
conda activate stitching

Check if stitching is available via conda:
conda search stitching
if yes, install
conda install stitching
if not, do it via pypi
pip install stitching

@ma-xq
Copy link
Author

ma-xq commented Aug 17, 2022

It didn't work.Error information is:
`Command-line error: too many arguments on command line

1 catastrophic error detected in the compilation of "0)PROCESS(0".
Compilation terminated.
OpenCL program build log: imgproc/morph
Status -11: CL_BUILD_PROGRAM_FAILURE
-D RADIUSX=1 -D RADIUSY=1 -D LSIZE0=16 -D LSIZE1=16 -D OP_DILATE -D PROCESS_ELEMS=PROCESS(0,0)PROCESS(0,1)PROCESS(0,2)PROCESS(1,0)PROCESS(1,1)PROCESS(1,2)PROCESS(2,0)PROCESS(2,1)PROCESS(2,2) -D T=uchar -D DEPTH_0 -D cn=1 -D T1=uchar -D convertToWT=convert_float -D convertToT=convert_uchar_sat_rte -D ST=uchar -D AMD_DEVICE
Frontend phase failed compilation.
`

@lukasalexanderweber
Copy link
Member

on which call does the error happen?

@ma-xq
Copy link
Author

ma-xq commented Aug 17, 2022

line:panorama = stitcher.stitch(["1.png", "2.png"])
`import stitching

print(stitching.version) # ok
stitcher = stitching.Stitcher() # ok
panorama = stitcher.stitch(["1.png", "2.png"]) # error`

@lukasalexanderweber
Copy link
Member

ok so the installation worked apperently..

Maybe it's a numba issue, try with

stitcher = stitching.Stitcher(crop=False)

@ma-xq
Copy link
Author

ma-xq commented Aug 17, 2022

It didn't work.Error information is: `Command-line error: too many arguments on command line

1 catastrophic error detected in the compilation of "0)PROCESS(0". Compilation terminated. OpenCL program build log: imgproc/morph Status -11: CL_BUILD_PROGRAM_FAILURE -D RADIUSX=1 -D RADIUSY=1 -D LSIZE0=16 -D LSIZE1=16 -D OP_DILATE -D PROCESS_ELEMS=PROCESS(0,0)PROCESS(0,1)PROCESS(0,2)PROCESS(1,0)PROCESS(1,1)PROCESS(1,2)PROCESS(2,0)PROCESS(2,1)PROCESS(2,2) -D T=uchar -D DEPTH_0 -D cn=1 -D T1=uchar -D convertToWT=convert_float -D convertToT=convert_uchar_sat_rte -D ST=uchar -D AMD_DEVICE Frontend phase failed compilation. `

same error

@lukasalexanderweber
Copy link
Member

please share the EXACT steps what you are doing.

@ma-xq
Copy link
Author

ma-xq commented Aug 17, 2022

I'm so sorry that I made a mistake. I didn't notice that PyCharm 2018.3.5(I'm using) doesn't support Python 3.8.
1.I create virtual conduct environment as you teach me.
2.Open pycharm and change it's project interpreter to the upper environment.In this step, the IDE show python=3.7.
3.In my script,run

import stitching

print(stitching.__version__)  # ok

stitcher = stitching.Stitcher(crop=False)  # ok
panorama = stitcher.stitch(["1.png", "2.png"])  # error

The IDE showed the error:

It didn't work.Error information is: `Command-line error: too many arguments on command line

1 catastrophic error detected in the compilation of "0)PROCESS(0". Compilation terminated. OpenCL program build log: imgproc/morph Status -11: CL_BUILD_PROGRAM_FAILURE -D RADIUSX=1 -D RADIUSY=1 -D LSIZE0=16 -D LSIZE1=16 -D OP_DILATE -D PROCESS_ELEMS=PROCESS(0,0)PROCESS(0,1)PROCESS(0,2)PROCESS(1,0)PROCESS(1,1)PROCESS(1,2)PROCESS(2,0)PROCESS(2,1)PROCESS(2,2) -D T=uchar -D DEPTH_0 -D cn=1 -D T1=uchar -D convertToWT=convert_float -D convertToT=convert_uchar_sat_rte -D ST=uchar -D AMD_DEVICE Frontend phase failed compilation. `

Then I tried on cmd.
1.Acitvate stitching environment.
2.Run stitch 1.png 2.png
It shows:

stitching 1.png 2.png into result.jpg
Command-line error: too many arguments on command line

1 catastrophic error detected in the compilation of "0)PROCESS(0".
Compilation terminated.
OpenCL program build log: imgproc/morph
Status -11: CL_BUILD_PROGRAM_FAILURE
-D RADIUSX=1 -D RADIUSY=1 -D LSIZE0=16 -D LSIZE1=16 -D OP_DILATE -D PROCESS_ELEM
S=PROCESS(0,0)PROCESS(0,1)PROCESS(0,2)PROCESS(1,0)PROCESS(1,1)PROCESS(1,2)PROCES
S(2,0)PROCESS(2,1)PROCESS(2,2) -D T=uchar -D DEPTH_0 -D cn=1 -D T1=uchar -D conv
ertToWT=convert_float -D convertToT=convert_uchar_sat_rte -D ST=uchar -D AMD_DEV
ICE
Frontend phase failed compilation.

I see the result.jpg although still have same error information.
Thank you very much.

@lukasalexanderweber
Copy link
Member

I see the result.jpg

Is this fine for you?

@ma-xq
Copy link
Author

ma-xq commented Aug 17, 2022

Yeah! It's so good! Thank you for your work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation Collect and attach more details (build flags, stacktraces, input dumps, etc)
Projects
None yet
Development

No branches or pull requests

2 participants