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

About alberto98fx's "Error-input array" #26

Open
YangLwBUAA opened this issue Nov 23, 2021 · 2 comments
Open

About alberto98fx's "Error-input array" #26

YangLwBUAA opened this issue Nov 23, 2021 · 2 comments
Assignees

Comments

@YangLwBUAA
Copy link

I met the same kind of error when the queryImage(212x142) is larger than trainImag(215x133).

Traceback (most recent call last):
  File "D:/Download/PythonSIFT-master/template_matching_demo.py", line 55, in <module>
    newimg[hdif:hdif + h1, :w1, i] = img1
ValueError: could not broadcast input array from shape (142,212) into shape (0,212)

And I exchange the two Image, then it works smoothly. So it seems to be trainImage's size cannot be smaller than queryImage's(Logically, it really should be like this)

Thx for ur share, it helps me a lot!

@YangLwBUAA
Copy link
Author

I may make a false conclusion. The size of two Images isn't the cause of this error. Here are my two test Images, and the error is:

Traceback (most recent call last):
  File "D:/Download/PythonSIFT-master/template_matching_demo.py", line 55, in <module>
    newimg[hdif:hdif + h1, :w1, i] = img1
ValueError: could not broadcast input array from shape (1706,1117) into shape (0,1117)

bottle on desk
bottle

These two Images were taken separately by iphone.
I will follow ur tutorial to learn more about SIFT and the code. Try to see if I can find the reason. I would be very grateful if you can provide help at your convenience.

@rmislam
Copy link
Owner

rmislam commented Nov 30, 2021

Hi @YangLwBUAA, thanks for your interest in this repo!
Thanks for posting the images you used. I will look into this and try to get back to you within a few days.

@rmislam rmislam self-assigned this Nov 30, 2021
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