Omitting negative pixels in the image representation

2 Ansichten (letzte 30 Tage)
med-sweng
med-sweng am 16 Feb. 2014
Kommentiert: Image Analyst am 18 Feb. 2014
Say that I have an image where there are some pixels which values are negative. How can I omit those from the image representation in `MATLAB`?
Thanks.
  1 Kommentar
Image Analyst
Image Analyst am 16 Feb. 2014
What's going on? You already had a discussion on this going in http://www.mathworks.com/matlabcentral/answers/116236#comment_196593 and then you posted the same thing twice more. I deleted the version that no one has answered yet. Why would you want to look for answers in three separate threads?????

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Wayne King
Wayne King am 16 Feb. 2014
Depending on your data and application, you can just take the absolute value. If that doesn't work you can set all the negative values to zero using logical indexing
X = randn(256);
X(X<0) = 0;
  4 Kommentare
med-sweng
med-sweng am 18 Feb. 2014
Removing them from the display
Image Analyst
Image Analyst am 18 Feb. 2014
Wayne already gave you code for that. Look above.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by