centroid of convex hull

14 ビュー (過去 30 日間)
Noe alvarado
Noe alvarado 2013 年 1 月 23 日
hi, i want to find de centroid of convex hull, how i can do it in matlab? I formed the convex hull with n-dimensional points. To find the convex hull i use convhull and convhulln thanks for your help

採用された回答

Image Analyst
Image Analyst 2013 年 1 月 23 日
You need to get a binary image first. If you just have x,y coordinates, like you used convhull, then you need to call poly2mask(). If you have an image of non-convex objects, then you need to call bwconvhull() and it will give you an image of all objects' convex hulls. Then simply call regionprops asking for the centroid.
measurements = regionprops(binaryImage, 'Centroid');
It's a structure array. Each element of measurements is a structure with fields that represent the measurements you asked it to make, like Centroid, area, whatever.
  13 件のコメント
Matt J
Matt J 2013 年 1 月 31 日
編集済み: Matt J 2013 年 1 月 31 日
I would give it the benefit of the doubt, but since you brought it up, vert2con and con2vert are not without their bugs. Unfortunately, he no longer actively monitors feedback and hasn't replied to my bug reports, so I've had to make a number of my own fixes to them as the basis for my versions
Noe alvarado
Noe alvarado 2013 年 2 月 1 日
thanks for your help, i'm going to try your ideas.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeBounding Regions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by