30 Ağu. 2022
tarihinde yayınlandı.
import cv2
import glob
#file dizininde sadece .jpg uzantılı dosyaları okumak istersek
#PATH="C:\\Users\\USER-PC\\Desktop\\file\\*.jpg"
#file dizininde tüm dosyaları okuyacak
PATH="C:\\Users\\USER-PC\\Desktop\\file\\"
path=glob.glob(PATH)
for file in path:
#print(file)
img=cv2.imread(file)
cv2.imshow("Image",img)
cv2.waitKey(0)
cv2.destroyAllWindows()
Resimlerin Boyutları
import cv2
import glob
PATH="C:\\Users\\USERNAME-PC\\Desktop\\file\\*.jpg"
path=glob.glob(PATH)
for file in path:
#print(file)
img=cv2.imread(file)
#resim boyutları
height, width, channels = img.shape
print(height, width, channels)
cv2.imshow("Image",img)
cv2.waitKey(0)
cv2.destroyAllWindows()