How I can change the more than one pixel values in gray scale image ?
Show older comments
% I have gray image X (480x640 double), having values between 0 and 0 to 1, I want to change the values of all pixel to 1 that are closer to 1 and change values of all pixel to 0 that are near to 0.
1 Comment
Image Analyst
on 26 Oct 2012
Why did you post a duplicate when you already had this: http://www.mathworks.com/matlabcentral/answers/51939-how-i-can-change-the-certain-pixel-values-in-gray-scale-image?
Accepted Answer
More Answers (1)
Wayne King
on 26 Oct 2012
Edited: Wayne King
on 26 Oct 2012
The function round(), rounds to the nearest integer.
X = rand(480,640);
Xnew = round(X);
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!