确定投资回报率之间的相对位置

时间:2018-11-13 10:30:36

标签: matlab

简化问题。我想找到ROI与其他ROI的相关位置,然后将结果放在矩阵中。

示例,这是一张包含一系列ROI的图片。

enter image description here

可以使用region props函数提取ROI的位置。

stats = regionprops(ROIs,'centroid');

首先,我想到了使用质心并将其用作其他点的锚点

t1 = transpose([stats.Centroid]);
t2 = transpose(reshape(t1,[2,40]));

[~,idx] = find(t2(:,1)==min(t2(:,1)));
anchorpoint = t2(idx,:);

ydif = t2(:,1)-anchorpoint(1);
xdif = t2(:,2)-anchorpoint(2);

这将给我到锚点的相对距离,符号(+-)表示之前,之后或之上,之下。下一步将是什么?

我可以从锚点找到数组的假定尺寸

ydim = sum((abs(ydif)<20))

ydim = 5

xdim = sum((abs(xdif)<20))

xdim = 8

但这是相对的,因为投资回报率存在差距。

从那时起我迷茫不知所措

0 个答案:

没有答案