nopeAnon / Automated-HoloCure-Fishing

Automated Holocure Fishing Bot
GNU General Public License v3.0
68 stars 33 forks source link

Color problems maybe ? #45

Closed PandHerisson closed 11 months ago

PandHerisson commented 11 months ago

Hello I have this problem when i try to use the code does anybody kbows why ?

PS C:\Users\kevin> & C:/Users/kevin/AppData/Local/Microsoft/WindowsApps/python3.11.exe c:/Users/kevin/OneDrive/Documents/Automated-HoloCure-Fishing-master/holocurefishing.py [ WARN:0@0.023] global loadsave.cpp:248 cv::findDecoder imread('./img/360p/ok.png'): can't open/read file: check file path/integrity [ WARN:0@0.027] global loadsave.cpp:248 cv::findDecoder imread('./img/360p/space.png'): can't open/read file: check file path/integrity [ WARN:0@0.031] global loadsave.cpp:248 cv::findDecoder imread('./img/360p/left.png'): can't open/read file: check file path/integrity [ WARN:0@0.033] global loadsave.cpp:248 cv::findDecoder imread('./img/360p/right.png'): can't open/read file: check file path/integrity [ WARN:0@0.036] global loadsave.cpp:248 cv::findDecoder imread('./img/360p/up.png'): can't open/read file: check file path/integrity [ WARN:0@0.038] global loadsave.cpp:248 cv::findDecoder imread_('./img/360p/down.png'): can't open/read file: check file path/integrity Traceback (most recent call last): File "c:\Users\kevin\OneDrive\Documents\Automated-HoloCure-Fishing-master\holocure_fishing.py", line 8, in from imgproc import templates, masks File "c:\Users\kevin\OneDrive\Documents\Automated-HoloCure-Fishing-master\imgproc.py", line 21, in templates[name] = cv2.cvtColor(img, cv2.COLOR_BGRA2BGR) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cv2.error: OpenCV(4.8.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

TakeoIschiFan commented 11 months ago

Probable duplicate of #35 when not running the script inside the main code folder.

Try issueing a cd c:/Users/kevin/OneDrive/Documents/Automated-HoloCure-Fishing-master command first, or open a command line in the holocure fishing folder. Let me know if that solves the issue.

PandHerisson commented 11 months ago

Sorry i used visual studio for the code so i don't know how i am supposed open a command line in the holocure fishing folder or do the first option and i'm not good at coding etc. But I saw that NopeAnon said in #35 that i could use the launch_python.bat by it just don't work like my screen flash the command console and then nothing.

aap007freak commented 11 months ago

I'll try to be a bit more explicit:

  1. Open the Automated-HoloCure-Fishing folder in file explorer.
  2. In the top adress bar, remove the path, type "cmd" and press enter. A terminal window should now pop up.
  3. You should check that the terminal is indeed in the correct folder (the path is displayed before the ">" in the terminal).
  4. Type "prepare.bat" and press enter. This will execute the prepare.bat script (same thing as double clicking it)
  5. After the script finishes use should see a (.venv) prefix before the ">"
  6. type "python holocure_fishing.py". This should execute the main program.

Let me know if you fail at any of these steps. I agree the setup steps in the readme are bit confusing I am working on improving them.

PandHerisson commented 11 months ago

It gave me an error saying that there is no module named "cv2"

TakeoIschiFan commented 11 months ago

It gave me an error saying that there is no module named "cv2"

At step 6? You sure you typed prepare.bat in the terminal first first?

PandHerisson commented 11 months ago

Capture d'écran 2023-10-14 223009

TakeoIschiFan commented 11 months ago

That's really weird, I think its mixing up your global python environment and the virtual environment? @PandHerisson Can you try opening up a terminal in the holocure fishing folder again, delete the .venv folder if it exists and execute the following commands:

if that doesn't fix it then I have no idea tbf

PandHerisson commented 11 months ago

Thank you so much it finally worked