Any help greatly appreciated.
import numpy as np
import cv2
import glob
from imutils import paths
import os
import os.path
print(os.getcwd())
os.environ['TF_ENABLE_ONEDNN_OPTS'] = '0'
captcha_image = ("c:/Users/micha/Documents/PythonProgramming/IG//captcha.jpg")
# Load the image and convert it to grayscale
image = cv2.imread(captcha_image)
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
I keep getting the following error;
Traceback (most recent call last):
File “c:\Users\micha\Documents\PythonProgramming\IG\pytesseract_solver.py”, line 18, in
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cv2.error: OpenCV(4.10.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:196: error: (-215:Assertion failed) !_src.empty() in function ‘cv::cvtColor’