The part of my code that I am having trouble on is the following.
if __name__ == '__main__':
for n, image_file in enumerate(os.scandir(image_folder)):
img = image_file
fig, ax = plt.subplots(1)
# mngr = plt.get_current_fig_manager()
# mngr.window.setGeometry(250, 120, 1280, 1024)
image = cv2.imread(image_file.path)
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
I receive the following error
image = cv2.cvtColor(image,cv2.COLOR_BGR2RGB)
cv2.error: OpenCV(3.4.4) C:\projects\opencv-python\opencv\module\imgproc\src\color.cpp:181:error:(-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'
I understand that the imread() may be empty because the images it is trying to read are not correctly saved. I am trying to test this code with 3 images saved as 000001, 000002, 000003... I am confused on why the images that are saved in the folder in C:\imagez are not working. I have tried saving 3 new images and still get the same error. Any advise would be great!