Ask Your Question
0

threshold cannot work normally

asked 2017-12-03 05:55:06 -0600

yode gravatar image

updated 2017-12-03 05:57:03 -0600

As the document of threshold

@Param src input array (multiple-channel, 8-bit or 32-bit floating point).

But why my this code cannot work??

Mat img = (Mat_<float>(1, 6) << 2, 948, 6, 77, 53, 500);
threshold(img, img, 0, 255, THRESH_OTSU);

Can anyone give me a reason?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-12-03 06:24:26 -0600

berak gravatar image

updated 2017-12-03 06:25:50 -0600

you have to read the fine print in the docs, too !

Currently, the Otsu's and Triangle methods are implemented only for 8-bit images.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-12-03 05:55:06 -0600

Seen: 142 times

Last updated: Dec 03 '17