Find vertices in image of convex polygon

バージョン 1.0.0 (6.82 KB) 作成者: Matt J
Estimates the corner points of a pixelated convex polygon having a known number of vertices.

ダウンロード: 421

更新 2020/2/5


The command pgonCorners() implemented in this FEX submission takes a binary image of a convex polygon as input and returns estimated locations of its vertices (to the nearest pixel) as output. Prior knowledge of the number of vertices is assumed. The method used is based on an idea from linear programming discussed in this Matlab Answers post,

Although the method was designed with convex polygons in mind, it sometimes works rather well on approximately convex objects, as demonstrated in example scripts contained in this submission and illustrated in the thumbnail image above.


corners = pgonCorners(BW,k)
corners = pgonCorners(BW,k,N)


BW: Input binary image.
k: Number of vertices to search for.
N: Number of angular samples partitioning the unit circle (default=360).
Affects the resolution of the search.


corners: Detected corners in counter-clockwise order as a k x 2 matrix.


Matt J (2023). Find vertices in image of convex polygon (, MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2019b
R2016b 以降のリリースと互換性あり
Windows macOS Linux
Help Center および MATLAB AnswersGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート