✍ 디렉토리 내, 이미지 파일 가져와서 opencv를 통한 이미지 출력
1. 설정한 이미지 저장 경로 내, 이미지 가져오기
2. 디렉토리 내, 첫 번째부터 마지막까지 이미지 저장 경로 받아옴
3. opencv를 통한 경로 내 이미지 가져와서 변수에 저장
4. opencv를 통한 이미지 출력 / 0.001초
import cv2 as cv
import os
# image count
cnt = 0
for i in os.listdir('test_data'):
DATASET_PATH = os.path.realpath("test_data/")
path = DATASET_PATH + "\\" + i
img_color = cv.imread(path)
print("image index : ", cnt) # image index print
cnt = cnt + 1
cv.imshow("image", img_color)
cv.waitKey(1)
'알고리즘 예제 > Python' 카테고리의 다른 글
[Python] - Codeup 알고리즘 (0) | 2022.03.06 |
---|---|
[Python] - Coding Test / 6098 문제 (0) | 2022.03.06 |
[Python] - Coding Test / 6097 문제 (0) | 2022.03.06 |
[Python] - Coding Test / 6095 문제 (0) | 2022.03.06 |
[Python] - Coding Test / 6092 문제 (0) | 2022.03.06 |