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!