2023-04-26
[Image Quilting for Texture Synthesis]
♣ 에러 내용
cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'
♣ 에러 부분
if __name__ == "__main__": # 해당 main.py 가 메인으로 불려왔을 때 실행
# Start the main loop here
path = args.image_path # (호출인자)이미지 경로 - 사용자가 입력
# Get all blocks
image = cv2.imread(path) # 이미지 읽어오기
image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)/255.0 # openCv : 컬러값 BGR -> RGB 변경 => 0~255 -> 0~1 값 변경
- 호출 인자로 이미지 경로를 불러와서 cv2.imread 를 하는데 경로에 오타가 있어서 나타난 오류다
- src.empty() : 이미지가 없다는 뜻
- imread() 함수에서 읽은 이미지의 유무를 다시한번 체크해봐야함.
- 참고 : https://fordiy.tistory.com/35
'프로젝트 에러 > [CGVR] texture-synthesis' 카테고리의 다른 글
pytorch - gpu 사용하기 (0) | 2023.07.14 |
---|---|
"ValueError: The truth value of an array with more than one element isambiguous. Use a.any() or a.all()" (0) | 2023.05.02 |
파이썬 python 주석 단축키 [ ctrl + / ] 안 될 때 (0) | 2023.04.27 |
cannot import name 'model_urls' from 'torchvision.models.vgg' (0) | 2023.04.25 |