[ Error ]/CT Skin Segmentation

OpenCV Error: Assertion failed (src.type() == CV_8UC1) in cv::threshold, file C:\builds\2_4_PackSlave-win64-vc11-shared\opencv\modules\imgproc\src\thresh.cpp, line 719

황찌옹 2022. 8. 4. 01:49

 

image

 

image

 

CV_8UC1 이라는 건 imread 할 때 8비트 3채널 color 영상으로 받아 왔기 때문에 발생하는 오류!
(imread 디폴트 값 : color 영상)

 

따라서 Otsu Thresholding 할 때에는 1채널 gray scale 영상을 input으로 넣어 줘야 하므로,
imread('path', 0) 이렇게 mode : 0으로 imread 해야 함.

 

image