Omitting negative pixels in the image representation

1 次查看(过去 30 天)
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 个评论
Image Analyst
Image Analyst 2014-2-16
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?????

请先登录,再进行评论。

回答(1 个)

Wayne King
Wayne King 2014-2-16
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 个评论

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by