Use of Imagesc to show more than one image on a single figure

24 ビュー (過去 30 日間)
Oluwaseyi Aliu
Oluwaseyi Aliu 2020 年 9 月 22 日
編集済み: Rena Berman 2020 年 10 月 8 日
Hello,
please how can I use imagesc to display more than one image on a single figure using distinctive colors or what's the alternative to capture more than on image on a single figure.

採用された回答

Oluwaseyi Aliu
Oluwaseyi Aliu 2020 年 9 月 22 日
Thanks so much for your prompt response. The images were only divided into segments in the same figure; that is not what I want sir.
The attached showed exactly what I need; for example, red shows fluid 1, blue show fluid 2 and green show solid background.
Kindly check my attachment. Thanks in anticipation!
  5 件のコメント
Walter Roberson
Walter Roberson 2020 年 9 月 22 日
You would need to imshow(rgbImage)
Note: watch out that your data range matches the datatype being used. If your arrays are double() then your data ranges should all be 0 to 1, but if your arrays are uint8() then your data ranges should be 0 to 255.
Oluwaseyi Aliu
Oluwaseyi Aliu 2020 年 9 月 22 日
Thanks so much!

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2020 年 9 月 22 日
編集済み: Image Analyst 2020 年 9 月 22 日
Try stitching them together if they're the same number of rows and color channels:
wideImage = [rgbImage1, rgbImage2];
imagesc(wideImage);
Use ind2rgb() if you have gray scale images that you want to pseudocolor:
rgbImage1 = ind2rgb(grayImage1, jet(256)); % Convert grayImage1 to color using the jet colormap.
rgbImage2 = ind2rgb(grayImage2, hsv(256)); % Convert grayImage2 to color using the hsv colormap.
wideImage = [rgbImage1, rgbImage2];
imagesc(wideImage);
  1 件のコメント
Image Analyst
Image Analyst 2020 年 9 月 22 日
Try
rgbImage = cat(3, mat2gray(fluid1Image), mat2gray(solidBackground), mat2gray(fluid2Image));
imagesc(rgbImage);
This will scale all input images to the range 0-1 and put each into one of the color channels. It should be able to show up then.

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

カテゴリ

Help Center および File ExchangeBlue についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by