如何使用 Matlab 分割图像并将其显示在单独的 window 中?

How to segment an image and display it in separate window using Matlab?

我正在计算给定水泡中有缺陷的药片。为此,我需要像图像一样分割片剂水泡。然后必须将每个分割的图像与已经存储在数据库中的原始图像进行比较。

在我所指的基础论文中,他们告诉我们要分割输入图像然后进行比较。

除了分割,我已经完成了所有提到的步骤。如何分割处理后的图像?我需要为此保存处理过的图像吗?有没有像上面那样获取分割图像的函数?

提前致谢!

您可以使用 imcrop. For displaying an image you can use either imshow or imagesc. You can display several images on the same figure using subplot 在 Matlab 中裁剪图像:

img = imread( 'path/to/your/image.png' ); %// read image from disk
c1 = imcrop( img, [10 20 50 100] ); %// crop a portion of the image
c2 = imcrop( img, [70 20 50 100] ); %// crop another portion
%//displaying
figure;
subplot(1,2,1);imshow(c1,[]);title('first crop');
subplot(1,2,2);imshow(c2,[]);title('second crop');