【发布时间】:2021-10-15 05:36:29
【问题描述】:
在 MATLAB 中我有以下代码:
props = regionprops(bw,'BoundingBox');
v = cat(1, props.BoundingBox);
并且 v 返回: [194.5000, 156.5000, 378.0000, 154.0000; 325.5000、342.5000、160.0000、160.0000]
在 Python 中:
label_img = label(bw, connectivity = bw.ndim)
regions = regionprops(label_img)
v = np.array([p.bbox for p in regions]).reshape(2,4)
这一次 v 返回:array([[156, 194, 310, 572], [342, 325, 502, 485]])
有些数字很相似,但我不知道它们的真正含义。 ¿ 有谁知道我怎样才能在 MATLAB 中获得相同的结果?
【问题讨论】:
标签: python matlab opencv scikit-image