【发布时间】:2012-11-04 06:03:50
【问题描述】:
如何在 Matlab 中不使用 imfreehand 而自动选择图像中不规则形状的蒙版?图像的背景是黑色的,我想选择整个图像作为没有黑色背景的蒙版(没有黑色背景的所有内容)。
【问题讨论】:
标签: image matlab image-processing masking
如何在 Matlab 中不使用 imfreehand 而自动选择图像中不规则形状的蒙版?图像的背景是黑色的,我想选择整个图像作为没有黑色背景的蒙版(没有黑色背景的所有内容)。
【问题讨论】:
标签: image matlab image-processing masking
试试这个:
threshold=0; % or a different value if needed
mask=image>threshold;
假设背景是真正的黑色,即像素值为 0,则将阈值设置为零。否则,选择一个捕获背景的值(有一些方法可以自动完成)
【讨论】:
imagesc(mask); colormap(gray)