Filter löschen
Filter löschen

Problem in thresholding an image

1 Ansicht (letzte 30 Tage)
Algorithms Analyst
Algorithms Analyst am 12 Mär. 2013
Hi all
I am facing problem in thresholding an image such that in image 1 belongs to background and 0 belongs to foreground pixel.I have computed thresholded now i wan to satify the foreground equation like that
image>=threshold
how can I do it?such that 0 belongs to foreground in this image(black) and 1 belongs to background(white.) image is 576x720 and threshold computed is 576x720.
Thanks
  1 Kommentar
Image Analyst
Image Analyst am 12 Mär. 2013
Can you upload your image somewhere?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 12 Mär. 2013
Like this:
foregroundImage = yourImage < threshold; % Can use <= if you want.
The foreground will be black (this is opposite to the normal way of foreground being white).
If your image has teh "foreground" as 0 and background as 1, then you'd do this:
foregroundImage = yourImage == 0;
but in that case it sounds like your image has already been thresholded.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by