帮酷
List<MatOfPoint> contours;//already initialized somewhere in your code
List<MatOfPoint2f> newContours = new ArrayList<>();
for(MatOfPoint point : contours) {
MatOfPoint2f newPoint = new MatOfPoint2f(point.toArray());
newContours.add(newPoint);
}
如何从列表 <MatOfPoint> 转换为 MatOfPoint2f?
最新推荐文章于 2024-04-07 12:24:08 发布
本文介绍了一种将轮廓数据从一种类型转换为另一种类型的实用方法。通过遍历原始轮廓集合并为每个轮廓创建新的MatOfPoint2f实例,可以轻松实现轮廓类型的转换。
4434

被折叠的 条评论
为什么被折叠?



