Omitting negative pixels in the image representation

조회 수: 1 (최근 30일)
med-sweng
med-sweng 2014년 2월 16일
댓글: Image Analyst 2014년 2월 18일
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
med-sweng
med-sweng 2014년 2월 18일
Removing them from the display
Image Analyst
Image Analyst 2014년 2월 18일
Wayne already gave you code for that. Look above.

댓글을 달려면 로그인하십시오.

카테고리

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