how can I convert a double image into gray unit8 image?

13 ビュー (過去 30 日間)
Waseem AL Aqqad
Waseem AL Aqqad 2014 年 10 月 26 日
編集済み: Waseem AL Aqqad 2016 年 8 月 14 日
Lets say that we have a 256x256 double image, how can we convert it into a 256x256 uint8?
  1 件のコメント
Khairul Bashar Syed
Khairul Bashar Syed 2014 年 10 月 26 日
Say the image matrix is im. So just use im=uint8(im);

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2014 年 10 月 26 日
I would use the uint8 function.
  11 件のコメント
Star Strider
Star Strider 2014 年 10 月 26 日
Actually, very few of us here are MathWorks employees. Most of us (including me) are unpaid volunteers who do our individual and collective best to share what we know.
If you cannot get im2unit8 or uint8 working, contact MathWorks Tech Support to see if they can figure out what the problem is.
Star Strider
Star Strider 2014 年 10 月 26 日
My pleasure!
I wish we could have gotten im2uint8 or uint8 working for you.

サインインしてコメントする。

その他の回答 (1 件)

Image Analyst
Image Analyst 2014 年 10 月 26 日
There is no function 'im2unit8' but there is a function im2uint8. It matters how you spell it and you spelled it incorrectly. I never use it - I use uint8(). im2uint8() also does scaling, of course you could use uint8(mat2gray()) to scale it to the full range.
  2 件のコメント
Star Strider
Star Strider 2014 年 10 月 26 日
I misspelled it in my last Comment but not earlier. Waseem has it in his MATLAB search path but apparently can’t use it or uint8.
That seems to be the problem.
Star Strider
Star Strider 2014 年 10 月 26 日
Waseem — You spelled it correctly earlier in this thread. However we did not see your code, so I assumed you simply misspelled it in your Question.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by