我正在尝试裁剪使用 mser 检测到的区域。mser.detect() 函数产生 mser 区域,我想裁剪该区域以提供结果输出。我正在使用 python,如果有人可以在 python 中提供帮助,我将不胜感激。
regions, _ = mser.detectRegions(img)
hulls = [cv2.rect(p.reshape(-1, 1, 2)) for p in regions]
print type(hulls);
cv2.polylines(vis, hulls, 1, (0, 255, 0))
#crop_img=[cv2.resize(vis, (b.width, b.height) ,interpolation = cv2.INTER_AREA) for b in bboxes]
我想根据船体裁剪它。