I have three different images and I want to take a small cross-section from all the three and then plot it on the same graph in order to make a comparison. Can anyone help me?

1 回表示 (過去 30 日間)
The three images are of 600*600. I want to cut a small portion from the figure like 330-353 along x-axis for each.

回答 (1 件)

Mehmed Saad
Mehmed Saad 2020 年 5 月 11 日
編集済み: Mehmed Saad 2020 年 5 月 11 日
im1 = imresize(imread('cameraman.tif'),[600 600]);
figure,imshow(im1),axis on
im1_seg = im1(:,330:353);
figure,imshow(im1_seg)
For comparing three different images you can use subplots ( drawing them on three different axes)
or if there size is same then you can draw them on 1 axes with seperation
For example
im1 = imresize(imread('cameraman.tif'),[600 600]);
im2 = imresize(imread('moon.tif'),[600 600]);
im3 = imresize(imread('canoe.tif'),[600 600]);
%%
im1 = im1(:,330:353);
im2 = im2(:,330:353);
im3 = im3(:,330:353);
%%
sepr = 255*ones(600,4);
figure,imshow([im1 sepr im2 sepr im3])
Edit:
For colored images
im4 = imresize(imread('car_2.jpg'),[600 600]);
figure,imshow(im4),axis on
im1_seg = im4(:,330:353,:);
figure,imshow(im1_seg)

カテゴリ

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

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by