MATLAB将灰度输出转换为实际强度

问题描述 投票:0回答:1

我正在尝试查找258 x 318 x 801两倍的3D图像的阈值。我首先将图像重塑为1D数组,然后使用graythresh

ROI = reshape(postImg,[],1);
thresh = graythresh(ROI);

但是我试图找到实际的强度阈值而不是0到1之间的值。除了使用multithresh之外,还有其他方法可以转换此强度阈值吗?

matlab image-thresholding
1个回答
0
投票

来自MATLAB documentation

Graythresh函数将多维数组转换为二维数组,使用整形,并忽略I的任何非零虚部。

因此,您的重塑可能是多余的。我认为这可以做到:

thresh = graythresh(postImg); % postIm can be 3D
BinIm = imbinarize(postIm,thresh); % creates a binary mask of your image
© www.soinside.com 2019 - 2024. All rights reserved.