How to logical AND gray scale image with a constant?
4 ビュー (過去 30 日間)
古いコメントを表示
ANDing an 8-bit gray level image with a constant value of 240 (11110000 in binary)?
0 件のコメント
採用された回答
Image Analyst
2015 年 8 月 4 日
Use bitand():
n1 = uint8(170); % Some number
n2 = uint8(240);
% Show what they are
dec2bin(n1)
dec2bin(n2)
% And them
out = bitand(n1, n2)
% Show result
dec2bin(out)
ans =
10101010
ans =
11110000
out =
160
ans =
10100000
It works for images as well as individual numbers.
その他の回答 (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!