How to generate a ROI matrix in Workspace after copying and pasting an existing ROI on an image (Copy an ROI to another image)
3 次查看(过去 30 天)
显示 更早的评论
Hi, Guys,
I have 2 images with the same size. An ROI was drawn on 1st image. Then I copy this ROI on the 1st image, and then paste it on the 2nd image. How to generate a ROI matrix for the 2nd image in Workspace? Thanks.
% Read 1st image and display it
i1 = imread('cameraman.tif'); figure(1)
imshow(i1);
h=imellipse; % Draw ROI on 1st image
ROI_1st = createMask(h);
% In Workspace, there is a variable "ROI_1st" as "256x256 logical".
% Copy the ROI in 1st image
% Read 2nd image and display it
i2 = imread('cameraman.tif');
figure(2)
imshow(i2);
% Paste the ROI on 2nd images
% Paste result and I can also move the ROI to the desired the position
After copying the ROI from the 1st image to the 2nd image, how to generate a variable in Workspace as a matrix to represent the 2nd ROI? Thank you very much.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Computer Vision with Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!