Ask Your Question
0

How do I threshold between two values a and b ?

asked 2014-11-07 19:56:32 -0600

huehuehue gravatar image

updated 2020-10-10 12:52:39 -0600

Sure I can create two thresholded Mat, one for each bound a and b, and multiply them component-wise, but how do I do that ?

edit retag flag offensive close merge delete

Comments

1

Can you express your idea in a mathematical equation? (Just ignore for a moment about how to get it working in OpenCV.)

rwong gravatar imagerwong ( 2014-11-07 20:50:26 -0600 )edit

^^ so, can we call it 'solved' ?

berak gravatar imageberak ( 2014-11-08 00:30:20 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-11-08 00:17:21 -0600

huehuehue gravatar image

Given the Matrix M, I threshold it (binary) with threshold value a, the ouput is A. Then I threshold M again (binry inverted) with value b, the output is B. Then if I multiply A and B component wise (Hadamard product) I should get what I want.

But I found the "inrange" function which does that automatically.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-11-07 19:56:32 -0600

Seen: 964 times

Last updated: Nov 07 '14