[Python] Why does my cv2.imread() giving me None? (python)

Discussão em 'Python' iniciado por Stack, Junho 22, 2025.

  1. Stack

    Stack Membro Participativo

    I am new to this image detection thing and I've been following a youtube video and trying to make a program that detects an image so I can automate some fishing in a game. But I keep getting this error where everytime I made a correct path to the image file I keep getting None output. Could somebody help me with this please?

    from numpy import asarray
    from mss import mss
    import cv2
    import time
    import pyautogui
    import imageio.v3 as iio

    import os
    import shutil

    def vision():
    cords = (400,400,1100,400)
    mark = cv2.imread("D:\\Python\\New folder\\apple.png")

    print(cv2.imshow("OpenCV Image",mark))

    while True:
    vision()


    My screenshot of the output:

    [​IMG]

    expected the image to be read but when I recall it, it wont work.

    Continue reading...

Compartilhe esta Página