フィルターのクリア

Normalizing a gray scale image to the range [0,1]

26 ビュー (過去 30 日間)
med-sweng
med-sweng 2014 年 11 月 7 日
コメント済み: Image Analyst 2014 年 11 月 7 日
I'm trying to normalize a gray scale image to the range [0,1]. I tried different ways for normalizing the image, but always getting only pixels with "0" or "1", and not the values in-between.
How can I get the other values in this range?
Thanks.

回答 (2 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 11 月 7 日
編集済み: Azzi Abdelmalek 2014 年 11 月 7 日
a = mat2gray(yourimage)

med-sweng
med-sweng 2014 年 11 月 7 日
  2 件のコメント
Youssef  Khmou
Youssef Khmou 2014 年 11 月 7 日
im2double(X);
Image Analyst
Image Analyst 2014 年 11 月 7 日
mat2gray() scales the min to 0 and the max to 1, while im2double() divides by the max possible for that class (255 for uint8 and 65535 for uint16), so they do different things. With im2double there may not be a 0 or a 1. To do what I said in that answer you linked to, you can use mat2gray().

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

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by