intensity transformation

see.. basically, i have this image.that has certain intensity values.. low=a and y=b, where a and b are between 0 and 255. and i have this other image, whose lower and upper intensity values are c and d. i want to transform the second image's intensity range to that of the first image's. ie, create a (linear)mapping such that c maps on to a and d maps on to b... is there a matlab function to do this?? or can anyone just give me ideas on how to code this?? i want options other than imhist (that just helps u view the intensity range) and the imadjust(that works for intensity ranges between 0 and 1)

 採用された回答

Image Analyst
Image Analyst 2011 年 6 月 12 日

0 投票

Just change this to set your desired min and max:
Let f be your array. Then . . .
originalMinValue = double(min(min(f)))
originalMaxValue = double(max(max(f)))
originalRange = originalMaxValue - originalMinValue;
% Get a double image in the range -1 to +1
desiredMin = -1;
desiredMax = 1;
desiredRange = desiredMax - desiredMin;
normalized = desiredRange * (double(grayImage) -
originalMinValue) / originalRange + desiredMin;

1 件のコメント

blackcoffee
blackcoffee 2011 年 6 月 13 日
thank you.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCartesian Coordinate System Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by