how do you threshold using simulink auto threshold block?

5 views (last 30 days)
I want to detect red, so my Webcam input --> i only take the Cr signal (Y_Cb_Cr).
that signal is put into an authothreshold block.
how do i threshold it for example:
lower_range < Threshold value < upper range
so if its between those range its black/white...
Question 2 (SIMULINK BLOCKS) I can detect the red object using the Cr signal
when i remove the red object. a lot of noise is in the video... put the red back in only the red is detected (environment= black)
How do i threshold/filter fix this so when the red object is removed from the scene... it doesnt have random white/black flickering noise all over. i don't know how to fix this in simulink
thanks a lot!

Answers (1)

Seth Popinchalk
Seth Popinchalk on 13 Mar 2011
The noise is probably due to a very even background color in your image. With such an even intensity, the Autothreshold block will probably turn half the pixels black and half white. You could switch between a constant signal to the autotheshold signal when the object is onscreen. You just need to detect the condition when it exists. For example, if you know your system will only ever have one object in view at a time, you could test for exactly 1 object. When there are more objects (due to noise) you know you are getting the noise, so you could turn off the autotheshold signal.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by