在 Matlab 中将点列表转换为边界框 [英] Convert List of Points to a Bounding Box in Matlab

查看:46
本文介绍了在 Matlab 中将点列表转换为边界框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个边界框:

 bbox = [10 20 50 60];

我使用以下方法将边界框转换为点列表:

I convert the bounding box to a list of points using:

 points = bbox2points(bbox);

然后我使用 affine2dtransformPointsForward 对点应用旋转.现在我有了转换后的点,如何将它们转换回边界框?是否有一些相当于points2bbox"的内置函数?谢谢.

I then apply a rotation to the points using affine2d and transformPointsForward. Now I have my transformed points, how can I convert them back to a bounding box? Is there some built in function equivalent to "points2bbox"? Thanks.

推荐答案

现在排序.我只是以各种方式翻转图像,然后使用旋转角度和原始图像的尺寸(保持不变)计算新的边界框位置.

Now sorted. I just flipped the images in various ways and then calculated the new bounding box position using the angle of rotation and the dimensions of the original image (which remained constant).

这篇关于在 Matlab 中将点列表转换为边界框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆