윤제로의 제로베이스

[Python OpenCV] src_depth != CV_16F && src_depth != CV_32S in function 'convertToShow' 해결 방법 본문

Issue board/python

[Python OpenCV] src_depth != CV_16F && src_depth != CV_32S in function 'convertToShow' 해결 방법

윤_제로 2023. 2. 24. 12:48

mask 색상을 바꾸느라 numpy로 opencv를 좀 다뤘는데 아래와 같은 오류가 발생했다.

그래서 왜 안되지..? 똑같은 array인데 왜 imshow()를 못 하지..?!?! 하고 찾아본 결과... 단순한 dtype오류였다....

 

opencv에서 이미지를 띄우려면 uint8 타입이 필요하다고 한다!

오류

cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-ms668fyv/opencv/modules/highgui/src/precomp.hpp:137: error: (-215:Assertion failed) src_depth != CV_16F && src_depth != CV_32S in function 'convertToShow'

 

오류 코드

해결 방법

 

 

참고 자료

https://kosb.tistory.com/76

 

[python opencv] Src_depth! = CV_32S in function 'convertToShow' 오류 해결방법

오류 내용 OpenCV(4.5.2) C:/Users/runneradmin/AppData/Local/Temp/pip-req-build-t9hleyt8/opencv/modules/highgui/src/precomp.hpp:140: error: (-215:Assertion failed) src_depth != CV_16F && src_depth != CV_32S in function 'convertToShow' 오류 코드 impor

kosb.tistory.com