Convert Position Vectors to Vertices, and Vice Versa!

A utility function to convert between rectangular position [x y w h] and vertices [x; y]
Aktualisiert 1. Sep 2016

Lizenz anzeigen

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.

Zitieren als

Brett Shoelson (2024). Convert Position Vectors to Vertices, and Vice Versa! (, MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2014b
Kompatibel mit allen Versionen
Windows macOS Linux
Mehr zu Convert Image Type finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise

Updated license