Ask Your Question
0

How do I threshold between two values a and b ?

asked Nov 8 '14

huehuehue gravatar image

updated Oct 10 '0

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 ?

Preview: (hide)

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 (Nov 8 '14)edit

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

berak gravatar imageberak (Nov 8 '14)edit

1 answer

Sort by » oldest newest most voted
1

answered Nov 8 '14

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.

Preview: (hide)

Question Tools

Stats

Asked: Nov 8 '14

Seen: 1,054 times

Last updated: Nov 07 '14