【发布时间】:2017-05-18 17:44:32
【问题描述】:
我正在尝试使用 Matlab 找到图像中某个区域的关闭点:
考虑这个示例代码:
myimg = rgb2gray(imread('tissue.png')); %load grayscale example image of cells
BW=bwareaopen(myimg<150,10); %only look at dark pixels, remove small objects
BW=bwlabel(imfill(BW,'holes')) %fill holes of structures, label structures
figure;
imagesc(BW); %display image
我想找到离某个点最近的结构的最近点,例如[0,0]。到目前为止,我的方法是获取所有连接结构的所有质心,然后遍历所有结构以找到最接近的结构(不准确且效率低下)。
【问题讨论】:
标签: matlab image-segmentation nearest-neighbor