Convert Position Vectors to Vertices, and Vice Versa!

版本 1.0.0.1 (2.9 KB) 作者: Brett Shoelson
A utility function to convert between rectangular position [x y w h] and vertices [x; y]
337.0 次下载
更新时间 2016/9/1

查看许可证

Many MATLAB and Toolbox functions require the specification of rectangular regions. Several use "position vectors," specified as [Xmin Ymin Width Height], many others require specification by vertex, [x; y]. For rectangular ROIs, either one defines the other. This submission facilitates easy conversion from position to vertex:
verts = posToVert(posn);
or from vertices to position:

posn = vertToPos(vert);

Simple, but useful.

引用格式

Brett Shoelson (2024). Convert Position Vectors to Vertices, and Vice Versa! (https://www.mathworks.com/matlabcentral/fileexchange/48728-convert-position-vectors-to-vertices-and-vice-versa), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2014b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Convert Image Type 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.1

Updated license

1.0.0.0