我正在尝试查找258 x 318 x 801两倍的3D图像的阈值。我首先将图像重塑为1D数组,然后使用graythresh
ROI = reshape(postImg,[],1);
thresh = graythresh(ROI);
但是我试图找到实际的强度阈值而不是0到1之间的值。除了使用multithresh之外,还有其他方法可以转换此强度阈值吗?
Graythresh函数将多维数组转换为二维数组,使用整形,并忽略I的任何非零虚部。
因此,您的重塑可能是多余的。我认为这可以做到:
thresh = graythresh(postImg); % postIm can be 3D
BinIm = imbinarize(postIm,thresh); % creates a binary mask of your image