Image threshold value question
1 次查看(过去 30 天)
显示 更早的评论
Hello guys, Normally we set one value 'a', then we have [0 a]= black, [a 255]=white My question is, can we do it like this way, [0 a]=black, [a b]=white, [b 255]=black I hold you can understand my terrible description.
0 个评论
采纳的回答
Image Analyst
2013-2-20
Sure, just do two comparisons:
binaryImage = grayImage >= a & grayImage <= b;
0 个评论
更多回答(1 个)
Thorsten
2013-2-20
I = imread('cameraman.tif');
a = 100; b = 150;
ind = setdiff(find(I > a), find(I < b));
B = logical(size(I));
B(ind) = 1;
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!