I got a Data set which full of images. My aim is converting this images to gray scale. I can easily do this with one image but I need to do whit multiple images. Here is my code;
import cv2
import glob
path = "/path/*.jpg"
for file in glob.glob(path):
img = cv2.imread(file)
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imshow('Gray image', gray)
cv2.imwrite('/path/cat' + '_gray.jpg', gray)
When I run this script, it's only convert a single image but my aim is converting the all images in the path. I'm really beginer on image processing and OpenCv2 module. Thanks already now for your helps.