Ask Your Question
0

OPENCV 4.04 > THRESH_OTSU mode: > 'src_type == CV_8UC1 || src_type == CV_16UC1' > where > 'src_type' is 6 (CV_64FC1)

asked 2020-10-10 06:31:39 -0500

fcy16 gravatar image

updated 2020-10-10 06:37:14 -0500

berak gravatar image

Im getting this mistake in pyhton, opencv Traceback (most recent call last):

File "C:/Users/PycharmProjects/prosses/main.py", line 116, in cv2.THRESH_BINARY_INV | cv2.THRESH_OTSU)[1] cv2.error: OpenCV(4.4.0) C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-hfoi92lm\opencv\modules\imgproc\src\thresh.cpp:1557: error: (-2:Unspecified error) in function 'double __cdecl cv::threshold(const class cv::_InputArray &,const class cv::_OutputArray &,double,double,int)'

THRESH_OTSU mode: 'src_type == CV_8UC1 || src_type == CV_16UC1' where 'src_type' is 6 (CV_64FC1)

[ WARN:0] global C:\Users\appveyor\AppData\Local\Temp\1\pip-req-build-hfoi92lm\opencv\modules\videoio\src\cap_msmf.cpp (435) `anonymous-namespace'::SourceReaderCB::~SourceReaderCB terminating async callback
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-10-10 06:38:50 -0500

berak gravatar image

updated 2020-10-10 14:52:27 -0500

you can only use the THRESH_OTSU flag with 8 or 16 bit single channel integer images (yours is of type double / float64)

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-10-10 06:31:39 -0500

Seen: 182 times

Last updated: Oct 10