bin2gray function's input is decimal.
古いコメントを表示
if dec2bin converts decimal to binary. and hex2dec converts hexadecimal to decimal. then how come bin2gray converts DECIMAL to gray?
採用された回答
その他の回答 (1 件)
Image Analyst
2015 年 5 月 29 日
You'll have to ask whomever wrote it. It's not part of MATLAB.
A built-in MATLAB function to convert floating point numbers in any range to grayscale is called mat2gray() . It scales the min to 0 and the max to 1. If you want a uint8 image, you can do
grayImage = uint8(255 * mat2gray(floatingPointMatrix));
3 件のコメント
Walter Roberson
2015 年 5 月 30 日
bin2gray() is part of the Communications Systems Toolbox
Elad
2015 年 5 月 30 日
Image Analyst
2015 年 5 月 30 日
Thanks Walter. I've added the Communications System Toolbox to the Products list for Elad. If he had put that there, I would have figured out where that function came from.
Elad, it's in a special toolbox that you have so that's why it shows up in your MATLAB help but not mine . I don't think it's a common toolbox - only 188 of 159,300 questions here in Answers deal with it. The most discussed toolboxes here are Imaging and Signal - #1 and 2 toolboxes respectively.
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!