Would it be possible to change the greyscale to a blue scale?

조회 수: 18 (최근 30일)
Would it be possible to change this greyscale picture into a other color scale like in the two images? I tried some codes to make the binary into a color but i am trying to have something more clear to look than greyscale... Thank you

채택된 답변

Turlough Hughes
Turlough Hughes 2022년 1월 4일
I don't think MATLAB has a blue scale colormap. You could do something custom, like the following. I'll use camerman for illustration:
I = imread('cameraman.tif');
imshow(I)
n = 128;
blueMap = [zeros(n/2,1) linspace(0,0.5,n/2).' linspace(0.5,1,n/2).';...
linspace(0,1,n/2).' linspace(0.5,1,n/2).' ones(n/2,1)];
figure()
imshow(I)
colormap(blueMap)
It's much simpler just using one of the builtin colormaps:
imshow(I)
colormap('copper') % or parula, hsv, bone, jet, etc.
  댓글 수: 1
Mathias Giesbrecht
Mathias Giesbrecht 2022년 1월 4일
편집: Mathias Giesbrecht 2022년 1월 4일
Thanks for the exemple!
the bulitin colormap turbo does perfectly the job

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

J Chen
J Chen 2022년 1월 4일
Take a look at the colormap command - https://www.mathworks.com/help/matlab/ref/colormap.html

카테고리

Help CenterFile Exchange에서 Blue에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by