![](/img/trans.png)
[英]How to find the original format of images (pages) present in a tiff file using python?
[英]How to display the length(no. of images) ([in this format]) of all the images present in the folders selected using python
圖片 = random.sample(range(1, 68),25)
我有 68 個文件夾,每個文件夾有 170 張圖片。 我需要選擇從上述命令生成的文件夾編號並顯示長度。 如何使用 python 做到這一點。
您可以通過以下方式獲取文件夾中圖像的形狀
DIR = '/content/images'
for name in os.listdir(DIR):
im=cv2.imread('/content/images/'+name)
print(im.shape)
輸出:
(183, 275, 3)
(191, 264, 3)
(194, 259, 3)
(210, 352, 3)
(1114, 1922, 3)
(194, 259, 3)
謝謝你。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.