How to set grayscale just between 100 to 250?
1 view (last 30 days)
Show older comments
Dear all, Im a newby to matlab.I have 8bit gray scale image "X". I want to set the gray level just between 100 -250. Any respond will be appreciated. Thanks
0 Comments
Accepted Answer
Jan
on 4 Mar 2015
The question is not clear. But let me guess:
X = randi([0, 255], 640, 480, 'uint8'); % Example image
X(X < 100) = 100;
X(X > 250) = 250;
Or:
X = min(max(X, uint8(100)), uint8(250));
0 Comments
More Answers (0)
See Also
Categories
Find more on Image Processing Toolbox 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!