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

edit: very inefficient/wrong identifications #2

Open
Pranjal-SB opened this issue Oct 5, 2023 · 11 comments
Open

edit: very inefficient/wrong identifications #2

Pranjal-SB opened this issue Oct 5, 2023 · 11 comments

Comments

@Pranjal-SB
Copy link

Traceback (most recent call last):
  File "stuf/matcher.py", line 1, in <module>
    import cv2
  File "stuf/.pythonlibs/lib/python3.10/site-packages/cv2/__init__.py", line 181, in <module>
    bootstrap()
  File "stuf/.pythonlibs/lib/python3.10/site-packages/cv2/__init__.py", line 111, in bootstrap
    load_first_config(['config.py'], True)
  File "stuf/.pythonlibs/lib/python3.10/site-packages/cv2/__init__.py", line 109, in load_first_config
    raise ImportError('OpenCV loader: missing configuration file: {}. Check OpenCV installation.'.format(fnames))
ImportError: OpenCV loader: missing configuration file: ['config.py']. Check OpenCV installation.
@Pranjal-SB
Copy link
Author

when i do python3 matcher.py i get that error

@Pranjal-SB
Copy link
Author

i researched a bit and found out that this error mostly comes only in replit which i am using 😅 lol but still if you could help i would be glad

@Pranjal-SB
Copy link
Author

i tried running on my pc and after a long load of all the templates i could find i got this different error

[*] Loaded "./templates/Wartortle.png"!
[*] Loaded "./templates/Watchog.png"!
[*] Loaded "./templates/Wattrel.png"!
[*] Loaded "./templates/Weavile.png"!
[*] Loaded "./templates/Weedle.png"!
[*] Loaded "./templates/Weepinbell.png"!
[*] Loaded "./templates/Weezing.png"!
[*] Loaded "./templates/Whimsicott.png"!
[*] Loaded "./templates/Whirlipede.png"!
[*] Loaded "./templates/Whiscash.png"!
[*] Loaded "./templates/Whismur.png"!
[*] Loaded "./templates/Wigglytuff.png"!
[*] Loaded "./templates/Wiglett.png"!
[*] Loaded "./templates/Wimpod.png"!
[*] Loaded "./templates/Wingull.png"!
[*] Loaded "./templates/Wishiwashi.png"!
[*] Loaded "./templates/Wo-Chien.png"!
[*] Loaded "./templates/Wobbuffet.png"!
[*] Loaded "./templates/Woobat.png"!
[*] Loaded "./templates/Wooloo.png"!
[*] Loaded "./templates/Wooper.png"!
[*] Loaded "./templates/Wormadam.png"!
[*] Loaded "./templates/Wugtrio.png"!
[*] Loaded "./templates/Wurmple.png"!
[*] Loaded "./templates/Wynaut.png"!
[*] Loaded "./templates/Wyrdeer.png"!
[*] Loaded "./templates/Xatu.png"!
[*] Loaded "./templates/Xerneas.png"!
[*] Loaded "./templates/Xurkitree.png"!
[*] Loaded "./templates/Yamask.png"!
[*] Loaded "./templates/Yamper.png"!
[*] Loaded "./templates/Yanma.png"!
[*] Loaded "./templates/Yanmega.png"!
[*] Loaded "./templates/Yungoos.png"!
[*] Loaded "./templates/Yveltal.png"!
[*] Loaded "./templates/Zacian.png"!
[*] Loaded "./templates/Zamazenta.png"!
[*] Loaded "./templates/Zangoose.png"!
[*] Loaded "./templates/Zapdos.png"!
[*] Loaded "./templates/Zarude.png"!
[*] Loaded "./templates/Zebstrika.png"!
[*] Loaded "./templates/Zekrom.png"!
[*] Loaded "./templates/Zeraora.png"!
[*] Loaded "./templates/Zigzagoon.png"!
[*] Loaded "./templates/Zoroark.png"!
[*] Loaded "./templates/Zorua.png"!
[*] Loaded "./templates/Zubat.png"!
[*] Loaded "./templates/Zweilous.png"!
[*] Loaded "./templates/Zygarde.png"!
[*] Testing source: ./test_poketwo_spawns/poketwo_deino.png
Traceback (most recent call last):
  File "C:\Users\psbha\Documents\Stuff\opencv_poketwofinder-master\matcher.py", line 99, in <module>
    main()
  File "C:\Users\psbha\Documents\Stuff\opencv_poketwofinder-master\matcher.py", line 92, in main
    match_canditates.append({"name": str(template), "template": template.template, "result": check_matching(poketwo_spawn.template, template.template)})
                                                                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\psbha\Documents\Stuff\opencv_poketwofinder-master\matcher.py", line 55, in check_matching
    kp1, kp2, matches = match_images(src, templ_flipped, False)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\psbha\Documents\Stuff\opencv_poketwofinder-master\matcher.py", line 12, in match_images
    matches = bf.match(des1, des2)
              ^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\core\src\batch_distance.cpp:275: error: (-215:Assertion failed) type == src2.type() && src1.cols == src2.cols && (type == CV_32F || type == CV_8U) in function 'cv::batchDistance'

@Pranjal-SB
Copy link
Author

checked google maybe its because i gave 1000 templates or smh maybe

@Pranjal-SB
Copy link
Author

oh it was because of flabebe template
it has those specia e s in her name so it didnt load correctly

@Pranjal-SB
Copy link
Author

image
bruh i have the exact deino image but this

@Pranjal-SB
Copy link
Author

//......loads
[*] Testing source: ./test_poketwo_spawns/poketwo_deino.png
[*] Potential Match: 'Iron moth' with score: 139

@Pranjal-SB
Copy link
Author

maybe most probably was becoz of the background

@Pranjal-SB
Copy link
Author

image

new issue
not right at all fr

@Pranjal-SB Pranjal-SB changed the title im getting this error when i try to run edit: very inefficient/wrong identifications Oct 6, 2023
@Pranjal-SB
Copy link
Author

if there is any way to remove the bg before scan it may work better

@Bonkeyzz
Copy link
Owner

Bonkeyzz commented Oct 6, 2023

Hello!

image bruh i have the exact deino image but this

image

new issue not right at all fr

This python script currently does not have any instructions to follow when trying to match a source image containing a pokemon that it does not have a template for & it may output inaccurate results even with pre-existing templates, I was aware of that issue already and plan on fixing it at some point.

if there is any way to remove the bg before scan it may work better

I am not so sure if i will implement such feature, though its a maybe.

Thank you for the feedback!

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