image thumbnail

Convert Position Vectors to Vertices, and Vice Versa!

バージョン (2.86 KB) 作成者: Brett Shoelson
A utility function to convert between rectangular position [x y w h] and vertices [x; y]

ダウンロード 337 件

更新 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 (2022). Convert Position Vectors to Vertices, and Vice Versa! (, MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2014b
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!