カラーレンジを反映して画像を保存する
Show older comments
連番画像(8bit)を読み込み,指定のカラ―レンジを反映させてカラー画像として保存したいです.
やりたいこと
①.表示上のカラーレンジの指定
②.閾値以下の値をノイズとして黒にする.
(⇒カラーレンジを0~255とすると.10以下をすべて黒色に変換する)
③.①②を反映した画像を保存する.
下記のスクリプトを例として修正したいと思います.
for n= 1:5
IMG = imread (['アドレス\No',num2str(n),'.tif']); %画像読みこみ..IMGは8bit
%保存時に反映したいレンジ★
colormap(jet)
cmin = 50;
cmax = 255;
caxis([cmin cmax]);
colorbar
%画像保存.この設定だとカラーレンジは自動=0~255(MIN MAX).↑★の設定は反映されない
newmap=colormap(jet);
imwrite(IMG,newmap,['アドレス\Color_No',num2str(n),'.tif']);
end
Accepted Answer
More Answers (0)
Categories
Find more on Blue in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!