Two figures, same colormap stretch

Hello,
I have two matrices of image data that I would like to plot in grayscale. The first image is before any image processing and the second is after i have preformed the image processing.
The problem I am having is that I want to use imagesc() on both of the images, but this will result in two different color scales.
I want to plot both images on different figures using the same colormap scale so that I can show the improvement in the variance across the image.
Thanks for your help,
I am a matlab novice, so step by step instructions would be amazing help to me.

답변 (1개)

Image Analyst
Image Analyst 2012년 1월 30일

0 개 추천

Call colormap(gray) after you call imagesc or imshow.
grayImage1 = imread('moon.tif');
imagesc(grayImage1);
colormap(gray);
colorbar;
figure;
grayImage2 = imread('cameraman.tif');
imagesc(grayImage2);
colormap(gray);
colorbar;

댓글 수: 1

Jacob Brinkmann
Jacob Brinkmann 2012년 1월 30일
This wont affect the dynamic range of the colormap, though. If I were to use your answer, wouldn't differing values between the images be plotted to the same color?
I have data that ranges maybe from [50-100] and the other data ranging from [40-150]. I want to use the same image scaling from the larger dynamic range for the image that has a smaller dynamic range.
Does that make more sense? Thanks for your response to my inquiries.

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

카테고리

도움말 센터File Exchange에서 White에 대해 자세히 알아보기

질문:

2012년 1월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by