How to display an existing ROI on an image (Copy an ROI to another image)
6 ビュー (過去 30 日間)
古いコメントを表示
Hi, Guys,
I have 2 images with the same size. An ROI was drawn on 1st image. I want to display this ROI on 2nd image. The key is to display this ROI at the same location on 2nd image. Please see the following example.
% Read 1st image and display it
i1 = imread('cameraman.tif');
figure(1)
imshow(i1);
h=imellipse; % Draw ROI on 1st image

% Read 2nd image and display it
i2 = imread('cameraman.tif');
figure(2)
imshow(i2);

How to copy the ROI generated on 1st image (h) to Figure (2) and display it? Thank you!

0 件のコメント
採用された回答
Joseph Cheng
2014 年 3 月 27 日
with the h = imellipse; you can get the points by doing
vert = getVertices(h)
figure(2),imshow(i2),hold on;
plot(vert(:,1),vert(:,2))
3 件のコメント
Joseph Cheng
2014 年 3 月 28 日
That shows most parameters you can change for your plot. Additionally you can look at the plot documentation in the link below.
plot(x,y,'--gs',...
'LineWidth',2,...
'MarkerSize',10,...
'MarkerEdgeColor','b',...
'MarkerFaceColor',[0.5,0.5,0.5])
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!